@traefik-labs/faency 13.2.0 → 13.4.0

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.
Files changed (121) hide show
  1. package/dist/components/Accordion/Accordion.cjs +24 -18
  2. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  3. package/dist/components/Accordion/Accordion.js +24 -18
  4. package/dist/components/Accordion/Accordion.js.map +1 -1
  5. package/dist/components/Alert/Alert.cjs.map +1 -1
  6. package/dist/components/Alert/Alert.js.map +1 -1
  7. package/dist/components/AriaTable/AriaTable.cjs +47 -9
  8. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.js +48 -10
  10. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  11. package/dist/components/Badge/Badge.vanilla.css.cjs.map +1 -1
  12. package/dist/components/Badge/Badge.vanilla.css.js.map +1 -1
  13. package/dist/components/Card/Card.cjs.map +1 -1
  14. package/dist/components/Card/Card.js.map +1 -1
  15. package/dist/components/Combobox/Combobox.vanilla.cjs +170 -0
  16. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -0
  17. package/dist/components/Combobox/Combobox.vanilla.css.cjs +33 -0
  18. package/dist/components/Combobox/Combobox.vanilla.css.cjs.map +1 -0
  19. package/dist/components/Combobox/Combobox.vanilla.css.js +29 -0
  20. package/dist/components/Combobox/Combobox.vanilla.css.js.map +1 -0
  21. package/dist/components/Combobox/Combobox.vanilla.js +167 -0
  22. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -0
  23. package/dist/components/Dialog/Dialog.cjs +4 -3
  24. package/dist/components/Dialog/Dialog.cjs.map +1 -1
  25. package/dist/components/Dialog/Dialog.js +4 -3
  26. package/dist/components/Dialog/Dialog.js.map +1 -1
  27. package/dist/components/Meter/Meter.vanilla.cjs +74 -0
  28. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -0
  29. package/dist/components/Meter/Meter.vanilla.css.cjs +26 -0
  30. package/dist/components/Meter/Meter.vanilla.css.cjs.map +1 -0
  31. package/dist/components/Meter/Meter.vanilla.css.js +21 -0
  32. package/dist/components/Meter/Meter.vanilla.css.js.map +1 -0
  33. package/dist/components/Meter/Meter.vanilla.js +72 -0
  34. package/dist/components/Meter/Meter.vanilla.js.map +1 -0
  35. package/dist/components/Navigation/Navigation.cjs +4 -1
  36. package/dist/components/Navigation/Navigation.cjs.map +1 -1
  37. package/dist/components/Navigation/Navigation.js +4 -1
  38. package/dist/components/Navigation/Navigation.js.map +1 -1
  39. package/dist/components/RadioAccordion/RadioAccordion.cjs +10 -6
  40. package/dist/components/RadioAccordion/RadioAccordion.cjs.map +1 -1
  41. package/dist/components/RadioAccordion/RadioAccordion.js +10 -6
  42. package/dist/components/RadioAccordion/RadioAccordion.js.map +1 -1
  43. package/dist/components/RowLink/RowLink.cjs +95 -0
  44. package/dist/components/RowLink/RowLink.cjs.map +1 -0
  45. package/dist/components/RowLink/RowLink.js +90 -0
  46. package/dist/components/RowLink/RowLink.js.map +1 -0
  47. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +57 -0
  48. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -0
  49. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs +35 -0
  50. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs.map +1 -0
  51. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js +34 -0
  52. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js.map +1 -0
  53. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +53 -0
  54. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -0
  55. package/dist/components/Select/Select.cjs +1 -1
  56. package/dist/components/Select/Select.js +1 -1
  57. package/dist/components/SidePanel/SidePanel.cjs +3 -3
  58. package/dist/components/SidePanel/SidePanel.cjs.map +1 -1
  59. package/dist/components/SidePanel/SidePanel.js +3 -3
  60. package/dist/components/SidePanel/SidePanel.js.map +1 -1
  61. package/dist/components/Skeleton/Skeleton.cjs +4 -0
  62. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  63. package/dist/components/Skeleton/Skeleton.js +4 -0
  64. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  65. package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -1
  66. package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -1
  67. package/dist/components/Spinner/Spinner.vanilla.cjs +50 -0
  68. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -0
  69. package/dist/components/Spinner/Spinner.vanilla.css.cjs +21 -0
  70. package/dist/components/Spinner/Spinner.vanilla.css.cjs.map +1 -0
  71. package/dist/components/Spinner/Spinner.vanilla.css.js +19 -0
  72. package/dist/components/Spinner/Spinner.vanilla.css.js.map +1 -0
  73. package/dist/components/Spinner/Spinner.vanilla.js +48 -0
  74. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -0
  75. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +214 -0
  76. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -0
  77. package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs +14 -0
  78. package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs.map +1 -0
  79. package/dist/components/SplitLayout/SplitLayout.vanilla.css.js +10 -0
  80. package/dist/components/SplitLayout/SplitLayout.vanilla.css.js.map +1 -0
  81. package/dist/components/SplitLayout/SplitLayout.vanilla.js +210 -0
  82. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -0
  83. package/dist/components/Table/ExpandButton.cjs +18 -0
  84. package/dist/components/Table/ExpandButton.cjs.map +1 -0
  85. package/dist/components/Table/ExpandButton.js +19 -0
  86. package/dist/components/Table/ExpandButton.js.map +1 -0
  87. package/dist/components/Table/Table.cjs +39 -13
  88. package/dist/components/Table/Table.cjs.map +1 -1
  89. package/dist/components/Table/Table.js +40 -14
  90. package/dist/components/Table/Table.js.map +1 -1
  91. package/dist/components/Toast/Toast.vanilla.cjs +96 -0
  92. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -0
  93. package/dist/components/Toast/Toast.vanilla.css.cjs +44 -0
  94. package/dist/components/Toast/Toast.vanilla.css.cjs.map +1 -0
  95. package/dist/components/Toast/Toast.vanilla.css.js +37 -0
  96. package/dist/components/Toast/Toast.vanilla.css.js.map +1 -0
  97. package/dist/components/Toast/Toast.vanilla.js +90 -0
  98. package/dist/components/Toast/Toast.vanilla.js.map +1 -0
  99. package/dist/components/Toast/ToastProvider.vanilla.cjs +98 -0
  100. package/dist/components/Toast/ToastProvider.vanilla.cjs.map +1 -0
  101. package/dist/components/Toast/ToastProvider.vanilla.js +94 -0
  102. package/dist/components/Toast/ToastProvider.vanilla.js.map +1 -0
  103. package/dist/faency.css +2311 -1340
  104. package/dist/index.cjs +33 -6
  105. package/dist/index.d.ts +1185 -10
  106. package/dist/index.js +16 -7
  107. package/dist/styles/cssProps.cjs +3 -10
  108. package/dist/styles/cssProps.cjs.map +1 -1
  109. package/dist/styles/cssProps.js +3 -10
  110. package/dist/styles/cssProps.js.map +1 -1
  111. package/dist/styles/resolveColor.cjs +18 -0
  112. package/dist/styles/resolveColor.cjs.map +1 -0
  113. package/dist/styles/resolveColor.js +18 -0
  114. package/dist/styles/resolveColor.js.map +1 -0
  115. package/dist/styles/themes.css.cjs.map +1 -1
  116. package/dist/styles/themes.css.js.map +1 -1
  117. package/dist/styles/tokens.css.cjs +484 -0
  118. package/dist/styles/tokens.css.cjs.map +1 -0
  119. package/dist/styles/tokens.css.js +484 -0
  120. package/dist/styles/tokens.css.js.map +1 -0
  121. package/package.json +3 -9
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","names":["styled","DialogPrimitive","overlayStyles","Card","elevationVariants","React","IconButton","Cross1Icon"],"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,gBAAgBA,wBAAAA,OAAOC,uBAAgB,SAASC,gBAAAA,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,IAAA,CAACD,uBAAgB,MAAjB;EAAsB,GAAI;EAAQ;CAA+B,CAAA;AAC1E;AAEA,IAAa,gBAAgBD,wBAAAA,OAAOC,uBAAgB,SAASE,aAAAA,MAAM;CACjE,UAAU;CACV,KAAK;CACL,MAAM;CACN,WAAW;CACX,UAAU;CACV,WAAW;CACX,SAAS;CACT,WAAW;CACX,iBAAiB;CACjB,WAAW;CACX,cAAc;CAEd,YAAY;CACZ,UAAU;CAEV,aAAa,EACX,WAAW,OACb;CAEA,WAAW,EACT,SAAS,OACX;CAEA,UAAU,EACR,WAAWC,kBAAAA,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC;AAED,IAAM,oBAAoBJ,wBAAAA,OAAOC,uBAAgB,OAAO;CACtD,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;AACV,CAAC;AAKD,IAAa,wBAAwBI,MAAAA,QAAM,YAGxC,OAAO,iBACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAD;CAAmB,SAAA;CACjB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;EAAY,KAAK;EAAc,KAAK,EAAE,OAAO,cAAc;EAAG,GAAI;EAChE,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,YAAD,CAAa,CAAA;CACH,CAAA;AACK,CAAA,CACpB;AAMD,IAAa,gBAAgBF,MAAAA,QAAM,YAGhC,EAAE,UAAU,GAAG,SAAS,iBACzB,iBAAA,GAAA,kBAAA,KAAA,CAAC,eAAD;CAAe,GAAI;CAAO,KAAK;CAA/B,UAAA,CACG,UACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD,CAAwB,CAAA,CACX;AAChB,CAAA,CAAA;AAED,IAAa,uBAAuBJ,uBAAgB;AACpD,IAAa,oBAAoBA,uBAAgB;AACjD,IAAa,eAAeA,uBAAgB;AAC5C,IAAa,cAAcA,uBAAgB;AAC3C,IAAa,gBAAgBA,uBAAgB"}
1
+ {"version":3,"file":"Dialog.cjs","names":["styled","DialogPrimitive","overlayStyles","Card","elevationVariants","React","IconButton","Cross1Icon"],"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>, 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' }} aria-label=\"Close\" {...props}>\n <Cross1Icon aria-hidden />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype DialogContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype DialogContentProps = DialogContentPrimitiveProps &\n VariantProps<typeof StyledContent> & { css?: CSS; closeLabel?: string };\n\nexport const DialogContent = React.forwardRef<\n React.ElementRef<typeof StyledContent>,\n DialogContentProps\n>(({ children, closeLabel = 'Close', ...props }, forwardedRef) => (\n <StyledContent {...props} ref={forwardedRef}>\n {children}\n <DialogCloseIconButton aria-label={closeLabel} />\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":";;;;;;;;;;;;;AAc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AAA,CACG,UACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD,EAAuB,cAAY,WAAa,CAAA,CACnC;AAChB,CAAA,CAAA;AAED,IAAa,uBAAuBJ,uBAAgB;AACpD,IAAa,oBAAoBA,uBAAgB;AACjD,IAAa,eAAeA,uBAAgB;AAC5C,IAAa,cAAcA,uBAAgB;AAC3C,IAAa,gBAAgBA,uBAAgB"}
@@ -51,14 +51,15 @@ var DialogCloseIconButton = React.forwardRef((props, forwardedRef) => /* @__PURE
51
51
  children: /* @__PURE__ */ jsx(IconButton, {
52
52
  ref: forwardedRef,
53
53
  css: { color: "$hiContrast" },
54
+ "aria-label": "Close",
54
55
  ...props,
55
- children: /* @__PURE__ */ jsx(Cross1Icon, {})
56
+ children: /* @__PURE__ */ jsx(Cross1Icon, { "aria-hidden": true })
56
57
  })
57
58
  }));
