@traefik-labs/faency 12.3.6 → 12.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/colors/deepBlue.cjs +4 -0
- package/dist/colors/deepBlue.js +1 -1
- package/dist/colors/elevation.cjs +2 -0
- package/dist/colors/elevation.js +1 -1
- package/dist/colors/grayBlue.cjs +4 -0
- package/dist/colors/grayBlue.js +1 -1
- package/dist/colors/index.cjs +1 -0
- package/dist/colors/index.cjs.map +1 -1
- package/dist/colors/index.js +1 -1
- package/dist/colors/index.js.map +1 -1
- package/dist/colors/neon.cjs +4 -0
- package/dist/colors/neon.js +1 -1
- package/dist/colors/orange.cjs +4 -0
- package/dist/colors/orange.js +1 -1
- package/dist/colors/red.cjs +4 -0
- package/dist/colors/red.js +1 -1
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.themes.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.themes.js.map +1 -1
- package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.themes.cjs.map +1 -1
- package/dist/components/Badge/Badge.themes.js.map +1 -1
- package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
- package/dist/components/Badge/Badge.vanilla.js.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.css.cjs +0 -1
- package/dist/components/Blockquote/Blockquote.vanilla.css.js +0 -1
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.vanilla.cjs.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
- package/dist/components/Button/Button.cjs +1 -0
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.themes.cjs.map +1 -1
- package/dist/components/Button/Button.themes.js.map +1 -1
- package/dist/components/Button/Button.vanilla.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.themes.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.themes.js.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.themes.cjs.map +1 -1
- package/dist/components/Card/Card.themes.js.map +1 -1
- package/dist/components/Card/Card.vanilla.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.css.cjs +0 -1
- package/dist/components/Card/Card.vanilla.css.js +0 -1
- package/dist/components/Card/Card.vanilla.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.themes.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.themes.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.themes.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.themes.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
- package/dist/components/CodeBlock/prism-extend.cjs +1 -0
- package/dist/components/Container/Container.cjs.map +1 -1
- package/dist/components/Container/Container.vanilla.cjs +1 -0
- package/dist/components/Container/Container.vanilla.cjs.map +1 -1
- package/dist/components/Container/Container.vanilla.js +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/DateTimePickerInput/DateTimePickerInput.cjs.map +1 -1
- package/dist/components/DateTimePickerInput/DateTimePickerInput.js.map +1 -1
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.themes.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.themes.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/components/DropdownMenu/styles.cjs +1 -0
- package/dist/components/DropdownMenu/styles.js +1 -1
- package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
- package/dist/components/FaencyProvider.cjs.map +1 -1
- package/dist/components/Flex/Flex.cjs.map +1 -1
- package/dist/components/Flex/Flex.vanilla.cjs +1 -0
- package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
- package/dist/components/Flex/Flex.vanilla.js +1 -1
- package/dist/components/Grid/Grid.cjs.map +1 -1
- package/dist/components/Grid/Grid.vanilla.cjs +1 -0
- package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
- package/dist/components/Grid/Grid.vanilla.js +1 -1
- package/dist/components/Heading/Heading.themes.cjs.map +1 -1
- package/dist/components/Heading/Heading.themes.js.map +1 -1
- package/dist/components/IconButton/IconButton.themes.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.themes.js.map +1 -1
- package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
- package/dist/components/Image/Image.cjs.map +1 -1
- package/dist/components/Image/Image.vanilla.cjs.map +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.theme.cjs.map +1 -1
- package/dist/components/Input/Input.theme.js.map +1 -1
- package/dist/components/Input/Input.themes.cjs.map +1 -1
- package/dist/components/Input/Input.themes.js.map +1 -1
- package/dist/components/Input/Input.vanilla.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.cjs.map +1 -1
- package/dist/components/Link/Link.themes.cjs.map +1 -1
- package/dist/components/Link/Link.themes.js.map +1 -1
- package/dist/components/List/List.cjs.map +1 -1
- package/dist/components/List/List.themes.cjs.map +1 -1
- package/dist/components/List/List.themes.js.map +1 -1
- package/dist/components/Navigation/Navigation.cjs.map +1 -1
- package/dist/components/Navigation/Navigation.themes.cjs.map +1 -1
- package/dist/components/Navigation/Navigation.themes.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.cjs.map +1 -1
- package/dist/components/NavigationTree/NavigationTreeContainer.cjs.map +1 -1
- package/dist/components/NavigationTree/NavigationTreeDrawer.cjs.map +1 -1
- package/dist/components/NavigationTree/NavigationTreeItem.cjs.map +1 -1
- package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
- package/dist/components/Paragraph/Paragraph.cjs.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.themes.cjs.map +1 -1
- package/dist/components/Radio/Radio.themes.js.map +1 -1
- package/dist/components/RadioAccordion/RadioAccordion.cjs.map +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.themes.cjs.map +1 -1
- package/dist/components/Select/Select.themes.js.map +1 -1
- package/dist/components/SidePanel/SidePanel.cjs.map +1 -1
- package/dist/components/SidePanel/SidePanel.themes.cjs.map +1 -1
- package/dist/components/SidePanel/SidePanel.themes.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.themes.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.themes.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.themes.cjs.map +1 -1
- package/dist/components/Switch/Switch.themes.js.map +1 -1
- package/dist/components/Table/Table.cjs +14 -12
- package/dist/components/Table/Table.cjs.map +1 -1
- package/dist/components/Table/Table.themes.cjs.map +1 -1
- package/dist/components/Table/Table.themes.js.map +1 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.themes.cjs.map +1 -1
- package/dist/components/Text/Text.themes.js.map +1 -1
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.theme.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.theme.js.map +1 -1
- package/dist/components/Textarea/Textarea.themes.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.themes.js.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.themes.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.themes.js.map +1 -1
- package/dist/components/colorSchemeContext.cjs.map +1 -1
- package/dist/components/colorSchemeContext.js.map +1 -1
- package/dist/faency.css +1478 -1478
- package/dist/stitches.config.cjs +1 -0
- package/dist/stitches.config.cjs.map +1 -1
- package/dist/stitches.config.js +11 -8
- package/dist/stitches.config.js.map +1 -1
- package/dist/styles/cssProps.cjs.map +1 -1
- package/dist/styles/cssProps.js.map +1 -1
- package/dist/styles/themeContext.cjs.map +1 -1
- package/dist/styles/themeContext.js.map +1 -1
- package/dist/styles/themes.css.cjs +0 -13
- package/dist/styles/themes.css.js +0 -13
- package/package.json +52 -52
|
@@ -21,5 +21,6 @@ require("prismjs/components/prism-toml.js");
|
|
|
21
21
|
for (const [key, value] of Object.entries(prismjs.default.languages)) if (typeof value !== "function" && !(key in prism_react_renderer.Prism.languages)) prism_react_renderer.Prism.languages[key] = value;
|
|
22
22
|
prism_react_renderer.Prism.languages.text = { text: /[\s\S]+/ };
|
|
23
23
|
//#endregion
|
|
24
|
+
exports.Prism = prism_react_renderer.Prism;
|
|
24
25
|
|
|
25
26
|
//# sourceMappingURL=prism-extend.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.cjs","names":[],"sources":["../../../components/Container/Container.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Container = styled('div', {\n // Reset\n boxSizing: 'border-box',\n flexShrink: 0,\n\n // Custom\n ml: 'auto',\n mr: 'auto',\n px: '$5',\n\n variants: {\n size: {\n '1': {\n maxWidth: '425px',\n },\n '2': {\n maxWidth: '768px',\n },\n '3': {\n maxWidth: '1440px',\n },\n '4': {\n maxWidth: 'none',\n },\n },\n noGutter: {\n true: {\n px: 0,\n },\n },\n },\n defaultVariants: {\n size: '4',\n },\n});\n"],"mappings":";AAEA,IAAa,+CAAY,
|
|
1
|
+
{"version":3,"file":"Container.cjs","names":[],"sources":["../../../components/Container/Container.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Container = styled('div', {\n // Reset\n boxSizing: 'border-box',\n flexShrink: 0,\n\n // Custom\n ml: 'auto',\n mr: 'auto',\n px: '$5',\n\n variants: {\n size: {\n '1': {\n maxWidth: '425px',\n },\n '2': {\n maxWidth: '768px',\n },\n '3': {\n maxWidth: '1440px',\n },\n '4': {\n maxWidth: 'none',\n },\n },\n noGutter: {\n true: {\n px: 0,\n },\n },\n },\n defaultVariants: {\n size: '4',\n },\n});\n"],"mappings":";AAEA,IAAa,+CAAY,CAAA,CAAA,OAAO,OAAO;CAErC,WAAW;CACX,YAAY;CAGZ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,UAAU;EACR,MAAM;GACJ,KAAK,EACH,UAAU,QACZ;GACA,KAAK,EACH,UAAU,QACZ;GACA,KAAK,EACH,UAAU,SACZ;GACA,KAAK,EACH,UAAU,OACZ;EACF;EACA,UAAU,EACR,MAAM,EACJ,IAAI,EACN,EACF;CACF;CACA,iBAAiB,EACf,MAAM,IACR;AACF,CAAC"}
|
|
@@ -30,5 +30,6 @@ ContainerVanillaComponent.displayName = "ContainerVanilla";
|
|
|
30
30
|
var ContainerVanilla = ContainerVanillaComponent;
|
|
31
31
|
//#endregion
|
|
32
32
|
exports.ContainerVanilla = ContainerVanilla;
|
|
33
|
+
exports.ContainerVanillaComponent = ContainerVanillaComponent;
|
|
33
34
|
|
|
34
35
|
//# sourceMappingURL=Container.vanilla.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.vanilla.cjs","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;;AAuBA,IAAa,4BAA4B,MAAA,QAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,
|
|
1
|
+
{"version":3,"file":"Container.vanilla.cjs","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;;AAuBA,IAAa,4BAA4B,MAAA,QAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,iBAAA,CAAoB,IAAI;CAC1B;CAIA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GALK,8BAAA,gBAAgB;GAAE;GAAM;EAAS,CAKnC,EAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
|
|
@@ -27,6 +27,6 @@ var ContainerVanillaComponent = React.forwardRef(({ as, className, css, style, s
|
|
|
27
27
|
ContainerVanillaComponent.displayName = "ContainerVanilla";
|
|
28
28
|
var ContainerVanilla = ContainerVanillaComponent;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ContainerVanilla };
|
|
30
|
+
export { ContainerVanilla, ContainerVanillaComponent };
|
|
31
31
|
|
|
32
32
|
//# sourceMappingURL=Container.vanilla.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.cjs","names":[],"sources":["../../../components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { DPDatesConfig, DPPropGetter, DPUserConfig, useDatePicker } from '@rehookify/datepicker';\nimport { addMonths, addYears } from 'date-fns';\nimport React, { useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Flex } from '../Flex';\nimport { Text } from '../Text';\n\nconst CalendarGrid = styled('div', {\n display: 'grid',\n alignItems: 'center',\n gap: '$1',\n px: '$2',\n borderLeft: '2px solid $buttonSecondaryBorder',\n borderRight: '2px solid $buttonSecondaryBorder',\n});\n\nconst SevenColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(7, 1fr)',\n});\n\nconst ThreeColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(3, 1fr)',\n height: '100%',\n});\n\nconst StyledDiv = styled('div');\n\ntype HeaderProps = {\n centerButtonLabel: string;\n centerButtonOnClick: () => void;\n leftButtonProps: DPPropGetter;\n rightButtonProps: DPPropGetter;\n};\n\nfunction Header({\n centerButtonLabel,\n centerButtonOnClick,\n leftButtonProps,\n rightButtonProps,\n}: HeaderProps) {\n return (\n <Flex align=\"center\" gap=\"2\" css={{ px: '$2' }}>\n <Button type=\"button\" ghost variant=\"secondary\" {...leftButtonProps}>\n <ChevronLeftIcon />\n </Button>\n <Button\n type=\"button\"\n role=\"button\"\n tabIndex={0}\n css={{ flexGrow: 1, textAlign: 'center' }}\n ghost\n onClick={centerButtonOnClick}\n variant=\"secondary\"\n >\n {centerButtonLabel}\n </Button>\n <Button type=\"button\" ghost variant=\"secondary\" {...rightButtonProps}>\n <ChevronRightIcon />\n </Button>\n </Flex>\n );\n}\n\ntype CustomDPDatesConfig = Omit<DPDatesConfig, 'mode'>;\n\ntype CustomDPUserConfig = Omit<DPUserConfig, 'dates'> & {\n dates?: Partial<CustomDPDatesConfig>;\n};\n\nexport type DateTimePickerProps = CustomDPUserConfig & {\n css?: CSS;\n onFastTravelClick?: () => void;\n onTimeButtonClick?: () => void;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerVariants = VariantProps<DateTimePickerProps>;\n\nexport const DateTimePicker = React.forwardRef<\n React.ElementRef<typeof StyledDiv>,\n DateTimePickerProps\n>(\n (\n { css, onFastTravelClick, onTimeButtonClick, showDatePresets, showTimePicker, ...config },\n fowardedRef,\n ) => {\n const {\n data: { calendars, months, time, weekDays, years },\n propGetters: {\n addOffset,\n dayButton,\n monthButton,\n nextYearsButton,\n previousYearsButton,\n subtractOffset,\n timeButton,\n yearButton,\n },\n } = useDatePicker(config);\n\n const [page, setPage] = useState<number>(0);\n\n const { days, month, year } = calendars[0];\n\n return (\n <StyledDiv css={css} ref={fowardedRef}>\n <Flex direction=\"column\" gap=\"2\" css={{ display: 'inline-flex' }}>\n <Flex>\n <Box\n css={{\n flex: 1,\n minHeight: config.calendar?.mode === 'fluid' ? '244px' : '280px',\n minWidth: '268px',\n }}\n >\n <Flex\n direction=\"column\"\n css={{ display: page === 0 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={month}\n centerButtonOnClick={() => setPage(1)}\n leftButtonProps={subtractOffset({ months: 1 })}\n rightButtonProps={addOffset({ months: 1 })}\n />\n <SevenColGrid>\n {weekDays.map((weekDay, index) => (\n <Text key={index} css={{ lineHeight: '$sizes$6', textAlign: 'center' }}>\n {weekDay}\n </Text>\n ))}\n {days.map((d) => (\n <Button\n key={d.$date.toString()}\n type=\"button\"\n css={{\n width: '32px',\n px: 0,\n color:\n !d.disabled && !d.inCurrentMonth && !d.selected\n ? '$textSubtle'\n : undefined,\n fontWeight: d.now && !d.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!d.selected}\n variant={d.now || d.selected ? 'primary' : 'secondary'}\n {...dayButton(d)}\n tabIndex={dayButton(d).disabled ? dayButton(d).tabIndex : 0}\n >\n {d.day}\n </Button>\n ))}\n </SevenColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 1 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={year}\n centerButtonOnClick={() => setPage(2)}\n leftButtonProps={subtractOffset({ years: 1 })}\n rightButtonProps={addOffset({ years: 1 })}\n />\n <ThreeColGrid>\n {months.map((m) => (\n <Button\n key={m.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: m.now && !m.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!m.selected}\n variant={m.now || m.selected ? 'primary' : 'secondary'}\n {...monthButton(m)}\n onClick={(evt) => {\n setPage(0);\n const fn = monthButton(m).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={monthButton(m).disabled ? monthButton(m).tabIndex : 0}\n >\n {m.month}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 2 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={`${years[0].year} - ${years[years.length - 1].year}`}\n centerButtonOnClick={() => setPage(0)}\n leftButtonProps={previousYearsButton()}\n rightButtonProps={nextYearsButton()}\n />\n <ThreeColGrid>\n {years.map((y) => (\n <Button\n key={y.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: y.now && !y.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!y.selected}\n variant={y.now || y.selected ? 'primary' : 'secondary'}\n {...yearButton(y)}\n onClick={(evt) => {\n setPage(0);\n const fn = yearButton(y).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={yearButton(y).disabled ? yearButton(y).tabIndex : 0}\n >\n {y.year}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n </Box>\n\n {showTimePicker ? (\n <Box css={{ flex: 1, width: '90px', position: 'relative', overflow: 'auto' }}>\n <Flex\n direction=\"column\"\n gap=\"1\"\n css={{ position: 'absolute', top: 0, left: 0, height: '100%', width: '100%' }}\n >\n <Text css={{ mt: '32px', ml: '8px', lineHeight: '$sizes$6' }}>Time</Text>\n <Flex direction=\"column\" gap=\"1\" css={{ overflow: 'auto', px: '$2' }}>\n {time.map((t) => (\n <Button\n key={t.$date.toString()}\n type=\"button\"\n css={{\n px: '$2',\n fontWeight: t.now && !t.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!t.selected}\n variant={t.now || t.selected ? 'primary' : 'secondary'}\n {...timeButton(t)}\n onClick={(evt) => {\n const fn = timeButton(t).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n if (typeof onTimeButtonClick !== 'undefined') onTimeButtonClick();\n }}\n tabIndex={timeButton(t).disabled ? timeButton(t).tabIndex : 0}\n >\n {t.time}\n </Button>\n ))}\n </Flex>\n </Flex>\n </Box>\n ) : undefined}\n </Flex>\n\n {showDatePresets ? (\n <Flex gap=\"2\">\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 M\n </Button>\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 3)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 3 M\n </Button>\n {showTimePicker ? (\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addYears(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 Y\n </Button>\n ) : undefined}\n </Flex>\n ) : undefined}\n </Flex>\n </StyledDiv>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,eAAe,wBAAA,OAAO,OAAO;CACjC,SAAS;CACT,YAAY;CACZ,KAAK;CACL,IAAI;CACJ,YAAY;CACZ,aAAa;AACf,CAAC;AAED,IAAM,eAAe,wBAAA,OAAO,cAAc,EACxC,qBAAqB,iBACvB,CAAC;AAED,IAAM,eAAe,wBAAA,OAAO,cAAc;CACxC,qBAAqB;CACrB,QAAQ;AACV,CAAC;AAED,IAAM,YAAY,wBAAA,OAAO,KAAK;AAS9B,SAAS,OAAO,EACd,mBACA,qBACA,iBACA,oBACc;CACd,OACE,iBAAA,GAAA,kBAAA,MAAC,aAAA,MAAD;EAAM,OAAM;EAAS,KAAI;EAAI,KAAK,EAAE,IAAI,KAAK;YAA7C;GACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,QAAD;IAAQ,MAAK;IAAS,OAAA;IAAM,SAAQ;IAAY,G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C,iBAAA,GAAA,kBAAA,MAAC,aAAA,MAAD;IAAM,KAAI;cAAV;KACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,QAAD;MACE,MAAK;MACL,KAAK,EAAE,MAAM,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,EAAA,GAAA,SAAA,2BAAW,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC/C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA;KACR,iBAAA,GAAA,kBAAA,KAAC,eAAA,QAAD;MACE,MAAK;MACL,KAAK,EAAE,MAAM,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,EAAA,GAAA,SAAA,2BAAW,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC/C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA;KACP,iBACC,iBAAA,GAAA,kBAAA,KAAC,eAAA,QAAD;MACE,MAAK;MACL,KAAK,EAAE,MAAM,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,EAAA,GAAA,SAAA,0BAAU,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC9C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA,IACN,KAAA;IACA;QACJ,KAAA,CACA;;CACG,CAAA;AAEf,CACF"}
|
|
1
|
+
{"version":3,"file":"DateTimePicker.cjs","names":[],"sources":["../../../components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { DPDatesConfig, DPPropGetter, DPUserConfig, useDatePicker } from '@rehookify/datepicker';\nimport { addMonths, addYears } from 'date-fns';\nimport React, { useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Flex } from '../Flex';\nimport { Text } from '../Text';\n\nconst CalendarGrid = styled('div', {\n display: 'grid',\n alignItems: 'center',\n gap: '$1',\n px: '$2',\n borderLeft: '2px solid $buttonSecondaryBorder',\n borderRight: '2px solid $buttonSecondaryBorder',\n});\n\nconst SevenColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(7, 1fr)',\n});\n\nconst ThreeColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(3, 1fr)',\n height: '100%',\n});\n\nconst StyledDiv = styled('div');\n\ntype HeaderProps = {\n centerButtonLabel: string;\n centerButtonOnClick: () => void;\n leftButtonProps: DPPropGetter;\n rightButtonProps: DPPropGetter;\n};\n\nfunction Header({\n centerButtonLabel,\n centerButtonOnClick,\n leftButtonProps,\n rightButtonProps,\n}: HeaderProps) {\n return (\n <Flex align=\"center\" gap=\"2\" css={{ px: '$2' }}>\n <Button type=\"button\" ghost variant=\"secondary\" {...leftButtonProps}>\n <ChevronLeftIcon />\n </Button>\n <Button\n type=\"button\"\n role=\"button\"\n tabIndex={0}\n css={{ flexGrow: 1, textAlign: 'center' }}\n ghost\n onClick={centerButtonOnClick}\n variant=\"secondary\"\n >\n {centerButtonLabel}\n </Button>\n <Button type=\"button\" ghost variant=\"secondary\" {...rightButtonProps}>\n <ChevronRightIcon />\n </Button>\n </Flex>\n );\n}\n\ntype CustomDPDatesConfig = Omit<DPDatesConfig, 'mode'>;\n\ntype CustomDPUserConfig = Omit<DPUserConfig, 'dates'> & {\n dates?: Partial<CustomDPDatesConfig>;\n};\n\nexport type DateTimePickerProps = CustomDPUserConfig & {\n css?: CSS;\n onFastTravelClick?: () => void;\n onTimeButtonClick?: () => void;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerVariants = VariantProps<DateTimePickerProps>;\n\nexport const DateTimePicker = React.forwardRef<\n React.ElementRef<typeof StyledDiv>,\n DateTimePickerProps\n>(\n (\n { css, onFastTravelClick, onTimeButtonClick, showDatePresets, showTimePicker, ...config },\n fowardedRef,\n ) => {\n const {\n data: { calendars, months, time, weekDays, years },\n propGetters: {\n addOffset,\n dayButton,\n monthButton,\n nextYearsButton,\n previousYearsButton,\n subtractOffset,\n timeButton,\n yearButton,\n },\n } = useDatePicker(config);\n\n const [page, setPage] = useState<number>(0);\n\n const { days, month, year } = calendars[0];\n\n return (\n <StyledDiv css={css} ref={fowardedRef}>\n <Flex direction=\"column\" gap=\"2\" css={{ display: 'inline-flex' }}>\n <Flex>\n <Box\n css={{\n flex: 1,\n minHeight: config.calendar?.mode === 'fluid' ? '244px' : '280px',\n minWidth: '268px',\n }}\n >\n <Flex\n direction=\"column\"\n css={{ display: page === 0 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={month}\n centerButtonOnClick={() => setPage(1)}\n leftButtonProps={subtractOffset({ months: 1 })}\n rightButtonProps={addOffset({ months: 1 })}\n />\n <SevenColGrid>\n {weekDays.map((weekDay, index) => (\n <Text key={index} css={{ lineHeight: '$sizes$6', textAlign: 'center' }}>\n {weekDay}\n </Text>\n ))}\n {days.map((d) => (\n <Button\n key={d.$date.toString()}\n type=\"button\"\n css={{\n width: '32px',\n px: 0,\n color:\n !d.disabled && !d.inCurrentMonth && !d.selected\n ? '$textSubtle'\n : undefined,\n fontWeight: d.now && !d.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!d.selected}\n variant={d.now || d.selected ? 'primary' : 'secondary'}\n {...dayButton(d)}\n tabIndex={dayButton(d).disabled ? dayButton(d).tabIndex : 0}\n >\n {d.day}\n </Button>\n ))}\n </SevenColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 1 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={year}\n centerButtonOnClick={() => setPage(2)}\n leftButtonProps={subtractOffset({ years: 1 })}\n rightButtonProps={addOffset({ years: 1 })}\n />\n <ThreeColGrid>\n {months.map((m) => (\n <Button\n key={m.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: m.now && !m.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!m.selected}\n variant={m.now || m.selected ? 'primary' : 'secondary'}\n {...monthButton(m)}\n onClick={(evt) => {\n setPage(0);\n const fn = monthButton(m).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={monthButton(m).disabled ? monthButton(m).tabIndex : 0}\n >\n {m.month}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 2 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={`${years[0].year} - ${years[years.length - 1].year}`}\n centerButtonOnClick={() => setPage(0)}\n leftButtonProps={previousYearsButton()}\n rightButtonProps={nextYearsButton()}\n />\n <ThreeColGrid>\n {years.map((y) => (\n <Button\n key={y.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: y.now && !y.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!y.selected}\n variant={y.now || y.selected ? 'primary' : 'secondary'}\n {...yearButton(y)}\n onClick={(evt) => {\n setPage(0);\n const fn = yearButton(y).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={yearButton(y).disabled ? yearButton(y).tabIndex : 0}\n >\n {y.year}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n </Box>\n\n {showTimePicker ? (\n <Box css={{ flex: 1, width: '90px', position: 'relative', overflow: 'auto' }}>\n <Flex\n direction=\"column\"\n gap=\"1\"\n css={{ position: 'absolute', top: 0, left: 0, height: '100%', width: '100%' }}\n >\n <Text css={{ mt: '32px', ml: '8px', lineHeight: '$sizes$6' }}>Time</Text>\n <Flex direction=\"column\" gap=\"1\" css={{ overflow: 'auto', px: '$2' }}>\n {time.map((t) => (\n <Button\n key={t.$date.toString()}\n type=\"button\"\n css={{\n px: '$2',\n fontWeight: t.now && !t.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!t.selected}\n variant={t.now || t.selected ? 'primary' : 'secondary'}\n {...timeButton(t)}\n onClick={(evt) => {\n const fn = timeButton(t).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n if (typeof onTimeButtonClick !== 'undefined') onTimeButtonClick();\n }}\n tabIndex={timeButton(t).disabled ? timeButton(t).tabIndex : 0}\n >\n {t.time}\n </Button>\n ))}\n </Flex>\n </Flex>\n </Box>\n ) : undefined}\n </Flex>\n\n {showDatePresets ? (\n <Flex gap=\"2\">\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 M\n </Button>\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 3)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 3 M\n </Button>\n {showTimePicker ? (\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addYears(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 Y\n </Button>\n ) : undefined}\n </Flex>\n ) : undefined}\n </Flex>\n </StyledDiv>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,eAAe,wBAAA,OAAO,OAAO;CACjC,SAAS;CACT,YAAY;CACZ,KAAK;CACL,IAAI;CACJ,YAAY;CACZ,aAAa;AACf,CAAC;AAED,IAAM,eAAe,wBAAA,OAAO,cAAc,EACxC,qBAAqB,iBACvB,CAAC;AAED,IAAM,eAAe,wBAAA,OAAO,cAAc;CACxC,qBAAqB;CACrB,QAAQ;AACV,CAAC;AAED,IAAM,YAAY,wBAAA,OAAO,KAAK;AAS9B,SAAS,OAAO,EACd,mBACA,qBACA,iBACA,oBACc;CACd,OACE,iBAAA,GAAA,kBAAA,KAAA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I,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA,IACN,KAAA;IACA;QACJ,KAAA,CACA;;CACG,CAAA;AAEf,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.js","names":[],"sources":["../../../components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { DPDatesConfig, DPPropGetter, DPUserConfig, useDatePicker } from '@rehookify/datepicker';\nimport { addMonths, addYears } from 'date-fns';\nimport React, { useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Flex } from '../Flex';\nimport { Text } from '../Text';\n\nconst CalendarGrid = styled('div', {\n display: 'grid',\n alignItems: 'center',\n gap: '$1',\n px: '$2',\n borderLeft: '2px solid $buttonSecondaryBorder',\n borderRight: '2px solid $buttonSecondaryBorder',\n});\n\nconst SevenColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(7, 1fr)',\n});\n\nconst ThreeColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(3, 1fr)',\n height: '100%',\n});\n\nconst StyledDiv = styled('div');\n\ntype HeaderProps = {\n centerButtonLabel: string;\n centerButtonOnClick: () => void;\n leftButtonProps: DPPropGetter;\n rightButtonProps: DPPropGetter;\n};\n\nfunction Header({\n centerButtonLabel,\n centerButtonOnClick,\n leftButtonProps,\n rightButtonProps,\n}: HeaderProps) {\n return (\n <Flex align=\"center\" gap=\"2\" css={{ px: '$2' }}>\n <Button type=\"button\" ghost variant=\"secondary\" {...leftButtonProps}>\n <ChevronLeftIcon />\n </Button>\n <Button\n type=\"button\"\n role=\"button\"\n tabIndex={0}\n css={{ flexGrow: 1, textAlign: 'center' }}\n ghost\n onClick={centerButtonOnClick}\n variant=\"secondary\"\n >\n {centerButtonLabel}\n </Button>\n <Button type=\"button\" ghost variant=\"secondary\" {...rightButtonProps}>\n <ChevronRightIcon />\n </Button>\n </Flex>\n );\n}\n\ntype CustomDPDatesConfig = Omit<DPDatesConfig, 'mode'>;\n\ntype CustomDPUserConfig = Omit<DPUserConfig, 'dates'> & {\n dates?: Partial<CustomDPDatesConfig>;\n};\n\nexport type DateTimePickerProps = CustomDPUserConfig & {\n css?: CSS;\n onFastTravelClick?: () => void;\n onTimeButtonClick?: () => void;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerVariants = VariantProps<DateTimePickerProps>;\n\nexport const DateTimePicker = React.forwardRef<\n React.ElementRef<typeof StyledDiv>,\n DateTimePickerProps\n>(\n (\n { css, onFastTravelClick, onTimeButtonClick, showDatePresets, showTimePicker, ...config },\n fowardedRef,\n ) => {\n const {\n data: { calendars, months, time, weekDays, years },\n propGetters: {\n addOffset,\n dayButton,\n monthButton,\n nextYearsButton,\n previousYearsButton,\n subtractOffset,\n timeButton,\n yearButton,\n },\n } = useDatePicker(config);\n\n const [page, setPage] = useState<number>(0);\n\n const { days, month, year } = calendars[0];\n\n return (\n <StyledDiv css={css} ref={fowardedRef}>\n <Flex direction=\"column\" gap=\"2\" css={{ display: 'inline-flex' }}>\n <Flex>\n <Box\n css={{\n flex: 1,\n minHeight: config.calendar?.mode === 'fluid' ? '244px' : '280px',\n minWidth: '268px',\n }}\n >\n <Flex\n direction=\"column\"\n css={{ display: page === 0 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={month}\n centerButtonOnClick={() => setPage(1)}\n leftButtonProps={subtractOffset({ months: 1 })}\n rightButtonProps={addOffset({ months: 1 })}\n />\n <SevenColGrid>\n {weekDays.map((weekDay, index) => (\n <Text key={index} css={{ lineHeight: '$sizes$6', textAlign: 'center' }}>\n {weekDay}\n </Text>\n ))}\n {days.map((d) => (\n <Button\n key={d.$date.toString()}\n type=\"button\"\n css={{\n width: '32px',\n px: 0,\n color:\n !d.disabled && !d.inCurrentMonth && !d.selected\n ? '$textSubtle'\n : undefined,\n fontWeight: d.now && !d.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!d.selected}\n variant={d.now || d.selected ? 'primary' : 'secondary'}\n {...dayButton(d)}\n tabIndex={dayButton(d).disabled ? dayButton(d).tabIndex : 0}\n >\n {d.day}\n </Button>\n ))}\n </SevenColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 1 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={year}\n centerButtonOnClick={() => setPage(2)}\n leftButtonProps={subtractOffset({ years: 1 })}\n rightButtonProps={addOffset({ years: 1 })}\n />\n <ThreeColGrid>\n {months.map((m) => (\n <Button\n key={m.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: m.now && !m.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!m.selected}\n variant={m.now || m.selected ? 'primary' : 'secondary'}\n {...monthButton(m)}\n onClick={(evt) => {\n setPage(0);\n const fn = monthButton(m).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={monthButton(m).disabled ? monthButton(m).tabIndex : 0}\n >\n {m.month}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 2 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={`${years[0].year} - ${years[years.length - 1].year}`}\n centerButtonOnClick={() => setPage(0)}\n leftButtonProps={previousYearsButton()}\n rightButtonProps={nextYearsButton()}\n />\n <ThreeColGrid>\n {years.map((y) => (\n <Button\n key={y.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: y.now && !y.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!y.selected}\n variant={y.now || y.selected ? 'primary' : 'secondary'}\n {...yearButton(y)}\n onClick={(evt) => {\n setPage(0);\n const fn = yearButton(y).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={yearButton(y).disabled ? yearButton(y).tabIndex : 0}\n >\n {y.year}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n </Box>\n\n {showTimePicker ? (\n <Box css={{ flex: 1, width: '90px', position: 'relative', overflow: 'auto' }}>\n <Flex\n direction=\"column\"\n gap=\"1\"\n css={{ position: 'absolute', top: 0, left: 0, height: '100%', width: '100%' }}\n >\n <Text css={{ mt: '32px', ml: '8px', lineHeight: '$sizes$6' }}>Time</Text>\n <Flex direction=\"column\" gap=\"1\" css={{ overflow: 'auto', px: '$2' }}>\n {time.map((t) => (\n <Button\n key={t.$date.toString()}\n type=\"button\"\n css={{\n px: '$2',\n fontWeight: t.now && !t.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!t.selected}\n variant={t.now || t.selected ? 'primary' : 'secondary'}\n {...timeButton(t)}\n onClick={(evt) => {\n const fn = timeButton(t).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n if (typeof onTimeButtonClick !== 'undefined') onTimeButtonClick();\n }}\n tabIndex={timeButton(t).disabled ? timeButton(t).tabIndex : 0}\n >\n {t.time}\n </Button>\n ))}\n </Flex>\n </Flex>\n </Box>\n ) : undefined}\n </Flex>\n\n {showDatePresets ? (\n <Flex gap=\"2\">\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 M\n </Button>\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 3)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 3 M\n </Button>\n {showTimePicker ? (\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addYears(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n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M,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,CAAC,0BAAU,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC/C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA;KACR,oBAAC,QAAD;MACE,MAAK;MACL,KAAK,EAAE,MAAM,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,CAAC,0BAAU,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC/C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA;KACP,iBACC,oBAAC,QAAD;MACE,MAAK;MACL,KAAK,EAAE,MAAM,QAAQ;MACrB,SAAQ;MACR,eAAe;OACb,OAAO,cAAc,CAAC,yBAAS,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;OAC9C,IAAI,OAAO,sBAAsB,aAAa,kBAAkB;MAClE;gBACD;KAEO,CAAA,IACN,KAAA;IACA;QACJ,KAAA,CACA;;CACG,CAAA;AAEf,CACF"}
|
|
1
|
+
{"version":3,"file":"DateTimePicker.js","names":[],"sources":["../../../components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';\nimport { DPDatesConfig, DPPropGetter, DPUserConfig, useDatePicker } from '@rehookify/datepicker';\nimport { addMonths, addYears } from 'date-fns';\nimport React, { useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Flex } from '../Flex';\nimport { Text } from '../Text';\n\nconst CalendarGrid = styled('div', {\n display: 'grid',\n alignItems: 'center',\n gap: '$1',\n px: '$2',\n borderLeft: '2px solid $buttonSecondaryBorder',\n borderRight: '2px solid $buttonSecondaryBorder',\n});\n\nconst SevenColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(7, 1fr)',\n});\n\nconst ThreeColGrid = styled(CalendarGrid, {\n gridTemplateColumns: 'repeat(3, 1fr)',\n height: '100%',\n});\n\nconst StyledDiv = styled('div');\n\ntype HeaderProps = {\n centerButtonLabel: string;\n centerButtonOnClick: () => void;\n leftButtonProps: DPPropGetter;\n rightButtonProps: DPPropGetter;\n};\n\nfunction Header({\n centerButtonLabel,\n centerButtonOnClick,\n leftButtonProps,\n rightButtonProps,\n}: HeaderProps) {\n return (\n <Flex align=\"center\" gap=\"2\" css={{ px: '$2' }}>\n <Button type=\"button\" ghost variant=\"secondary\" {...leftButtonProps}>\n <ChevronLeftIcon />\n </Button>\n <Button\n type=\"button\"\n role=\"button\"\n tabIndex={0}\n css={{ flexGrow: 1, textAlign: 'center' }}\n ghost\n onClick={centerButtonOnClick}\n variant=\"secondary\"\n >\n {centerButtonLabel}\n </Button>\n <Button type=\"button\" ghost variant=\"secondary\" {...rightButtonProps}>\n <ChevronRightIcon />\n </Button>\n </Flex>\n );\n}\n\ntype CustomDPDatesConfig = Omit<DPDatesConfig, 'mode'>;\n\ntype CustomDPUserConfig = Omit<DPUserConfig, 'dates'> & {\n dates?: Partial<CustomDPDatesConfig>;\n};\n\nexport type DateTimePickerProps = CustomDPUserConfig & {\n css?: CSS;\n onFastTravelClick?: () => void;\n onTimeButtonClick?: () => void;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerVariants = VariantProps<DateTimePickerProps>;\n\nexport const DateTimePicker = React.forwardRef<\n React.ElementRef<typeof StyledDiv>,\n DateTimePickerProps\n>(\n (\n { css, onFastTravelClick, onTimeButtonClick, showDatePresets, showTimePicker, ...config },\n fowardedRef,\n ) => {\n const {\n data: { calendars, months, time, weekDays, years },\n propGetters: {\n addOffset,\n dayButton,\n monthButton,\n nextYearsButton,\n previousYearsButton,\n subtractOffset,\n timeButton,\n yearButton,\n },\n } = useDatePicker(config);\n\n const [page, setPage] = useState<number>(0);\n\n const { days, month, year } = calendars[0];\n\n return (\n <StyledDiv css={css} ref={fowardedRef}>\n <Flex direction=\"column\" gap=\"2\" css={{ display: 'inline-flex' }}>\n <Flex>\n <Box\n css={{\n flex: 1,\n minHeight: config.calendar?.mode === 'fluid' ? '244px' : '280px',\n minWidth: '268px',\n }}\n >\n <Flex\n direction=\"column\"\n css={{ display: page === 0 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={month}\n centerButtonOnClick={() => setPage(1)}\n leftButtonProps={subtractOffset({ months: 1 })}\n rightButtonProps={addOffset({ months: 1 })}\n />\n <SevenColGrid>\n {weekDays.map((weekDay, index) => (\n <Text key={index} css={{ lineHeight: '$sizes$6', textAlign: 'center' }}>\n {weekDay}\n </Text>\n ))}\n {days.map((d) => (\n <Button\n key={d.$date.toString()}\n type=\"button\"\n css={{\n width: '32px',\n px: 0,\n color:\n !d.disabled && !d.inCurrentMonth && !d.selected\n ? '$textSubtle'\n : undefined,\n fontWeight: d.now && !d.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!d.selected}\n variant={d.now || d.selected ? 'primary' : 'secondary'}\n {...dayButton(d)}\n tabIndex={dayButton(d).disabled ? dayButton(d).tabIndex : 0}\n >\n {d.day}\n </Button>\n ))}\n </SevenColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 1 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={year}\n centerButtonOnClick={() => setPage(2)}\n leftButtonProps={subtractOffset({ years: 1 })}\n rightButtonProps={addOffset({ years: 1 })}\n />\n <ThreeColGrid>\n {months.map((m) => (\n <Button\n key={m.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: m.now && !m.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!m.selected}\n variant={m.now || m.selected ? 'primary' : 'secondary'}\n {...monthButton(m)}\n onClick={(evt) => {\n setPage(0);\n const fn = monthButton(m).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={monthButton(m).disabled ? monthButton(m).tabIndex : 0}\n >\n {m.month}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n\n <Flex\n direction=\"column\"\n css={{ display: page === 2 ? 'flex' : 'none', height: '100%' }}\n >\n <Header\n centerButtonLabel={`${years[0].year} - ${years[years.length - 1].year}`}\n centerButtonOnClick={() => setPage(0)}\n leftButtonProps={previousYearsButton()}\n rightButtonProps={nextYearsButton()}\n />\n <ThreeColGrid>\n {years.map((y) => (\n <Button\n key={y.$date.toString()}\n type=\"button\"\n css={{\n px: 0,\n fontWeight: y.now && !y.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!y.selected}\n variant={y.now || y.selected ? 'primary' : 'secondary'}\n {...yearButton(y)}\n onClick={(evt) => {\n setPage(0);\n const fn = yearButton(y).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n }}\n tabIndex={yearButton(y).disabled ? yearButton(y).tabIndex : 0}\n >\n {y.year}\n </Button>\n ))}\n </ThreeColGrid>\n </Flex>\n </Box>\n\n {showTimePicker ? (\n <Box css={{ flex: 1, width: '90px', position: 'relative', overflow: 'auto' }}>\n <Flex\n direction=\"column\"\n gap=\"1\"\n css={{ position: 'absolute', top: 0, left: 0, height: '100%', width: '100%' }}\n >\n <Text css={{ mt: '32px', ml: '8px', lineHeight: '$sizes$6' }}>Time</Text>\n <Flex direction=\"column\" gap=\"1\" css={{ overflow: 'auto', px: '$2' }}>\n {time.map((t) => (\n <Button\n key={t.$date.toString()}\n type=\"button\"\n css={{\n px: '$2',\n fontWeight: t.now && !t.selected ? '$bold' : undefined,\n textAlign: 'center',\n }}\n ghost={!t.selected}\n variant={t.now || t.selected ? 'primary' : 'secondary'}\n {...timeButton(t)}\n onClick={(evt) => {\n const fn = timeButton(t).onClick;\n if (typeof fn !== 'undefined') fn(evt);\n if (typeof onTimeButtonClick !== 'undefined') onTimeButtonClick();\n }}\n tabIndex={timeButton(t).disabled ? timeButton(t).tabIndex : 0}\n >\n {t.time}\n </Button>\n ))}\n </Flex>\n </Flex>\n </Box>\n ) : undefined}\n </Flex>\n\n {showDatePresets ? (\n <Flex gap=\"2\">\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 M\n </Button>\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addMonths(new Date(), 3)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 3 M\n </Button>\n {showTimePicker ? (\n <Button\n type=\"button\"\n css={{ flex: '1 1 0' }}\n variant=\"secondary\"\n onClick={() => {\n config.onDatesChange([addYears(new Date(), 1)]);\n if (typeof onFastTravelClick !== 'undefined') onFastTravelClick();\n }}\n >\n Now + 1 Y\n </Button>\n ) : undefined}\n </Flex>\n ) : undefined}\n </Flex>\n </StyledDiv>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,eAAe,OAAO,OAAO;CACjC,SAAS;CACT,YAAY;CACZ,KAAK;CACL,IAAI;CACJ,YAAY;CACZ,aAAa;AACf,CAAC;AAED,IAAM,eAAe,OAAO,cAAc,EACxC,qBAAqB,iBACvB,CAAC;AAED,IAAM,eAAe,OAAO,cAAc;CACxC,qBAAqB;CACrB,QAAQ;AACV,CAAC;AAED,IAAM,YAAY,OAAO,KAAK;AAS9B,SAAS,OAAO,EACd,mBACA,qBACA,iBACA,oBACc;CACd,OACE,qBAAC,MAAD;EAAM,OAAM;EAAS,KAAI;EAAI,KAAK,EAAE,IAAI,KAAK;YAA7C;GACE,oBAAC,QAAD;IAAQ,MAAK;IAAS,OAAA;IAAM,SAAQ;IAAY,GAAI;cAClD,oBAAC,iBAAD,CAAkB,CAAA;GACZ,CAAA;GACR,oBAAC,QAAD;IACE,MAAK;IACL,MAAK;IACL,UAAU;IACV,KAAK;KAAE,UAAU;KAAG,WAAW;IAAS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A,CACA;;CACG,CAAA;AAEf,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePickerInput.cjs","names":[],"sources":["../../../components/DateTimePickerInput/DateTimePickerInput.tsx"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingFocusManager,\n offset,\n Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { DPUserConfig } from '@rehookify/datepicker';\nimport { format, parse } from 'date-fns';\nimport React, { MouseEventHandler, Ref, useMemo, useRef, useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { Input, InputHandle } from '../Input';\n\nconst StyledWrapper = styled('div', {\n display: 'flex',\n position: 'relative',\n width: '100%',\n\n '& .firefox-patch': {\n display: 'none',\n },\n\n '@supports (-moz-appearance: none)': {\n '& .firefox-patch': {\n display: 'block',\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '17px',\n top: '6px',\n background: '$inputBg',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n\n '&:focus-visible': {\n '&::before': {\n backgroundColor: '$inputFocusBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.15,\n },\n },\n },\n\n '@hover': {\n '&:hover .firefox-patch': {\n '&::before': {\n backgroundColor: '$inputHoverBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport type DateTimePickerInputProps = Omit<DPUserConfig, 'onDatesChange' | 'selectedDates'> & {\n inputCSS?: CSS;\n inputProps?: Omit<typeof Input, 'css' | 'onChange' | 'ref' | 'value'>;\n onChange?: (d: Date[]) => void;\n pickerCSS?: CSS;\n pickerPlacement?: Placement;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerInputVariants = VariantProps<DateTimePickerInputProps>;\n\nexport const DateTimePickerInput = React.forwardRef<\n React.ElementRef<typeof StyledWrapper>,\n DateTimePickerInputProps\n>(\n (\n {\n inputCSS,\n inputProps,\n onChange,\n pickerCSS,\n pickerPlacement,\n showDatePresets,\n showTimePicker,\n ...pickerProps\n },\n fowardedRef,\n ) => {\n const formatStr = \"yyyy-MM-dd'T'HH:mm\";\n\n const arrowRef = useRef(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [selectedDates, onDatesChange] = useState<Date[]>([]);\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const middleware = useMemo(\n () => [\n offset(10),\n flip(),\n shift(),\n // arrowRef is passed to floating-ui which handles it correctly\n arrow({ element: arrowRef }),\n ],\n [],\n );\n\n const { refs, floatingStyles, context } = useFloating({\n open: isPickerOpen,\n onOpenChange: setIsPickerOpen,\n placement: pickerPlacement,\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);\n const { onClick: onFirefoxPatchClick } = getReferenceProps();\n\n return (\n <StyledWrapper ref={fowardedRef}>\n <Input\n startAdornment={<CalendarIcon />}\n {...getReferenceProps()}\n {...inputProps}\n css={{ '& input::-webkit-calendar-picker-indicator': { display: 'none' }, ...inputCSS }}\n onChange={(evt) => {\n const value = evt.currentTarget.value;\n setInputValue(value);\n try {\n const newDates = (value as string)\n .split(',')\n .map((d) => parse(d.trim(), formatStr, new Date()));\n onDatesChange(newDates);\n if (onChange) onChange(newDates);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n // empty\n }\n }}\n ref={refs.setReference as Ref<InputHandle>}\n type=\"datetime-local\"\n value={inputValue}\n />\n <div\n className=\"firefox-patch\"\n onClick={onFirefoxPatchClick as MouseEventHandler<HTMLDivElement>}\n />\n {isPickerOpen && (\n <FloatingFocusManager context={context} initialFocus={-1} modal={false}>\n {/* refs.setFloating is a stable callback ref from floating-ui */}\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <Card>\n <DateTimePicker\n {...pickerProps}\n css={pickerCSS}\n onDatesChange={(d) => {\n onDatesChange(d);\n setInputValue(d.map((date) => format(date, formatStr)).join(', '));\n if (onChange) onChange(d);\n }}\n onFastTravelClick={() => setIsPickerOpen(false)}\n onTimeButtonClick={() => setIsPickerOpen(false)}\n selectedDates={selectedDates}\n showDatePresets={showDatePresets}\n showTimePicker={showTimePicker}\n />\n </Card>\n <FloatingArrow ref={arrowRef} context={context} fill=\"var(--colors-01dp)\" />\n </div>\n </FloatingFocusManager>\n )}\n </StyledWrapper>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,gBAAgB,wBAAA,OAAO,OAAO;CAClC,SAAS;CACT,UAAU;CACV,OAAO;CAEP,oBAAoB,EAClB,SAAS,OACX;CAEA,qCAAqC;EACnC,oBAAoB;GAClB,SAAS;GACT,OAAO;GACP,QAAQ;GACR,UAAU;GACV,OAAO;GACP,KAAK;GACL,YAAY;GAEZ,aAAa;IACX,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GACA,YAAY;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GAEA,mBAAmB;IACjB,aAAa,EACX,iBAAiB,gBACnB;IACA,YAAY;KACV,iBAAiB;KACjB,SAAS;IACX;GACF;EACF;EAEA,UAAU,EACR,0BAA0B;GACxB,aAAa,EACX,iBAAiB,gBACnB;GACA,YAAY;IACV,iBAAiB;IACjB,SAAS;GACX;EACF,EACF;CACF;AACF,CAAC;AAcD,IAAa,sBAAsB,MAAA,QAAM,YAKrC,EACE,UACA,YACA,UACA,WACA,iBACA,iBACA,gBACA,GAAG,eAEL,gBACG;CACH,MAAM,YAAY;CAElB,MAAM,YAAA,GAAA,MAAA,
|
|
1
|
+
{"version":3,"file":"DateTimePickerInput.cjs","names":[],"sources":["../../../components/DateTimePickerInput/DateTimePickerInput.tsx"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingFocusManager,\n offset,\n Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { DPUserConfig } from '@rehookify/datepicker';\nimport { format, parse } from 'date-fns';\nimport React, { MouseEventHandler, Ref, useMemo, useRef, useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { Input, InputHandle } from '../Input';\n\nconst StyledWrapper = styled('div', {\n display: 'flex',\n position: 'relative',\n width: '100%',\n\n '& .firefox-patch': {\n display: 'none',\n },\n\n '@supports (-moz-appearance: none)': {\n '& .firefox-patch': {\n display: 'block',\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '17px',\n top: '6px',\n background: '$inputBg',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n\n '&:focus-visible': {\n '&::before': {\n backgroundColor: '$inputFocusBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.15,\n },\n },\n },\n\n '@hover': {\n '&:hover .firefox-patch': {\n '&::before': {\n backgroundColor: '$inputHoverBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport type DateTimePickerInputProps = Omit<DPUserConfig, 'onDatesChange' | 'selectedDates'> & {\n inputCSS?: CSS;\n inputProps?: Omit<typeof Input, 'css' | 'onChange' | 'ref' | 'value'>;\n onChange?: (d: Date[]) => void;\n pickerCSS?: CSS;\n pickerPlacement?: Placement;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerInputVariants = VariantProps<DateTimePickerInputProps>;\n\nexport const DateTimePickerInput = React.forwardRef<\n React.ElementRef<typeof StyledWrapper>,\n DateTimePickerInputProps\n>(\n (\n {\n inputCSS,\n inputProps,\n onChange,\n pickerCSS,\n pickerPlacement,\n showDatePresets,\n showTimePicker,\n ...pickerProps\n },\n fowardedRef,\n ) => {\n const formatStr = \"yyyy-MM-dd'T'HH:mm\";\n\n const arrowRef = useRef(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [selectedDates, onDatesChange] = useState<Date[]>([]);\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const middleware = useMemo(\n () => [\n offset(10),\n flip(),\n shift(),\n // arrowRef is passed to floating-ui which handles it correctly\n arrow({ element: arrowRef }),\n ],\n [],\n );\n\n const { refs, floatingStyles, context } = useFloating({\n open: isPickerOpen,\n onOpenChange: setIsPickerOpen,\n placement: pickerPlacement,\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);\n const { onClick: onFirefoxPatchClick } = getReferenceProps();\n\n return (\n <StyledWrapper ref={fowardedRef}>\n <Input\n startAdornment={<CalendarIcon />}\n {...getReferenceProps()}\n {...inputProps}\n css={{ '& input::-webkit-calendar-picker-indicator': { display: 'none' }, ...inputCSS }}\n onChange={(evt) => {\n const value = evt.currentTarget.value;\n setInputValue(value);\n try {\n const newDates = (value as string)\n .split(',')\n .map((d) => parse(d.trim(), formatStr, new Date()));\n onDatesChange(newDates);\n if (onChange) onChange(newDates);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n // empty\n }\n }}\n ref={refs.setReference as Ref<InputHandle>}\n type=\"datetime-local\"\n value={inputValue}\n />\n <div\n className=\"firefox-patch\"\n onClick={onFirefoxPatchClick as MouseEventHandler<HTMLDivElement>}\n />\n {isPickerOpen && (\n <FloatingFocusManager context={context} initialFocus={-1} modal={false}>\n {/* refs.setFloating is a stable callback ref from floating-ui */}\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <Card>\n <DateTimePicker\n {...pickerProps}\n css={pickerCSS}\n onDatesChange={(d) => {\n onDatesChange(d);\n setInputValue(d.map((date) => format(date, formatStr)).join(', '));\n if (onChange) onChange(d);\n }}\n onFastTravelClick={() => setIsPickerOpen(false)}\n onTimeButtonClick={() => setIsPickerOpen(false)}\n selectedDates={selectedDates}\n showDatePresets={showDatePresets}\n showTimePicker={showTimePicker}\n />\n </Card>\n <FloatingArrow ref={arrowRef} context={context} fill=\"var(--colors-01dp)\" />\n </div>\n </FloatingFocusManager>\n )}\n </StyledWrapper>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,gBAAgB,wBAAA,OAAO,OAAO;CAClC,SAAS;CACT,UAAU;CACV,OAAO;CAEP,oBAAoB,EAClB,SAAS,OACX;CAEA,qCAAqC;EACnC,oBAAoB;GAClB,SAAS;GACT,OAAO;GACP,QAAQ;GACR,UAAU;GACV,OAAO;GACP,KAAK;GACL,YAAY;GAEZ,aAAa;IACX,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GACA,YAAY;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GAEA,mBAAmB;IACjB,aAAa,EACX,iBAAiB,gBACnB;IACA,YAAY;KACV,iBAAiB;KACjB,SAAS;IACX;GACF;EACF;EAEA,UAAU,EACR,0BAA0B;GACxB,aAAa,EACX,iBAAiB,gBACnB;GACA,YAAY;IACV,iBAAiB;IACjB,SAAS;GACX;EACF,EACF;CACF;AACF,CAAC;AAcD,IAAa,sBAAsB,MAAA,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,CAAC;MACpD,cAAc,QAAQ;MACtB,IAAI,UAAU,SAAS,QAAQ;KAEjC,SAAS,KAAK,CAEd;IACF;IACA,KAAK,KAAK;IACV,MAAK;IACL,OAAO;GACR,CAAA;GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAU;IACV,SAAS;GACV,CAAA;GACA,gBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAA,sBAAD;IAA+B;IAAS,cAAc;IAAI,OAAO;cAE/D,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;KAAK,KAAK,KAAK;KAAa,OAAO;KAAgB,GAAI,iBAAiB;eAAxE,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,MAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAA,gBAAD;MACE,GAAI;MACJ,KAAK;MACL,gBAAgB,MAAM;OACpB,cAAc,CAAC;OACf,cAAc,EAAE,KAAK,UAAA,GAAA,SAAA,OAAA,CAAgB,MAAM,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;OACjE,IAAI,UAAU,SAAS,CAAC;MAC1B;MACA,yBAAyB,gBAAgB,KAAK;MAC9C,yBAAyB,gBAAgB,KAAK;MAC/B;MACE;MACD;KACjB,CAAA,EACG,CAAA,GACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAA,eAAD;MAAe,KAAK;MAAmB;MAAS,MAAK;KAAsB,CAAA,CACxE;;GACe,CAAA;EAEX;;AAEnB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePickerInput.js","names":[],"sources":["../../../components/DateTimePickerInput/DateTimePickerInput.tsx"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingFocusManager,\n offset,\n Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { DPUserConfig } from '@rehookify/datepicker';\nimport { format, parse } from 'date-fns';\nimport React, { MouseEventHandler, Ref, useMemo, useRef, useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { Input, InputHandle } from '../Input';\n\nconst StyledWrapper = styled('div', {\n display: 'flex',\n position: 'relative',\n width: '100%',\n\n '& .firefox-patch': {\n display: 'none',\n },\n\n '@supports (-moz-appearance: none)': {\n '& .firefox-patch': {\n display: 'block',\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '17px',\n top: '6px',\n background: '$inputBg',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n\n '&:focus-visible': {\n '&::before': {\n backgroundColor: '$inputFocusBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.15,\n },\n },\n },\n\n '@hover': {\n '&:hover .firefox-patch': {\n '&::before': {\n backgroundColor: '$inputHoverBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport type DateTimePickerInputProps = Omit<DPUserConfig, 'onDatesChange' | 'selectedDates'> & {\n inputCSS?: CSS;\n inputProps?: Omit<typeof Input, 'css' | 'onChange' | 'ref' | 'value'>;\n onChange?: (d: Date[]) => void;\n pickerCSS?: CSS;\n pickerPlacement?: Placement;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerInputVariants = VariantProps<DateTimePickerInputProps>;\n\nexport const DateTimePickerInput = React.forwardRef<\n React.ElementRef<typeof StyledWrapper>,\n DateTimePickerInputProps\n>(\n (\n {\n inputCSS,\n inputProps,\n onChange,\n pickerCSS,\n pickerPlacement,\n showDatePresets,\n showTimePicker,\n ...pickerProps\n },\n fowardedRef,\n ) => {\n const formatStr = \"yyyy-MM-dd'T'HH:mm\";\n\n const arrowRef = useRef(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [selectedDates, onDatesChange] = useState<Date[]>([]);\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const middleware = useMemo(\n () => [\n offset(10),\n flip(),\n shift(),\n // arrowRef is passed to floating-ui which handles it correctly\n arrow({ element: arrowRef }),\n ],\n [],\n );\n\n const { refs, floatingStyles, context } = useFloating({\n open: isPickerOpen,\n onOpenChange: setIsPickerOpen,\n placement: pickerPlacement,\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);\n const { onClick: onFirefoxPatchClick } = getReferenceProps();\n\n return (\n <StyledWrapper ref={fowardedRef}>\n <Input\n startAdornment={<CalendarIcon />}\n {...getReferenceProps()}\n {...inputProps}\n css={{ '& input::-webkit-calendar-picker-indicator': { display: 'none' }, ...inputCSS }}\n onChange={(evt) => {\n const value = evt.currentTarget.value;\n setInputValue(value);\n try {\n const newDates = (value as string)\n .split(',')\n .map((d) => parse(d.trim(), formatStr, new Date()));\n onDatesChange(newDates);\n if (onChange) onChange(newDates);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n // empty\n }\n }}\n ref={refs.setReference as Ref<InputHandle>}\n type=\"datetime-local\"\n value={inputValue}\n />\n <div\n className=\"firefox-patch\"\n onClick={onFirefoxPatchClick as MouseEventHandler<HTMLDivElement>}\n />\n {isPickerOpen && (\n <FloatingFocusManager context={context} initialFocus={-1} modal={false}>\n {/* refs.setFloating is a stable callback ref from floating-ui */}\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <Card>\n <DateTimePicker\n {...pickerProps}\n css={pickerCSS}\n onDatesChange={(d) => {\n onDatesChange(d);\n setInputValue(d.map((date) => format(date, formatStr)).join(', '));\n if (onChange) onChange(d);\n }}\n onFastTravelClick={() => setIsPickerOpen(false)}\n onTimeButtonClick={() => setIsPickerOpen(false)}\n selectedDates={selectedDates}\n showDatePresets={showDatePresets}\n showTimePicker={showTimePicker}\n />\n </Card>\n <FloatingArrow ref={arrowRef} context={context} fill=\"var(--colors-01dp)\" />\n </div>\n </FloatingFocusManager>\n )}\n </StyledWrapper>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,gBAAgB,OAAO,OAAO;CAClC,SAAS;CACT,UAAU;CACV,OAAO;CAEP,oBAAoB,EAClB,SAAS,OACX;CAEA,qCAAqC;EACnC,oBAAoB;GAClB,SAAS;GACT,OAAO;GACP,QAAQ;GACR,UAAU;GACV,OAAO;GACP,KAAK;GACL,YAAY;GAEZ,aAAa;IACX,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GACA,YAAY;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,eAAe;GACjB;GAEA,mBAAmB;IACjB,aAAa,EACX,iBAAiB,gBACnB;IACA,YAAY;KACV,iBAAiB;KACjB,SAAS;IACX;GACF;EACF;EAEA,UAAU,EACR,0BAA0B;GACxB,aAAa,EACX,iBAAiB,gBACnB;GACA,YAAY;IACV,iBAAiB;IACjB,SAAS;GACX;EACF,EACF;CACF;AACF,CAAC;AAcD,IAAa,sBAAsB,MAAM,YAKrC,EACE,UACA,YACA,UACA,WACA,iBACA,iBACA,gBACA,GAAG,eAEL,gBACG;CACH,MAAM,YAAY;CAElB,MAAM,WAAW,OAAO,IAAI;CAE5B,MAAM,CAAC,YAAY,iBAAiB,SAAiB,EAAE;CACvD,MAAM,CAAC,eAAe,iBAAiB,SAAiB,CAAC,CAAC;CAC1D,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CAatD,MAAM,EAAE,MAAM,gBAAgB,YAAY,YAAY;EACpD,MAAM;EACN,cAAc;EACd,WAAW;EACX,YAfiB,cACX;GACJ,OAAO,EAAE;GACT,KAAK;GACL,MAAM;GAEN,MAAM,EAAE,SAAS,SAAS,CAAC;EAC7B,GACA,CAAC,CAOD;EACA,sBAAsB;CACxB,CAAC;CAMD,MAAM,EAAE,mBAAmB,qBAAqB,gBAAgB;EAJlD,SAAS,OAI0C;EAHjD,WAAW,OAG6C;EAF3D,QAAQ,OAE4D;CAAI,CAAC;CACtF,MAAM,EAAE,SAAS,wBAAwB,kBAAkB;CAE3D,OACE,qBAAC,eAAD;EAAe,KAAK;YAApB;GACE,oBAAC,OAAD;IACE,gBAAgB,oBAAC,cAAD,CAAe,CAAA;IAC/B,GAAI,kBAAkB;IACtB,GAAI;IACJ,KAAK;KAAE,8CAA8C,EAAE,SAAS,OAAO;KAAG,GAAG;IAAS;IACtF,WAAW,QAAQ;KACjB,MAAM,QAAQ,IAAI,cAAc;KAChC,cAAc,KAAK;KACnB,IAAI;MACF,MAAM,WAAY,MACf,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"DateTimePickerInput.js","names":[],"sources":["../../../components/DateTimePickerInput/DateTimePickerInput.tsx"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingFocusManager,\n offset,\n Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { CalendarIcon } from '@radix-ui/react-icons';\nimport { DPUserConfig } from '@rehookify/datepicker';\nimport { format, parse } from 'date-fns';\nimport React, { MouseEventHandler, Ref, useMemo, useRef, useState } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { Input, InputHandle } from '../Input';\n\nconst StyledWrapper = styled('div', {\n display: 'flex',\n position: 'relative',\n width: '100%',\n\n '& .firefox-patch': {\n display: 'none',\n },\n\n '@supports (-moz-appearance: none)': {\n '& .firefox-patch': {\n display: 'block',\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '17px',\n top: '6px',\n background: '$inputBg',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n pointerEvents: 'none',\n },\n\n '&:focus-visible': {\n '&::before': {\n backgroundColor: '$inputFocusBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.15,\n },\n },\n },\n\n '@hover': {\n '&:hover .firefox-patch': {\n '&::before': {\n backgroundColor: '$inputHoverBg',\n },\n '&::after': {\n backgroundColor: '$primary',\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport type DateTimePickerInputProps = Omit<DPUserConfig, 'onDatesChange' | 'selectedDates'> & {\n inputCSS?: CSS;\n inputProps?: Omit<typeof Input, 'css' | 'onChange' | 'ref' | 'value'>;\n onChange?: (d: Date[]) => void;\n pickerCSS?: CSS;\n pickerPlacement?: Placement;\n showDatePresets?: boolean;\n showTimePicker?: boolean;\n};\n\nexport type DateTimePickerInputVariants = VariantProps<DateTimePickerInputProps>;\n\nexport const DateTimePickerInput = React.forwardRef<\n React.ElementRef<typeof StyledWrapper>,\n DateTimePickerInputProps\n>(\n (\n {\n inputCSS,\n inputProps,\n onChange,\n pickerCSS,\n pickerPlacement,\n showDatePresets,\n showTimePicker,\n ...pickerProps\n },\n fowardedRef,\n ) => {\n const formatStr = \"yyyy-MM-dd'T'HH:mm\";\n\n const arrowRef = useRef(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [selectedDates, onDatesChange] = useState<Date[]>([]);\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const middleware = useMemo(\n () => [\n offset(10),\n flip(),\n shift(),\n // arrowRef is passed to floating-ui which handles it correctly\n arrow({ element: arrowRef }),\n ],\n [],\n );\n\n const { refs, floatingStyles, context } = useFloating({\n open: isPickerOpen,\n onOpenChange: setIsPickerOpen,\n placement: pickerPlacement,\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);\n const { onClick: onFirefoxPatchClick } = getReferenceProps();\n\n return (\n <StyledWrapper ref={fowardedRef}>\n <Input\n startAdornment={<CalendarIcon />}\n {...getReferenceProps()}\n {...inputProps}\n css={{ '& input::-webkit-calendar-picker-indicator': { display: 'none' }, ...inputCSS }}\n onChange={(evt) => {\n const value = evt.currentTarget.value;\n setInputValue(value);\n try {\n const newDates = (value as string)\n .split(',')\n .map((d) => parse(d.trim(), formatStr, new Date()));\n onDatesChange(newDates);\n if (onChange) onChange(newDates);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n // empty\n }\n }}\n ref={refs.setReference as Ref<InputHandle>}\n type=\"datetime-local\"\n value={inputValue}\n />\n <div\n className=\"firefox-patch\"\n onClick={onFirefoxPatchClick as MouseEventHandler<HTMLDivElement>}\n />\n {isPickerOpen && (\n <FloatingFocusManager context={context} initialFocus={-1} modal={false}>\n {/* refs.setFloating is a stable callback ref from floating-ui */}\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <Card>\n <DateTimePicker\n {...pickerProps}\n css={pickerCSS}\n onDatesChange={(d) => {\n onDatesChange(d);\n setInputValue(d.map((date) => format(date, formatStr)).join(', '));\n if (onChange) onChange(d);\n }}\n onFastTravelClick={() => setIsPickerOpen(false)}\n onTimeButtonClick={() => setIsPickerOpen(false)}\n selectedDates={selectedDates}\n showDatePresets={showDatePresets}\n showTimePicker={showTimePicker}\n />\n </Card>\n <FloatingArrow ref={arrowRef} context={context} fill=\"var(--colors-01dp)\" />\n </div>\n </FloatingFocusManager>\n )}\n </StyledWrapper>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,gBAAgB,OAAO,OAAO;CAClC,SAAS;CACT,UAAU;CACV,OAAO;CAEP,oBAAoB,EAClB,SAAS,OACX;CAEA,qCAAqC;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AI,kBAAkB;IACtB,GAAI;IACJ,KAAK;KAAE,8CAA8C,EAAE,SAAS,OAAO;KAAG,GAAG;IAAS;IACtF,WAAW,QAAQ;KACjB,MAAM,QAAQ,IAAI,cAAc;KAChC,cAAc,KAAK;KACnB,IAAI;MACF,MAAM,WAAY,MACf,MAAM,GAAG,CAAC,CACV,KAAK,MAAM,MAAM,EAAE,KAAK,GAAG,2BAAW,IAAI,KAAK,CAAC,CAAC;MACpD,cAAc,QAAQ;MACtB,IAAI,UAAU,SAAS,QAAQ;KAEjC,SAAS,KAAK,CAEd;IACF;IACA,KAAK,KAAK;IACV,MAAK;IACL,OAAO;GACR,CAAA;GACD,oBAAC,OAAD;IACE,WAAU;IACV,SAAS;GACV,CAAA;GACA,gBACC,oBAAC,sBAAD;IAA+B;IAAS,cAAc;IAAI,OAAO;cAE/D,qBAAC,OAAD;KAAK,KAAK,KAAK;KAAa,OAAO;KAAgB,GAAI,iBAAiB;eAAxE,CACE,oBAAC,MAAD,EAAA,UACE,oBAAC,gBAAD;MACE,GAAI;MACJ,KAAK;MACL,gBAAgB,MAAM;OACpB,cAAc,CAAC;OACf,cAAc,EAAE,KAAK,SAAS,OAAO,MAAM,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;OACjE,IAAI,UAAU,SAAS,CAAC;MAC1B;MACA,yBAAyB,gBAAgB,KAAK;MAC9C,yBAAyB,gBAAgB,KAAK;MAC/B;MACE;MACD;KACjB,CAAA,EACG,CAAA,GACN,oBAAC,eAAD;MAAe,KAAK;MAAmB;MAAS,MAAK;KAAsB,CAAA,CACxE;;GACe,CAAA;EAEX;;AAEnB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs","names":[],"sources":["../../../components/Dialog/Dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { elevationVariants } from '../Elevation/Elevation';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & {\n children: React.ReactNode;\n};\n\nexport const DialogOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n});\n\nexport function Dialog({ children, ...props }: DialogProps) {\n return <DialogPrimitive.Root {...props}>{children}</DialogPrimitive.Root>;\n}\n\nexport const StyledContent = styled(DialogPrimitive.Content, Card, {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n minWidth: 200,\n maxHeight: '85vh',\n padding: '$4',\n marginTop: '-5vh',\n backgroundColor: '$dialogBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n borderRadius: '$3',\n // animation: `${fadeIn} 125ms linear, ${moveDown} 125ms cubic-bezier(0.22, 1, 0.36, 1)`,\n willChange: 'transform',\n overflow: 'auto',\n\n '&::before': {\n boxShadow: 'none',\n },\n\n '&:focus': {\n outline: 'none',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 5,\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface DialogCloseButtonProps\n extends VariantProps<typeof IconButton>,\n ComponentProps<typeof IconButton> {}\nexport const DialogCloseIconButton = React.forwardRef<\n React.ElementRef<typeof IconButton>,\n DialogCloseButtonProps\n>((props, forwardedRef) => (\n <StyledCloseButton asChild>\n <IconButton ref={forwardedRef} css={{ color: '$hiContrast' }} {...props}>\n <Cross1Icon />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype DialogContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype DialogContentProps = DialogContentPrimitiveProps &\n VariantProps<typeof StyledContent> & { css?: CSS };\n\nexport const DialogContent = React.forwardRef<\n React.ElementRef<typeof StyledContent>,\n DialogContentProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledContent {...props} ref={forwardedRef}>\n {children}\n <DialogCloseIconButton />\n </StyledContent>\n));\n\nexport const DialogClosePrimitive = DialogPrimitive.Close;\nexport const DialogDescription = DialogPrimitive.Description;\nexport const DialogPortal = DialogPrimitive.Portal;\nexport const DialogTitle = DialogPrimitive.Title;\nexport const DialogTrigger = DialogPrimitive.Trigger;\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,gBAAgB,wBAAA,OAAO,uBAAgB,SAAS,gBAAA,eAAe;CAC1E,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC;AAED,SAAgB,OAAO,EAAE,UAAU,GAAG,SAAsB;CAC1D,OAAO,iBAAA,GAAA,kBAAA,
|
|
1
|
+
{"version":3,"file":"Dialog.cjs","names":[],"sources":["../../../components/Dialog/Dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport { Card } from '../Card';\nimport { elevationVariants } from '../Elevation/Elevation';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & {\n children: React.ReactNode;\n};\n\nexport const DialogOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n});\n\nexport function Dialog({ children, ...props }: DialogProps) {\n return <DialogPrimitive.Root {...props}>{children}</DialogPrimitive.Root>;\n}\n\nexport const StyledContent = styled(DialogPrimitive.Content, Card, {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n minWidth: 200,\n maxHeight: '85vh',\n padding: '$4',\n marginTop: '-5vh',\n backgroundColor: '$dialogBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n borderRadius: '$3',\n // animation: `${fadeIn} 125ms linear, ${moveDown} 125ms cubic-bezier(0.22, 1, 0.36, 1)`,\n willChange: 'transform',\n overflow: 'auto',\n\n '&::before': {\n boxShadow: 'none',\n },\n\n '&:focus': {\n outline: 'none',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 5,\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface DialogCloseButtonProps\n extends VariantProps<typeof IconButton>,\n ComponentProps<typeof IconButton> {}\nexport const DialogCloseIconButton = React.forwardRef<\n React.ElementRef<typeof IconButton>,\n DialogCloseButtonProps\n>((props, forwardedRef) => (\n <StyledCloseButton asChild>\n <IconButton ref={forwardedRef} css={{ color: '$hiContrast' }} {...props}>\n <Cross1Icon />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype DialogContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype DialogContentProps = DialogContentPrimitiveProps &\n VariantProps<typeof StyledContent> & { css?: CSS };\n\nexport const DialogContent = React.forwardRef<\n React.ElementRef<typeof StyledContent>,\n DialogContentProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledContent {...props} ref={forwardedRef}>\n {children}\n <DialogCloseIconButton />\n </StyledContent>\n));\n\nexport const DialogClosePrimitive = DialogPrimitive.Close;\nexport const DialogDescription = DialogPrimitive.Description;\nexport const DialogPortal = DialogPrimitive.Portal;\nexport const DialogTitle = DialogPrimitive.Title;\nexport const DialogTrigger = DialogPrimitive.Trigger;\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,gBAAgB,wBAAA,OAAO,uBAAgB,SAAS,gBAAA,eAAe;CAC1E,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC;AAED,SAAgB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.themes.cjs","names":[],"sources":["../../../components/Dialog/Dialog.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n dialogBackground: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n dialogBackground: '$deepBlue2',\n });\n\n export const getDark: Factory = () => ({\n dialogBackground: '$deepBlue3',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,kBAAkB,aACpB;CAEa,OAAA,iBAA0B,EACrC,kBAAkB,aACpB;
|
|
1
|
+
{"version":3,"file":"Dialog.themes.cjs","names":[],"sources":["../../../components/Dialog/Dialog.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n dialogBackground: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n dialogBackground: '$deepBlue2',\n });\n\n export const getDark: Factory = () => ({\n dialogBackground: '$deepBlue3',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,kBAAkB,aACpB;CAEa,OAAA,iBAA0B,EACrC,kBAAkB,aACpB;GACD,UAAA,QAAA,CAAA,EAAD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.themes.js","names":[],"sources":["../../../components/Dialog/Dialog.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n dialogBackground: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n dialogBackground: '$deepBlue2',\n });\n\n export const getDark: Factory = () => ({\n dialogBackground: '$deepBlue3',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,kBAAkB,aACpB;CAEa,OAAA,iBAA0B,EACrC,kBAAkB,aACpB;
|
|
1
|
+
{"version":3,"file":"Dialog.themes.js","names":[],"sources":["../../../components/Dialog/Dialog.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n dialogBackground: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n dialogBackground: '$deepBlue2',\n });\n\n export const getDark: Factory = () => ({\n dialogBackground: '$deepBlue3',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,kBAAkB,aACpB;CAEa,OAAA,iBAA0B,EACrC,kBAAkB,aACpB;GACD,UAAA,QAAA,CAAA,EAAD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.cjs","names":[],"sources":["../../../components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon } from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { CSS, styled } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Flex } from '../Flex';\nimport { panelStyles } from '../Panel';\nimport { itemCss, labelCss, menuCss, separatorCss } from './styles';\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuContent = styled(DropdownMenuPrimitive.Content, menuCss, panelStyles);\nexport const DropdownMenuSeparator = styled(DropdownMenuPrimitive.Separator, separatorCss);\nexport const DropdownMenuItem = styled(DropdownMenuPrimitive.Item, itemCss);\n\nconst StyledDropdownMenuRadioItem = styled(DropdownMenuPrimitive.RadioItem, itemCss);\n\ntype DialogMenuRadioItemPrimitiveProps = Omit<\n React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>,\n 'as'\n>;\ntype DialogMenuRadioItemProps = DialogMenuRadioItemPrimitiveProps & { css?: CSS };\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuRadioItem>,\n DialogMenuRadioItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuRadioItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: 'absolute', left: '$1' }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <Flex css={{ width: '$3', height: '$3', alignItems: 'center', justifyContent: 'center' }}>\n <Box\n css={{\n width: '$1',\n height: '$1',\n backgroundColor: 'currentColor',\n borderRadius: '$round',\n }}\n />\n </Flex>\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuRadioItem>\n));\n\nconst StyledDropdownMenuCheckboxItem = styled(DropdownMenuPrimitive.CheckboxItem, itemCss);\n\ntype DialogMenuCheckboxItemPrimitiveProps = Omit<\n React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>,\n 'as'\n>;\ntype DialogMenuCheckboxItemProps = DialogMenuCheckboxItemPrimitiveProps & { css?: CSS };\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuCheckboxItem>,\n DialogMenuCheckboxItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuCheckboxItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: 'absolute', left: '$1' }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuCheckboxItem>\n));\n\nexport const DropdownMenuLabel = styled(DropdownMenuPrimitive.Label, labelCss);\nexport const DropdownMenuRadioGroup = styled(DropdownMenuPrimitive.RadioGroup, {});\nexport const DropdownMenuGroup = styled(DropdownMenuPrimitive.Group, {});\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAa,eAAe,8BAAsB;AAClD,IAAa,sBAAsB,8BAAsB;AACzD,IAAa,sBAAsB,wBAAA,OAAO,8BAAsB,SAAS,eAAA,SAAS,cAAA,WAAW;AAC7F,IAAa,wBAAwB,wBAAA,OAAO,8BAAsB,WAAW,eAAA,YAAY;AACzF,IAAa,mBAAmB,wBAAA,OAAO,8BAAsB,MAAM,eAAA,OAAO;AAE1E,IAAM,8BAA8B,wBAAA,OAAO,8BAAsB,WAAW,eAAA,OAAO;AAQnF,IAAa,wBAAwB,MAAA,QAAM,YAGxC,EAAE,UAAU,GAAG,SAAS,iBACzB,iBAAA,GAAA,kBAAA,
|
|
1
|
+
{"version":3,"file":"DropdownMenu.cjs","names":[],"sources":["../../../components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon } from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { CSS, styled } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Flex } from '../Flex';\nimport { panelStyles } from '../Panel';\nimport { itemCss, labelCss, menuCss, separatorCss } from './styles';\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuContent = styled(DropdownMenuPrimitive.Content, menuCss, panelStyles);\nexport const DropdownMenuSeparator = styled(DropdownMenuPrimitive.Separator, separatorCss);\nexport const DropdownMenuItem = styled(DropdownMenuPrimitive.Item, itemCss);\n\nconst StyledDropdownMenuRadioItem = styled(DropdownMenuPrimitive.RadioItem, itemCss);\n\ntype DialogMenuRadioItemPrimitiveProps = Omit<\n React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>,\n 'as'\n>;\ntype DialogMenuRadioItemProps = DialogMenuRadioItemPrimitiveProps & { css?: CSS };\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuRadioItem>,\n DialogMenuRadioItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuRadioItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: 'absolute', left: '$1' }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <Flex css={{ width: '$3', height: '$3', alignItems: 'center', justifyContent: 'center' }}>\n <Box\n css={{\n width: '$1',\n height: '$1',\n backgroundColor: 'currentColor',\n borderRadius: '$round',\n }}\n />\n </Flex>\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuRadioItem>\n));\n\nconst StyledDropdownMenuCheckboxItem = styled(DropdownMenuPrimitive.CheckboxItem, itemCss);\n\ntype DialogMenuCheckboxItemPrimitiveProps = Omit<\n React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>,\n 'as'\n>;\ntype DialogMenuCheckboxItemProps = DialogMenuCheckboxItemPrimitiveProps & { css?: CSS };\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuCheckboxItem>,\n DialogMenuCheckboxItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuCheckboxItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: 'absolute', left: '$1' }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuCheckboxItem>\n));\n\nexport const DropdownMenuLabel = styled(DropdownMenuPrimitive.Label, labelCss);\nexport const DropdownMenuRadioGroup = styled(DropdownMenuPrimitive.RadioGroup, {});\nexport const DropdownMenuGroup = styled(DropdownMenuPrimitive.Group, {});\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAa,eAAe,8BAAsB;AAClD,IAAa,sBAAsB,8BAAsB;AACzD,IAAa,s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AAA,kBAAA,IAAA,CAAC,sBAAA,WAAD,CAAY,CAAA,EACuB,CAAA;CAClC,CAAA,GACJ,QAC6B;EACjC;AAED,IAAa,oBAAoB,wBAAA,OAAO,8BAAsB,OAAO,eAAA,QAAQ;AAC7E,IAAa,yBAAyB,wBAAA,OAAO,8BAAsB,YAAY,CAAC,CAAC;AACjF,IAAa,oBAAoB,wBAAA,OAAO,8BAAsB,OAAO,CAAC,CAAC;AACvE,IAAa,qBAAqB,8BAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Elevation.vanilla.cjs","names":[],"sources":["../../../components/Elevation/Elevation.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;AA0BA,IAAM,iCAAA,GAAA,MAAA,
|
|
1
|
+
{"version":3,"file":"Elevation.vanilla.cjs","names":[],"sources":["../../../components/Elevation/Elevation.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;AA0BA,IAAM,iCAAA,GAAA,MAAA,WAAA,EAEF,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAA,yBAAA,iBAAA,CAAoB,IAAI;CAAE;CAGzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GALK,8BAAA,gBAAgB,EAAE,QAAQ,CAK5B,EAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FaencyProvider.cjs","names":[],"sources":["../../components/FaencyProvider.tsx"],"sourcesContent":["import { Provider as TooltipProvider } from '@radix-ui/react-tooltip';\nimport React from 'react';\n\nimport { ColorSchemeProvider } from './colorSchemeContext';\n\ninterface FaencyProviderProps {\n children?: React.ReactNode;\n}\n\nexport const FaencyProvider = ({ children }: FaencyProviderProps) => (\n <TooltipProvider>\n <ColorSchemeProvider>{children}</ColorSchemeProvider>\n </TooltipProvider>\n);\n"],"mappings":";;;;;;;AASA,IAAa,kBAAkB,EAAE,eAC/B,iBAAA,GAAA,kBAAA,
|
|
1
|
+
{"version":3,"file":"FaencyProvider.cjs","names":[],"sources":["../../components/FaencyProvider.tsx"],"sourcesContent":["import { Provider as TooltipProvider } from '@radix-ui/react-tooltip';\nimport React from 'react';\n\nimport { ColorSchemeProvider } from './colorSchemeContext';\n\ninterface FaencyProviderProps {\n children?: React.ReactNode;\n}\n\nexport const FaencyProvider = ({ children }: FaencyProviderProps) => (\n <TooltipProvider>\n <ColorSchemeProvider>{children}</ColorSchemeProvider>\n </TooltipProvider>\n);\n"],"mappings":";;;;;;;AASA,IAAa,kBAAkB,EAAE,eAC/B,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAA,UAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,2BAAA,qBAAD,EAAsB,SAA8B,CAAA,EACrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.cjs","names":[],"sources":["../../../components/Flex/Flex.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Flex = styled('div', {\n boxSizing: 'border-box',\n display: 'flex',\n\n variants: {\n direction: {\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n rowReverse: {\n flexDirection: 'row-reverse',\n },\n columnReverse: {\n flexDirection: 'column-reverse',\n },\n },\n align: {\n start: {\n alignItems: 'flex-start',\n },\n center: {\n alignItems: 'center',\n },\n end: {\n alignItems: 'flex-end',\n },\n stretch: {\n alignItems: 'stretch',\n },\n baseline: {\n alignItems: 'baseline',\n },\n ['space-evenly']: {\n alignItems: 'space-evenly',\n },\n ['space-between']: {\n alignItems: 'space-between',\n },\n ['space-around']: {\n alignItems: 'space-around',\n },\n },\n justify: {\n start: {\n justifyContent: 'flex-start',\n },\n center: {\n justifyContent: 'center',\n },\n end: {\n justifyContent: 'flex-end',\n },\n between: {\n justifyContent: 'space-between',\n },\n ['space-evenly']: {\n justifyContent: 'space-evenly',\n },\n ['space-between']: {\n justifyContent: 'space-between',\n },\n ['space-around']: {\n justifyContent: 'space-around',\n },\n },\n wrap: {\n noWrap: {\n flexWrap: 'nowrap',\n },\n wrap: {\n flexWrap: 'wrap',\n },\n wrapReverse: {\n flexWrap: 'wrap-reverse',\n },\n },\n gap: {\n 1: {\n gap: '$1',\n },\n 2: {\n gap: '$2',\n },\n 3: {\n gap: '$3',\n },\n 4: {\n gap: '$4',\n },\n 5: {\n gap: '$5',\n },\n 6: {\n gap: '$6',\n },\n 7: {\n gap: '$7',\n },\n 8: {\n gap: '$8',\n },\n 9: {\n gap: '$9',\n },\n },\n },\n defaultVariants: {\n direction: 'row',\n align: 'stretch',\n justify: 'start',\n wrap: 'noWrap',\n },\n});\n"],"mappings":";AAEA,IAAa,0CAAO,
|
|
1
|
+
{"version":3,"file":"Flex.cjs","names":[],"sources":["../../../components/Flex/Flex.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Flex = styled('div', {\n boxSizing: 'border-box',\n display: 'flex',\n\n variants: {\n direction: {\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n rowReverse: {\n flexDirection: 'row-reverse',\n },\n columnReverse: {\n flexDirection: 'column-reverse',\n },\n },\n align: {\n start: {\n alignItems: 'flex-start',\n },\n center: {\n alignItems: 'center',\n },\n end: {\n alignItems: 'flex-end',\n },\n stretch: {\n alignItems: 'stretch',\n },\n baseline: {\n alignItems: 'baseline',\n },\n ['space-evenly']: {\n alignItems: 'space-evenly',\n },\n ['space-between']: {\n alignItems: 'space-between',\n },\n ['space-around']: {\n alignItems: 'space-around',\n },\n },\n justify: {\n start: {\n justifyContent: 'flex-start',\n },\n center: {\n justifyContent: 'center',\n },\n end: {\n justifyContent: 'flex-end',\n },\n between: {\n justifyContent: 'space-between',\n },\n ['space-evenly']: {\n justifyContent: 'space-evenly',\n },\n ['space-between']: {\n justifyContent: 'space-between',\n },\n ['space-around']: {\n justifyContent: 'space-around',\n },\n },\n wrap: {\n noWrap: {\n flexWrap: 'nowrap',\n },\n wrap: {\n flexWrap: 'wrap',\n },\n wrapReverse: {\n flexWrap: 'wrap-reverse',\n },\n },\n gap: {\n 1: {\n gap: '$1',\n },\n 2: {\n gap: '$2',\n },\n 3: {\n gap: '$3',\n },\n 4: {\n gap: '$4',\n },\n 5: {\n gap: '$5',\n },\n 6: {\n gap: '$6',\n },\n 7: {\n gap: '$7',\n },\n 8: {\n gap: '$8',\n },\n 9: {\n gap: '$9',\n },\n },\n },\n defaultVariants: {\n direction: 'row',\n align: 'stretch',\n justify: 'start',\n wrap: 'noWrap',\n },\n});\n"],"mappings":";AAEA,IAAa,0CAAO,CAAA,CAAA,OAAO,OAAO;CAChC,WAAW;CACX,SAAS;CAET,UAAU;EACR,WAAW;GACT,KAAK,EACH,eAAe,MACjB;GACA,QAAQ,EACN,eAAe,SACjB;GACA,YAAY,EACV,eAAe,cACjB;GACA,eAAe,EACb,eAAe,iBACjB;EACF;EACA,OAAO;GACL,OAAO,EACL,YAAY,aACd;GACA,QAAQ,EACN,YAAY,SACd;GACA,KAAK,EACH,YAAY,WACd;GACA,SAAS,EACP,YAAY,UACd;GACA,UAAU,EACR,YAAY,WACd;IACC,iBAAiB,EAChB,YAAY,eACd;IACC,kBAAkB,EACjB,YAAY,gBACd;IACC,iBAAiB,EAChB,YAAY,eACd;EACF;EACA,SAAS;GACP,OAAO,EACL,gBAAgB,aAClB;GACA,QAAQ,EACN,gBAAgB,SAClB;GACA,KAAK,EACH,gBAAgB,WAClB;GACA,SAAS,EACP,gBAAgB,gBAClB;IACC,iBAAiB,EAChB,gBAAgB,eAClB;IACC,kBAAkB,EACjB,gBAAgB,gBAClB;IACC,iBAAiB,EAChB,gBAAgB,eAClB;EACF;EACA,MAAM;GACJ,QAAQ,EACN,UAAU,SACZ;GACA,MAAM,EACJ,UAAU,OACZ;GACA,aAAa,EACX,UAAU,eACZ;EACF;EACA,KAAK;GACH,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;EACF;CACF;CACA,iBAAiB;EACf,WAAW;EACX,OAAO;EACP,SAAS;EACT,MAAM;CACR;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.vanilla.cjs","names":[],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;;;AA6BA,IAAa,uBAAuB,MAAA,QAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,
|
|
1
|
+
{"version":3,"file":"Flex.vanilla.cjs","names":[],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;;;AA6BA,IAAa,uBAAuB,MAAA,QAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,iBAAA,CAAoB,IAAI;CAC1B;CAIA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GALK,yBAAA,WAAW;GAAE;GAAW;GAAO;GAAS;GAAM;EAAI,CAKpD,EAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
|
|
@@ -30,6 +30,6 @@ var FlexVanillaComponent = React.forwardRef(({ as, className, css, style, direct
|
|
|
30
30
|
FlexVanillaComponent.displayName = "FlexVanilla";
|
|
31
31
|
var FlexVanilla = FlexVanillaComponent;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { FlexVanilla };
|
|
33
|
+
export { FlexVanilla, FlexVanillaComponent };
|
|
34
34
|
|
|
35
35
|
//# sourceMappingURL=Flex.vanilla.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.cjs","names":[],"sources":["../../../components/Grid/Grid.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Grid = styled('div', {\n boxSizing: 'border-box',\n display: 'grid',\n\n variants: {\n align: {\n start: {\n alignItems: 'start',\n },\n center: {\n alignItems: 'center',\n },\n end: {\n alignItems: 'end',\n },\n stretch: {\n alignItems: 'stretch',\n },\n baseline: {\n alignItems: 'baseline',\n },\n },\n justify: {\n start: {\n justifyContent: 'start',\n },\n center: {\n justifyContent: 'center',\n },\n end: {\n justifyContent: 'end',\n },\n between: {\n justifyContent: 'space-between',\n },\n },\n flow: {\n row: {\n gridAutoFlow: 'row',\n },\n column: {\n gridAutoFlow: 'column',\n },\n dense: {\n gridAutoFlow: 'dense',\n },\n rowDense: {\n gridAutoFlow: 'row dense',\n },\n columnDense: {\n gridAutoFlow: 'column dense',\n },\n },\n columns: {\n 1: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n 2: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n 3: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n 4: {\n gridTemplateColumns: 'repeat(4, 1fr)',\n },\n },\n gap: {\n 1: {\n gap: '$1',\n },\n 2: {\n gap: '$2',\n },\n 3: {\n gap: '$3',\n },\n 4: {\n gap: '$4',\n },\n 5: {\n gap: '$5',\n },\n 6: {\n gap: '$6',\n },\n 7: {\n gap: '$7',\n },\n 8: {\n gap: '$8',\n },\n 9: {\n gap: '$9',\n },\n },\n gapX: {\n 1: {\n columnGap: '$1',\n },\n 2: {\n columnGap: '$2',\n },\n 3: {\n columnGap: '$3',\n },\n 4: {\n columnGap: '$4',\n },\n 5: {\n columnGap: '$5',\n },\n 6: {\n columnGap: '$6',\n },\n 7: {\n columnGap: '$7',\n },\n 8: {\n columnGap: '$8',\n },\n 9: {\n columnGap: '$9',\n },\n },\n gapY: {\n 1: {\n rowGap: '$1',\n },\n 2: {\n rowGap: '$2',\n },\n 3: {\n rowGap: '$3',\n },\n 4: {\n rowGap: '$4',\n },\n 5: {\n rowGap: '$5',\n },\n 6: {\n rowGap: '$6',\n },\n 7: {\n rowGap: '$7',\n },\n 8: {\n rowGap: '$8',\n },\n 9: {\n rowGap: '$9',\n },\n },\n },\n});\n"],"mappings":";AAEA,IAAa,0CAAO,
|
|
1
|
+
{"version":3,"file":"Grid.cjs","names":[],"sources":["../../../components/Grid/Grid.tsx"],"sourcesContent":["import { styled } from '../../stitches.config';\n\nexport const Grid = styled('div', {\n boxSizing: 'border-box',\n display: 'grid',\n\n variants: {\n align: {\n start: {\n alignItems: 'start',\n },\n center: {\n alignItems: 'center',\n },\n end: {\n alignItems: 'end',\n },\n stretch: {\n alignItems: 'stretch',\n },\n baseline: {\n alignItems: 'baseline',\n },\n },\n justify: {\n start: {\n justifyContent: 'start',\n },\n center: {\n justifyContent: 'center',\n },\n end: {\n justifyContent: 'end',\n },\n between: {\n justifyContent: 'space-between',\n },\n },\n flow: {\n row: {\n gridAutoFlow: 'row',\n },\n column: {\n gridAutoFlow: 'column',\n },\n dense: {\n gridAutoFlow: 'dense',\n },\n rowDense: {\n gridAutoFlow: 'row dense',\n },\n columnDense: {\n gridAutoFlow: 'column dense',\n },\n },\n columns: {\n 1: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n 2: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n 3: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n 4: {\n gridTemplateColumns: 'repeat(4, 1fr)',\n },\n },\n gap: {\n 1: {\n gap: '$1',\n },\n 2: {\n gap: '$2',\n },\n 3: {\n gap: '$3',\n },\n 4: {\n gap: '$4',\n },\n 5: {\n gap: '$5',\n },\n 6: {\n gap: '$6',\n },\n 7: {\n gap: '$7',\n },\n 8: {\n gap: '$8',\n },\n 9: {\n gap: '$9',\n },\n },\n gapX: {\n 1: {\n columnGap: '$1',\n },\n 2: {\n columnGap: '$2',\n },\n 3: {\n columnGap: '$3',\n },\n 4: {\n columnGap: '$4',\n },\n 5: {\n columnGap: '$5',\n },\n 6: {\n columnGap: '$6',\n },\n 7: {\n columnGap: '$7',\n },\n 8: {\n columnGap: '$8',\n },\n 9: {\n columnGap: '$9',\n },\n },\n gapY: {\n 1: {\n rowGap: '$1',\n },\n 2: {\n rowGap: '$2',\n },\n 3: {\n rowGap: '$3',\n },\n 4: {\n rowGap: '$4',\n },\n 5: {\n rowGap: '$5',\n },\n 6: {\n rowGap: '$6',\n },\n 7: {\n rowGap: '$7',\n },\n 8: {\n rowGap: '$8',\n },\n 9: {\n rowGap: '$9',\n },\n },\n },\n});\n"],"mappings":";AAEA,IAAa,0CAAO,CAAA,CAAA,OAAO,OAAO;CAChC,WAAW;CACX,SAAS;CAET,UAAU;EACR,OAAO;GACL,OAAO,EACL,YAAY,QACd;GACA,QAAQ,EACN,YAAY,SACd;GACA,KAAK,EACH,YAAY,MACd;GACA,SAAS,EACP,YAAY,UACd;GACA,UAAU,EACR,YAAY,WACd;EACF;EACA,SAAS;GACP,OAAO,EACL,gBAAgB,QAClB;GACA,QAAQ,EACN,gBAAgB,SAClB;GACA,KAAK,EACH,gBAAgB,MAClB;GACA,SAAS,EACP,gBAAgB,gBAClB;EACF;EACA,MAAM;GACJ,KAAK,EACH,cAAc,MAChB;GACA,QAAQ,EACN,cAAc,SAChB;GACA,OAAO,EACL,cAAc,QAChB;GACA,UAAU,EACR,cAAc,YAChB;GACA,aAAa,EACX,cAAc,eAChB;EACF;EACA,SAAS;GACP,GAAG,EACD,qBAAqB,iBACvB;GACA,GAAG,EACD,qBAAqB,iBACvB;GACA,GAAG,EACD,qBAAqB,iBACvB;GACA,GAAG,EACD,qBAAqB,iBACvB;EACF;EACA,KAAK;GACH,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;GACA,GAAG,EACD,KAAK,KACP;EACF;EACA,MAAM;GACJ,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;GACA,GAAG,EACD,WAAW,KACb;EACF;EACA,MAAM;GACJ,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;GACA,GAAG,EACD,QAAQ,KACV;EACF;CACF;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.vanilla.cjs","names":[],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;;;AA0BA,IAAa,uBAAuB,MAAA,QAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,
|
|
1
|
+
{"version":3,"file":"Grid.vanilla.cjs","names":[],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;;;AA0BA,IAAa,uBAAuB,MAAA,QAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,qBAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,iBAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,IAAA,GAAA,yBAAA,iBAAA,CAAoB,IAAI;CAC1B;CAIA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GALK,yBAAA,WAAW;GAAE;GAAO;GAAS;GAAM;GAAK;GAAM;EAAK,CAKrD,EAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
|
|
@@ -34,6 +34,6 @@ var GridVanillaComponent = React.forwardRef(({ as, className, css, style, align,
|
|
|
34
34
|
GridVanillaComponent.displayName = "GridVanilla";
|
|
35
35
|
var GridVanilla = GridVanillaComponent;
|
|
36
36
|
//#endregion
|
|
37
|
-
export { GridVanilla };
|
|
37
|
+
export { GridVanilla, GridVanillaComponent };
|
|
38
38
|
|
|
39
39
|
//# sourceMappingURL=Grid.vanilla.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.themes.cjs","names":[],"sources":["../../../components/Heading/Heading.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\nimport tinycolor from 'tinycolor2';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n headingDefault: Property.Color;\n };\n\n type Factory = (primaryColor: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n headingDefault: tinycolor('black').setAlpha(0.74).toHslString(),\n });\n\n export const getDark: Factory = () => ({\n headingDefault: tinycolor('white').setAlpha(0.74).toHslString(),\n });\n}\n"],"mappings":";;;;AAKO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,iBAAA,GAAA,WAAA,
|
|
1
|
+
{"version":3,"file":"Heading.themes.cjs","names":[],"sources":["../../../components/Heading/Heading.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\nimport tinycolor from 'tinycolor2';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n headingDefault: Property.Color;\n };\n\n type Factory = (primaryColor: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n headingDefault: tinycolor('black').setAlpha(0.74).toHslString(),\n });\n\n export const getDark: Factory = () => ({\n headingDefault: tinycolor('white').setAlpha(0.74).toHslString(),\n });\n}\n"],"mappings":";;;;AAKO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,iBAAA,GAAA,WAAA,QAAA,CAA0B,OAAO,CAAC,CAAC,SAAS,GAAI,CAAC,CAAC,YAAY,EAChE;CAEa,OAAA,iBAA0B,EACrC,iBAAA,GAAA,WAAA,QAAA,CAA0B,OAAO,CAAC,CAAC,SAAS,GAAI,CAAC,CAAC,YAAY,EAChE;GACD,UAAA,QAAA,CAAA,EAAD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.themes.js","names":[],"sources":["../../../components/Heading/Heading.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\nimport tinycolor from 'tinycolor2';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n headingDefault: Property.Color;\n };\n\n type Factory = (primaryColor: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n headingDefault: tinycolor('black').setAlpha(0.74).toHslString(),\n });\n\n export const getDark: Factory = () => ({\n headingDefault: tinycolor('white').setAlpha(0.74).toHslString(),\n });\n}\n"],"mappings":";;AAKO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,gBAAgB,UAAU,OAAO,
|
|
1
|
+
{"version":3,"file":"Heading.themes.js","names":[],"sources":["../../../components/Heading/Heading.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\nimport tinycolor from 'tinycolor2';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n headingDefault: Property.Color;\n };\n\n type Factory = (primaryColor: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n headingDefault: tinycolor('black').setAlpha(0.74).toHslString(),\n });\n\n export const getDark: Factory = () => ({\n headingDefault: tinycolor('white').setAlpha(0.74).toHslString(),\n });\n}\n"],"mappings":";;AAKO,IAAA;;CAOQ,OAAA,kBAA2B,EACtC,gBAAgB,UAAU,OAAO,CAAC,CAAC,SAAS,GAAI,CAAC,CAAC,YAAY,EAChE;CAEa,OAAA,iBAA0B,EACrC,gBAAgB,UAAU,OAAO,CAAC,CAAC,SAAS,GAAI,CAAC,CAAC,YAAY,EAChE;GACD,UAAA,QAAA,CAAA,EAAD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.themes.cjs","names":[],"sources":["../../../components/IconButton/IconButton.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n iconButtonBackground: Property.Color;\n iconButtonHoverBorder: Property.Color;\n iconButtonHoverBackground: Property.Color;\n iconButtonFocusBorder: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n iconButtonBackground: 'white',\n iconButtonHoverBorder: '$slate9',\n iconButtonHoverBackground: '$slateA3',\n iconButtonFocusBorder: '$slate10',\n });\n\n export const getDark: Factory = () => ({\n iconButtonBackground: '$deepBlue2',\n iconButtonHoverBorder: '$deepBlue6',\n iconButtonHoverBackground: '$slateA4',\n iconButtonFocusBorder: '$deepBlue7',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAUQ,OAAA,kBAA2B;EACtC,sBAAsB;EACtB,uBAAuB;EACvB,2BAA2B;EAC3B,uBAAuB;CACzB;CAEa,OAAA,iBAA0B;EACrC,sBAAsB;EACtB,uBAAuB;EACvB,2BAA2B;EAC3B,uBAAuB;CACzB;
|
|
1
|
+
{"version":3,"file":"IconButton.themes.cjs","names":[],"sources":["../../../components/IconButton/IconButton.themes.ts"],"sourcesContent":["import { Property } from '@stitches/react/types/css';\n\nimport { ColorInfo } from '../../utils/getPrimaryColorInfo';\n\nexport namespace Theme {\n type Colors = {\n iconButtonBackground: Property.Color;\n iconButtonHoverBorder: Property.Color;\n iconButtonHoverBackground: Property.Color;\n iconButtonFocusBorder: Property.Color;\n };\n\n type Factory = (primaryColor?: ColorInfo) => Colors;\n\n export const getLight: Factory = () => ({\n iconButtonBackground: 'white',\n iconButtonHoverBorder: '$slate9',\n iconButtonHoverBackground: '$slateA3',\n iconButtonFocusBorder: '$slate10',\n });\n\n export const getDark: Factory = () => ({\n iconButtonBackground: '$deepBlue2',\n iconButtonHoverBorder: '$deepBlue6',\n iconButtonHoverBackground: '$slateA4',\n iconButtonFocusBorder: '$deepBlue7',\n });\n}\n"],"mappings":";AAIO,IAAA;;CAUQ,OAAA,kBAA2B;EACtC,sBAAsB;EACtB,uBAAuB;EACvB,2BAA2B;EAC3B,uBAAuB;CACzB;CAEa,OAAA,iBAA0B;EACrC,sBAAsB;EACtB,uBAAuB;EACvB,2BAA2B;EAC3B,uBAAuB;CACzB;GACD,UAAA,QAAA,CAAA,EAAD"}
|