generated from atls-lab/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/UI components pt#3
- Loading branch information
Showing
192 changed files
with
4,062 additions
and
543 deletions.
There are no files selected for viewing
Binary file added
BIN
+1.54 KB
.yarn/cache/@atls-config-prettier-npm-0.0.5-0a66208dbc-f501e0d241.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.07 KB
.yarn/cache/@atls-ui-generators-icons-npm-0.0.16-48eb3c5efc-9ac903e747.zip
Binary file not shown.
Binary file added
BIN
+3.69 KB
.yarn/cache/@atls-ui-generators-utils-npm-0.0.6-3d1dc2a130-5d462ebb35.zip
Binary file not shown.
Binary file added
BIN
+23.9 KB
.yarn/cache/@atls-ui-parts-button-npm-0.1.1-42445eebf1-d48ffa07e5.zip
Binary file not shown.
Binary file added
BIN
+3.44 KB
.yarn/cache/@atls-ui-parts-condition-npm-0.1.1-1887b7ae5f-5a6acd6014.zip
Binary file not shown.
Binary file added
BIN
+5.28 KB
.yarn/cache/@atls-ui-parts-events-state-npm-0.0.6-44c96d68a0-951248e278.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+19.1 KB
.yarn/cache/@atls-ui-parts-layout-npm-0.1.1-7a12afdae4-69596f6b40.zip
Binary file not shown.
Binary file added
BIN
+2.54 KB
.yarn/cache/@atls-ui-parts-portal-npm-0.0.7-55cf1149a3-a43c325f09.zip
Binary file not shown.
Binary file added
BIN
+8.17 KB
.yarn/cache/@atls-ui-parts-select-npm-0.1.1-9202bcd048-6fa43c5b56.zip
Binary file not shown.
Binary file added
BIN
+3.04 KB
.yarn/cache/@atls-ui-parts-styles-npm-0.1.1-81e56174aa-a275b47e18.zip
Binary file not shown.
Binary file added
BIN
+18.3 KB
.yarn/cache/@atls-ui-parts-switch-npm-0.1.1-8284bcc81f-af1c1b0781.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.08 KB
.yarn/cache/@atls-utils-use-hover-npm-0.0.2-b5fd27e7ba-2c85f1b9bc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+18.5 KB
.yarn/cache/@emotion-is-prop-valid-npm-1.2.1-794afe6a94-fe231c472d.zip
Binary file not shown.
Binary file added
BIN
+18.6 KB
.yarn/cache/@emotion-is-prop-valid-npm-1.2.2-53f93f2b2d-0fa3960abf.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+12.3 KB
...li-fs-npm-3.1.0-0844a57978-f3a7ab3a31.zip → ...li-fs-npm-3.1.1-c19bd09f3c-1e0e040870.zip
Binary file not shown.
Binary file added
BIN
+3.45 KB
.yarn/cache/@styled-system-background-npm-5.1.2-0b07cb6c1a-8874bc2f99.zip
Binary file not shown.
Binary file added
BIN
+4.41 KB
.yarn/cache/@styled-system-border-npm-5.1.5-1e220a39fb-6070fbe468.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.44 KB
.yarn/cache/@styled-system-flexbox-npm-5.1.2-9832e992b1-43c357b845.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.99 KB
.yarn/cache/@styled-system-layout-npm-5.1.2-ea143a71e4-0ffbc1cf32.zip
Binary file not shown.
Binary file added
BIN
+3.7 KB
.yarn/cache/@styled-system-position-npm-5.1.2-ce38b58782-bf659a45fd.zip
Binary file not shown.
Binary file added
BIN
+3.31 KB
.yarn/cache/@styled-system-shadow-npm-5.1.2-3ca697965a-6b13e35f7d.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.75 KB
.yarn/cache/@styled-system-typography-npm-5.1.2-5987b8ad66-fc931c8a01.zip
Binary file not shown.
Binary file added
BIN
+5.56 KB
.yarn/cache/@styled-system-variant-npm-5.1.5-b63323f6f9-170b7dd0ab.zip
Binary file not shown.
Binary file added
BIN
+3.99 KB
.yarn/cache/@svgr-babel-plugin-add-jsx-attribute-npm-5.4.0-7f1e614ce1-1c538cf312.zip
Binary file not shown.
Binary file added
BIN
+3.64 KB
.yarn/cache/@svgr-babel-plugin-remove-jsx-attribute-npm-5.4.0-81b60827fa-ad2231bfcb.zip
Binary file not shown.
Binary file added
BIN
+3.54 KB
.../cache/@svgr-babel-plugin-remove-jsx-empty-expression-npm-5.0.1-61d6aef206-175c8f13dd.zip
Binary file not shown.
Binary file added
BIN
+3.89 KB
.../cache/@svgr-babel-plugin-replace-jsx-attribute-value-npm-5.0.1-b13516ed13-68f4e2a5b9.zip
Binary file not shown.
Binary file added
BIN
+4.35 KB
.yarn/cache/@svgr-babel-plugin-svg-dynamic-title-npm-5.4.0-6e508e9c0a-c46feb5245.zip
Binary file not shown.
Binary file added
BIN
+3.66 KB
.yarn/cache/@svgr-babel-plugin-svg-em-dimensions-npm-5.4.0-0229e38da4-0d19b26147.zip
Binary file not shown.
Binary file added
BIN
+4.52 KB
...n/cache/@svgr-babel-plugin-transform-react-native-svg-npm-5.4.0-62f0a6e8dc-8ac5dc9fb2.zip
Binary file not shown.
Binary file added
BIN
+5.95 KB
.yarn/cache/@svgr-babel-plugin-transform-svg-component-npm-5.5.0-82fe1aa0d7-fcd5502c69.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+14.5 KB
.yarn/cache/@svgr-hast-util-to-babel-ast-npm-5.5.0-fef404b2de-a46c77510d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+379 KB
...de-npm-18.19.32-7009a25f1a-8640445fd9.zip → ...de-npm-18.19.33-d8c24b1fab-e5816356e3.zip
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+399 KB
...de-npm-20.12.10-a3a9559a54-b3ab044969.zip → ...de-npm-20.12.12-3a45001f1f-e3945da0a3.zip
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+83.4 KB
...eact-npm-18.3.1-5744cb1fe5-baa6b8a75c.zip → ...eact-npm-18.3.2-a469287c56-a85eed82c1.zip
Binary file not shown.
Binary file added
BIN
+11.9 KB
.yarn/cache/@types-styled-system-npm-5.1.22-5df778941b-61aa4d7ffa.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+182 KB
...ibzip-npm-3.0.1-4450730cd1-8862a27d95.zip → ...ibzip-npm-3.1.0-73edb40bfc-d3113b362d.zip
Binary file not shown.
Binary file renamed
BIN
+105 KB
...tials-npm-4.1.1-b2313dcbb7-b9e4ca21a6.zip → ...tials-npm-4.1.2-513dd892ff-7ac3d32d07.zip
Binary file not shown.
Binary file renamed
BIN
+15.9 KB
...n-pnp-npm-4.0.4-32b901d256-0b67c3ff21.zip → ...n-pnp-npm-4.0.5-3a312b6634-7d3277ffbb.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+15.3 KB
.yarn/cache/compute-scroll-into-view-npm-2.0.4-c2c11d0ba3-a9015cbf46.zip
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+38.5 KB
...ium-npm-1.4.757-5a3876707f-5ce5d8d7e6.zip → ...ium-npm-1.4.772-205b7b3257-56c5c28e2c.zip
Binary file not shown.
Binary file renamed
BIN
+64.4 KB
...olve-npm-5.16.0-610f8be3e5-47f123676b.zip → ...olve-npm-5.16.1-0564383bb8-1c44474437.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+131 KB
...lob-npm-10.3.12-f2e90133a0-9e8186abc2.zip → ...lob-npm-10.3.15-501e87a16f-b2b1c74309.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+3.65 KB
...olors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip → ...olors-npm-1.0.1-39442f3da8-fa68166d1f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-6.75 KB
.yarn/cache/update-browserslist-db-npm-1.0.15-7a2f8a8231-6800bfac69.zip
Binary file not shown.
Binary file added
BIN
+7.45 KB
.yarn/cache/update-browserslist-db-npm-1.0.16-ca365328e3-071bf0b2fb.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"name": "@app/renderer-entrypoint", | ||
"version": "0.0.1", | ||
"license": "BSD-3-Clause", | ||
"type": "module", | ||
"scripts": { | ||
"build": "yarn next build src --no-lint && rm ./src/.next/standalone/package.json ; cp -r ./src/.next/standalone ./dist && cp -r ./src/.next/static ./dist/src/.next/static && mv ./dist/src/server.js ./dist/src/index.cjs", | ||
"dev": "yarn next dev src", | ||
"prepack": "run build", | ||
"start": "node dist/src/index.cjs" | ||
}, | ||
"dependencies": { | ||
"next": "14.1.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "20.11.5", | ||
"@types/react": "18.3.1", | ||
"@types/react-dom": "18.3.0", | ||
"typescript": "5.2.2" | ||
} | ||
"name": "@app/renderer-entrypoint", | ||
"version": "0.0.1", | ||
"license": "BSD-3-Clause", | ||
"type": "module", | ||
"scripts": { | ||
"build": "yarn next build src --no-lint && rm ./src/.next/standalone/package.json ; cp -r ./src/.next/standalone ./dist && cp -r ./src/.next/static ./dist/src/.next/static && mv ./dist/src/server.js ./dist/src/index.cjs", | ||
"dev": "yarn next dev src", | ||
"prepack": "run build", | ||
"start": "node dist/src/index.cjs" | ||
}, | ||
"devDependencies": { | ||
"@emotion/react": "11.11.4", | ||
"@types/node": "20.12.12", | ||
"@types/react": "18.3.2", | ||
"@types/react-dom": "18.3.0", | ||
"@ui/theme": "workspace:*", | ||
"next": "14.1.0", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"typescript": "5.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
|
||
const Page = () => <h1>Team management</h1> | ||
const Page = () => <>page</> | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "@ui/dropdown", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "BSD-3-Clause", | ||
"main": "src/index.ts", | ||
"dependencies": { | ||
"@atls-ui-parts/layout": "0.1.1", | ||
"@atls-ui-parts/select": "0.1.1", | ||
"@atls-ui-parts/text": "0.1.3", | ||
"@atls-ui-proto/button": "0.1.1" | ||
}, | ||
"devDependencies": { | ||
"@emotion/css": "11.11.2", | ||
"@emotion/react": "11.11.4", | ||
"@emotion/styled": "11.11.5", | ||
"@types/react": "18.3.2", | ||
"@types/react-dom": "18.3.0", | ||
"@types/styled-system": "5.1.22", | ||
"framer-motion": "10.16.1", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"react-laag": "2.0.5", | ||
"styled-system": "5.1.5", | ||
"styled-tools": "1.7.2" | ||
}, | ||
"peerDependencies": { | ||
"@emotion/css": "*", | ||
"@emotion/react": "*", | ||
"@emotion/styled": "*", | ||
"framer-motion": "*", | ||
"react": "*", | ||
"react-dom": "*", | ||
"styled-system": "*", | ||
"styled-tools": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled from '@emotion/styled' | ||
import { Box } from '@atls-ui-parts/layout' | ||
import { useTheme } from '@emotion/react' | ||
|
||
import React from 'react' | ||
import { FC } from 'react' | ||
import { PropsWithChildren } from 'react' | ||
import { useHover } from 'react-laag' | ||
|
||
import { DropdownButtonProps } from './button.interfaces' | ||
import { DropdownButtonContainerProps } from './button.interfaces' | ||
import { DotTheme } from './button.interfaces' | ||
import { DotComponent } from './dot' | ||
import { baseButtonStyles } from './button.styles' | ||
import { sizeButtonStyles } from './button.styles' | ||
import { appearanceButtonStyles } from './button.styles' | ||
|
||
const DropdownButtonContainer = styled(Box)<DropdownButtonContainerProps>( | ||
baseButtonStyles, | ||
sizeButtonStyles, | ||
appearanceButtonStyles | ||
) | ||
|
||
export const DropdownButton: FC<PropsWithChildren<DropdownButtonProps>> = ({ | ||
triggerProps, | ||
onClick, | ||
isOpen, | ||
children, | ||
}) => { | ||
const DEFAULT_COUNT = 3 | ||
const [hover, hoverProps] = useHover() | ||
const theme: DotTheme = useTheme() | ||
|
||
return ( | ||
<DropdownButtonContainer | ||
{...triggerProps} | ||
onClick={onClick} | ||
pressed={isOpen} | ||
hover={hover} | ||
{...hoverProps} | ||
> | ||
<DotComponent count={theme.spaces?.normalCount || DEFAULT_COUNT} /> | ||
{children} | ||
</DropdownButtonContainer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { BoxProps } from '@atls-ui-parts/layout' | ||
import { Theme } from '@emotion/react' | ||
|
||
import { TriggerProps } from 'react-laag' | ||
|
||
export interface DropdownButtonProps extends BoxProps { | ||
triggerProps: TriggerProps | ||
onClick: VoidFunction | ||
isOpen: boolean | ||
} | ||
|
||
export interface DropdownButtonContainerProps extends BoxProps { | ||
pressed: boolean | ||
hover: boolean | ||
} | ||
|
||
export interface DotTheme extends Theme { | ||
// spaces: Record<string, string | number> | ||
spaces?: { | ||
normalCount: number | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { styleFn } from 'styled-system' | ||
import { prop } from 'styled-tools' | ||
import { ifProp } from 'styled-tools' | ||
|
||
export const baseButtonStyles: styleFn = ({ theme }) => ({ | ||
cursor: 'pointer', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: theme.radii.f9, | ||
gap: theme.spaces.semiTiny, | ||
}) | ||
|
||
export const sizeButtonStyles: styleFn = ({ theme }) => ({ | ||
width: theme.spaces.increased, | ||
height: theme.spaces.semiModerate, | ||
}) | ||
|
||
const defaultAppearanceButtonStyles: styleFn = ({ theme }) => ({ | ||
backgroundColor: theme.colors.dropdown.button.default, | ||
}) | ||
|
||
const hoveredAppearanceButtonStyles: styleFn = ({ theme }) => ({ | ||
backgroundColor: theme.colors.dropdown.button.hover, | ||
boxShadow: theme.shadows.dropdownButton, | ||
}) | ||
|
||
const pressedAppearanceButtonStyles: styleFn = ({ theme }) => ({ | ||
backgroundColor: theme.colors.dropdown.button.pressed, | ||
boxShadow: theme.shadows.dropdownButton, | ||
}) | ||
|
||
export const appearanceButtonStyles = ifProp( | ||
prop('pressed', false), | ||
pressedAppearanceButtonStyles, | ||
ifProp(prop('hover', false), hoveredAppearanceButtonStyles, defaultAppearanceButtonStyles) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from '@emotion/styled' | ||
import { Box } from '@atls-ui-parts/layout' | ||
import { BoxProps } from '@atls-ui-parts/layout' | ||
|
||
import React from 'react' | ||
import { FC } from 'react' | ||
|
||
import { DotProps } from './dot.iterfaces' | ||
import { sizeDotStyles } from './dot.styles' | ||
import { appearanceDotStyles } from './dot.styles' | ||
|
||
const Dot = styled(Box)<BoxProps>(sizeDotStyles, appearanceDotStyles) | ||
|
||
export const DotComponent: FC<DotProps> = ({ count }) => Array(count).fill(<Dot />) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface DotProps { | ||
count: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { styleFn } from 'styled-system' | ||
|
||
export const appearanceDotStyles: styleFn = ({ theme }) => ({ | ||
backgroundColor: theme.colors.dropdown.dot.background, | ||
}) | ||
|
||
export const sizeDotStyles: styleFn = ({ theme }) => ({ | ||
width: theme.spaces.semiTiny, | ||
height: theme.spaces.semiTiny, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './dot.component' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './button.component' |
34 changes: 34 additions & 0 deletions
34
ui/dropdown/src/child-container/child-container.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import styled from '@emotion/styled' | ||
import { Box } from '@atls-ui-parts/layout' | ||
import { BoxProps } from '@atls-ui-parts/layout' | ||
|
||
import React from 'react' | ||
import { FC } from 'react' | ||
import { PropsWithChildren } from 'react' | ||
import { MouseEventHandler } from 'react' | ||
|
||
import { ChildContainerProps } from './child-container.interfaces' | ||
import { baseChildContainerStyles } from './child-container.styles' | ||
import { shapeChildContainerStyles } from './child-container.styles' | ||
import { appearanceChildContainerStyles } from './child-container.styles' | ||
|
||
const StyledBox = styled(Box)<BoxProps>( | ||
baseChildContainerStyles, | ||
shapeChildContainerStyles, | ||
appearanceChildContainerStyles | ||
) | ||
|
||
export const ChildContainer: FC<PropsWithChildren<ChildContainerProps>> = ({ | ||
layerProps, | ||
children, | ||
}) => { | ||
const childrenContainerHandler: MouseEventHandler<HTMLDivElement> = (e) => { | ||
e.stopPropagation() | ||
} | ||
|
||
return ( | ||
<StyledBox {...layerProps} onClick={childrenContainerHandler}> | ||
{children} | ||
</StyledBox> | ||
) | ||
} |
5 changes: 5 additions & 0 deletions
5
ui/dropdown/src/child-container/child-container.interfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LayerProps } from 'react-laag' | ||
|
||
export interface ChildContainerProps { | ||
layerProps: LayerProps | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { styleFn } from 'styled-system' | ||
|
||
export const baseChildContainerStyles: styleFn = ({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
boxSizing: 'border-box', | ||
padding: theme.spaces.tiny, | ||
}) | ||
|
||
export const shapeChildContainerStyles: styleFn = ({ theme }) => ({ | ||
borderRadius: theme.radii.f9, | ||
}) | ||
|
||
export const appearanceChildContainerStyles: styleFn = ({ theme }) => ({ | ||
backgroundColor: theme.colors.dropdown.childContainer, | ||
boxShadow: theme.shadows.asphalt, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './child-container.component' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Box } from '@atls-ui-parts/layout' | ||
|
||
import React from 'react' | ||
import { FC } from 'react' | ||
import { PropsWithChildren } from 'react' | ||
import { useState } from 'react' | ||
import { useLayer } from 'react-laag' | ||
|
||
import { DropdownButton } from './button/button.component' | ||
import { ChildContainer } from './child-container' | ||
import { DropdownProps } from './dropdown.interface' | ||
|
||
export const Dropdown: FC<PropsWithChildren<DropdownProps>> = ({ children }) => { | ||
const [isOpen, setOpen] = useState(false) | ||
|
||
const buttonClickHandler = () => setOpen(!isOpen) | ||
const buttonCloseClickHandler = () => setOpen(false) | ||
|
||
const { renderLayer, triggerProps, layerProps } = useLayer({ | ||
isOpen, | ||
onOutsideClick: buttonCloseClickHandler, | ||
onDisappear: buttonCloseClickHandler, | ||
placement: 'bottom-start', | ||
overflowContainer: false, | ||
auto: true, | ||
triggerOffset: 12, | ||
containerOffset: 16, | ||
arrowOffset: 16, | ||
}) | ||
|
||
return ( | ||
<DropdownButton triggerProps={triggerProps} isOpen={isOpen} onClick={buttonClickHandler}> | ||
{renderLayer( | ||
<Box>{isOpen && <ChildContainer layerProps={layerProps}>{children}</ChildContainer>}</Box> | ||
)} | ||
</DropdownButton> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export interface DropdownProps {} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './dropdown.component' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { SVGProps } from 'react' | ||
|
||
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'color' | 'stroke'> { | ||
color?: string | boolean | any | ||
stroke?: string | boolean | any | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.