58
- var DialogContent = React.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxs(StyledContent, {
59
+ var DialogContent = React.forwardRef(({ children, closeLabel = "Close", ...props }, forwardedRef) => /* @__PURE__ */ jsxs(StyledContent, {
59
60
  ...props,
60
61
  ref: forwardedRef,
61
- children: [children, /* @__PURE__ */ jsx(DialogCloseIconButton, {})]
62
+ children: [children, /* @__PURE__ */ jsx(DialogCloseIconButton, { "aria-label": closeLabel })]
62
63
  }));
63
64
  var DialogClosePrimitive = DialogPrimitive.Close;
64
65
  var DialogDescription = DialogPrimitive.Description;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","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,OAAO,gBAAgB,SAAS,eAAe;CAC1E,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC;AAED,SAAgB,OAAO,EAAE,UAAU,GAAG,SAAsB;CAC1D,OAAO,oBAAC,gBAAgB,MAAjB;EAAsB,GAAI;EAAQ;CAA+B,CAAA;AAC1E;AAEA,IAAa,gBAAgB,OAAO,gBAAgB,SAAS,MAAM;CACjE,UAAU;CACV,KAAK;CACL,MAAM;CACN,WAAW;CACX,UAAU;CACV,WAAW;CACX,SAAS;CACT,WAAW;CACX,iBAAiB;CACjB,WAAW;CACX,cAAc;CAEd,YAAY;CACZ,UAAU;CAEV,aAAa,EACX,WAAW,OACb;CAEA,WAAW,EACT,SAAS,OACX;CAEA,UAAU,EACR,WAAW,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC;AAED,IAAM,oBAAoB,OAAO,gBAAgB,OAAO;CACtD,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;AACV,CAAC;AAKD,IAAa,wBAAwB,MAAM,YAGxC,OAAO,iBACR,oBAAC,mBAAD;CAAmB,SAAA;CACjB,UAAA,oBAAC,YAAD;EAAY,KAAK;EAAc,KAAK,EAAE,OAAO,cAAc;EAAG,GAAI;EAChE,UAAA,oBAAC,YAAD,CAAa,CAAA;CACH,CAAA;AACK,CAAA,CACpB;AAMD,IAAa,gBAAgB,MAAM,YAGhC,EAAE,UAAU,GAAG,SAAS,iBACzB,qBAAC,eAAD;CAAe,GAAI;CAAO,KAAK;CAA/B,UAAA,CACG,UACD,oBAAC,uBAAD,CAAwB,CAAA,CACX;AAChB,CAAA,CAAA;AAED,IAAa,uBAAuB,gBAAgB;AACpD,IAAa,oBAAoB,gBAAgB;AACjD,IAAa,eAAe,gBAAgB;AAC5C,IAAa,cAAc,gBAAgB;AAC3C,IAAa,gBAAgB,gBAAgB"}
1
+ {"version":3,"file":"Dialog.js","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>, 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' }} aria-label=\"Close\" {...props}>\n <Cross1Icon aria-hidden />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype DialogContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype DialogContentProps = DialogContentPrimitiveProps &\n VariantProps<typeof StyledContent> & { css?: CSS; closeLabel?: string };\n\nexport const DialogContent = React.forwardRef<\n React.ElementRef<typeof StyledContent>,\n DialogContentProps\n>(({ children, closeLabel = 'Close', ...props }, forwardedRef) => (\n <StyledContent {...props} ref={forwardedRef}>\n {children}\n <DialogCloseIconButton aria-label={closeLabel} />\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,OAAO,gBAAgB,SAAS,eAAe;CAC1E,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC;AAED,SAAgB,OAAO,EAAE,UAAU,GAAG,SAAsB;CAC1D,OAAO,oBAAC,gBAAgB,MAAjB;EAAsB,GAAI;EAAQ;CAA+B,CAAA;AAC1E;AAEA,IAAa,gBAAgB,OAAO,gBAAgB,SAAS,MAAM;CACjE,UAAU;CACV,KAAK;CACL,MAAM;CACN,WAAW;CACX,UAAU;CACV,WAAW;CACX,SAAS;CACT,WAAW;CACX,iBAAiB;CACjB,WAAW;CACX,cAAc;CAEd,YAAY;CACZ,UAAU;CAEV,aAAa,EACX,WAAW,OACb;CAEA,WAAW,EACT,SAAS,OACX;CAEA,UAAU,EACR,WAAW,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC;AAED,IAAM,oBAAoB,OAAO,gBAAgB,OAAO;CACtD,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;AACV,CAAC;AAID,IAAa,wBAAwB,MAAM,YAGxC,OAAO,iBACR,oBAAC,mBAAD;CAAmB,SAAA;CACjB,UAAA,oBAAC,YAAD;EAAY,KAAK;EAAc,KAAK,EAAE,OAAO,cAAc;EAAG,cAAW;EAAQ,GAAI;EACnF,UAAA,oBAAC,YAAD,EAAY,eAAA,KAAa,CAAA;CACf,CAAA;AACK,CAAA,CACpB;AAMD,IAAa,gBAAgB,MAAM,YAGhC,EAAE,UAAU,aAAa,SAAS,GAAG,SAAS,iBAC/C,qBAAC,eAAD;CAAe,GAAI;CAAO,KAAK;CAA/B,UAAA,CACG,UACD,oBAAC,uBAAD,EAAuB,cAAY,WAAa,CAAA,CACnC;AAChB,CAAA,CAAA;AAED,IAAa,uBAAuB,gBAAgB;AACpD,IAAa,oBAAoB,gBAAgB;AACjD,IAAa,eAAe,gBAAgB;AAC5C,IAAa,cAAc,gBAAgB;AAC3C,IAAa,gBAAgB,gBAAgB"}
@@ -0,0 +1,74 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_resolveColor = require("../../styles/resolveColor.cjs");
3
+ const require_cssProps = require("../../styles/cssProps.cjs");
4
+ const require_themeContext = require("../../styles/themeContext.cjs");
5
+ const require_Meter_vanilla_css = require("./Meter.vanilla.css.cjs");
6
+ let react = require("react");
7
+ react = require_runtime.__toESM(react, 1);
8
+ let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ // components/Meter/Meter.vanilla.tsx
11
+ var MeterVanilla = (0, react.forwardRef)(({ value, color, segments, max, label, valueLabel, size, className, css, style, "aria-label": ariaLabel, ...props }, ref) => {
12
+ const { colors } = require_themeContext.useVanillaExtractTheme();
13
+ const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
14
+ const items = segments ?? [{
15
+ value: value ?? 0,
16
+ color
17
+ }];
18
+ const values = items.map((s) => Math.max(0, s.value));
19
+ const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);
20
+ let remaining = total;
21
+ const widths = values.map((v) => {
22
+ const shown = Math.min(v, Math.max(0, remaining));
23
+ remaining -= shown;
24
+ return total > 0 ? shown / total * 100 : 0;
25
+ });
26
+ const name = ariaLabel ?? label;
27
+ const ariaProps = items.length === 1 ? {
28
+ role: "meter",
29
+ "aria-valuenow": Math.min(values[0], total),
30
+ "aria-valuemin": 0,
31
+ "aria-valuemax": total,
32
+ "aria-valuetext": valueLabel ?? items[0].label,
33
+ "aria-label": name ?? items[0].label
34
+ } : {
35
+ role: "img",
36
+ "aria-label": ariaLabel ?? [label, items.map((s) => s.label ?? String(s.value)).join(", ")].filter(Boolean).join(": ")
37
+ };
38
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
39
+ ref,
40
+ className: `${require_Meter_vanilla_css.root} ${className || ""}`.trim(),
41
+ style: {
42
+ ...cssStyles,
43
+ ...style,
44
+ ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
45
+ },
46
+ ...props,
47
+ children: [(label || valueLabel) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
48
+ className: "sfokyy1",
49
+ "aria-hidden": true,
50
+ children: [label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
51
+ className: "sfokyy2",
52
+ children: label
53
+ }), valueLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
54
+ className: "sfokyy3",
55
+ children: valueLabel
56
+ })]
57
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
58
+ className: require_Meter_vanilla_css.trackRecipe({ size }),
59
+ ...ariaProps,
60
+ children: items.map((s, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
61
+ className: require_Meter_vanilla_css.segment,
62
+ title: s.label,
63
+ style: {
64
+ width: `${widths[i]}%`,
65
+ backgroundColor: s.color && require_resolveColor.resolveColor(s.color, colors)
66
+ }
67
+ }, i))
68
+ })]
69
+ });
70
+ });
71
+ MeterVanilla.displayName = "MeterVanilla";
72
+ exports.MeterVanilla = MeterVanilla;
73
+
74
+ //# sourceMappingURL=Meter.vanilla.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","root","assignInlineVars","trackRecipe","segment","resolveColor"],"sources":["../../../components/Meter/Meter.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { resolveColor } from '../../styles/resolveColor';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div\n ref={ref}\n className={`${root} ${className || ''}`.trim()}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;;;AAuCA,IAAa,gBAAA,GAAeA,MAAAA,WAAAA,EAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA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CAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAWC,0BAAAA,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAEE,WAAWC,0BAAAA;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAASC,qBAAAA,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,cAAc"}
@@ -0,0 +1,26 @@
1
+ ;/* empty css */
2
+ let _vanilla_extract_recipes_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
3
+ // components/Meter/Meter.vanilla.css.ts
4
+ var root = "sfokyy0";
5
+ var caption = "sfokyy1";
6
+ var captionLabel = "sfokyy2";
7
+ var captionValue = "sfokyy3";
8
+ var trackRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
9
+ defaultClassName: "sfokyy4",
10
+ variantClassNames: { size: {
11
+ small: "sfokyy5",
12
+ medium: "sfokyy6",
13
+ large: "sfokyy7"
14
+ } },
15
+ defaultVariants: { size: "medium" },
16
+ compoundVariants: []
17
+ });
18
+ var segment = "sfokyy8";
19
+ exports.caption = caption;
20
+ exports.captionLabel = captionLabel;
21
+ exports.captionValue = captionValue;
22
+ exports.root = root;
23
+ exports.segment = segment;
24
+ exports.trackRecipe = trackRecipe;
25
+
26
+ //# sourceMappingURL=Meter.vanilla.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Meter/Meter.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const root = style({\n display: 'flex',\n flexDirection: 'column',\n gap: tokens.space['1'],\n minWidth: 0,\n});\n\nexport const caption = style({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'baseline',\n gap: tokens.space['2'],\n fontFamily: tokens.fonts.rubik,\n fontSize: tokens.fontSizes['2'],\n lineHeight: '1.4',\n});\n\nexport const captionLabel = style({\n color: tokens.colors.textDefault,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n});\n\nexport const captionValue = style({\n marginLeft: 'auto',\n color: tokens.colors.textSubtle,\n fontVariantNumeric: 'tabular-nums',\n whiteSpace: 'nowrap',\n});\n\nexport const trackRecipe = recipe({\n base: {\n display: 'flex',\n width: '100%',\n borderRadius: tokens.radii['1'],\n backgroundColor: tokens.colors.meterTrackBg,\n overflow: 'hidden',\n },\n variants: {\n size: {\n small: { height: tokens.sizes['1'] },\n medium: { height: tokens.sizes['2'] },\n large: { height: '12px' },\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\n\nexport const segment = style({\n height: '100%',\n flexShrink: 0,\n selectors: {\n '&:nth-child(3n+1)': { backgroundColor: tokens.colors.chartSeries1 },\n '&:nth-child(3n+2)': { backgroundColor: tokens.colors.chartSeries2 },\n '&:nth-child(3n)': { backgroundColor: tokens.colors.chartSeries3 },\n '&:last-child': {\n borderTopRightRadius: tokens.radii['1'],\n borderBottomRightRadius: tokens.radii['1'],\n },\n },\n});\n"],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /* empty css */
2
+ import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
3
+ // components/Meter/Meter.vanilla.css.ts
4
+ var root = "sfokyy0";
5
+ var caption = "sfokyy1";
6
+ var captionLabel = "sfokyy2";
7
+ var captionValue = "sfokyy3";
8
+ var trackRecipe = createRuntimeFn({
9
+ defaultClassName: "sfokyy4",
10
+ variantClassNames: { size: {
11
+ small: "sfokyy5",
12
+ medium: "sfokyy6",
13
+ large: "sfokyy7"
14
+ } },
15
+ defaultVariants: { size: "medium" },
16
+ compoundVariants: []
17
+ });
18
+ var segment = "sfokyy8";
19
+ export { caption, captionLabel, captionValue, root, segment, trackRecipe };
20
+
21
+ //# sourceMappingURL=Meter.vanilla.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Meter/Meter.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const root = style({\n display: 'flex',\n flexDirection: 'column',\n gap: tokens.space['1'],\n minWidth: 0,\n});\n\nexport const caption = style({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'baseline',\n gap: tokens.space['2'],\n fontFamily: tokens.fonts.rubik,\n fontSize: tokens.fontSizes['2'],\n lineHeight: '1.4',\n});\n\nexport const captionLabel = style({\n color: tokens.colors.textDefault,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n});\n\nexport const captionValue = style({\n marginLeft: 'auto',\n color: tokens.colors.textSubtle,\n fontVariantNumeric: 'tabular-nums',\n whiteSpace: 'nowrap',\n});\n\nexport const trackRecipe = recipe({\n base: {\n display: 'flex',\n width: '100%',\n borderRadius: tokens.radii['1'],\n backgroundColor: tokens.colors.meterTrackBg,\n overflow: 'hidden',\n },\n variants: {\n size: {\n small: { height: tokens.sizes['1'] },\n medium: { height: tokens.sizes['2'] },\n large: { height: '12px' },\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\n\nexport const segment = style({\n height: '100%',\n flexShrink: 0,\n selectors: {\n '&:nth-child(3n+1)': { backgroundColor: tokens.colors.chartSeries1 },\n '&:nth-child(3n+2)': { backgroundColor: tokens.colors.chartSeries2 },\n '&:nth-child(3n)': { backgroundColor: tokens.colors.chartSeries3 },\n '&:last-child': {\n borderTopRightRadius: tokens.radii['1'],\n borderBottomRightRadius: tokens.radii['1'],\n },\n },\n});\n"],"mappings":""}
@@ -0,0 +1,72 @@
1
+ import { resolveColor } from "../../styles/resolveColor.js";
2
+ import { processCSSProp } from "../../styles/cssProps.js";
3
+ import { useVanillaExtractTheme } from "../../styles/themeContext.js";
4
+ import { root, segment, trackRecipe } from "./Meter.vanilla.css.js";
5
+ import { forwardRef } from "react";
6
+ import { assignInlineVars } from "@vanilla-extract/dynamic";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // components/Meter/Meter.vanilla.tsx
9
+ var MeterVanilla = forwardRef(({ value, color, segments, max, label, valueLabel, size, className, css, style, "aria-label": ariaLabel, ...props }, ref) => {
10
+ const { colors } = useVanillaExtractTheme();
11
+ const { style: cssStyles, vars } = processCSSProp(css, colors);
12
+ const items = segments ?? [{
13
+ value: value ?? 0,
14
+ color
15
+ }];
16
+ const values = items.map((s) => Math.max(0, s.value));
17
+ const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);
18
+ let remaining = total;
19
+ const widths = values.map((v) => {
20
+ const shown = Math.min(v, Math.max(0, remaining));
21
+ remaining -= shown;
22
+ return total > 0 ? shown / total * 100 : 0;
23
+ });
24
+ const name = ariaLabel ?? label;
25
+ const ariaProps = items.length === 1 ? {
26
+ role: "meter",
27
+ "aria-valuenow": Math.min(values[0], total),
28
+ "aria-valuemin": 0,
29
+ "aria-valuemax": total,
30
+ "aria-valuetext": valueLabel ?? items[0].label,
31
+ "aria-label": name ?? items[0].label
32
+ } : {
33
+ role: "img",
34
+ "aria-label": ariaLabel ?? [label, items.map((s) => s.label ?? String(s.value)).join(", ")].filter(Boolean).join(": ")
35
+ };
36
+ return /* @__PURE__ */ jsxs("div", {
37
+ ref,
38
+ className: `${root} ${className || ""}`.trim(),
39
+ style: {
40
+ ...cssStyles,
41
+ ...style,
42
+ ...assignInlineVars(vars)
43
+ },
44
+ ...props,
45
+ children: [(label || valueLabel) && /* @__PURE__ */ jsxs("div", {
46
+ className: "sfokyy1",
47
+ "aria-hidden": true,
48
+ children: [label && /* @__PURE__ */ jsx("span", {
49
+ className: "sfokyy2",
50
+ children: label
51
+ }), valueLabel && /* @__PURE__ */ jsx("span", {
52
+ className: "sfokyy3",
53
+ children: valueLabel
54
+ })]
55
+ }), /* @__PURE__ */ jsx("div", {
56
+ className: trackRecipe({ size }),
57
+ ...ariaProps,
58
+ children: items.map((s, i) => /* @__PURE__ */ jsx("div", {
59
+ className: segment,
60
+ title: s.label,
61
+ style: {
62
+ width: `${widths[i]}%`,
63
+ backgroundColor: s.color && resolveColor(s.color, colors)
64
+ }
65
+ }, i))
66
+ })]
67
+ });
68
+ });
69
+ MeterVanilla.displayName = "MeterVanilla";
70
+ export { MeterVanilla };
71
+
72
+ //# sourceMappingURL=Meter.vanilla.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter.vanilla.js","names":[],"sources":["../../../components/Meter/Meter.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { resolveColor } from '../../styles/resolveColor';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div\n ref={ref}\n className={`${root} ${className || ''}`.trim()}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;AAuCA,IAAa,eAAe,YAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA,OACA,cAAc,WACd,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,QAA+B,YAAY,CAAC;EAAE,OAAO,SAAS;EAAG;CAAM,CAAC;CAC9E,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,KAAK,CAAC;CACpD,MAAM,QAAQ,QAAQ,WAAW,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG,CAAC,IAAI;CAEzE,IAAI,YAAY;CAChB,MAAM,SAAS,OAAO,KAAK,MAAM;EAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;EAChD,aAAa;EACb,OAAO,QAAQ,IAAK,QAAQ,QAAS,MAAM;CAC7C,CAAC;CAED,MAAM,OAAO,aAAa;CAC1B,MAAM,YACJ,MAAM,WAAW,IACb;EACE,MAAM;EACN,iBAAiB,KAAK,IAAI,OAAO,IAAI,KAAK;EAC1C,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB,cAAc,MAAM,EAAE,CAAC;EACzC,cAAc,QAAQ,MAAM,EAAE,CAAC;CACjC,IACA;EACE,MAAM;EACN,cACE,aACA,CAAC,OAAO,MAAM,KAAK,MAAM,EAAE,SAAS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CAChB;CAEN,OACE,qBAAC,OAAD;EACO;EACL,WAAW,GAAG,KAAK,GAAG,aAAa,KAAK,KAAK;EAC7C,OAAO;GAAE,GAAG;GAAW,GAAG;GAAO,GAAG,iBAAiB,IAAI;EAAE;EAC3D,GAAI;EAJN,UAAA,EAMI,SAAS,eAET,qBAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAW,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,oBAAC,OAAD;IAEE,WAAW;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAAS,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,cAAc"}
@@ -113,7 +113,10 @@ var NavigationDrawer = require_stitches_config.styled("nav", {
113
113
  });
