Skip to content

Commit

Permalink
add sticky mode support to sidenav
Browse files Browse the repository at this point in the history
  • Loading branch information
rudream committed Nov 1, 2024
1 parent 271417c commit 16d43ee
Show file tree
Hide file tree
Showing 8 changed files with 359 additions and 144 deletions.
13 changes: 3 additions & 10 deletions web/packages/design/src/Icon/Icons.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { ComponentType } from 'react';
import React from 'react';

import { Text } from '..';

import Flex from './../Flex';

import { IconProps } from './Icon';

import * as Icon from '.';

export default {
Expand Down Expand Up @@ -52,6 +50,7 @@ export const Icons = () => (
<IconBox IconCmpt={Icon.ArrowFatLinesUp} text="ArrowFatLinesUp" />
<IconBox IconCmpt={Icon.ArrowForward} text="ArrowForward" />
<IconBox IconCmpt={Icon.ArrowLeft} text="ArrowLeft" />
<IconBox IconCmpt={Icon.ArrowLineLeft} text="ArrowLineLeft" />
<IconBox IconCmpt={Icon.ArrowRight} text="ArrowRight" />
<IconBox IconCmpt={Icon.ArrowSquareOut} text="ArrowSquareOut" />
<IconBox IconCmpt={Icon.ArrowUp} text="ArrowUp" />
Expand Down Expand Up @@ -230,13 +229,7 @@ export const Icons = () => (
</Flex>
);

const IconBox = ({
IconCmpt,
text,
}: {
IconCmpt: ComponentType<IconProps>;
text: string;
}) => (
const IconBox = ({ IconCmpt, text }) => (
<Flex m="10px" width="300px">
<IconCmpt />
<Text ml={2}>{text}</Text>
Expand Down
65 changes: 65 additions & 0 deletions web/packages/design/src/Icon/Icons/ArrowLineLeft.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Teleport
* Copyright (C) 2023 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* MIT License
Copyright (c) 2020 Phosphor Icons
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

import React from 'react';

import { Icon, IconProps } from '../Icon';

/*
THIS FILE IS GENERATED. DO NOT EDIT.
*/

export function ArrowLineLeft({ size = 24, color, ...otherProps }: IconProps) {
return (
<Icon
size={size}
color={color}
className="icon icon-arrowlineleft"
{...otherProps}
>
<path d="M4.5 3.75C4.5 3.33579 4.16421 3 3.75 3C3.33579 3 3 3.33579 3 3.75V20.25C3 20.6642 3.33579 21 3.75 21C4.16421 21 4.5 20.6642 4.5 20.25V3.75Z" />
<path d="M14.0303 4.71967C13.7374 4.42678 13.2626 4.42678 12.9697 4.71967L6.21967 11.4697C6.14776 11.5416 6.09351 11.6245 6.05691 11.7129C6.02024 11.8013 6 11.8983 6 12C6 12.1919 6.07322 12.3839 6.21967 12.5303L12.9697 19.2803C13.2626 19.5732 13.7374 19.5732 14.0303 19.2803C14.3232 18.9874 14.3232 18.5126 14.0303 18.2197L8.56066 12.75H21.25C21.6642 12.75 22 12.4142 22 12C22 11.5858 21.6642 11.25 21.25 11.25H8.56066L14.0303 5.78033C14.3232 5.48744 14.3232 5.01256 14.0303 4.71967Z" />
</Icon>
);
}
4 changes: 4 additions & 0 deletions web/packages/design/src/Icon/assets/ArrowLineLeft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/packages/design/src/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export { ArrowDown } from './Icons/ArrowDown';
export { ArrowFatLinesUp } from './Icons/ArrowFatLinesUp';
export { ArrowForward } from './Icons/ArrowForward';
export { ArrowLeft } from './Icons/ArrowLeft';
export { ArrowLineLeft } from './Icons/ArrowLineLeft';
export { ArrowRight } from './Icons/ArrowRight';
export { ArrowSquareOut } from './Icons/ArrowSquareOut';
export { ArrowUp } from './Icons/ArrowUp';
Expand Down
Loading

0 comments on commit 16d43ee

Please sign in to comment.