114
114
  var StyledLink = require_stitches_config.styled("a", baseNavItemCss, { textDecoration: "none" });
115
115
  var StyledButton = require_stitches_config.styled("button", baseNavItemCss);
116
- var NavigationItemWrapper = (props) => props.as === "a" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLink, { ...props }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
116
+ var NavigationItemWrapper = (props) => props.as === "a" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLink, {
117
+ "aria-current": props.active ? "page" : void 0,
118
+ ...props
119
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
117
120
  type: "button",
118
121
  ...props
119
122
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.cjs","names":["styled","Flex","css","elevationVariants","useMemo"],"sources":["../../../components/Navigation/Navigation.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\n\nimport { CSS, css, styled, VariantProps } from '../../stitches.config';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\n\nconst FlexWithOpacity = styled(Flex, {\n opacity: 0.74,\n\n variants: {\n active: {\n true: {\n opacity: 1,\n },\n },\n },\n});\n\nconst baseNavItemCss = css({\n position: 'relative',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n backgroundColor: '$navButtonBg',\n color: '$navButtonText',\n border: 'none',\n minHeight: '$7',\n width: '100%',\n px: '$3',\n py: '$2',\n borderRadius: '$3',\n cursor: 'pointer',\n fontFamily: '$rubik',\n fontWeight: '$medium',\n outline: 'none',\n fontSize: '$3',\n mt: '$2',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n\n [`&:focus > ${FlexWithOpacity}, &:hover > ${FlexWithOpacity}`]: {\n opacity: 1,\n },\n\n '&:focus': {\n color: '$navButtonFocusText',\n boxShadow: 'inset 0 0 0 2px $colors$navButtonFocusBorder',\n\n '&::before': {\n backgroundColor: '$navButtonFocusBg',\n },\n '&::after': {\n backgroundColor: '$navButtonFocusBg2',\n opacity: 0.05,\n },\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonHoverText',\n\n '&::before': {\n backgroundColor: '$navButtonHoverBg',\n },\n '&::after': {\n backgroundColor: '$navButtonHoverBg2',\n opacity: 0.05,\n },\n },\n },\n\n '&:first-child': {\n mt: 0,\n },\n\n variants: {\n active: {\n true: {\n color: '$navButtonActiveText',\n\n '&::before': {\n backgroundColor: '$navButtonActiveBg',\n },\n '&::after': {\n backgroundColor: '$navButtonActiveBg2',\n opacity: 0.05,\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonActiveText',\n },\n },\n\n '&:focus': {\n color: '$navButtonActiveText',\n },\n },\n },\n },\n defaultVariants: {\n active: false,\n },\n});\n\nexport const NavigationContainer = styled('div', {\n display: 'flex',\n boxSizing: 'border-box',\n flexDirection: 'column',\n});\n\nexport type NavigationContainerVariants = VariantProps<typeof NavigationContainer>;\nexport type NavigationContainerProps = NavigationContainerVariants & NonNullable<unknown>;\n\nexport const NavigationDrawer = styled('nav', {\n display: 'flex',\n boxSizing: 'border-box',\n padding: '$3',\n maxWidth: '240px',\n flexDirection: 'column',\n variants: {\n elevation: elevationVariants,\n fullWidth: {\n true: {\n px: 0,\n '> *, > div > *,': {\n borderRadius: 0,\n\n '&::before': {\n borderRadius: 0,\n },\n\n '&::after': {\n borderRadius: 0,\n },\n\n '&:focus': {\n border: 'none',\n boxShadow: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n elevation: 1,\n fullWidth: false,\n },\n});\n\nexport type NavigationDrawerVariants = VariantProps<typeof NavigationDrawer>;\nexport type NavigationDrawerProps = NavigationDrawerVariants & NonNullable<unknown>;\n\nconst StyledLink = styled('a', baseNavItemCss, {\n textDecoration: 'none',\n});\n\ntype StyledLinkProps = VariantProps<typeof StyledLink> & React.ComponentProps<typeof StyledLink>;\n\nconst StyledButton = styled('button', baseNavItemCss);\n\ntype StyledButtonProps = VariantProps<typeof StyledButton> &\n React.ComponentProps<typeof StyledButton>;\ninterface NavigationItemBaseProps {\n css?: CSS;\n startAdornment?: ReactNode;\n endAdornment?: ReactNode;\n children?: ReactNode;\n active?: boolean;\n}\n\ntype NavigationItemButtonProps = NavigationItemBaseProps &\n StyledButtonProps & {\n as?: 'button';\n };\ntype NavigationItemLinkProps = NavigationItemBaseProps &\n StyledLinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n as: 'a';\n };\n\nexport type NavigationItemProps = NavigationItemButtonProps | NavigationItemLinkProps;\n\nconst NavigationItemWrapper = (props: NavigationItemProps): JSX.Element =>\n props.as === 'a' ? <StyledLink {...props} /> : <StyledButton type=\"button\" {...props} />;\n\nexport const NavigationItem = ({\n startAdornment,\n endAdornment,\n children,\n ...restProps\n}: NavigationItemProps): JSX.Element => {\n const hasStartAdornment = useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n return (\n <NavigationItemWrapper {...restProps}>\n {hasStartAdornment && (\n <FlexWithOpacity css={{ pr: '$2', ml: '-$1' }} active={restProps.active}>\n {startAdornment}\n </FlexWithOpacity>\n )}\n <FlexWithOpacity css={{ flexGrow: 1 }} active={restProps.active}>\n {children}\n </FlexWithOpacity>\n {hasEndAdornment && <Flex css={{ pl: '$2', mr: '-$1' }}>{endAdornment}</Flex>}\n </NavigationItemWrapper>\n );\n};\n\nexport type NavigationItemVariants = VariantProps<typeof NavigationItem>;\n\nexport const NavigationLink = (props: Omit<NavigationItemLinkProps, 'as'>) => (\n <NavigationItem as=\"a\" {...props} />\n);\n\nexport type NavigationLinkVariants = VariantProps<typeof NavigationLink>;\n\nexport type NavigationLinkProps = NavigationLinkVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;AAMA,IAAM,kBAAkBA,wBAAAA,OAAOC,aAAAA,MAAM;CACnC,SAAS;CAET,UAAU,EACR,QAAQ,EACN,MAAM,EACJ,SAAS,EACX,EACF,EACF;AACF,CAAC;AAED,IAAM,iBAAiBC,wBAAAA,IAAI;CACzB,UAAU;CACV,SAAS;CACT,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,cAAc;CACd,QAAQ;CACR,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,IAAI;CAEJ,aAAa;EACX,WAAW;EACX,SA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B,EAC7C,gBAAgB,OAClB,CAAC;AAID,IAAM,eAAeA,wBAAAA,OAAO,UAAU,cAAc;AAwBpD,IAAM,yBAAyB,UAC7B,MAAM,OAAO,MAAM,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD,EAAY,GAAI,MAAQ,CAAA,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD;CAAc,MAAK;CAAS,GAAI;AAAQ,CAAA;AAEzF,IAAa,kBAAkB,EAC7B,gBACA,cACA,UACA,GAAG,gBACmC;CACtC,MAAM,qBAAA,GAAoBI,MAAAA,QAAAA,OAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACjF,MAAM,mBAAA,GAAkBA,MAAAA,QAAAA,OAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAE3E,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,uBAAD;EAAuB,GAAI;EAA3B,UAAA;GACG,qBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;IAAiB,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAG,QAAQ,UAAU;IAC9D,UAAA;GACc,CAAA;GAEnB,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;IAAiB,KAAK,EAAE,UAAU,EAAE;IAAG,QAAQ,UAAU;IACtD;GACc,CAAA;GAChB,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAACH,aAAAA,MAAD;IAAM,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAI,UAAA;GAAmB,CAAA;EACvD;;AAE3B;AAIA,IAAa,kBAAkB,UAC7B,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;CAAgB,IAAG;CAAI,GAAI;AAAQ,CAAA"}
1
+ {"version":3,"file":"Navigation.cjs","names":["styled","Flex","css","elevationVariants","useMemo"],"sources":["../../../components/Navigation/Navigation.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\n\nimport { CSS, css, styled, VariantProps } from '../../stitches.config';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\n\nconst FlexWithOpacity = styled(Flex, {\n opacity: 0.74,\n\n variants: {\n active: {\n true: {\n opacity: 1,\n },\n },\n },\n});\n\nconst baseNavItemCss = css({\n position: 'relative',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n backgroundColor: '$navButtonBg',\n color: '$navButtonText',\n border: 'none',\n minHeight: '$7',\n width: '100%',\n px: '$3',\n py: '$2',\n borderRadius: '$3',\n cursor: 'pointer',\n fontFamily: '$rubik',\n fontWeight: '$medium',\n outline: 'none',\n fontSize: '$3',\n mt: '$2',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n\n [`&:focus > ${FlexWithOpacity}, &:hover > ${FlexWithOpacity}`]: {\n opacity: 1,\n },\n\n '&:focus': {\n color: '$navButtonFocusText',\n boxShadow: 'inset 0 0 0 2px $colors$navButtonFocusBorder',\n\n '&::before': {\n backgroundColor: '$navButtonFocusBg',\n },\n '&::after': {\n backgroundColor: '$navButtonFocusBg2',\n opacity: 0.05,\n },\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonHoverText',\n\n '&::before': {\n backgroundColor: '$navButtonHoverBg',\n },\n '&::after': {\n backgroundColor: '$navButtonHoverBg2',\n opacity: 0.05,\n },\n },\n },\n\n '&:first-child': {\n mt: 0,\n },\n\n variants: {\n active: {\n true: {\n color: '$navButtonActiveText',\n\n '&::before': {\n backgroundColor: '$navButtonActiveBg',\n },\n '&::after': {\n backgroundColor: '$navButtonActiveBg2',\n opacity: 0.05,\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonActiveText',\n },\n },\n\n '&:focus': {\n color: '$navButtonActiveText',\n },\n },\n },\n },\n defaultVariants: {\n active: false,\n },\n});\n\nexport const NavigationContainer = styled('div', {\n display: 'flex',\n boxSizing: 'border-box',\n flexDirection: 'column',\n});\n\nexport type NavigationContainerVariants = VariantProps<typeof NavigationContainer>;\nexport type NavigationContainerProps = NavigationContainerVariants & NonNullable<unknown>;\n\nexport const NavigationDrawer = styled('nav', {\n display: 'flex',\n boxSizing: 'border-box',\n padding: '$3',\n maxWidth: '240px',\n flexDirection: 'column',\n variants: {\n elevation: elevationVariants,\n fullWidth: {\n true: {\n px: 0,\n '> *, > div > *,': {\n borderRadius: 0,\n\n '&::before': {\n borderRadius: 0,\n },\n\n '&::after': {\n borderRadius: 0,\n },\n\n '&:focus': {\n border: 'none',\n boxShadow: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n elevation: 1,\n fullWidth: false,\n },\n});\n\nexport type NavigationDrawerVariants = VariantProps<typeof NavigationDrawer>;\nexport type NavigationDrawerProps = NavigationDrawerVariants & NonNullable<unknown>;\n\nconst StyledLink = styled('a', baseNavItemCss, {\n textDecoration: 'none',\n});\n\ntype StyledLinkProps = VariantProps<typeof StyledLink> & React.ComponentProps<typeof StyledLink>;\n\nconst StyledButton = styled('button', baseNavItemCss);\n\ntype StyledButtonProps = VariantProps<typeof StyledButton> &\n React.ComponentProps<typeof StyledButton>;\ninterface NavigationItemBaseProps {\n css?: CSS;\n startAdornment?: ReactNode;\n endAdornment?: ReactNode;\n children?: ReactNode;\n active?: boolean;\n}\n\ntype NavigationItemButtonProps = NavigationItemBaseProps &\n StyledButtonProps & {\n as?: 'button';\n };\ntype NavigationItemLinkProps = NavigationItemBaseProps &\n StyledLinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n as: 'a';\n };\n\nexport type NavigationItemProps = NavigationItemButtonProps | NavigationItemLinkProps;\n\nconst NavigationItemWrapper = (props: NavigationItemProps): JSX.Element =>\n props.as === 'a' ? (\n <StyledLink aria-current={props.active ? 'page' : undefined} {...props} />\n ) : (\n <StyledButton type=\"button\" {...props} />\n );\n\nexport const NavigationItem = ({\n startAdornment,\n endAdornment,\n children,\n ...restProps\n}: NavigationItemProps): JSX.Element => {\n const hasStartAdornment = useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n return (\n <NavigationItemWrapper {...restProps}>\n {hasStartAdornment && (\n <FlexWithOpacity css={{ pr: '$2', ml: '-$1' }} active={restProps.active}>\n {startAdornment}\n </FlexWithOpacity>\n )}\n <FlexWithOpacity css={{ flexGrow: 1 }} active={restProps.active}>\n {children}\n </FlexWithOpacity>\n {hasEndAdornment && <Flex css={{ pl: '$2', mr: '-$1' }}>{endAdornment}</Flex>}\n </NavigationItemWrapper>\n );\n};\n\nexport type NavigationItemVariants = VariantProps<typeof NavigationItem>;\n\nexport const NavigationLink = (props: Omit<NavigationItemLinkProps, 'as'>) => (\n <NavigationItem as=\"a\" {...props} />\n);\n\nexport type NavigationLinkVariants = VariantProps<typeof NavigationLink>;\n\nexport type NavigationLinkProps = NavigationLinkVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;AAMA,IAAM,kBAAkBA,wBAAAA,OAAOC,aAAAA,MAAM;CACnC,SAAS;CAET,UAAU,EACR,QAAQ,EACN,MAAM,EACJ,SAAS,EACX,EACF,EACF;AACF,CAAC;AAED,IAAM,iBAAiBC,wBAAAA,IAAI;CACzB,UAAU;CACV,SAAS;CACT,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,cAAc;CACd,QAAQ;CACR,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,IAAI;CAEJ,aAAa;EACX,WAAW;EACX,SAAS;EACT,UAAU;EACV,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACN,cAAc;CAChB;CACA,YAAY;EACV,WAAW;EACX,SAAS;EACT,UAAU;E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,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;CAAY,gBAAc,MAAM,SAAS,SAAS,KAAA;CAAW,GAAI;AAAQ,CAAA,IAEzE,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD;CAAc,MAAK;CAAS,GAAI;AAAQ,CAAA;AAG5C,IAAa,kBAAkB,EAC7B,gBACA,cACA,UACA,GAAG,gBACmC;CACtC,MAAM,qBAAA,GAAoBI,MAAAA,QAAAA,OAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACjF,MAAM,mBAAA,GAAkBA,MAAAA,QAAAA,OAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAE3E,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,uBAAD;EAAuB,GAAI;EAA3B,UAAA;GACG,qBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;IAAiB,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAG,QAAQ,UAAU;IAC9D,UAAA;GACc,CAAA;GAEnB,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;IAAiB,KAAK,EAAE,UAAU,EAAE;IAAG,QAAQ,UAAU;IACtD;GACc,CAAA;GAChB,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAACH,aAAAA,MAAD;IAAM,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAI,UAAA;GAAmB,CAAA;EACvD;;AAE3B;AAIA,IAAa,kBAAkB,UAC7B,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;CAAgB,IAAG;CAAI,GAAI;AAAQ,CAAA"}
@@ -111,7 +111,10 @@ var NavigationDrawer = styled("nav", {
111
111
  });
112
112
  var StyledLink = styled("a", baseNavItemCss, { textDecoration: "none" });
113
113
  var StyledButton = styled("button", baseNavItemCss);
114
- var NavigationItemWrapper = (props) => props.as === "a" ? /* @__PURE__ */ jsx(StyledLink, { ...props }) : /* @__PURE__ */ jsx(StyledButton, {
114
+ var NavigationItemWrapper = (props) => props.as === "a" ? /* @__PURE__ */ jsx(StyledLink, {
115
+ "aria-current": props.active ? "page" : void 0,
116
+ ...props
117
+ }) : /* @__PURE__ */ jsx(StyledButton, {
115
118
  type: "button",
116
119
  ...props
117
120
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.js","names":[],"sources":["../../../components/Navigation/Navigation.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\n\nimport { CSS, css, styled, VariantProps } from '../../stitches.config';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\n\nconst FlexWithOpacity = styled(Flex, {\n opacity: 0.74,\n\n variants: {\n active: {\n true: {\n opacity: 1,\n },\n },\n },\n});\n\nconst baseNavItemCss = css({\n position: 'relative',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n backgroundColor: '$navButtonBg',\n color: '$navButtonText',\n border: 'none',\n minHeight: '$7',\n width: '100%',\n px: '$3',\n py: '$2',\n borderRadius: '$3',\n cursor: 'pointer',\n fontFamily: '$rubik',\n fontWeight: '$medium',\n outline: 'none',\n fontSize: '$3',\n mt: '$2',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n\n [`&:focus > ${FlexWithOpacity}, &:hover > ${FlexWithOpacity}`]: {\n opacity: 1,\n },\n\n '&:focus': {\n color: '$navButtonFocusText',\n boxShadow: 'inset 0 0 0 2px $colors$navButtonFocusBorder',\n\n '&::before': {\n backgroundColor: '$navButtonFocusBg',\n },\n '&::after': {\n backgroundColor: '$navButtonFocusBg2',\n opacity: 0.05,\n },\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonHoverText',\n\n '&::before': {\n backgroundColor: '$navButtonHoverBg',\n },\n '&::after': {\n backgroundColor: '$navButtonHoverBg2',\n opacity: 0.05,\n },\n },\n },\n\n '&:first-child': {\n mt: 0,\n },\n\n variants: {\n active: {\n true: {\n color: '$navButtonActiveText',\n\n '&::before': {\n backgroundColor: '$navButtonActiveBg',\n },\n '&::after': {\n backgroundColor: '$navButtonActiveBg2',\n opacity: 0.05,\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonActiveText',\n },\n },\n\n '&:focus': {\n color: '$navButtonActiveText',\n },\n },\n },\n },\n defaultVariants: {\n active: false,\n },\n});\n\nexport const NavigationContainer = styled('div', {\n display: 'flex',\n boxSizing: 'border-box',\n flexDirection: 'column',\n});\n\nexport type NavigationContainerVariants = VariantProps<typeof NavigationContainer>;\nexport type NavigationContainerProps = NavigationContainerVariants & NonNullable<unknown>;\n\nexport const NavigationDrawer = styled('nav', {\n display: 'flex',\n boxSizing: 'border-box',\n padding: '$3',\n maxWidth: '240px',\n flexDirection: 'column',\n variants: {\n elevation: elevationVariants,\n fullWidth: {\n true: {\n px: 0,\n '> *, > div > *,': {\n borderRadius: 0,\n\n '&::before': {\n borderRadius: 0,\n },\n\n '&::after': {\n borderRadius: 0,\n },\n\n '&:focus': {\n border: 'none',\n boxShadow: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n elevation: 1,\n fullWidth: false,\n },\n});\n\nexport type NavigationDrawerVariants = VariantProps<typeof NavigationDrawer>;\nexport type NavigationDrawerProps = NavigationDrawerVariants & NonNullable<unknown>;\n\nconst StyledLink = styled('a', baseNavItemCss, {\n textDecoration: 'none',\n});\n\ntype StyledLinkProps = VariantProps<typeof StyledLink> & React.ComponentProps<typeof StyledLink>;\n\nconst StyledButton = styled('button', baseNavItemCss);\n\ntype StyledButtonProps = VariantProps<typeof StyledButton> &\n React.ComponentProps<typeof StyledButton>;\ninterface NavigationItemBaseProps {\n css?: CSS;\n startAdornment?: ReactNode;\n endAdornment?: ReactNode;\n children?: ReactNode;\n active?: boolean;\n}\n\ntype NavigationItemButtonProps = NavigationItemBaseProps &\n StyledButtonProps & {\n as?: 'button';\n };\ntype NavigationItemLinkProps = NavigationItemBaseProps &\n StyledLinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n as: 'a';\n };\n\nexport type NavigationItemProps = NavigationItemButtonProps | NavigationItemLinkProps;\n\nconst NavigationItemWrapper = (props: NavigationItemProps): JSX.Element =>\n props.as === 'a' ? <StyledLink {...props} /> : <StyledButton type=\"button\" {...props} />;\n\nexport const NavigationItem = ({\n startAdornment,\n endAdornment,\n children,\n ...restProps\n}: NavigationItemProps): JSX.Element => {\n const hasStartAdornment = useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n return (\n <NavigationItemWrapper {...restProps}>\n {hasStartAdornment && (\n <FlexWithOpacity css={{ pr: '$2', ml: '-$1' }} active={restProps.active}>\n {startAdornment}\n </FlexWithOpacity>\n )}\n <FlexWithOpacity css={{ flexGrow: 1 }} active={restProps.active}>\n {children}\n </FlexWithOpacity>\n {hasEndAdornment && <Flex css={{ pl: '$2', mr: '-$1' }}>{endAdornment}</Flex>}\n </NavigationItemWrapper>\n );\n};\n\nexport type NavigationItemVariants = VariantProps<typeof NavigationItem>;\n\nexport const NavigationLink = (props: Omit<NavigationItemLinkProps, 'as'>) => (\n <NavigationItem as=\"a\" {...props} />\n);\n\nexport type NavigationLinkVariants = VariantProps<typeof NavigationLink>;\n\nexport type NavigationLinkProps = NavigationLinkVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;AAMA,IAAM,kBAAkB,OAAO,MAAM;CACnC,SAAS;CAET,UAAU,EACR,QAAQ,EACN,MAAM,EACJ,SAAS,EACX,EACF,EACF;AACF,CAAC;AAED,IAAM,iBAAiB,IAAI;CACzB,UAAU;CACV,SAAS;CACT,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,IAAI;CACJ,IAAI;CACJ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,WAAW;EACX,WAAW;CACb;AACF,CAAC;AAKD,IAAM,aAAa,OAAO,KAAK,gBAAgB,EAC7C,gBAAgB,OAClB,CAAC;AAID,IAAM,eAAe,OAAO,UAAU,cAAc;AAwBpD,IAAM,yBAAyB,UAC7B,MAAM,OAAO,MAAM,oBAAC,YAAD,EAAY,GAAI,MAAQ,CAAA,IAAI,oBAAC,cAAD;CAAc,MAAK;CAAS,GAAI;AAAQ,CAAA;AAEzF,IAAa,kBAAkB,EAC7B,gBACA,cACA,UACA,GAAG,gBACmC;CACtC,MAAM,oBAAoB,cAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACjF,MAAM,kBAAkB,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAE3E,OACE,qBAAC,uBAAD;EAAuB,GAAI;EAA3B,UAAA;GACG,qBACC,oBAAC,iBAAD;IAAiB,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAG,QAAQ,UAAU;IAC9D,UAAA;GACc,CAAA;GAEnB,oBAAC,iBAAD;IAAiB,KAAK,EAAE,UAAU,EAAE;IAAG,QAAQ,UAAU;IACtD;GACc,CAAA;GAChB,mBAAmB,oBAAC,MAAD;IAAM,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAI,UAAA;GAAmB,CAAA;EACvD;;AAE3B;AAIA,IAAa,kBAAkB,UAC7B,oBAAC,gBAAD;CAAgB,IAAG;CAAI,GAAI;AAAQ,CAAA"}
1
+ {"version":3,"file":"Navigation.js","names":[],"sources":["../../../components/Navigation/Navigation.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\n\nimport { CSS, css, styled, VariantProps } from '../../stitches.config';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\n\nconst FlexWithOpacity = styled(Flex, {\n opacity: 0.74,\n\n variants: {\n active: {\n true: {\n opacity: 1,\n },\n },\n },\n});\n\nconst baseNavItemCss = css({\n position: 'relative',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n backgroundColor: '$navButtonBg',\n color: '$navButtonText',\n border: 'none',\n minHeight: '$7',\n width: '100%',\n px: '$3',\n py: '$2',\n borderRadius: '$3',\n cursor: 'pointer',\n fontFamily: '$rubik',\n fontWeight: '$medium',\n outline: 'none',\n fontSize: '$3',\n mt: '$2',\n\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: '$3',\n },\n\n [`&:focus > ${FlexWithOpacity}, &:hover > ${FlexWithOpacity}`]: {\n opacity: 1,\n },\n\n '&:focus': {\n color: '$navButtonFocusText',\n boxShadow: 'inset 0 0 0 2px $colors$navButtonFocusBorder',\n\n '&::before': {\n backgroundColor: '$navButtonFocusBg',\n },\n '&::after': {\n backgroundColor: '$navButtonFocusBg2',\n opacity: 0.05,\n },\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonHoverText',\n\n '&::before': {\n backgroundColor: '$navButtonHoverBg',\n },\n '&::after': {\n backgroundColor: '$navButtonHoverBg2',\n opacity: 0.05,\n },\n },\n },\n\n '&:first-child': {\n mt: 0,\n },\n\n variants: {\n active: {\n true: {\n color: '$navButtonActiveText',\n\n '&::before': {\n backgroundColor: '$navButtonActiveBg',\n },\n '&::after': {\n backgroundColor: '$navButtonActiveBg2',\n opacity: 0.05,\n },\n\n '@hover': {\n '&:hover': {\n color: '$navButtonActiveText',\n },\n },\n\n '&:focus': {\n color: '$navButtonActiveText',\n },\n },\n },\n },\n defaultVariants: {\n active: false,\n },\n});\n\nexport const NavigationContainer = styled('div', {\n display: 'flex',\n boxSizing: 'border-box',\n flexDirection: 'column',\n});\n\nexport type NavigationContainerVariants = VariantProps<typeof NavigationContainer>;\nexport type NavigationContainerProps = NavigationContainerVariants & NonNullable<unknown>;\n\nexport const NavigationDrawer = styled('nav', {\n display: 'flex',\n boxSizing: 'border-box',\n padding: '$3',\n maxWidth: '240px',\n flexDirection: 'column',\n variants: {\n elevation: elevationVariants,\n fullWidth: {\n true: {\n px: 0,\n '> *, > div > *,': {\n borderRadius: 0,\n\n '&::before': {\n borderRadius: 0,\n },\n\n '&::after': {\n borderRadius: 0,\n },\n\n '&:focus': {\n border: 'none',\n boxShadow: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n elevation: 1,\n fullWidth: false,\n },\n});\n\nexport type NavigationDrawerVariants = VariantProps<typeof NavigationDrawer>;\nexport type NavigationDrawerProps = NavigationDrawerVariants & NonNullable<unknown>;\n\nconst StyledLink = styled('a', baseNavItemCss, {\n textDecoration: 'none',\n});\n\ntype StyledLinkProps = VariantProps<typeof StyledLink> & React.ComponentProps<typeof StyledLink>;\n\nconst StyledButton = styled('button', baseNavItemCss);\n\ntype StyledButtonProps = VariantProps<typeof StyledButton> &\n React.ComponentProps<typeof StyledButton>;\ninterface NavigationItemBaseProps {\n css?: CSS;\n startAdornment?: ReactNode;\n endAdornment?: ReactNode;\n children?: ReactNode;\n active?: boolean;\n}\n\ntype NavigationItemButtonProps = NavigationItemBaseProps &\n StyledButtonProps & {\n as?: 'button';\n };\ntype NavigationItemLinkProps = NavigationItemBaseProps &\n StyledLinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n as: 'a';\n };\n\nexport type NavigationItemProps = NavigationItemButtonProps | NavigationItemLinkProps;\n\nconst NavigationItemWrapper = (props: NavigationItemProps): JSX.Element =>\n props.as === 'a' ? (\n <StyledLink aria-current={props.active ? 'page' : undefined} {...props} />\n ) : (\n <StyledButton type=\"button\" {...props} />\n );\n\nexport const NavigationItem = ({\n startAdornment,\n endAdornment,\n children,\n ...restProps\n}: NavigationItemProps): JSX.Element => {\n const hasStartAdornment = useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n return (\n <NavigationItemWrapper {...restProps}>\n {hasStartAdornment && (\n <FlexWithOpacity css={{ pr: '$2', ml: '-$1' }} active={restProps.active}>\n {startAdornment}\n </FlexWithOpacity>\n )}\n <FlexWithOpacity css={{ flexGrow: 1 }} active={restProps.active}>\n {children}\n </FlexWithOpacity>\n {hasEndAdornment && <Flex css={{ pl: '$2', mr: '-$1' }}>{endAdornment}</Flex>}\n </NavigationItemWrapper>\n );\n};\n\nexport type NavigationItemVariants = VariantProps<typeof NavigationItem>;\n\nexport const NavigationLink = (props: Omit<NavigationItemLinkProps, 'as'>) => (\n <NavigationItem as=\"a\" {...props} />\n);\n\nexport type NavigationLinkVariants = VariantProps<typeof NavigationLink>;\n\nexport type NavigationLinkProps = NavigationLinkVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;AAMA,IAAM,kBAAkB,OAAO,MAAM;CACnC,SAAS;CAET,UAAU,EACR,QAAQ,EACN,MAAM,EACJ,SAAS,EACX,EACF,EACF;AACF,CAAC;AAED,IAAM,iBAAiB,IAAI;CACzB,UAAU;CACV,SAAS;CACT,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,cAAc;CACd,QAAQ;CACR,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,IAAI;CAEJ,aAAa;EACX,WAAW;EACX,SAAS;EACT,UAAU;EACV,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACN,cAAc;CAChB;CACA,YAAY;EACV,WAAW;EACX,SAAS;EACT,UAAU;EACV,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACN,cAAc;CAChB;EAEC,aAAa,gBAAgB,cAAc,oBAAoB,EAC9D,SAAS,EACX;CAEA,WAAW;EACT,OAAO;EACP,WAAW;EAEX,aAAa,EACX,iBAAiB,oBACnB;EACA,YAAY;GACV,iBAAiB;GACjB,SAAS;EACX;CACF;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kB,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAE3E,OACE,qBAAC,uBAAD;EAAuB,GAAI;EAA3B,UAAA;GACG,qBACC,oBAAC,iBAAD;IAAiB,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAG,QAAQ,UAAU;IAC9D,UAAA;GACc,CAAA;GAEnB,oBAAC,iBAAD;IAAiB,KAAK,EAAE,UAAU,EAAE;IAAG,QAAQ,UAAU;IACtD;GACc,CAAA;GAChB,mBAAmB,oBAAC,MAAD;IAAM,KAAK;KAAE,IAAI;KAAM,IAAI;IAAM;IAAI,UAAA;GAAmB,CAAA;EACvD;;AAE3B;AAIA,IAAa,kBAAkB,UAC7B,oBAAC,gBAAD;CAAgB,IAAG;CAAI,GAAI;AAAQ,CAAA"}
@@ -31,12 +31,16 @@ var StyledRadio = require_stitches_config.styled("div", require_Radio.RADIO_BASE
31
31
  });
32
32
  var StyledIndicator = require_stitches_config.styled("div", require_Radio.INDICATOR_BASE_STYLES);
33
33
  var StyledRadioAccordionTrigger = require_stitches_config.styled(require_Accordion.StyledAccordionTrigger, { "@hover": { "&:hover": { [`& ${StyledRadio}`]: { boxShadow: "inset 0 0 0 1px $colors$radioHoverBorder" } } } });
34
- var RadioAccordionTrigger = react.default.forwardRef(({ children, ...props }, ref) => {
35
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion.StyledAccordionHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledRadioAccordionTrigger, {
36
- ref,
37
- ...props,
38
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledRadio, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIndicator, {}) }), children]
39
- }) });
34
+ var RadioAccordionTrigger = react.default.forwardRef(({ children, headingLevel = 3, ...props }, ref) => {
35
+ const Heading = headingLevel === "none" ? "div" : `h${headingLevel}`;
36
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion.StyledAccordionHeader, {
37
+ asChild: true,
38
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledRadioAccordionTrigger, {
39
+ ref,
40
+ ...props,
41
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledRadio, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIndicator, {}) }), children]
42
+ }) })
43
+ });
40
44
  });
41
45
  var RadioAccordionContent = require_Accordion.AccordionContent;
42
46
  exports.RadioAccordionContent = RadioAccordionContent;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioAccordion.cjs","names":["AccordionRoot","React","AccordionItem","styled","RADIO_BASE_STYLES","INDICATOR_BASE_STYLES","StyledAccordionTrigger","StyledAccordionHeader","AccordionContent"],"sources":["../../../components/RadioAccordion/RadioAccordion.tsx"],"sourcesContent":["import type { AccordionSingleProps } from '@radix-ui/react-accordion';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport {\n AccordionContent,\n AccordionItem,\n AccordionRoot,\n AccordionTriggerProps,\n StyledAccordionHeader,\n StyledAccordionTrigger,\n} from '../Accordion';\nimport { INDICATOR_BASE_STYLES, RADIO_BASE_STYLES } from '../Radio';\n\nexport interface RadioAccordionRootProps\n extends Omit<AccordionSingleProps, 'type' | 'collapsible'>,\n Omit<VariantProps<typeof AccordionRoot>, 'type' | 'collapsible'> {\n css?: CSS; // could not skipped\n}\n\nexport const RadioAccordionRoot: (props: RadioAccordionRootProps) => JSX.Element = (props) => (\n <AccordionRoot {...props} type=\"single\" collapsible={false} />\n);\n\nexport interface RadioAccordionItemProps\n extends ComponentProps<typeof AccordionItem>,\n VariantProps<typeof AccordionItem> {}\nexport const RadioAccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionItem>,\n RadioAccordionItemProps\n>(({ value, children, ...props }, forwardedRef) => {\n return (\n <AccordionItem\n value={value}\n ref={forwardedRef}\n css={{ display: 'inherit', flexDirection: 'column' }}\n {...props}\n >\n {children}\n </AccordionItem>\n );\n});\n\nconst StyledRadio = styled('div', RADIO_BASE_STYLES, {\n width: 18,\n height: 18,\n mr: '$2',\n '[data-state=open] > &': {\n backgroundColor: '$radioIndicator',\n },\n});\n\nconst StyledIndicator = styled('div', INDICATOR_BASE_STYLES);\n\nconst StyledRadioAccordionTrigger = styled(StyledAccordionTrigger, {\n '@hover': {\n '&:hover': {\n [`& ${StyledRadio}`]: {\n boxShadow: 'inset 0 0 0 1px $colors$radioHoverBorder',\n },\n },\n },\n});\n\nexport interface RadioAccordionTriggerProps extends AccordionTriggerProps {}\nexport const RadioAccordionTrigger = React.forwardRef<\n React.ElementRef<typeof StyledRadioAccordionTrigger>,\n RadioAccordionTriggerProps\n>(({ children, ...props }, ref) => {\n return (\n <StyledAccordionHeader>\n <StyledRadioAccordionTrigger ref={ref} {...props}>\n <StyledRadio>\n <StyledIndicator />\n </StyledRadio>\n {children}\n </StyledRadioAccordionTrigger>\n </StyledAccordionHeader>\n );\n});\n\nexport const RadioAccordionContent = AccordionContent;\n"],"mappings":";;;;;;;;AAoBA,IAAa,sBAAuE,UAClF,iBAAA,GAAA,kBAAA,IAAA,CAACA,kBAAAA,eAAD;CAAe,GAAI;CAAO,MAAK;CAAS,aAAa;AAAQ,CAAA;AAM/D,IAAa,qBAAqBC,MAAAA,QAAM,YAGrC,EAAE,OAAO,UAAU,GAAG,SAAS,iBAAiB;CACjD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,eAAD;EACS;EACP,KAAK;EACL,KAAK;GAAE,SAAS;GAAW,eAAe;EAAS;EACnD,GAAI;EAEH;CACY,CAAA;AAEnB,CAAC;AAED,IAAM,cAAcC,wBAAAA,OAAO,OAAOC,cAAAA,mBAAmB;CACnD,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,yBAAyB,EACvB,iBAAiB,kBACnB;AACF,CAAC;AAED,IAAM,kBAAkBD,wBAAAA,OAAO,OAAOE,cAAAA,qBAAqB;AAE3D,IAAM,8BAA8BF,wBAAAA,OAAOG,kBAAAA,wBAAwB,EACjE,UAAU,EACR,WAAW,GACR,KAAK,gBAAgB,EACpB,WAAW,2CACb,EACF,EACF,EACF,CAAC;AAGD,IAAa,wBAAwBL,MAAAA,QAAM,YAGxC,EAAE,UAAU,GAAG,SAAS,QAAQ;CACjC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,kBAAAA,uBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,6BAAD;EAAkC;EAAK,GAAI;EAA3C,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD,CAAkB,CAAA,EACP,CAAA,GACZ,QAC0B;CACR,CAAA,EAAA,CAAA;AAE3B,CAAC;AAED,IAAa,wBAAwBC,kBAAAA"}
1
+ {"version":3,"file":"RadioAccordion.cjs","names":["AccordionRoot","React","AccordionItem","styled","RADIO_BASE_STYLES","INDICATOR_BASE_STYLES","StyledAccordionTrigger","StyledAccordionHeader","AccordionContent"],"sources":["../../../components/RadioAccordion/RadioAccordion.tsx"],"sourcesContent":["import type { AccordionSingleProps } from '@radix-ui/react-accordion';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport {\n AccordionContent,\n AccordionItem,\n AccordionRoot,\n AccordionTriggerProps,\n StyledAccordionHeader,\n StyledAccordionTrigger,\n} from '../Accordion';\nimport { INDICATOR_BASE_STYLES, RADIO_BASE_STYLES } from '../Radio';\n\nexport interface RadioAccordionRootProps\n extends\n Omit<AccordionSingleProps, 'type' | 'collapsible'>,\n Omit<VariantProps<typeof AccordionRoot>, 'type' | 'collapsible'> {\n css?: CSS; // could not skipped\n}\n\nexport const RadioAccordionRoot: (props: RadioAccordionRootProps) => JSX.Element = (props) => (\n <AccordionRoot {...props} type=\"single\" collapsible={false} />\n);\n\nexport interface RadioAccordionItemProps\n extends ComponentProps<typeof AccordionItem>, VariantProps<typeof AccordionItem> {}\nexport const RadioAccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionItem>,\n RadioAccordionItemProps\n>(({ value, children, ...props }, forwardedRef) => {\n return (\n <AccordionItem\n value={value}\n ref={forwardedRef}\n css={{ display: 'inherit', flexDirection: 'column' }}\n {...props}\n >\n {children}\n </AccordionItem>\n );\n});\n\nconst StyledRadio = styled('div', RADIO_BASE_STYLES, {\n width: 18,\n height: 18,\n mr: '$2',\n '[data-state=open] > &': {\n backgroundColor: '$radioIndicator',\n },\n});\n\nconst StyledIndicator = styled('div', INDICATOR_BASE_STYLES);\n\nconst StyledRadioAccordionTrigger = styled(StyledAccordionTrigger, {\n '@hover': {\n '&:hover': {\n [`& ${StyledRadio}`]: {\n boxShadow: 'inset 0 0 0 1px $colors$radioHoverBorder',\n },\n },\n },\n});\n\nexport interface RadioAccordionTriggerProps extends Omit<\n AccordionTriggerProps,\n 'customIcon' | 'noIcon'\n> {}\nexport const RadioAccordionTrigger = React.forwardRef<\n React.ElementRef<typeof StyledRadioAccordionTrigger>,\n RadioAccordionTriggerProps\n>(({ children, headingLevel = 3, ...props }, ref) => {\n const Heading = headingLevel === 'none' ? 'div' : (`h${headingLevel}` as const);\n\n return (\n <StyledAccordionHeader asChild>\n <Heading>\n <StyledRadioAccordionTrigger ref={ref} {...props}>\n <StyledRadio>\n <StyledIndicator />\n </StyledRadio>\n {children}\n </StyledRadioAccordionTrigger>\n </Heading>\n </StyledAccordionHeader>\n );\n});\n\nexport const RadioAccordionContent = AccordionContent;\n"],"mappings":";;;;;;;;AAqBA,IAAa,sBAAuE,UAClF,iBAAA,GAAA,kBAAA,IAAA,CAACA,kBAAAA,eAAD;CAAe,GAAI;CAAO,MAAK;CAAS,aAAa;AAAQ,CAAA;AAK/D,IAAa,qBAAqBC,MAAAA,QAAM,YAGrC,EAAE,OAAO,UAAU,GAAG,SAAS,iBAAiB;CACjD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,eAAD;EACS;EACP,KAAK;EACL,KAAK;GAAE,SAAS;GAAW,eAAe;EAAS;EACnD,GAAI;EAEH;CACY,CAAA;AAEnB,CAAC;AAED,IAAM,cAAcC,wBAAAA,OAAO,OAAOC,cAAAA,mBAAmB;CACnD,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,yBAAyB,EACvB,iBAAiB,kBACnB;AACF,CAAC;AAED,IAAM,kBAAkBD,wBAAAA,OAAO,OAAOE,cAAAA,qBAAqB;AAE3D,IAAM,8BAA8BF,wBAAAA,OAAOG,kBAAAA,wBAAwB,EACjE,UAAU,EACR,WAAW,GACR,KAAK,gBAAgB,EACpB,WAAW,2CACb,EACF,EACF,EACF,CAAC;AAMD,IAAa,wBAAwBL,MAAAA,QAAM,YAGxC,EAAE,UAAU,eAAe,GAAG,GAAG,SAAS,QAAQ;CACnD,MAAM,UAAU,iBAAiB,SAAS,QAAS,IAAI;CAEvD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,kBAAAA,uBAAD;EAAuB,SAAA;EACrB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,6BAAD;GAAkC;GAAK,GAAI;GAA3C,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD,CAAkB,CAAA,EACP,CAAA,GACZ,QAC0B;EACtB,CAAA,EAAA,CAAA;CACY,CAAA;AAE3B,CAAC;AAED,IAAa,wBAAwBC,kBAAAA"}
@@ -29,12 +29,16 @@ var StyledRadio = styled("div", RADIO_BASE_STYLES, {
29
29
  });
30
30
  var StyledIndicator = styled("div", INDICATOR_BASE_STYLES);
31
31
  var StyledRadioAccordionTrigger = styled(StyledAccordionTrigger, { "@hover": { "&:hover": { [`& ${StyledRadio}`]: { boxShadow: "inset 0 0 0 1px $colors$radioHoverBorder" } } } });
32
- var RadioAccordionTrigger = React.forwardRef(({ children, ...props }, ref) => {
33
- return /* @__PURE__ */ jsx(StyledAccordionHeader, { children: /* @__PURE__ */ jsxs(StyledRadioAccordionTrigger, {
34
- ref,
35
- ...props,
36
- children: [/* @__PURE__ */ jsx(StyledRadio, { children: /* @__PURE__ */ jsx(StyledIndicator, {}) }), children]
37
- }) });
32
+ var RadioAccordionTrigger = React.forwardRef(({ children, headingLevel = 3, ...props }, ref) => {
33
+ const Heading = headingLevel === "none" ? "div" : `h${headingLevel}`;
34
+ return /* @__PURE__ */ jsx(StyledAccordionHeader, {
35
+ asChild: true,
36
+ children: /* @__PURE__ */ jsx(Heading, { children: /* @__PURE__ */ jsxs(StyledRadioAccordionTrigger, {
37
+ ref,
38
+ ...props,
39
+ children: [/* @__PURE__ */ jsx(StyledRadio, { children: /* @__PURE__ */ jsx(StyledIndicator, {}) }), children]
40
+ }) })
41
+ });
38
42
  });
39
43
  var RadioAccordionContent = AccordionContent;
40
44
  export { RadioAccordionContent, RadioAccordionItem, RadioAccordionRoot, RadioAccordionTrigger };
@@ -1 +1 @@
1
- {"version":3,"file":"RadioAccordion.js","names":[],"sources":["../../../components/RadioAccordion/RadioAccordion.tsx"],"sourcesContent":["import type { AccordionSingleProps } from '@radix-ui/react-accordion';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport {\n AccordionContent,\n AccordionItem,\n AccordionRoot,\n AccordionTriggerProps,\n StyledAccordionHeader,\n StyledAccordionTrigger,\n} from '../Accordion';\nimport { INDICATOR_BASE_STYLES, RADIO_BASE_STYLES } from '../Radio';\n\nexport interface RadioAccordionRootProps\n extends Omit<AccordionSingleProps, 'type' | 'collapsible'>,\n Omit<VariantProps<typeof AccordionRoot>, 'type' | 'collapsible'> {\n css?: CSS; // could not skipped\n}\n\nexport const RadioAccordionRoot: (props: RadioAccordionRootProps) => JSX.Element = (props) => (\n <AccordionRoot {...props} type=\"single\" collapsible={false} />\n);\n\nexport interface RadioAccordionItemProps\n extends ComponentProps<typeof AccordionItem>,\n VariantProps<typeof AccordionItem> {}\nexport const RadioAccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionItem>,\n RadioAccordionItemProps\n>(({ value, children, ...props }, forwardedRef) => {\n return (\n <AccordionItem\n value={value}\n ref={forwardedRef}\n css={{ display: 'inherit', flexDirection: 'column' }}\n {...props}\n >\n {children}\n </AccordionItem>\n );\n});\n\nconst StyledRadio = styled('div', RADIO_BASE_STYLES, {\n width: 18,\n height: 18,\n mr: '$2',\n '[data-state=open] > &': {\n backgroundColor: '$radioIndicator',\n },\n});\n\nconst StyledIndicator = styled('div', INDICATOR_BASE_STYLES);\n\nconst StyledRadioAccordionTrigger = styled(StyledAccordionTrigger, {\n '@hover': {\n '&:hover': {\n [`& ${StyledRadio}`]: {\n boxShadow: 'inset 0 0 0 1px $colors$radioHoverBorder',\n },\n },\n },\n});\n\nexport interface RadioAccordionTriggerProps extends AccordionTriggerProps {}\nexport const RadioAccordionTrigger = React.forwardRef<\n React.ElementRef<typeof StyledRadioAccordionTrigger>,\n RadioAccordionTriggerProps\n>(({ children, ...props }, ref) => {\n return (\n <StyledAccordionHeader>\n <StyledRadioAccordionTrigger ref={ref} {...props}>\n <StyledRadio>\n <StyledIndicator />\n </StyledRadio>\n {children}\n </StyledRadioAccordionTrigger>\n </StyledAccordionHeader>\n );\n});\n\nexport const RadioAccordionContent = AccordionContent;\n"],"mappings":";;;;;;AAoBA,IAAa,sBAAuE,UAClF,oBAAC,eAAD;CAAe,GAAI;CAAO,MAAK;CAAS,aAAa;AAAQ,CAAA;AAM/D,IAAa,qBAAqB,MAAM,YAGrC,EAAE,OAAO,UAAU,GAAG,SAAS,iBAAiB;CACjD,OACE,oBAAC,eAAD;EACS;EACP,KAAK;EACL,KAAK;GAAE,SAAS;GAAW,eAAe;EAAS;EACnD,GAAI;EAEH;CACY,CAAA;AAEnB,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,mBAAmB;CACnD,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,yBAAyB,EACvB,iBAAiB,kBACnB;AACF,CAAC;AAED,IAAM,kBAAkB,OAAO,OAAO,qBAAqB;AAE3D,IAAM,8BAA8B,OAAO,wBAAwB,EACjE,UAAU,EACR,WAAW,GACR,KAAK,gBAAgB,EACpB,WAAW,2CACb,EACF,EACF,EACF,CAAC;AAGD,IAAa,wBAAwB,MAAM,YAGxC,EAAE,UAAU,GAAG,SAAS,QAAQ;CACjC,OACE,oBAAC,uBAAD,EAAA,UACE,qBAAC,6BAAD;EAAkC;EAAK,GAAI;EAA3C,UAAA,CACE,oBAAC,aAAD,EAAA,UACE,oBAAC,iBAAD,CAAkB,CAAA,EACP,CAAA,GACZ,QAC0B;CACR,CAAA,EAAA,CAAA;AAE3B,CAAC;AAED,IAAa,wBAAwB"}
1
+ {"version":3,"file":"RadioAccordion.js","names":[],"sources":["../../../components/RadioAccordion/RadioAccordion.tsx"],"sourcesContent":["import type { AccordionSingleProps } from '@radix-ui/react-accordion';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, styled, VariantProps } from '../../stitches.config';\nimport {\n AccordionContent,\n AccordionItem,\n AccordionRoot,\n AccordionTriggerProps,\n StyledAccordionHeader,\n StyledAccordionTrigger,\n} from '../Accordion';\nimport { INDICATOR_BASE_STYLES, RADIO_BASE_STYLES } from '../Radio';\n\nexport interface RadioAccordionRootProps\n extends\n Omit<AccordionSingleProps, 'type' | 'collapsible'>,\n Omit<VariantProps<typeof AccordionRoot>, 'type' | 'collapsible'> {\n css?: CSS; // could not skipped\n}\n\nexport const RadioAccordionRoot: (props: RadioAccordionRootProps) => JSX.Element = (props) => (\n <AccordionRoot {...props} type=\"single\" collapsible={false} />\n);\n\nexport interface RadioAccordionItemProps\n extends ComponentProps<typeof AccordionItem>, VariantProps<typeof AccordionItem> {}\nexport const RadioAccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionItem>,\n RadioAccordionItemProps\n>(({ value, children, ...props }, forwardedRef) => {\n return (\n <AccordionItem\n value={value}\n ref={forwardedRef}\n css={{ display: 'inherit', flexDirection: 'column' }}\n {...props}\n >\n {children}\n </AccordionItem>\n );\n});\n\nconst StyledRadio = styled('div', RADIO_BASE_STYLES, {\n width: 18,\n height: 18,\n mr: '$2',\n '[data-state=open] > &': {\n backgroundColor: '$radioIndicator',\n },\n});\n\nconst StyledIndicator = styled('div', INDICATOR_BASE_STYLES);\n\nconst StyledRadioAccordionTrigger = styled(StyledAccordionTrigger, {\n '@hover': {\n '&:hover': {\n [`& ${StyledRadio}`]: {\n boxShadow: 'inset 0 0 0 1px $colors$radioHoverBorder',\n },\n },\n },\n});\n\nexport interface RadioAccordionTriggerProps extends Omit<\n AccordionTriggerProps,\n 'customIcon' | 'noIcon'\n> {}\nexport const RadioAccordionTrigger = React.forwardRef<\n React.ElementRef<typeof StyledRadioAccordionTrigger>,\n RadioAccordionTriggerProps\n>(({ children, headingLevel = 3, ...props }, ref) => {\n const Heading = headingLevel === 'none' ? 'div' : (`h${headingLevel}` as const);\n\n return (\n <StyledAccordionHeader asChild>\n <Heading>\n <StyledRadioAccordionTrigger ref={ref} {...props}>\n <StyledRadio>\n <StyledIndicator />\n </StyledRadio>\n {children}\n </StyledRadioAccordionTrigger>\n </Heading>\n </StyledAccordionHeader>\n );\n});\n\nexport const RadioAccordionContent = AccordionContent;\n"],"mappings":";;;;;;AAqBA,IAAa,sBAAuE,UAClF,oBAAC,eAAD;CAAe,GAAI;CAAO,MAAK;CAAS,aAAa;AAAQ,CAAA;AAK/D,IAAa,qBAAqB,MAAM,YAGrC,EAAE,OAAO,UAAU,GAAG,SAAS,iBAAiB;CACjD,OACE,oBAAC,eAAD;EACS;EACP,KAAK;EACL,KAAK;GAAE,SAAS;GAAW,eAAe;EAAS;EACnD,GAAI;EAEH;CACY,CAAA;AAEnB,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,mBAAmB;CACnD,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,yBAAyB,EACvB,iBAAiB,kBACnB;AACF,CAAC;AAED,IAAM,kBAAkB,OAAO,OAAO,qBAAqB;AAE3D,IAAM,8BAA8B,OAAO,wBAAwB,EACjE,UAAU,EACR,WAAW,GACR,KAAK,gBAAgB,EACpB,WAAW,2CACb,EACF,EACF,EACF,CAAC;AAMD,IAAa,wBAAwB,MAAM,YAGxC,EAAE,UAAU,eAAe,GAAG,GAAG,SAAS,QAAQ;CACnD,MAAM,UAAU,iBAAiB,SAAS,QAAS,IAAI;CAEvD,OACE,oBAAC,uBAAD;EAAuB,SAAA;EACrB,UAAA,oBAAC,SAAD,EAAA,UACE,qBAAC,6BAAD;GAAkC;GAAK,GAAI;GAA3C,UAAA,CACE,oBAAC,aAAD,EAAA,UACE,oBAAC,iBAAD,CAAkB,CAAA,EACP,CAAA,GACZ,QAC0B;EACtB,CAAA,EAAA,CAAA;CACY,CAAA;AAE3B,CAAC;AAED,IAAa,wBAAwB"}