@atom-learning/components 6.0.0-beta.30 → 6.0.0-beta.32

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 (68) hide show
  1. package/dist/components/action-icon/ActionIcon.js +1 -1
  2. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  3. package/dist/components/avatar/Avatar.js +1 -1
  4. package/dist/components/avatar/Avatar.js.map +1 -1
  5. package/dist/components/avatar/AvatarImage.js +1 -1
  6. package/dist/components/avatar/AvatarImage.js.map +1 -1
  7. package/dist/components/badge/Badge.js +1 -1
  8. package/dist/components/badge/Badge.js.map +1 -1
  9. package/dist/components/button/Button.js +1 -1
  10. package/dist/components/button/Button.js.map +1 -1
  11. package/dist/components/carousel/Carousel.d.ts +1 -1
  12. package/dist/components/carousel/CarouselArrows.js +1 -1
  13. package/dist/components/carousel/CarouselArrows.js.map +1 -1
  14. package/dist/components/carousel/CarouselSlider.d.ts +1 -1
  15. package/dist/components/carousel/CarouselSlider.js.map +1 -1
  16. package/dist/components/checkbox/Checkbox.js +1 -1
  17. package/dist/components/checkbox/Checkbox.js.map +1 -1
  18. package/dist/components/chip/Chip.js +1 -1
  19. package/dist/components/chip/Chip.js.map +1 -1
  20. package/dist/components/data-table/DataTableHeaderCell.js +1 -1
  21. package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
  22. package/dist/components/data-table/getNewAsyncData.js +1 -1
  23. package/dist/components/dialog/DialogContent.js +1 -1
  24. package/dist/components/dialog/DialogContent.js.map +1 -1
  25. package/dist/components/input/Input.d.ts +1 -9
  26. package/dist/components/input/Input.js +1 -1
  27. package/dist/components/input/Input.js.map +1 -1
  28. package/dist/components/keyboard-shortcut/KeyboardShortcut.js +1 -1
  29. package/dist/components/keyboard-shortcut/KeyboardShortcut.js.map +1 -1
  30. package/dist/components/label/Label.js +1 -1
  31. package/dist/components/label/Label.js.map +1 -1
  32. package/dist/components/link/Link.js +1 -1
  33. package/dist/components/link/Link.js.map +1 -1
  34. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.styles.js +1 -1
  35. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.styles.js.map +1 -1
  36. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalText.js +1 -1
  37. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalText.js.map +1 -1
  38. package/dist/components/segmented-control/SegmentedControlItemList.js +1 -1
  39. package/dist/components/segmented-control/SegmentedControlItemList.js.map +1 -1
  40. package/dist/components/segmented-control/SegmentedControlRoot.js +1 -1
  41. package/dist/components/segmented-control/SegmentedControlRoot.js.map +1 -1
  42. package/dist/components/stepper/StepperStepBullet.js +1 -1
  43. package/dist/components/stepper/StepperStepBullet.js.map +1 -1
  44. package/dist/components/stepper/StepperSteps.js +1 -1
  45. package/dist/components/stepper/StepperSteps.js.map +1 -1
  46. package/dist/components/table/TableCell.js +1 -1
  47. package/dist/components/table/TableCell.js.map +1 -1
  48. package/dist/components/table/TableStickyColumnsContainer.js +1 -1
  49. package/dist/components/table/TableStickyColumnsContainer.js.map +1 -1
  50. package/dist/components/tile-toggle-group/TileToggleGroupRoot.js +1 -1
  51. package/dist/components/tile-toggle-group/TileToggleGroupRoot.js.map +1 -1
  52. package/dist/components/toast/Toast.js +1 -1
  53. package/dist/components/toast/Toast.js.map +1 -1
  54. package/dist/components/toggle-group/ToggleGroupButton.d.ts +3 -10
  55. package/dist/components/toggle-group/ToggleGroupButton.js +1 -1
  56. package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -1
  57. package/dist/components/toggle-group/ToggleGroupItem.d.ts +2 -0
  58. package/dist/components/toggle-group/ToggleGroupItem.js +1 -1
  59. package/dist/components/toggle-group/ToggleGroupItem.js.map +1 -1
  60. package/dist/components/toggle-group/index.d.ts +1 -5
  61. package/dist/components/tree/TreeText.js +1 -1
  62. package/dist/components/tree/TreeText.js.map +1 -1
  63. package/dist/docgen.json +1 -1
  64. package/dist/index.cjs.js +1 -1
  65. package/dist/index.cjs.js.map +1 -1
  66. package/package.json +11 -6
  67. package/src/index.css +6 -0
  68. package/src/responsive-variant-classes.css +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { overrideStyledVariantValue } from '~/utilities/override-styled-variant-value/overrideStyledVariantValue'\n\nimport { Flex } from '../flex'\nimport { Text } from '../text'\n\nexport const InputBackground = styled(Flex, {\n base: [\n 'text-grey-1000',\n 'transition-[background]',\n 'duration-100',\n 'ease-out',\n 'transition-[border-color]',\n 'duration-100',\n 'ease-out',\n 'w-full',\n 'placeholder:opacity-100',\n 'placeholder:text-grey-700'\n ],\n variants: {\n appearance: {\n standard: [\n 'bg-white',\n 'border',\n 'border-grey-800',\n 'focus-within:border-blue-800',\n 'rounded-md'\n ],\n modern: [\n 'bg-grey-100',\n 'border-none',\n 'focus-within:outline-2',\n 'focus-within:outline-blue-800',\n 'focus-within:outline-offset-1',\n 'focus-within:outline-solid',\n 'focus-within:z-1',\n 'rounded-md'\n ]\n },\n size: {\n sm: ['h-8'],\n md: ['h-10'],\n lg: ['h-12'],\n xl: ['h-16']\n },\n disabled: {\n true: ['cursor-not-allowed', 'opacity-30']\n },\n state: {\n error: []\n }\n },\n compoundVariants: [\n {\n state: 'error',\n appearance: 'standard',\n class: ['border-danger']\n },\n {\n state: 'error',\n appearance: 'modern',\n class: ['bg-danger-light', 'focus-within:outline-danger']\n }\n ]\n})\n\nInputBackground.displayName = 'InputBackground'\n\nconst StyledInputText = styled(Text, {\n base: [\n 'appearance-none',\n 'border-none',\n 'bg-none',\n 'bg-none',\n 'bg-transparent',\n 'shadow-none',\n 'box-border',\n 'focus:outline-none',\n 'px-3',\n 'size-full'\n ]\n})\n\nexport type InputTextProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size'\n> &\n Omit<React.ComponentProps<typeof StyledInputText>, 'type' | 'as'> & {\n // override default 'type' property to prevent Input from being used to render\n // checkboxes, radios etc — we have dedicated components for them\n type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search'\n as?: never\n disabled?: boolean\n }\n\nconst toTextSize = {\n sm: 'sm',\n md: 'md',\n lg: 'md',\n xl: 'lg'\n}\n\nexport const InputText = React.forwardRef<HTMLInputElement, InputTextProps>(\n ({ type = 'text', size, ...rest }, ref) => {\n const textSize = React.useMemo(\n () => overrideStyledVariantValue(size, (s) => toTextSize[s]),\n [size]\n )\n\n return (\n <StyledInputText\n ref={ref}\n as=\"input\"\n type={type === 'number' ? 'text' : type}\n inputMode={type === 'number' ? 'numeric' : undefined}\n pattern={type === 'number' ? '[0-9]*' : undefined}\n size={textSize}\n {...(rest as any)}\n />\n )\n }\n)\n\nInputText.displayName = 'InputText'\n\ntype InputBackgroundProps = React.ComponentProps<typeof InputBackground>\nexport type InputProps = Omit<\n React.ComponentProps<typeof InputText>,\n 'size' | 'state' | 'appearance'\n> & {\n size?: InputBackgroundProps['size']\n state?: InputBackgroundProps['state']\n appearance?: InputBackgroundProps['appearance']\n disabled?: boolean\n name?: string\n readOnly?: boolean\n value?: string | number\n onChange?: React.ChangeEventHandler<HTMLInputElement>\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n size = 'md',\n appearance = 'standard',\n state,\n disabled,\n ...rest\n },\n ref\n ) => {\n return (\n <InputBackground\n size={size}\n appearance={appearance}\n disabled={disabled}\n state={state}\n className={className}\n >\n <InputText size={size} ref={ref} disabled={disabled} {...rest} />\n </InputBackground>\n )\n }\n)\n\nInput.displayName = 'Input'\n"],"names":["InputBackground","styled","Flex","StyledInputText","Text","toTextSize","InputText","React","type","size","rest","ref","textSize","overrideStyledVariantValue","s","Input","className","appearance","state","disabled"],"mappings":"wQAQO,MAAMA,EAAkBC,EAAOC,EAAM,CAC1C,KAAM,CACJ,iBACA,0BACA,eACA,WACA,4BACA,eACA,WACA,SACA,0BACA,2BACF,EACA,SAAU,CACR,WAAY,CACV,SAAU,CACR,WACA,SACA,kBACA,+BACA,YACF,EACA,OAAQ,CACN,cACA,cACA,yBACA,gCACA,gCACA,6BACA,mBACA,YACF,CACF,EACA,KAAM,CACJ,GAAI,CAAC,KAAK,EACV,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,CACb,EACA,SAAU,CACR,KAAM,CAAC,qBAAsB,YAAY,CAC3C,EACA,MAAO,CACL,MAAO,CACT,CAAA,CACF,EACA,iBAAkB,CAChB,CACE,MAAO,QACP,WAAY,WACZ,MAAO,CAAC,eAAe,CACzB,EACA,CACE,MAAO,QACP,WAAY,SACZ,MAAO,CAAC,kBAAmB,6BAA6B,CAC1D,CACF,CACF,CAAC,EAEDF,EAAgB,YAAc,kBAE9B,MAAMG,EAAkBF,EAAOG,EAAM,CACnC,KAAM,CACJ,kBACA,cACA,UACA,UACA,iBACA,cACA,aACA,qBACA,OACA,WACF,CACF,CAAC,EAcKC,EAAa,CACjB,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEaC,EAAYC,EAAM,WAC7B,CAAC,CAAE,KAAAC,EAAO,OAAQ,KAAAC,EAAM,GAAGC,CAAK,EAAGC,IAAQ,CACzC,MAAMC,EAAWL,EAAM,QACrB,IAAMM,EAA2BJ,EAAOK,GAAMT,EAAWS,CAAC,CAAC,EAC3D,CAACL,CAAI,CACP,EAEA,OACEF,EAAA,cAACJ,EAAA,CACC,IAAKQ,EACL,GAAG,QACH,KAAMH,IAAS,SAAW,OAASA,EACnC,UAAWA,IAAS,SAAW,UAAY,OAC3C,QAASA,IAAS,SAAW,SAAW,OACxC,KAAMI,EACL,GAAIF,CACP,CAAA,CAEJ,CACF,EAEAJ,EAAU,YAAc,YAiBX,MAAAS,EAAQR,EAAM,WACzB,CACE,CACE,UAAAS,EACA,KAAAP,EAAO,KACP,WAAAQ,EAAa,WACb,MAAAC,EACA,SAAAC,EACA,GAAGT,CACL,EACAC,IAGEJ,EAAA,cAACP,EAAA,CACC,KAAMS,EACN,WAAYQ,EACZ,SAAUE,EACV,MAAOD,EACP,UAAWF,CAEXT,EAAAA,EAAA,cAACD,EAAA,CAAU,KAAMG,EAAM,IAAKE,EAAK,SAAUQ,EAAW,GAAGT,CAAM,CAAA,CACjE,CAGN,EAEAK,EAAM,YAAc"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { overrideStyledVariantValue } from '~/utilities/override-styled-variant-value/overrideStyledVariantValue'\n\nimport { Flex } from '../flex'\nimport { Text } from '../text'\n\nexport const InputBackground = styled('div', {\n base: [\n 'flex',\n 'text-grey-1000',\n 'transition-[background]',\n 'duration-100',\n 'ease-out',\n 'transition-[border-color]',\n 'duration-100',\n 'ease-out',\n 'w-full'\n ],\n variants: {\n appearance: {\n standard: [\n 'bg-white',\n 'border',\n 'border-grey-800',\n 'focus-within:border-blue-800',\n 'rounded-md'\n ],\n modern: [\n 'bg-grey-100',\n 'border-none',\n 'focus-within:outline-2',\n 'focus-within:outline-blue-800',\n 'focus-within:outline-offset-1',\n 'focus-within:outline-solid',\n 'focus-within:z-1',\n 'rounded-md'\n ]\n },\n size: {\n sm: ['h-8'],\n md: ['h-10'],\n lg: ['h-12'],\n xl: ['h-16']\n },\n disabled: {\n true: ['cursor-not-allowed', 'opacity-30']\n },\n state: {\n error: []\n }\n },\n compoundVariants: [\n {\n state: 'error',\n appearance: 'standard',\n class: ['border-danger']\n },\n {\n state: 'error',\n appearance: 'modern',\n class: ['bg-danger-light', 'focus-within:outline-danger']\n }\n ]\n})\n\nInputBackground.displayName = 'InputBackground'\n\nconst StyledInputText = styled(Text, {\n base: [\n 'appearance-none',\n 'border-none',\n 'bg-none',\n 'bg-transparent',\n 'shadow-none',\n 'box-border',\n 'focus:outline-none',\n 'px-3',\n 'size-full',\n 'placeholder:opacity-100',\n 'placeholder:text-grey-700'\n ]\n})\n\nexport type InputTextProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size'\n> &\n Omit<React.ComponentProps<typeof StyledInputText>, 'type' | 'as'> & {\n // override default 'type' property to prevent Input from being used to render\n // checkboxes, radios etc — we have dedicated components for them\n type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search'\n as?: never\n disabled?: boolean\n }\n\nconst toTextSize = {\n sm: 'sm',\n md: 'md',\n lg: 'md',\n xl: 'lg'\n}\n\nexport const InputText = React.forwardRef<HTMLInputElement, InputTextProps>(\n ({ type = 'text', size, ...rest }, ref) => {\n const textSize = React.useMemo(\n () => overrideStyledVariantValue(size, (s) => toTextSize[s]),\n [size]\n )\n\n return (\n <StyledInputText\n ref={ref}\n as=\"input\"\n type={type === 'number' ? 'text' : type}\n inputMode={type === 'number' ? 'numeric' : undefined}\n pattern={type === 'number' ? '[0-9]*' : undefined}\n size={textSize}\n {...(rest as any)}\n />\n )\n }\n)\n\nInputText.displayName = 'InputText'\n\ntype InputBackgroundProps = React.ComponentProps<typeof InputBackground>\nexport type InputProps = Omit<\n React.ComponentProps<typeof InputText>,\n 'size' | 'state' | 'appearance'\n> & {\n size?: InputBackgroundProps['size']\n state?: InputBackgroundProps['state']\n appearance?: InputBackgroundProps['appearance']\n disabled?: boolean\n name?: string\n readOnly?: boolean\n value?: string | number\n onChange?: React.ChangeEventHandler<HTMLInputElement>\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n size = 'md',\n appearance = 'standard',\n state,\n disabled,\n ...rest\n },\n ref\n ) => {\n return (\n <InputBackground\n size={size}\n appearance={appearance}\n disabled={disabled}\n state={state}\n className={className}\n >\n <InputText size={size} ref={ref} disabled={disabled} {...rest} />\n </InputBackground>\n )\n }\n)\n\nInput.displayName = 'Input'\n"],"names":["InputBackground","styled","StyledInputText","Text","toTextSize","InputText","React","type","size","rest","ref","textSize","overrideStyledVariantValue","s","Input","className","appearance","state","disabled"],"mappings":"iOAQa,MAAAA,EAAkBC,EAAO,MAAO,CAC3C,KAAM,CACJ,OACA,iBACA,0BACA,eACA,WACA,4BACA,eACA,WACA,QACF,EACA,SAAU,CACR,WAAY,CACV,SAAU,CACR,WACA,SACA,kBACA,+BACA,YACF,EACA,OAAQ,CACN,cACA,cACA,yBACA,gCACA,gCACA,6BACA,mBACA,YACF,CACF,EACA,KAAM,CACJ,GAAI,CAAC,KAAK,EACV,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,CACb,EACA,SAAU,CACR,KAAM,CAAC,qBAAsB,YAAY,CAC3C,EACA,MAAO,CACL,MAAO,CACT,CAAA,CACF,EACA,iBAAkB,CAChB,CACE,MAAO,QACP,WAAY,WACZ,MAAO,CAAC,eAAe,CACzB,EACA,CACE,MAAO,QACP,WAAY,SACZ,MAAO,CAAC,kBAAmB,6BAA6B,CAC1D,CACF,CACF,CAAC,EAEDD,EAAgB,YAAc,kBAE9B,MAAME,EAAkBD,EAAOE,EAAM,CACnC,KAAM,CACJ,kBACA,cACA,UACA,iBACA,cACA,aACA,qBACA,OACA,YACA,0BACA,2BACF,CACF,CAAC,EAcKC,EAAa,CACjB,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEaC,EAAYC,EAAM,WAC7B,CAAC,CAAE,KAAAC,EAAO,OAAQ,KAAAC,EAAM,GAAGC,CAAK,EAAGC,IAAQ,CACzC,MAAMC,EAAWL,EAAM,QACrB,IAAMM,EAA2BJ,EAAOK,GAAMT,EAAWS,CAAC,CAAC,EAC3D,CAACL,CAAI,CACP,EAEA,OACEF,EAAA,cAACJ,EAAA,CACC,IAAKQ,EACL,GAAG,QACH,KAAMH,IAAS,SAAW,OAASA,EACnC,UAAWA,IAAS,SAAW,UAAY,OAC3C,QAASA,IAAS,SAAW,SAAW,OACxC,KAAMI,EACL,GAAIF,CAAAA,CACP,CAEJ,CACF,EAEAJ,EAAU,YAAc,YAiBjB,MAAMS,EAAQR,EAAM,WACzB,CACE,CACE,UAAAS,EACA,KAAAP,EAAO,KACP,WAAAQ,EAAa,WACb,MAAAC,EACA,SAAAC,EACA,GAAGT,CACL,EACAC,IAGEJ,EAAA,cAACN,EACC,CAAA,KAAMQ,EACN,WAAYQ,EACZ,SAAUE,EACV,MAAOD,EACP,UAAWF,CAAAA,EAEXT,EAAA,cAACD,EAAU,CAAA,KAAMG,EAAM,IAAKE,EAAK,SAAUQ,EAAW,GAAGT,CAAM,CAAA,CACjE,CAGN,EAEAK,EAAM,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Slot as p}from"@radix-ui/react-slot";import*as e from"react";import{styled as w}from"../../styled.js";import{useCallbackRefState as v}from"../../utilities/hooks/useCallbackRef.js";import{Text as x}from"../text/Text.js";const m=e.forwardRef(({asChild:o,config:s,targetWindow:r=!1,onKeyDown:n,...d},l)=>{const[f,y]=v();e.useImperativeHandle(l,()=>f);const t=e.useCallback(i=>{s.forEach(({shortcut:a,action:u})=>{Object.entries(a).every(([b,h])=>i[b]===h)&&u({event:i,shortcut:a})}),n==null||n(i)},[s,n]);return e.useEffect(()=>(r&&window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[r,t]),e.createElement(o?p:"div",{onKeyDown:r?void 0:t,ref:y,...d})});m.displayName="KeyboardShortcut";const k=w(x,{base:["bg-grey-100","text-text-subtle","px-2","text-[1em]","py-0.5","min-w-6","min-h-6","font-normal","inline-flex","justify-center","items-center","rounded-md","shrink-0"]}),c=o=>e.createElement(k,{size:"sm",as:"kbd",...o});c.displayName="KeyboardShortcut";export{m as KeyboardShortcut,c as KeyboardShortcutIndicator};
1
+ import{Slot as p}from"@radix-ui/react-slot";import*as e from"react";import{styled as w}from"../../styled.js";import{useCallbackRefState as v}from"../../utilities/hooks/useCallbackRef.js";import{Text as k}from"../text/Text.js";const c=e.forwardRef(({asChild:o,config:s,targetWindow:r=!1,onKeyDown:n,...m},l)=>{const[f,y]=v();e.useImperativeHandle(l,()=>f);const t=e.useCallback(i=>{s.forEach(({shortcut:a,action:u})=>{Object.entries(a).every(([b,h])=>i[b]===h)&&u({event:i,shortcut:a})}),n==null||n(i)},[s,n]);return e.useEffect(()=>(r&&window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[r,t]),e.createElement(o?p:"div",{onKeyDown:r?void 0:t,ref:y,...m})});c.displayName="KeyboardShortcut";const x=w(k,{base:["bg-grey-100","text-text-subtle","px-2","py-0.5","min-w-6","min-h-6","font-normal","inline-flex","justify-center","items-center","rounded-md","shrink-0"]}),d=o=>e.createElement(x,{size:"sm",as:"kbd",...o});d.displayName="KeyboardShortcut";export{c as KeyboardShortcut,d as KeyboardShortcutIndicator};
2
2
  //# sourceMappingURL=KeyboardShortcut.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardShortcut.js","sources":["../../../src/components/keyboard-shortcut/KeyboardShortcut.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\n\nimport { Text } from '../text'\n\ntype KeyboardEventWindowOrElement =\n | KeyboardEvent\n | React.KeyboardEvent<HTMLDivElement>\ntype ShortcutConfig = Partial<KeyboardEvent>\n\ntype KeyboardShortcutProps = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean\n config: {\n shortcut: ShortcutConfig\n action: ({\n event,\n shortcut\n }: {\n event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>\n shortcut: ShortcutConfig\n }) => void\n }[]\n targetWindow?: boolean\n onKeyDown?: (e: KeyboardEventWindowOrElement) => void\n}\n\nexport const KeyboardShortcut = React.forwardRef<\n HTMLDivElement,\n KeyboardShortcutProps\n>(({ asChild, config, targetWindow = false, onKeyDown, ...rest }, ref) => {\n const [targetElRef, setTargetElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => targetElRef as HTMLDivElement)\n\n const handleOnKeydown = React.useCallback(\n (e: KeyboardEventWindowOrElement) => {\n config.forEach(({ shortcut, action }) => {\n if (Object.entries(shortcut).every(([key, value]) => e[key] === value))\n action({ event: e, shortcut })\n })\n onKeyDown?.(e)\n },\n [config, onKeyDown]\n )\n\n React.useEffect(() => {\n if (targetWindow) window.addEventListener('keydown', handleOnKeydown)\n\n return () => {\n window.removeEventListener('keydown', handleOnKeydown)\n }\n }, [targetWindow, handleOnKeydown])\n\n const Component = asChild ? Slot : 'div'\n\n return (\n <Component\n onKeyDown={targetWindow ? undefined : (handleOnKeydown as any)}\n ref={setTargetElRef}\n {...rest}\n />\n )\n})\n\nKeyboardShortcut.displayName = 'KeyboardShortcut'\n\nconst StyledKeyboardShortcutIndicator = styled(Text, {\n base: [\n 'bg-grey-100',\n 'text-text-subtle',\n 'px-2',\n 'text-[1em]',\n 'py-0.5',\n 'min-w-6',\n 'min-h-6',\n 'font-normal',\n 'inline-flex',\n 'justify-center',\n 'items-center',\n 'rounded-md',\n 'shrink-0'\n ]\n})\n\ntype KeyboardShortcutIndicatorProps = React.ComponentProps<\n typeof StyledKeyboardShortcutIndicator\n>\n\nexport const KeyboardShortcutIndicator = (\n props: KeyboardShortcutIndicatorProps\n) => {\n return <StyledKeyboardShortcutIndicator size=\"sm\" as=\"kbd\" {...props} />\n}\n\nKeyboardShortcutIndicator.displayName = 'KeyboardShortcut'\n"],"names":["KeyboardShortcut","React","asChild","config","targetWindow","onKeyDown","rest","ref","targetElRef","setTargetElRef","useCallbackRefState","handleOnKeydown","e","shortcut","action","key","value","Slot","StyledKeyboardShortcutIndicator","styled","Text","KeyboardShortcutIndicator","props"],"mappings":"wOA6BaA,EAAmBC,EAAM,WAGpC,CAAC,CAAE,QAAAC,EAAS,OAAAC,EAAQ,aAAAC,EAAe,GAAO,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CACxE,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,EACtCT,EAAM,oBAAoBM,EAAK,IAAMC,CAA6B,EAElE,MAAMG,EAAkBV,EAAM,YAC3BW,GAAoC,CACnCT,EAAO,QAAQ,CAAC,CAAE,SAAAU,EAAU,OAAAC,CAAO,IAAM,CACnC,OAAO,QAAQD,CAAQ,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IAAMJ,EAAEG,CAAG,IAAMC,CAAK,GACnEF,EAAO,CAAE,MAAOF,EAAG,SAAAC,CAAS,CAAC,CACjC,CAAC,EACDR,GAAA,MAAAA,EAAYO,CAAAA,CACd,EACA,CAACT,EAAQE,CAAS,CACpB,EAEA,OAAAJ,EAAM,UAAU,KACVG,GAAc,OAAO,iBAAiB,UAAWO,CAAe,EAE7D,IAAM,CACX,OAAO,oBAAoB,UAAWA,CAAe,CACvD,GACC,CAACP,EAAcO,CAAe,CAAC,EAKhCV,EAAA,cAHgBC,EAAUe,EAAO,MAGhC,CACC,UAAWb,EAAe,OAAaO,EACvC,IAAKF,EACJ,GAAGH,CACN,CAAA,CAEJ,CAAC,EAEDN,EAAiB,YAAc,mBAE/B,MAAMkB,EAAkCC,EAAOC,EAAM,CACnD,KAAM,CACJ,cACA,mBACA,OACA,aACA,SACA,UACA,UACA,cACA,cACA,iBACA,eACA,aACA,UACF,CACF,CAAC,EAMYC,EACXC,GAEOrB,EAAA,cAACiB,EAAA,CAAgC,KAAK,KAAK,GAAG,MAAO,GAAGI,CAAO,CAAA,EAGxED,EAA0B,YAAc"}
1
+ {"version":3,"file":"KeyboardShortcut.js","sources":["../../../src/components/keyboard-shortcut/KeyboardShortcut.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\n\nimport { Text } from '../text'\n\ntype KeyboardEventWindowOrElement =\n | KeyboardEvent\n | React.KeyboardEvent<HTMLDivElement>\ntype ShortcutConfig = Partial<KeyboardEvent>\n\ntype KeyboardShortcutProps = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean\n config: {\n shortcut: ShortcutConfig\n action: ({\n event,\n shortcut\n }: {\n event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>\n shortcut: ShortcutConfig\n }) => void\n }[]\n targetWindow?: boolean\n onKeyDown?: (e: KeyboardEventWindowOrElement) => void\n}\n\nexport const KeyboardShortcut = React.forwardRef<\n HTMLDivElement,\n KeyboardShortcutProps\n>(({ asChild, config, targetWindow = false, onKeyDown, ...rest }, ref) => {\n const [targetElRef, setTargetElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => targetElRef as HTMLDivElement)\n\n const handleOnKeydown = React.useCallback(\n (e: KeyboardEventWindowOrElement) => {\n config.forEach(({ shortcut, action }) => {\n if (Object.entries(shortcut).every(([key, value]) => e[key] === value))\n action({ event: e, shortcut })\n })\n onKeyDown?.(e)\n },\n [config, onKeyDown]\n )\n\n React.useEffect(() => {\n if (targetWindow) window.addEventListener('keydown', handleOnKeydown)\n\n return () => {\n window.removeEventListener('keydown', handleOnKeydown)\n }\n }, [targetWindow, handleOnKeydown])\n\n const Component = asChild ? Slot : 'div'\n\n return (\n <Component\n onKeyDown={targetWindow ? undefined : (handleOnKeydown as any)}\n ref={setTargetElRef}\n {...rest}\n />\n )\n})\n\nKeyboardShortcut.displayName = 'KeyboardShortcut'\n\nconst StyledKeyboardShortcutIndicator = styled(Text, {\n base: [\n 'bg-grey-100',\n 'text-text-subtle',\n 'px-2',\n 'py-0.5',\n 'min-w-6',\n 'min-h-6',\n 'font-normal',\n 'inline-flex',\n 'justify-center',\n 'items-center',\n 'rounded-md',\n 'shrink-0'\n ]\n})\n\ntype KeyboardShortcutIndicatorProps = React.ComponentProps<\n typeof StyledKeyboardShortcutIndicator\n>\n\nexport const KeyboardShortcutIndicator = (\n props: KeyboardShortcutIndicatorProps\n) => {\n return <StyledKeyboardShortcutIndicator size=\"sm\" as=\"kbd\" {...props} />\n}\n\nKeyboardShortcutIndicator.displayName = 'KeyboardShortcut'\n"],"names":["KeyboardShortcut","React","asChild","config","targetWindow","onKeyDown","rest","ref","targetElRef","setTargetElRef","useCallbackRefState","handleOnKeydown","e","shortcut","action","key","value","Slot","StyledKeyboardShortcutIndicator","styled","Text","KeyboardShortcutIndicator","props"],"mappings":"wOA6BaA,EAAmBC,EAAM,WAGpC,CAAC,CAAE,QAAAC,EAAS,OAAAC,EAAQ,aAAAC,EAAe,GAAO,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CACxE,KAAM,CAACC,EAAaC,CAAc,EAAIC,EACtCT,EAAAA,EAAM,oBAAoBM,EAAK,IAAMC,CAA6B,EAElE,MAAMG,EAAkBV,EAAM,YAC3BW,GAAoC,CACnCT,EAAO,QAAQ,CAAC,CAAE,SAAAU,EAAU,OAAAC,CAAO,IAAM,CACnC,OAAO,QAAQD,CAAQ,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IAAMJ,EAAEG,CAAG,IAAMC,CAAK,GACnEF,EAAO,CAAE,MAAOF,EAAG,SAAAC,CAAS,CAAC,CACjC,CAAC,EACDR,GAAA,MAAAA,EAAYO,CAAAA,CACd,EACA,CAACT,EAAQE,CAAS,CACpB,EAEA,OAAAJ,EAAM,UAAU,KACVG,GAAc,OAAO,iBAAiB,UAAWO,CAAe,EAE7D,IAAM,CACX,OAAO,oBAAoB,UAAWA,CAAe,CACvD,GACC,CAACP,EAAcO,CAAe,CAAC,EAKhCV,EAAA,cAHgBC,EAAUe,EAAO,MAGhC,CACC,UAAWb,EAAe,OAAaO,EACvC,IAAKF,EACJ,GAAGH,CAAAA,CACN,CAEJ,CAAC,EAEDN,EAAiB,YAAc,mBAE/B,MAAMkB,EAAkCC,EAAOC,EAAM,CACnD,KAAM,CACJ,cACA,mBACA,OACA,SACA,UACA,UACA,cACA,cACA,iBACA,eACA,aACA,UACF,CACF,CAAC,EAMYC,EACXC,GAEOrB,EAAA,cAACiB,EAAA,CAAgC,KAAK,KAAK,GAAG,MAAO,GAAGI,CAAO,CAAA,EAGxED,EAA0B,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{styled as a}from"../../styled.js";const d=a("label",{base:["text-grey-900","font-body","m-0"],variants:{size:{sm:["text-sm","leading-[1.53]","capsize-[0.4056]"],md:["text-md","leading-normal","capsize-[0.3864]"]},type:{block:["block","font-semibold"],inline:["flex","font-normal","max-w-max"]},align:{start:[],center:[]},direction:{reverse:[],row:[]},appearance:{standard:[],modern:[]}},compoundVariants:[{type:"inline",align:"start",class:["items-start"]},{type:"inline",align:"center",class:["items-center"]},{type:"inline",direction:"reverse",class:["flex-row-reverse"]},{type:"inline",direction:"row",class:["flex-row"]},{type:"block",appearance:"modern",class:["font-normal"]}]}),p=a("span",{base:["text-danger","ml-1","font-normal"]}),t=({align:n="start",as:r="label",direction:i="row",size:l="md",type:s="block",children:o,required:c,...m})=>e.createElement(d,{as:r,size:l,type:s,align:n,direction:i,...m},o,c&&e.createElement(p,{"aria-hidden":!0},"*"));t.displayName="Label";export{t as Label};
1
+ import*as e from"react";import{styled as m}from"../../styled.js";const d=m("label",{base:["text-grey-900","font-body","m-0"],variants:{size:{sm:["text-sm","leading-[1.53]","capsize-[0.4056]"],md:["text-md","leading-normal","capsize-[0.3864]"]},type:{block:["block","font-semibold"],inline:["flex","font-normal","max-w-max"]},align:{start:[],center:[]},direction:{reverse:[],row:[]},appearance:{standard:[],modern:[]}},compoundVariants:[{type:"inline",align:"start",class:["items-start"]},{type:"inline",align:"center",class:["items-center"]},{type:"inline",direction:"reverse",class:["flex-row-reverse"]},{type:"inline",direction:"row",class:["flex-row"]},{type:"block",appearance:"modern",class:["font-normal"]}]}),a=({align:t="start",as:n="label",direction:r="row",size:i="md",type:l="block",children:s,required:o,...c})=>e.createElement(d,{as:n,size:i,type:l,align:t,direction:r,...c},s,o&&e.createElement("span",{className:"text-danger ml-1 font-normal","aria-hidden":!0},"*"));a.displayName="Label";export{a as Label};
2
2
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport type { Override } from '~/utilities/types'\n\nconst StyledLabel = styled('label', {\n base: ['text-grey-900', 'font-body', 'm-0'],\n variants: {\n size: {\n sm: ['text-sm', 'leading-[1.53]', 'capsize-[0.4056]'],\n md: ['text-md', 'leading-normal', 'capsize-[0.3864]']\n },\n type: {\n block: ['block', 'font-semibold'],\n inline: ['flex', 'font-normal', 'max-w-max']\n },\n align: { start: [], center: [] },\n direction: { reverse: [], row: [] },\n appearance: { standard: [], modern: [] }\n },\n compoundVariants: [\n {\n type: 'inline',\n align: 'start',\n class: ['items-start']\n },\n {\n type: 'inline',\n align: 'center',\n class: ['items-center']\n },\n {\n type: 'inline',\n direction: 'reverse',\n class: ['flex-row-reverse']\n },\n {\n type: 'inline',\n direction: 'row',\n class: ['flex-row']\n },\n {\n type: 'block',\n appearance: 'modern',\n class: ['font-normal']\n }\n ]\n})\n\nconst StyledAsterisk = styled('span', {\n base: ['text-danger', 'ml-1', 'font-normal']\n})\n\nexport type LabelProps = Override<\n React.ComponentPropsWithoutRef<typeof StyledLabel>,\n {\n as?: 'label' | 'legend'\n required?: boolean\n }\n>\n\nexport const Label = ({\n align = 'start',\n as = 'label',\n direction = 'row',\n size = 'md',\n type = 'block',\n children,\n required,\n ...rest\n}: LabelProps) => (\n <StyledLabel\n as={as}\n size={size}\n type={type}\n align={align}\n direction={direction}\n {...rest}\n >\n {children}\n {required && <StyledAsterisk aria-hidden>*</StyledAsterisk>}\n </StyledLabel>\n)\n\nLabel.displayName = 'Label'\n"],"names":["StyledLabel","styled","StyledAsterisk","Label","align","as","direction","size","type","children","required","rest","React"],"mappings":"iEAKA,MAAMA,EAAcC,EAAO,QAAS,CAClC,KAAM,CAAC,gBAAiB,YAAa,KAAK,EAC1C,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,CACtD,EACA,KAAM,CACJ,MAAO,CAAC,QAAS,eAAe,EAChC,OAAQ,CAAC,OAAQ,cAAe,WAAW,CAC7C,EACA,MAAO,CAAE,MAAO,CAAI,EAAA,OAAQ,CAAA,CAAG,EAC/B,UAAW,CAAE,QAAS,CAAI,EAAA,IAAK,EAAG,EAClC,WAAY,CAAE,SAAU,CAAC,EAAG,OAAQ,CAAA,CAAG,CACzC,EACA,iBAAkB,CAChB,CACE,KAAM,SACN,MAAO,QACP,MAAO,CAAC,aAAa,CACvB,EACA,CACE,KAAM,SACN,MAAO,SACP,MAAO,CAAC,cAAc,CACxB,EACA,CACE,KAAM,SACN,UAAW,UACX,MAAO,CAAC,kBAAkB,CAC5B,EACA,CACE,KAAM,SACN,UAAW,MACX,MAAO,CAAC,UAAU,CACpB,EACA,CACE,KAAM,QACN,WAAY,SACZ,MAAO,CAAC,aAAa,CACvB,CACF,CACF,CAAC,EAEKC,EAAiBD,EAAO,OAAQ,CACpC,KAAM,CAAC,cAAe,OAAQ,aAAa,CAC7C,CAAC,EAUYE,EAAQ,CAAC,CACpB,MAAAC,EAAQ,QACR,GAAAC,EAAK,QACL,UAAAC,EAAY,MACZ,KAAAC,EAAO,KACP,KAAAC,EAAO,QACP,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IACEC,EAAA,cAACZ,EAAA,CACC,GAAIK,EACJ,KAAME,EACN,KAAMC,EACN,MAAOJ,EACP,UAAWE,EACV,GAAGK,CAEHF,EAAAA,EACAC,GAAYE,EAAA,cAACV,EAAA,CAAe,cAAW,IAAC,GAAC,CAC5C,EAGFC,EAAM,YAAc"}
1
+ {"version":3,"file":"Label.js","sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport type { Override } from '~/utilities/types'\n\nconst StyledLabel = styled('label', {\n base: ['text-grey-900', 'font-body', 'm-0'],\n variants: {\n size: {\n sm: ['text-sm', 'leading-[1.53]', 'capsize-[0.4056]'],\n md: ['text-md', 'leading-normal', 'capsize-[0.3864]']\n },\n type: {\n block: ['block', 'font-semibold'],\n inline: ['flex', 'font-normal', 'max-w-max']\n },\n align: { start: [], center: [] },\n direction: { reverse: [], row: [] },\n appearance: { standard: [], modern: [] }\n },\n compoundVariants: [\n {\n type: 'inline',\n align: 'start',\n class: ['items-start']\n },\n {\n type: 'inline',\n align: 'center',\n class: ['items-center']\n },\n {\n type: 'inline',\n direction: 'reverse',\n class: ['flex-row-reverse']\n },\n {\n type: 'inline',\n direction: 'row',\n class: ['flex-row']\n },\n {\n type: 'block',\n appearance: 'modern',\n class: ['font-normal']\n }\n ]\n})\n\nexport type LabelProps = Override<\n React.ComponentPropsWithoutRef<typeof StyledLabel>,\n {\n as?: 'label' | 'legend'\n required?: boolean\n }\n>\n\nexport const Label = ({\n align = 'start',\n as = 'label',\n direction = 'row',\n size = 'md',\n type = 'block',\n children,\n required,\n ...rest\n}: LabelProps) => (\n <StyledLabel\n as={as}\n size={size}\n type={type}\n align={align}\n direction={direction}\n {...rest}\n >\n {children}\n {required && (\n <span className=\"text-danger ml-1 font-normal\" aria-hidden>\n *\n </span>\n )}\n </StyledLabel>\n)\n\nLabel.displayName = 'Label'\n"],"names":["StyledLabel","styled","Label","align","as","direction","size","type","children","required","rest","React"],"mappings":"iEAKA,MAAMA,EAAcC,EAAO,QAAS,CAClC,KAAM,CAAC,gBAAiB,YAAa,KAAK,EAC1C,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,CACtD,EACA,KAAM,CACJ,MAAO,CAAC,QAAS,eAAe,EAChC,OAAQ,CAAC,OAAQ,cAAe,WAAW,CAC7C,EACA,MAAO,CAAE,MAAO,CAAA,EAAI,OAAQ,CAAA,CAAG,EAC/B,UAAW,CAAE,QAAS,CAAI,EAAA,IAAK,EAAG,EAClC,WAAY,CAAE,SAAU,CAAA,EAAI,OAAQ,CAAG,CAAA,CACzC,EACA,iBAAkB,CAChB,CACE,KAAM,SACN,MAAO,QACP,MAAO,CAAC,aAAa,CACvB,EACA,CACE,KAAM,SACN,MAAO,SACP,MAAO,CAAC,cAAc,CACxB,EACA,CACE,KAAM,SACN,UAAW,UACX,MAAO,CAAC,kBAAkB,CAC5B,EACA,CACE,KAAM,SACN,UAAW,MACX,MAAO,CAAC,UAAU,CACpB,EACA,CACE,KAAM,QACN,WAAY,SACZ,MAAO,CAAC,aAAa,CACvB,CACF,CACF,CAAC,EAUYC,EAAQ,CAAC,CACpB,MAAAC,EAAQ,QACR,GAAAC,EAAK,QACL,UAAAC,EAAY,MACZ,KAAAC,EAAO,KACP,KAAAC,EAAO,QACP,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IACEC,EAAA,cAACX,EAAA,CACC,GAAII,EACJ,KAAME,EACN,KAAMC,EACN,MAAOJ,EACP,UAAWE,EACV,GAAGK,CAAAA,EAEHF,EACAC,GACCE,EAAA,cAAC,OAAK,CAAA,UAAU,+BAA+B,cAAW,EAAA,EAAC,GAE3D,CAEJ,EAGFT,EAAM,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as n from"react";import{styled as d}from"../../styled.js";import{getExternalAnchorProps as l}from"../../utilities/uri/index.js";const t=d("a",{base:["bg-[unset]","border-[unset]","px-[unset]","py-[unset]","text-primary-800","cursor-pointer","font-body","no-underline","focus:text-primary-900","focus:underline","hover:text-primary-900","hover:underline","active:text-primary-1000","disabled:cursor-not-allowed","disabled:opacity-30","disabled:pointer-events-none","[p_>_&]:after:content-none","[p_>_&]:before:content-none","[p_>_&]:text-[100%]/none","[h1>&]:after:content-none","[h1>&]:before:content-none","[h1>&]:text-[100%]/none","[h2>&]:after:content-none","[h2>&]:before:content-none","[h2>&]:text-[100%]/none","[h3>&]:after:content-none","[h3>&]:before:content-none","[h3>&]:text-[100%]/none","[h4>&]:after:content-none","[h4>&]:before:content-none","[h4>&]:text-[100%]/none","[li>&]:after:content-none","[li>&]:before:content-none","[li>&]:text-[100%]/none","[em>&]:after:content-none","[em>&]:before:content-none","[em>&]:text-[100%]/none"],variants:{size:{xs:["text-xs","leading-[1.6]","capsize-[0.4364]"],sm:["text-sm","leading-[1.53]","capsize-[0.4056]"],md:["text-md","leading-normal","capsize-[0.3864]"],lg:["text-lg","leading-[1.52]","capsize-[0.3983]"],xl:["text-xl","leading-[1.42]","capsize-[0.3506]"]},noCapsize:{true:["before:hidden!","after:hidden!"]}},defaultVariants:{size:"md"}},{enabledResponsiveVariants:!0}),o=n.forwardRef(({as:r,disabled:a,href:e,...i},s)=>n.createElement(t,{as:r||(e?void 0:"button"),noCapsize:e?void 0:!0,href:e,...a&&{disabled:!0},...i,...l(e),ref:s}));o.displayName="Link";export{o as Link,t as StyledLink};
1
+ import*as t from"react";import{styled as d}from"../../styled.js";import{getExternalAnchorProps as l}from"../../utilities/uri/index.js";const i=d("a",{base:["bg-[unset]","text-primary-800","cursor-pointer","font-body","no-underline","focus:text-primary-900","focus:underline","hover:text-primary-900","hover:underline","active:text-primary-1000","disabled:cursor-not-allowed","disabled:opacity-30","disabled:pointer-events-none","[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:after:content-none","[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:before:content-none","[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:text-[100%]/none"],variants:{size:{xs:["text-xs","leading-[1.6]","capsize-[0.4364]"],sm:["text-sm","leading-[1.53]","capsize-[0.4056]"],md:["text-md","leading-normal","capsize-[0.3864]"],lg:["text-lg","leading-[1.52]","capsize-[0.3983]"],xl:["text-xl","leading-[1.42]","capsize-[0.3506]"]},noCapsize:{true:["before:hidden!","after:hidden!"]}},defaultVariants:{size:"md"}},{enabledResponsiveVariants:!0}),n=t.forwardRef(({as:a,disabled:r,href:e,...o},s)=>t.createElement(i,{as:a||(e?void 0:"button"),noCapsize:e?void 0:!0,href:e,...r&&{disabled:!0},...o,...l(e),ref:s}));n.displayName="Link";export{n as Link,i as StyledLink};
2
2
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nexport const StyledLink = styled(\n 'a',\n {\n base: [\n 'bg-[unset]',\n 'border-[unset]',\n 'px-[unset]',\n 'py-[unset]',\n 'text-primary-800',\n 'cursor-pointer',\n 'font-body',\n 'no-underline',\n 'focus:text-primary-900',\n 'focus:underline',\n 'hover:text-primary-900',\n 'hover:underline',\n 'active:text-primary-1000',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none',\n '[p_>_&]:after:content-none',\n '[p_>_&]:before:content-none',\n '[p_>_&]:text-[100%]/none',\n '[h1>&]:after:content-none',\n '[h1>&]:before:content-none',\n '[h1>&]:text-[100%]/none',\n '[h2>&]:after:content-none',\n '[h2>&]:before:content-none',\n '[h2>&]:text-[100%]/none',\n '[h3>&]:after:content-none',\n '[h3>&]:before:content-none',\n '[h3>&]:text-[100%]/none',\n '[h4>&]:after:content-none',\n '[h4>&]:before:content-none',\n '[h4>&]:text-[100%]/none',\n '[li>&]:after:content-none',\n '[li>&]:before:content-none',\n '[li>&]:text-[100%]/none',\n '[em>&]:after:content-none',\n '[em>&]:before:content-none',\n '[em>&]:text-[100%]/none'\n ],\n variants: {\n size: {\n xs: ['text-xs', 'leading-[1.6]', 'capsize-[0.4364]'],\n sm: ['text-sm', 'leading-[1.53]', 'capsize-[0.4056]'],\n md: ['text-md', 'leading-normal', 'capsize-[0.3864]'],\n lg: ['text-lg', 'leading-[1.52]', 'capsize-[0.3983]'],\n xl: ['text-xl', 'leading-[1.42]', 'capsize-[0.3506]']\n },\n noCapsize: {\n true: ['before:hidden!', 'after:hidden!']\n }\n },\n defaultVariants: {\n size: 'md'\n }\n },\n { enabledResponsiveVariants: true }\n)\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n NavigatorActions & { disabled?: boolean }\n>\n\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n ({ as, disabled, href, ...rest }, ref) => (\n <StyledLink\n as={as || (!href ? 'button' : undefined)}\n noCapsize={!href ? true : undefined}\n href={href}\n {...(disabled && { disabled: true })}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref as any}\n />\n )\n)\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","Link","React","as","disabled","href","rest","ref","getExternalAnchorProps"],"mappings":"6IAOaA,EAAaC,EACxB,IACA,CACE,KAAM,CACJ,aACA,iBACA,aACA,aACA,mBACA,iBACA,YACA,eACA,yBACA,kBACA,yBACA,kBACA,2BACA,8BACA,sBACA,+BACA,6BACA,8BACA,2BACA,4BACA,6BACA,0BACA,4BACA,6BACA,0BACA,4BACA,6BACA,0BACA,4BACA,6BACA,0BACA,4BACA,6BACA,0BACA,4BACA,6BACA,yBACF,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,UAAW,gBAAiB,kBAAkB,EACnD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,CACtD,EACA,UAAW,CACT,KAAM,CAAC,iBAAkB,eAAe,CAC1C,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAOaC,EAAOC,EAAM,WACxB,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAK,EAAGC,IAChCL,EAAA,cAACH,EAAA,CACC,GAAII,IAAQE,EAAkB,OAAX,UACnB,UAAYA,EAAc,OAAP,GACnB,KAAMA,EACL,GAAID,GAAY,CAAE,SAAU,EAAK,EACjC,GAAGE,EACH,GAAGE,EAAuBH,CAAI,EAC/B,IAAKE,CAAAA,CACP,CAEJ,EAEAN,EAAK,YAAc"}
1
+ {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nexport const StyledLink = styled(\n 'a',\n {\n base: [\n 'bg-[unset]',\n 'text-primary-800',\n 'cursor-pointer',\n 'font-body',\n 'no-underline',\n 'focus:text-primary-900',\n 'focus:underline',\n 'hover:text-primary-900',\n 'hover:underline',\n 'active:text-primary-1000',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none',\n '[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:after:content-none',\n '[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:before:content-none',\n '[p>&,h1>&,h2>&,h3>&,h4>&,li>&,em>&]:text-[100%]/none'\n ],\n variants: {\n size: {\n xs: ['text-xs', 'leading-[1.6]', 'capsize-[0.4364]'],\n sm: ['text-sm', 'leading-[1.53]', 'capsize-[0.4056]'],\n md: ['text-md', 'leading-normal', 'capsize-[0.3864]'],\n lg: ['text-lg', 'leading-[1.52]', 'capsize-[0.3983]'],\n xl: ['text-xl', 'leading-[1.42]', 'capsize-[0.3506]']\n },\n noCapsize: {\n true: ['before:hidden!', 'after:hidden!']\n }\n },\n defaultVariants: {\n size: 'md'\n }\n },\n { enabledResponsiveVariants: true }\n)\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n NavigatorActions & { disabled?: boolean }\n>\n\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n ({ as, disabled, href, ...rest }, ref) => (\n <StyledLink\n as={as || (!href ? 'button' : undefined)}\n noCapsize={!href ? true : undefined}\n href={href}\n {...(disabled && { disabled: true })}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref as any}\n />\n )\n)\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","Link","React","as","disabled","href","rest","ref","getExternalAnchorProps"],"mappings":"uIAOa,MAAAA,EAAaC,EACxB,IACA,CACE,KAAM,CACJ,aACA,mBACA,iBACA,YACA,eACA,yBACA,kBACA,yBACA,kBACA,2BACA,8BACA,sBACA,+BACA,yDACA,0DACA,sDACF,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,UAAW,gBAAiB,kBAAkB,EACnD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,EACpD,GAAI,CAAC,UAAW,iBAAkB,kBAAkB,CACtD,EACA,UAAW,CACT,KAAM,CAAC,iBAAkB,eAAe,CAC1C,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAOaC,EAAOC,EAAM,WACxB,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAK,EAAGC,IAChCL,EAAA,cAACH,EACC,CAAA,GAAII,IAAQE,EAAkB,OAAX,UACnB,UAAYA,EAAc,OAAP,GACnB,KAAMA,EACL,GAAID,GAAY,CAAE,SAAU,EAAK,EACjC,GAAGE,EACH,GAAGE,EAAuBH,CAAI,EAC/B,IAAKE,CAAAA,CACP,CAEJ,EAEAN,EAAK,YAAc"}
@@ -1,2 +1,2 @@
1
- const e=["[--navigation-menu-vertical-item-font-weight:400]","data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]","border-none","outline-none","bg-none","decoration-[inherit]","cursor-pointer","rounded-xl","flex","items-center","p-2","pl-(--navigation-menu-vertical-item-pl)","w-full","text-(--text)","bg-(--background)","disabled:cursor-not-allowed","[text-decoration:unset]","disabled:opacity-30","not-disabled:active:bg-(--background-active)","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:bg-(--background-hover)","data-active:bg-(--background-selected)","data-active:text-(--text-selected)","data-active:[--navigation-menu-vertical-item-font-weight:600]"];export{e as navigationMenuVerticalItemStyles};
1
+ const e=["[--navigation-menu-vertical-item-font-weight:400]","data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]","border-none","outline-none","bg-none","decoration-[inherit]","cursor-pointer","rounded-lg","flex","items-center","p-2","pl-(--navigation-menu-vertical-item-pl)","w-full","text-(--text)","bg-(--background)","disabled:cursor-not-allowed","[text-decoration:unset]","disabled:opacity-30","not-disabled:active:bg-(--background-active)","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:bg-(--background-hover)","data-active:bg-(--background-selected)","data-active:text-(--text-selected)","data-active:[--navigation-menu-vertical-item-font-weight:600]"];export{e as navigationMenuVerticalItemStyles};
2
2
  //# sourceMappingURL=NavigationMenuVertical.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuVertical.styles.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.styles.ts"],"sourcesContent":["export const navigationMenuVerticalItemStyles = [\n '[--navigation-menu-vertical-item-font-weight:400]',\n 'data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]',\n 'border-none',\n 'outline-none',\n 'bg-none',\n 'decoration-[inherit]',\n 'cursor-pointer',\n 'rounded-xl',\n 'flex',\n 'items-center',\n 'p-2',\n 'pl-(--navigation-menu-vertical-item-pl)',\n 'w-full',\n 'text-(--text)',\n 'bg-(--background)',\n 'disabled:cursor-not-allowed',\n '[text-decoration:unset]',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--background-active)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--background-hover)',\n 'data-active:bg-(--background-selected)',\n 'data-active:text-(--text-selected)',\n 'data-active:[--navigation-menu-vertical-item-font-weight:600]'\n]\n"],"names":["navigationMenuVerticalItemStyles"],"mappings":"AAAO,MAAMA,EAAmC,CAC9C,oDACA,sEACA,cACA,eACA,UACA,uBACA,iBACA,aACA,OACA,eACA,MACA,0CACA,SACA,gBACA,oBACA,8BACA,0BACA,sBACA,+CACA,0CACA,sCACA,+EACA,4DACA,iCACA,6CACA,yCACA,qCACA,+DACF"}
1
+ {"version":3,"file":"NavigationMenuVertical.styles.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.styles.ts"],"sourcesContent":["export const navigationMenuVerticalItemStyles = [\n '[--navigation-menu-vertical-item-font-weight:400]',\n 'data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]',\n 'border-none',\n 'outline-none',\n 'bg-none',\n 'decoration-[inherit]',\n 'cursor-pointer',\n 'rounded-lg',\n 'flex',\n 'items-center',\n 'p-2',\n 'pl-(--navigation-menu-vertical-item-pl)',\n 'w-full',\n 'text-(--text)',\n 'bg-(--background)',\n 'disabled:cursor-not-allowed',\n '[text-decoration:unset]',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--background-active)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--background-hover)',\n 'data-active:bg-(--background-selected)',\n 'data-active:text-(--text-selected)',\n 'data-active:[--navigation-menu-vertical-item-font-weight:600]'\n]\n"],"names":["navigationMenuVerticalItemStyles"],"mappings":"AAAO,MAAMA,EAAmC,CAC9C,oDACA,sEACA,cACA,eACA,UACA,uBACA,iBACA,aACA,OACA,eACA,MACA,0CACA,SACA,gBACA,oBACA,8BACA,0BACA,sBACA,+CACA,0CACA,sCACA,+EACA,4DACA,iCACA,6CACA,yCACA,qCACA,+DACF"}
@@ -1,2 +1,2 @@
1
- import e from"react";import{Text as o}from"../text/Text.js";import{styled as i}from"../../styled.js";import"../side-bar/SideBar.js";import{useSidebarState as n}from"../side-bar/SideBarContext.js";const r=i(o,{base:["font-(--navigation-menu-vertical-item-font-weight)","leading-[1.2]","w-max","max-w-40","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[opacity,translate]"],variants:{isExpanded:{true:["opacity-100","motion-safe:translate-0"],false:["opacity-0","motion-safe:translate-x-2"]}}}),s=t=>{const{isExpanded:a}=n();return e.createElement(r,{size:"md",as:"span",...t,isExpanded:a})};export{s as NavigationMenuVerticalText};
1
+ import a from"react";import{Text as o}from"../text/Text.js";import{styled as i}from"../../styled.js";import"../side-bar/SideBar.js";import{useSidebarState as n}from"../side-bar/SideBarContext.js";const r=i(o,{base:["font-(--navigation-menu-vertical-item-font-weight)","w-max","max-w-40","text-left","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[opacity,translate]"],variants:{isExpanded:{true:["opacity-100","motion-safe:translate-0"],false:["opacity-0","motion-safe:translate-x-2"]}}}),s=t=>{const{isExpanded:e}=n();return a.createElement(r,{size:"md",as:"span",...t,isExpanded:e})};export{s as NavigationMenuVerticalText};
2
2
  //# sourceMappingURL=NavigationMenuVerticalText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuVerticalText.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'leading-[1.2]',\n 'w-max',\n 'max-w-40',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n isExpanded={isExpanded}\n />\n )\n}\n"],"names":["StyledNavigationMenuVerticalText","styled","Text","NavigationMenuVerticalText","props","isExpanded","useSidebarState","React"],"mappings":"oMAOA,MAAMA,EAAmCC,EAAOC,EAAM,CACpD,KAAM,CACJ,qDACA,gBACA,QACA,WACA,2BACA,uBACA,4CACF,EACA,SAAU,CACR,WAAY,CACV,KAAM,CAAC,cAAe,yBAAyB,EAC/C,MAAO,CAAC,YAAa,2BAA2B,CAClD,CACF,CACF,CAAC,EAMYC,EACXC,GACgB,CAChB,KAAM,CAAE,WAAAC,CAAW,EAAIC,IAEvB,OACEC,EAAA,cAACP,EAAA,CACC,KAAK,KACL,GAAG,OACF,GAAGI,EACJ,WAAYC,EACd,CAEJ"}
1
+ {"version":3,"file":"NavigationMenuVerticalText.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'w-max',\n 'max-w-40',\n 'text-left',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n isExpanded={isExpanded}\n />\n )\n}\n"],"names":["StyledNavigationMenuVerticalText","styled","Text","NavigationMenuVerticalText","props","isExpanded","useSidebarState","React"],"mappings":"oMAOA,MAAMA,EAAmCC,EAAOC,EAAM,CACpD,KAAM,CACJ,qDACA,QACA,WACA,YACA,2BACA,uBACA,4CACF,EACA,SAAU,CACR,WAAY,CACV,KAAM,CAAC,cAAe,yBAAyB,EAC/C,MAAO,CAAC,YAAa,2BAA2B,CAClD,CACF,CACF,CAAC,EAMYC,EACXC,GACgB,CAChB,KAAM,CAAE,WAAAC,CAAW,EAAIC,IAEvB,OACEC,EAAA,cAACP,EAAA,CACC,KAAK,KACL,GAAG,OACF,GAAGI,EACJ,WAAYC,EACd,CAEJ"}
@@ -1,2 +1,2 @@
1
- import*as t from"react";import{styled as l}from"../../styled.js";import{Tabs as v}from"../tabs/Tabs.js";import{SegmentedControlContext as g}from"./SegmentedControlContext.js";const b=l(v.TriggerList,{base:["relative","p-1","rounded-xl","overflow-hidden","[&>div[role=tablist]]:relative","[&>button]:z-2"],variants:{theme:{primary:["bg-primary-200"],marsh:["bg-marsh-200"]}}}),C=l("div",{base:["content-['']","absolute","bg-white","rounded-lg"],variants:{interacted:{true:["duration-300","ease-in","transition-all"],false:["transition-none"]}}}),w=s=>{const{theme:d,defaultValue:u,value:c}=t.useContext(g),a=t.useRef([]),i=t.Children.toArray(s.children).findIndex(e=>(e==null?void 0:e.props.value)===c),[m,f]=t.useState({left:0,height:0,width:0}),[h,p]=t.useState(!1),n=t.useCallback(()=>{const e=a.current[i];if(!e)return;const{width:o,height:r}=e.getBoundingClientRect();f({left:e.offsetLeft,height:r,width:o})},[i]);return t.useEffect(()=>{const e=new ResizeObserver(n),o=a.current;return o.forEach(r=>{r&&e.observe(r)}),()=>{o.forEach(r=>{r&&e.unobserve(r)}),e.disconnect()}},[i,n]),t.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n]),t.useEffect(()=>{n()},[i,n]),t.createElement(b,{theme:d,defaultValue:u,...s},t.createElement(C,{interacted:h,style:m}),t.Children.map(s.children,(e,o)=>{if(!t.isValidElement(e))throw new Error("Child passed to SegmentedControlItemList is not a valid element");return t.cloneElement(e,{onClick:r=>{p(!0),e.props.onClick&&e.props.onClick(r)},ref:r=>a.current[o]=r})}))};export{w as SegmentedControlItemList};
1
+ import*as t from"react";import{styled as l}from"../../styled.js";import{Tabs as v}from"../tabs/Tabs.js";import{SegmentedControlContext as g}from"./SegmentedControlContext.js";const b=l(v.TriggerList,{base:["relative","p-1","rounded-xl","overflow-hidden","[&>div[role=tablist]]:relative","[&>button]:z-2"],variants:{theme:{primary:["bg-primary-200"],marsh:["bg-marsh-200"]}}}),C=l("div",{base:["absolute","bg-white","rounded-lg"],variants:{interacted:{true:["duration-300","ease-in","transition-all"],false:["transition-none"]}}}),w=s=>{const{theme:d,defaultValue:u,value:c}=t.useContext(g),a=t.useRef([]),i=t.Children.toArray(s.children).findIndex(e=>(e==null?void 0:e.props.value)===c),[m,f]=t.useState({left:0,height:0,width:0}),[h,p]=t.useState(!1),n=t.useCallback(()=>{const e=a.current[i];if(!e)return;const{width:o,height:r}=e.getBoundingClientRect();f({left:e.offsetLeft,height:r,width:o})},[i]);return t.useEffect(()=>{const e=new ResizeObserver(n),o=a.current;return o.forEach(r=>{r&&e.observe(r)}),()=>{o.forEach(r=>{r&&e.unobserve(r)}),e.disconnect()}},[i,n]),t.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n]),t.useEffect(()=>{n()},[i,n]),t.createElement(b,{theme:d,defaultValue:u,...s},t.createElement(C,{interacted:h,style:m}),t.Children.map(s.children,(e,o)=>{if(!t.isValidElement(e))throw new Error("Child passed to SegmentedControlItemList is not a valid element");return t.cloneElement(e,{onClick:r=>{p(!0),e.props.onClick&&e.props.onClick(r)},ref:r=>a.current[o]=r})}))};export{w as SegmentedControlItemList};
2
2
  //# sourceMappingURL=SegmentedControlItemList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlItemList.js","sources":["../../../src/components/segmented-control/SegmentedControlItemList.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Tabs } from '../tabs'\nimport { SegmentedControlContext } from './SegmentedControlContext'\nimport { SegmentedControlItem } from './SegmentedControlItem'\n\nconst StyledTriggerList = styled(Tabs.TriggerList, {\n base: [\n 'relative',\n 'p-1',\n 'rounded-xl',\n 'overflow-hidden',\n '[&>div[role=tablist]]:relative',\n '[&>button]:z-2'\n ],\n variants: {\n theme: {\n primary: ['bg-primary-200'],\n marsh: ['bg-marsh-200']\n }\n }\n})\n\nconst SelectionIndicator = styled('div', {\n base: [\"content-['']\", 'absolute', 'bg-white', 'rounded-lg'],\n variants: {\n interacted: {\n true: ['duration-300', 'ease-in', 'transition-all'],\n false: ['transition-none']\n }\n }\n})\n\nexport const SegmentedControlItemList = (\n props: React.ComponentProps<typeof Tabs.TriggerList>\n): JSX.Element => {\n const { theme, defaultValue, value } = React.useContext(\n SegmentedControlContext\n )\n\n const tabsRef = React.useRef<(HTMLElement | null)[]>([])\n\n const selectedIndex = React.Children.toArray(props.children).findIndex(\n (child) => (child as React.ReactElement)?.props.value === value\n )\n\n const [indicatorStyles, setIndicatorStyles] = React.useState({\n left: 0,\n height: 0,\n width: 0\n })\n const [hasInteracted, setHasInteracted] = React.useState(false)\n\n const updateIndicatorPosition = React.useCallback(() => {\n const currentTab = tabsRef.current[selectedIndex]\n if (!currentTab) return\n\n const { width, height } = currentTab.getBoundingClientRect()\n setIndicatorStyles({ left: currentTab.offsetLeft, height, width })\n }, [selectedIndex])\n\n React.useEffect(() => {\n const resizeObserver = new ResizeObserver(updateIndicatorPosition)\n const currentTabs = tabsRef.current\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.observe(tab)\n })\n\n return () => {\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.unobserve(tab)\n })\n resizeObserver.disconnect()\n }\n }, [selectedIndex, updateIndicatorPosition])\n\n React.useEffect(() => {\n window.addEventListener('resize', updateIndicatorPosition)\n return () => {\n window.removeEventListener('resize', updateIndicatorPosition)\n }\n }, [updateIndicatorPosition])\n\n React.useEffect(() => {\n updateIndicatorPosition()\n }, [selectedIndex, updateIndicatorPosition])\n\n return (\n <StyledTriggerList theme={theme} defaultValue={defaultValue} {...props}>\n <SelectionIndicator interacted={hasInteracted} style={indicatorStyles} />\n {React.Children.map(props.children, (child, index) => {\n if (!React.isValidElement(child)) {\n throw new Error(\n `Child passed to SegmentedControlItemList is not a valid element`\n )\n }\n\n return React.cloneElement(\n child as React.ReactElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >,\n {\n onClick: (e) => {\n setHasInteracted(true)\n if (child.props.onClick) child.props.onClick(e)\n },\n ref: (el) => (tabsRef.current[index] = el)\n }\n )\n })}\n </StyledTriggerList>\n )\n}\n"],"names":["StyledTriggerList","styled","Tabs","SelectionIndicator","SegmentedControlItemList","props","theme","defaultValue","value","React","SegmentedControlContext","tabsRef","selectedIndex","child","indicatorStyles","setIndicatorStyles","hasInteracted","setHasInteracted","updateIndicatorPosition","currentTab","width","height","resizeObserver","currentTabs","tab","index","e","el"],"mappings":"+KAQA,MAAMA,EAAoBC,EAAOC,EAAK,YAAa,CACjD,KAAM,CACJ,WACA,MACA,aACA,kBACA,iCACA,gBACF,EACA,SAAU,CACR,MAAO,CACL,QAAS,CAAC,gBAAgB,EAC1B,MAAO,CAAC,cAAc,CACxB,CACF,CACF,CAAC,EAEKC,EAAqBF,EAAO,MAAO,CACvC,KAAM,CAAC,eAAgB,WAAY,WAAY,YAAY,EAC3D,SAAU,CACR,WAAY,CACV,KAAM,CAAC,eAAgB,UAAW,gBAAgB,EAClD,MAAO,CAAC,iBAAiB,CAC3B,CACF,CACF,CAAC,EAEYG,EACXC,GACgB,CAChB,KAAM,CAAE,MAAAC,EAAO,aAAAC,EAAc,MAAAC,CAAM,EAAIC,EAAM,WAC3CC,CACF,EAEMC,EAAUF,EAAM,OAA+B,CAAE,CAAA,EAEjDG,EAAgBH,EAAM,SAAS,QAAQJ,EAAM,QAAQ,EAAE,UAC1DQ,IAAWA,GAAA,KAAA,OAAAA,EAA8B,MAAM,SAAUL,CAC5D,EAEM,CAACM,EAAiBC,CAAkB,EAAIN,EAAM,SAAS,CAC3D,KAAM,EACN,OAAQ,EACR,MAAO,CACT,CAAC,EACK,CAACO,EAAeC,CAAgB,EAAIR,EAAM,SAAS,EAAK,EAExDS,EAA0BT,EAAM,YAAY,IAAM,CACtD,MAAMU,EAAaR,EAAQ,QAAQC,CAAa,EAChD,GAAI,CAACO,EAAY,OAEjB,KAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAIF,EAAW,sBAAsB,EAC3DJ,EAAmB,CAAE,KAAMI,EAAW,WAAY,OAAAE,EAAQ,MAAAD,CAAM,CAAC,CACnE,EAAG,CAACR,CAAa,CAAC,EAElB,OAAAH,EAAM,UAAU,IAAM,CACpB,MAAMa,EAAiB,IAAI,eAAeJ,CAAuB,EAC3DK,EAAcZ,EAAQ,QAC5B,OAAAY,EAAY,QAASC,GAAQ,CACvBA,GAAKF,EAAe,QAAQE,CAAG,CACrC,CAAC,EAEM,IAAM,CACXD,EAAY,QAASC,GAAQ,CACvBA,GAAKF,EAAe,UAAUE,CAAG,CACvC,CAAC,EACDF,EAAe,WACjB,CAAA,CACF,EAAG,CAACV,EAAeM,CAAuB,CAAC,EAE3CT,EAAM,UAAU,KACd,OAAO,iBAAiB,SAAUS,CAAuB,EAClD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAuB,CAC9D,GACC,CAACA,CAAuB,CAAC,EAE5BT,EAAM,UAAU,IAAM,CACpBS,EACF,CAAA,EAAG,CAACN,EAAeM,CAAuB,CAAC,EAGzCT,EAAA,cAACT,EAAA,CAAkB,MAAOM,EAAO,aAAcC,EAAe,GAAGF,CAC/DI,EAAAA,EAAA,cAACN,EAAA,CAAmB,WAAYa,EAAe,MAAOF,CAAiB,CAAA,EACtEL,EAAM,SAAS,IAAIJ,EAAM,SAAU,CAACQ,EAAOY,IAAU,CACpD,GAAI,CAAChB,EAAM,eAAeI,CAAK,EAC7B,MAAM,IAAI,MACR,iEACF,EAGF,OAAOJ,EAAM,aACXI,EAGA,CACE,QAAUa,GAAM,CACdT,EAAiB,EAAI,EACjBJ,EAAM,MAAM,SAASA,EAAM,MAAM,QAAQa,CAAC,CAChD,EACA,IAAMC,GAAQhB,EAAQ,QAAQc,CAAK,EAAIE,CACzC,CACF,CACF,CAAC,CACH,CAEJ"}
1
+ {"version":3,"file":"SegmentedControlItemList.js","sources":["../../../src/components/segmented-control/SegmentedControlItemList.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Tabs } from '../tabs'\nimport { SegmentedControlContext } from './SegmentedControlContext'\nimport { SegmentedControlItem } from './SegmentedControlItem'\n\nconst StyledTriggerList = styled(Tabs.TriggerList, {\n base: [\n 'relative',\n 'p-1',\n 'rounded-xl',\n 'overflow-hidden',\n '[&>div[role=tablist]]:relative',\n '[&>button]:z-2'\n ],\n variants: {\n theme: {\n primary: ['bg-primary-200'],\n marsh: ['bg-marsh-200']\n }\n }\n})\n\nconst SelectionIndicator = styled('div', {\n base: ['absolute', 'bg-white', 'rounded-lg'],\n variants: {\n interacted: {\n true: ['duration-300', 'ease-in', 'transition-all'],\n false: ['transition-none']\n }\n }\n})\n\nexport const SegmentedControlItemList = (\n props: React.ComponentProps<typeof Tabs.TriggerList>\n): JSX.Element => {\n const { theme, defaultValue, value } = React.useContext(\n SegmentedControlContext\n )\n\n const tabsRef = React.useRef<(HTMLElement | null)[]>([])\n\n const selectedIndex = React.Children.toArray(props.children).findIndex(\n (child) => (child as React.ReactElement)?.props.value === value\n )\n\n const [indicatorStyles, setIndicatorStyles] = React.useState({\n left: 0,\n height: 0,\n width: 0\n })\n const [hasInteracted, setHasInteracted] = React.useState(false)\n\n const updateIndicatorPosition = React.useCallback(() => {\n const currentTab = tabsRef.current[selectedIndex]\n if (!currentTab) return\n\n const { width, height } = currentTab.getBoundingClientRect()\n setIndicatorStyles({ left: currentTab.offsetLeft, height, width })\n }, [selectedIndex])\n\n React.useEffect(() => {\n const resizeObserver = new ResizeObserver(updateIndicatorPosition)\n const currentTabs = tabsRef.current\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.observe(tab)\n })\n\n return () => {\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.unobserve(tab)\n })\n resizeObserver.disconnect()\n }\n }, [selectedIndex, updateIndicatorPosition])\n\n React.useEffect(() => {\n window.addEventListener('resize', updateIndicatorPosition)\n return () => {\n window.removeEventListener('resize', updateIndicatorPosition)\n }\n }, [updateIndicatorPosition])\n\n React.useEffect(() => {\n updateIndicatorPosition()\n }, [selectedIndex, updateIndicatorPosition])\n\n return (\n <StyledTriggerList theme={theme} defaultValue={defaultValue} {...props}>\n <SelectionIndicator interacted={hasInteracted} style={indicatorStyles} />\n {React.Children.map(props.children, (child, index) => {\n if (!React.isValidElement(child)) {\n throw new Error(\n `Child passed to SegmentedControlItemList is not a valid element`\n )\n }\n\n return React.cloneElement(\n child as React.ReactElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >,\n {\n onClick: (e) => {\n setHasInteracted(true)\n if (child.props.onClick) child.props.onClick(e)\n },\n ref: (el) => (tabsRef.current[index] = el)\n }\n )\n })}\n </StyledTriggerList>\n )\n}\n"],"names":["StyledTriggerList","styled","Tabs","SelectionIndicator","SegmentedControlItemList","props","theme","defaultValue","value","React","SegmentedControlContext","tabsRef","selectedIndex","child","indicatorStyles","setIndicatorStyles","hasInteracted","setHasInteracted","updateIndicatorPosition","currentTab","width","height","resizeObserver","currentTabs","tab","index","e","el"],"mappings":"+KAQA,MAAMA,EAAoBC,EAAOC,EAAK,YAAa,CACjD,KAAM,CACJ,WACA,MACA,aACA,kBACA,iCACA,gBACF,EACA,SAAU,CACR,MAAO,CACL,QAAS,CAAC,gBAAgB,EAC1B,MAAO,CAAC,cAAc,CACxB,CACF,CACF,CAAC,EAEKC,EAAqBF,EAAO,MAAO,CACvC,KAAM,CAAC,WAAY,WAAY,YAAY,EAC3C,SAAU,CACR,WAAY,CACV,KAAM,CAAC,eAAgB,UAAW,gBAAgB,EAClD,MAAO,CAAC,iBAAiB,CAC3B,CACF,CACF,CAAC,EAEYG,EACXC,GACgB,CAChB,KAAM,CAAE,MAAAC,EAAO,aAAAC,EAAc,MAAAC,CAAM,EAAIC,EAAM,WAC3CC,CACF,EAEMC,EAAUF,EAAM,OAA+B,CAAA,CAAE,EAEjDG,EAAgBH,EAAM,SAAS,QAAQJ,EAAM,QAAQ,EAAE,UAC1DQ,IAAWA,GAAA,KAAA,OAAAA,EAA8B,MAAM,SAAUL,CAC5D,EAEM,CAACM,EAAiBC,CAAkB,EAAIN,EAAM,SAAS,CAC3D,KAAM,EACN,OAAQ,EACR,MAAO,CACT,CAAC,EACK,CAACO,EAAeC,CAAgB,EAAIR,EAAM,SAAS,EAAK,EAExDS,EAA0BT,EAAM,YAAY,IAAM,CACtD,MAAMU,EAAaR,EAAQ,QAAQC,CAAa,EAChD,GAAI,CAACO,EAAY,OAEjB,KAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAIF,EAAW,sBAAsB,EAC3DJ,EAAmB,CAAE,KAAMI,EAAW,WAAY,OAAAE,EAAQ,MAAAD,CAAM,CAAC,CACnE,EAAG,CAACR,CAAa,CAAC,EAElB,OAAAH,EAAM,UAAU,IAAM,CACpB,MAAMa,EAAiB,IAAI,eAAeJ,CAAuB,EAC3DK,EAAcZ,EAAQ,QAC5B,OAAAY,EAAY,QAASC,GAAQ,CACvBA,GAAKF,EAAe,QAAQE,CAAG,CACrC,CAAC,EAEM,IAAM,CACXD,EAAY,QAASC,GAAQ,CACvBA,GAAKF,EAAe,UAAUE,CAAG,CACvC,CAAC,EACDF,EAAe,YACjB,CACF,EAAG,CAACV,EAAeM,CAAuB,CAAC,EAE3CT,EAAM,UAAU,KACd,OAAO,iBAAiB,SAAUS,CAAuB,EAClD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAuB,CAC9D,GACC,CAACA,CAAuB,CAAC,EAE5BT,EAAM,UAAU,IAAM,CACpBS,EAAwB,CAC1B,EAAG,CAACN,EAAeM,CAAuB,CAAC,EAGzCT,EAAA,cAACT,EAAA,CAAkB,MAAOM,EAAO,aAAcC,EAAe,GAAGF,CAC/DI,EAAAA,EAAA,cAACN,EAAA,CAAmB,WAAYa,EAAe,MAAOF,CAAiB,CAAA,EACtEL,EAAM,SAAS,IAAIJ,EAAM,SAAU,CAACQ,EAAOY,IAAU,CACpD,GAAI,CAAChB,EAAM,eAAeI,CAAK,EAC7B,MAAM,IAAI,MACR,iEACF,EAGF,OAAOJ,EAAM,aACXI,EAGA,CACE,QAAUa,GAAM,CACdT,EAAiB,EAAI,EACjBJ,EAAM,MAAM,SAASA,EAAM,MAAM,QAAQa,CAAC,CAChD,EACA,IAAMC,GAAQhB,EAAQ,QAAQc,CAAK,EAAIE,CACzC,CACF,CACF,CAAC,CACH,CAEJ"}
@@ -1,2 +1,2 @@
1
- import*as o from"react";import{styled as v}from"../../styled.js";import{Tabs as c}from"../tabs/Tabs.js";import{SegmentedControlContext as f}from"./SegmentedControlContext.js";const p=v(c,{base:["[&>div]:border-none"],variants:{size:{sm:["w-[unset]"],md:[],lg:[]}}},{enabledResponsiveVariants:!0}),C=({size:n,theme:s="primary",defaultValue:e,children:i,...t})=>{const a=t.value!==void 0,[u,m]=o.useState(e),r=a?t.value:u,l=a?t.onValueChange:m;o.useEffect(()=>{!a&&e&&m(e)},[e,a]);const d=o.useMemo(()=>({size:n,theme:s,defaultValue:e,onValueChange:l,value:r}),[n,s,e,l,r]);return o.createElement(f.Provider,{value:d},o.createElement(p,{size:n,value:r,onValueChange:l,...t},i))};export{C as SegmentedControlRoot};
1
+ import*as o from"react";import{styled as v}from"../../styled.js";import{Tabs as c}from"../tabs/Tabs.js";import{SegmentedControlContext as f}from"./SegmentedControlContext.js";const p=v(c,{base:["[&>div]:border-none"],variants:{size:{sm:["w-[unset]!"],md:[],lg:[]}}},{enabledResponsiveVariants:!0}),C=({size:n,theme:s="primary",defaultValue:e,children:i,...t})=>{const a=t.value!==void 0,[u,m]=o.useState(e),r=a?t.value:u,l=a?t.onValueChange:m;o.useEffect(()=>{!a&&e&&m(e)},[e,a]);const d=o.useMemo(()=>({size:n,theme:s,defaultValue:e,onValueChange:l,value:r}),[n,s,e,l,r]);return o.createElement(f.Provider,{value:d},o.createElement(p,{size:n,value:r,onValueChange:l,...t},i))};export{C as SegmentedControlRoot};
2
2
  //# sourceMappingURL=SegmentedControlRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlRoot.js","sources":["../../../src/components/segmented-control/SegmentedControlRoot.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Tabs } from '../tabs'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst StyledSegmentedControlRoot = styled(\n Tabs,\n {\n base: ['[&>div]:border-none'],\n variants: {\n size: {\n sm: ['w-[unset]'],\n md: [],\n lg: []\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nexport interface SegmentedControlRootProps\n extends React.ComponentProps<typeof StyledSegmentedControlRoot> {\n theme?: SegmentedControlTheme\n}\n\nexport const SegmentedControlRoot = ({\n size,\n theme = 'primary',\n defaultValue,\n children,\n ...props\n}: React.PropsWithChildren<SegmentedControlRootProps>): React.JSX.Element => {\n const isControlled = props.value !== undefined\n\n const [internalValue, setInternalValue] = React.useState(defaultValue)\n\n const currentValue = isControlled ? props.value : internalValue\n const handleValueChange = isControlled\n ? props.onValueChange\n : setInternalValue\n\n React.useEffect(() => {\n if (!isControlled && defaultValue) {\n setInternalValue(defaultValue)\n }\n }, [defaultValue, isControlled])\n\n const value = React.useMemo(\n () => ({\n size,\n theme,\n defaultValue,\n onValueChange: handleValueChange,\n value: currentValue\n }),\n [size, theme, defaultValue, handleValueChange, currentValue]\n )\n\n return (\n <SegmentedControlContext.Provider value={value}>\n <StyledSegmentedControlRoot\n size={size}\n value={currentValue}\n onValueChange={handleValueChange}\n {...props}\n >\n {children}\n </StyledSegmentedControlRoot>\n </SegmentedControlContext.Provider>\n )\n}\n"],"names":["StyledSegmentedControlRoot","styled","Tabs","SegmentedControlRoot","size","theme","defaultValue","children","props","isControlled","internalValue","setInternalValue","React","currentValue","handleValueChange","value","SegmentedControlContext"],"mappings":"+KAQA,MAAMA,EAA6BC,EACjCC,EACA,CACE,KAAM,CAAC,qBAAqB,EAC5B,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,WAAW,EAChB,GAAI,GACJ,GAAI,CACN,CAAA,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAOaC,EAAuB,CAAC,CACnC,KAAAC,EACA,MAAAC,EAAQ,UACR,aAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAA6E,CAC3E,MAAMC,EAAeD,EAAM,QAAU,OAE/B,CAACE,EAAeC,CAAgB,EAAIC,EAAM,SAASN,CAAY,EAE/DO,EAAeJ,EAAeD,EAAM,MAAQE,EAC5CI,EAAoBL,EACtBD,EAAM,cACNG,EAEJC,EAAM,UAAU,IAAM,CAChB,CAACH,GAAgBH,GACnBK,EAAiBL,CAAY,CAEjC,EAAG,CAACA,EAAcG,CAAY,CAAC,EAE/B,MAAMM,EAAQH,EAAM,QAClB,KAAO,CACL,KAAAR,EACA,MAAAC,EACA,aAAAC,EACA,cAAeQ,EACf,MAAOD,CACT,GACA,CAACT,EAAMC,EAAOC,EAAcQ,EAAmBD,CAAY,CAC7D,EAEA,OACED,EAAA,cAACI,EAAwB,SAAxB,CAAiC,MAAOD,CACvCH,EAAAA,EAAA,cAACZ,EAAA,CACC,KAAMI,EACN,MAAOS,EACP,cAAeC,EACd,GAAGN,CAEHD,EAAAA,CACH,CACF,CAEJ"}
1
+ {"version":3,"file":"SegmentedControlRoot.js","sources":["../../../src/components/segmented-control/SegmentedControlRoot.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Tabs } from '../tabs'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst StyledSegmentedControlRoot = styled(\n Tabs,\n {\n base: ['[&>div]:border-none'],\n variants: {\n size: {\n sm: ['w-[unset]!'],\n md: [],\n lg: []\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nexport interface SegmentedControlRootProps\n extends React.ComponentProps<typeof StyledSegmentedControlRoot> {\n theme?: SegmentedControlTheme\n}\n\nexport const SegmentedControlRoot = ({\n size,\n theme = 'primary',\n defaultValue,\n children,\n ...props\n}: React.PropsWithChildren<SegmentedControlRootProps>): React.JSX.Element => {\n const isControlled = props.value !== undefined\n\n const [internalValue, setInternalValue] = React.useState(defaultValue)\n\n const currentValue = isControlled ? props.value : internalValue\n const handleValueChange = isControlled\n ? props.onValueChange\n : setInternalValue\n\n React.useEffect(() => {\n if (!isControlled && defaultValue) {\n setInternalValue(defaultValue)\n }\n }, [defaultValue, isControlled])\n\n const value = React.useMemo(\n () => ({\n size,\n theme,\n defaultValue,\n onValueChange: handleValueChange,\n value: currentValue\n }),\n [size, theme, defaultValue, handleValueChange, currentValue]\n )\n\n return (\n <SegmentedControlContext.Provider value={value}>\n <StyledSegmentedControlRoot\n size={size}\n value={currentValue}\n onValueChange={handleValueChange}\n {...props}\n >\n {children}\n </StyledSegmentedControlRoot>\n </SegmentedControlContext.Provider>\n )\n}\n"],"names":["StyledSegmentedControlRoot","styled","Tabs","SegmentedControlRoot","size","theme","defaultValue","children","props","isControlled","internalValue","setInternalValue","React","currentValue","handleValueChange","value","SegmentedControlContext"],"mappings":"+KAQA,MAAMA,EAA6BC,EACjCC,EACA,CACE,KAAM,CAAC,qBAAqB,EAC5B,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,YAAY,EACjB,GAAI,GACJ,GAAI,CACN,CAAA,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAOaC,EAAuB,CAAC,CACnC,KAAAC,EACA,MAAAC,EAAQ,UACR,aAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAA6E,CAC3E,MAAMC,EAAeD,EAAM,QAAU,OAE/B,CAACE,EAAeC,CAAgB,EAAIC,EAAM,SAASN,CAAY,EAE/DO,EAAeJ,EAAeD,EAAM,MAAQE,EAC5CI,EAAoBL,EACtBD,EAAM,cACNG,EAEJC,EAAM,UAAU,IAAM,CAChB,CAACH,GAAgBH,GACnBK,EAAiBL,CAAY,CAEjC,EAAG,CAACA,EAAcG,CAAY,CAAC,EAE/B,MAAMM,EAAQH,EAAM,QAClB,KAAO,CACL,KAAAR,EACA,MAAAC,EACA,aAAAC,EACA,cAAeQ,EACf,MAAOD,CACT,GACA,CAACT,EAAMC,EAAOC,EAAcQ,EAAmBD,CAAY,CAC7D,EAEA,OACED,EAAA,cAACI,EAAwB,SAAxB,CAAiC,MAAOD,CACvCH,EAAAA,EAAA,cAACZ,EAAA,CACC,KAAMI,EACN,MAAOS,EACP,cAAeC,EACd,GAAGN,CAEHD,EAAAA,CACH,CACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- import{styled as e}from"../../styled.js";import{Flex as t}from"../flex/Flex.js";const r=e(t,{base:["relative","p-2","justify-center","items-center","size-8","rounded-[50%]","border-none","bg-grey-200","z-1","flex-none"],variants:{status:{default:["bg-grey-200","text-grey-700"],active:["bg-white","border-2","border-current","text-primary-900"],viewed:["bg-white","border-2","border-grey-600","text-grey-1000"],completed:["bg-primary-800","text-white"],reviewed:["bg-primary-900","text-white"],success:["bg-success","text-white"]}}});export{r as StepperStepBullet};
1
+ import{styled as e}from"../../styled.js";import{Flex as t}from"../flex/Flex.js";const r=e(t,{base:["relative","p-2","justify-center","items-center","size-8","rounded-[50%]","border-0","bg-grey-200","z-1","flex-none"],variants:{status:{default:["bg-grey-200","text-grey-700"],active:["bg-white","border-2","border-current","text-primary-900"],viewed:["bg-white","border-2","border-grey-600","text-grey-1000"],completed:["bg-primary-800","text-white"],reviewed:["bg-primary-900","text-white"],success:["bg-success","text-white"]}}});export{r as StepperStepBullet};
2
2
  //# sourceMappingURL=StepperStepBullet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepperStepBullet.js","sources":["../../../src/components/stepper/StepperStepBullet.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nimport { Flex } from '../flex'\n\nexport const StepperStepBullet = styled(Flex, {\n base: [\n 'relative',\n 'p-2',\n 'justify-center',\n 'items-center',\n 'size-8',\n 'rounded-[50%]',\n 'border-none',\n 'bg-grey-200',\n 'z-1',\n 'flex-none'\n ],\n variants: {\n status: {\n default: ['bg-grey-200', 'text-grey-700'],\n active: ['bg-white', 'border-2', 'border-current', 'text-primary-900'],\n viewed: ['bg-white', 'border-2', 'border-grey-600', 'text-grey-1000'],\n completed: ['bg-primary-800', 'text-white'],\n reviewed: ['bg-primary-900', 'text-white'],\n success: ['bg-success', 'text-white']\n }\n }\n})\n"],"names":["StepperStepBullet","styled","Flex"],"mappings":"gFAIO,MAAMA,EAAoBC,EAAOC,EAAM,CAC5C,KAAM,CACJ,WACA,MACA,iBACA,eACA,SACA,gBACA,cACA,cACA,MACA,WACF,EACA,SAAU,CACR,OAAQ,CACN,QAAS,CAAC,cAAe,eAAe,EACxC,OAAQ,CAAC,WAAY,WAAY,iBAAkB,kBAAkB,EACrE,OAAQ,CAAC,WAAY,WAAY,kBAAmB,gBAAgB,EACpE,UAAW,CAAC,iBAAkB,YAAY,EAC1C,SAAU,CAAC,iBAAkB,YAAY,EACzC,QAAS,CAAC,aAAc,YAAY,CACtC,CACF,CACF,CAAC"}
1
+ {"version":3,"file":"StepperStepBullet.js","sources":["../../../src/components/stepper/StepperStepBullet.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nimport { Flex } from '../flex'\n\nexport const StepperStepBullet = styled(Flex, {\n base: [\n 'relative',\n 'p-2',\n 'justify-center',\n 'items-center',\n 'size-8',\n 'rounded-[50%]',\n 'border-0',\n 'bg-grey-200',\n 'z-1',\n 'flex-none'\n ],\n variants: {\n status: {\n default: ['bg-grey-200', 'text-grey-700'],\n active: ['bg-white', 'border-2', 'border-current', 'text-primary-900'],\n viewed: ['bg-white', 'border-2', 'border-grey-600', 'text-grey-1000'],\n completed: ['bg-primary-800', 'text-white'],\n reviewed: ['bg-primary-900', 'text-white'],\n success: ['bg-success', 'text-white']\n }\n }\n})\n"],"names":["StepperStepBullet","styled","Flex"],"mappings":"gFAIO,MAAMA,EAAoBC,EAAOC,EAAM,CAC5C,KAAM,CACJ,WACA,MACA,iBACA,eACA,SACA,gBACA,WACA,cACA,MACA,WACF,EACA,SAAU,CACR,OAAQ,CACN,QAAS,CAAC,cAAe,eAAe,EACxC,OAAQ,CAAC,WAAY,WAAY,iBAAkB,kBAAkB,EACrE,OAAQ,CAAC,WAAY,WAAY,kBAAmB,gBAAgB,EACpE,UAAW,CAAC,iBAAkB,YAAY,EAC1C,SAAU,CAAC,iBAAkB,YAAY,EACzC,QAAS,CAAC,aAAc,YAAY,CACtC,CACF,CACF,CAAC"}
@@ -1,2 +1,2 @@
1
- import{Ok as f}from"@atom-learning/icons";import*as l from"react";import{styled as v}from"../../styled.js";import{Flex as h}from"../flex/Flex.js";import{Icon as I}from"../icon/Icon.js";import{useStepper as D}from"./stepper-context/StepperContext.js";import{StepperStepBullet as T}from"./StepperStepBullet.js";import{StepperStepContainer as w}from"./StepperStepContainer.js";import{StepperStepLabel as L}from"./StepperStepLabel.js";import{Status as t}from"./types.js";const U=v(h,{base:["justify-between"],variants:{direction:{vertical:["flex-col"],horizontal:["flex-row"]}}}),g=({className:S})=>{const{steps:o,goToStep:m,activeStep:r,viewedSteps:i,allowSkip:n,direction:p,hideLabels:E,completedSteps:c,showCompletedIcons:u}=D(),d=s=>{const e=o[s];return e.status?e.status:c.length===o.length?t.SUCCESS:r===s&&c.includes(r)?t.REVIEWED:r===s?t.ACTIVE:c.includes(s)?t.COMPLETED:i.includes(s)?t.VIEWED:t.DEFAULT},C=s=>{var e;const a=(e=o[s])==null?void 0:e.status;return c.length===o.length?t.SUCCESS:a===t.SUCCESS?t.SUCCESS:a===t.COMPLETED||s<Math.max(...i)?t.ACTIVE:a===t.VIEWED?t.VIEWED:t.DEFAULT};return l.createElement(U,{className:S,direction:p},o.map((s,e)=>{const a=d(e),b=C(e);return l.createElement(w,{tabIndex:0,key:`step_${e}`,direction:p,separator:b,status:a,style:{"--steps":o.length},className:p==="horizontal"?"w-[calc(100%/var(--steps, 0))]":"h-[calc(100%/var(--steps, 0))]",canInteract:n},l.createElement(T,{as:n?"button":"div",onClick:()=>n&&i.includes(e)?m==null?void 0:m(e):void 0,status:a,"aria-current":e===r?"step":void 0,"aria-label":s.label?"":`step ${e+1}`,"aria-labelledby":s.label?`step-${e}`:void 0,className:n&&i.includes(e)?"cursor-pointer":"cursor-auto"},s.status===t.SUCCESS||u&&a===t.COMPLETED?l.createElement(I,{is:f}):e+1),s.label&&!E&&l.createElement(L,{as:"span",id:`step-${e}`,direction:p,status:a},s.label))}))};export{g as StepperSteps};
1
+ import{Ok as f}from"@atom-learning/icons";import*as l from"react";import{styled as v}from"../../styled.js";import{Flex as h}from"../flex/Flex.js";import{Icon as I}from"../icon/Icon.js";import{useStepper as D}from"./stepper-context/StepperContext.js";import{StepperStepBullet as T}from"./StepperStepBullet.js";import{StepperStepContainer as w}from"./StepperStepContainer.js";import{StepperStepLabel as L}from"./StepperStepLabel.js";import{Status as t}from"./types.js";const U=v(h,{base:["justify-between"],variants:{direction:{vertical:["flex-col"],horizontal:["flex-row"]}}}),g=({className:S})=>{const{steps:o,goToStep:m,activeStep:r,viewedSteps:i,allowSkip:n,direction:p,hideLabels:E,completedSteps:c,showCompletedIcons:u}=D(),d=s=>{const e=o[s];return e.status?e.status:c.length===o.length?t.SUCCESS:r===s&&c.includes(r)?t.REVIEWED:r===s?t.ACTIVE:c.includes(s)?t.COMPLETED:i.includes(s)?t.VIEWED:t.DEFAULT},C=s=>{var e;const a=(e=o[s])==null?void 0:e.status;return c.length===o.length?t.SUCCESS:a===t.SUCCESS?t.SUCCESS:a===t.COMPLETED||s<Math.max(...i)?t.ACTIVE:a===t.VIEWED?t.VIEWED:t.DEFAULT};return l.createElement(U,{className:S,direction:p},o.map((s,e)=>{const a=d(e),b=C(e);return l.createElement(w,{tabIndex:0,key:`step_${e}`,direction:p,separator:b,status:a,style:{"--steps":o.length||0},className:p==="horizontal"?"w-[calc(100%/var(--steps))]":"h-[calc(100%/var(--steps))]",canInteract:n},l.createElement(T,{as:n?"button":"div",onClick:()=>n&&i.includes(e)?m==null?void 0:m(e):void 0,status:a,"aria-current":e===r?"step":void 0,"aria-label":s.label?"":`step ${e+1}`,"aria-labelledby":s.label?`step-${e}`:void 0,className:n&&i.includes(e)?"cursor-pointer":"cursor-auto"},s.status===t.SUCCESS||u&&a===t.COMPLETED?l.createElement(I,{is:f}):e+1),s.label&&!E&&l.createElement(L,{as:"span",id:`step-${e}`,direction:p,status:a},s.label))}))};export{g as StepperSteps};
2
2
  //# sourceMappingURL=StepperSteps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepperSteps.js","sources":["../../../src/components/stepper/StepperSteps.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Flex } from '../flex'\nimport { Icon } from '../icon'\nimport { useStepper } from './stepper-context/StepperContext'\nimport { StepperStepBullet } from './StepperStepBullet'\nimport { StepperStepContainer } from './StepperStepContainer'\nimport { StepperStepLabel } from './StepperStepLabel'\nimport { IStepperStepsProps, Status } from './types'\n\nconst StepperStepsContainer = styled(Flex, {\n base: ['justify-between'],\n variants: {\n direction: {\n vertical: ['flex-col'],\n horizontal: ['flex-row']\n }\n }\n})\n\nexport const StepperSteps = ({ className }: IStepperStepsProps) => {\n const {\n steps,\n goToStep,\n activeStep,\n viewedSteps,\n allowSkip,\n direction,\n hideLabels,\n completedSteps,\n showCompletedIcons\n } = useStepper()\n\n const getBulletStatus = (index: number) => {\n const activeBullet = steps[index]\n\n if (activeBullet.status) return activeBullet.status\n if (completedSteps.length === steps.length) return Status.SUCCESS\n if (activeStep === index && completedSteps.includes(activeStep))\n return Status.REVIEWED\n if (activeStep === index) return Status.ACTIVE\n if (completedSteps.includes(index)) return Status.COMPLETED\n if (viewedSteps.includes(index)) return Status.VIEWED\n return Status.DEFAULT\n }\n\n const getSeparatorStatus = (index: number) => {\n const bulletStatus = steps[index]?.status\n\n if (completedSteps.length === steps.length) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.SUCCESS) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.COMPLETED || index < Math.max(...viewedSteps)) {\n return Status.ACTIVE\n }\n\n if (bulletStatus === Status.VIEWED) {\n return Status.VIEWED\n }\n\n return Status.DEFAULT\n }\n\n return (\n <StepperStepsContainer className={className} direction={direction}>\n {steps.map((step, index) => {\n const bulletStatus = getBulletStatus(index)\n const separatorStatus = getSeparatorStatus(index)\n\n return (\n <StepperStepContainer\n tabIndex={0}\n key={`step_${index}`}\n direction={direction}\n separator={separatorStatus}\n status={bulletStatus}\n style={{ '--steps': steps.length }}\n className={\n direction === 'horizontal'\n ? 'w-[calc(100%/var(--steps, 0))]'\n : 'h-[calc(100%/var(--steps, 0))]'\n }\n canInteract={allowSkip}\n >\n <StepperStepBullet\n as={allowSkip ? 'button' : 'div'}\n onClick={() =>\n allowSkip && viewedSteps.includes(index)\n ? goToStep?.(index)\n : undefined\n }\n status={bulletStatus}\n aria-current={index === activeStep ? 'step' : undefined}\n aria-label={!step.label ? `step ${index + 1}` : ''}\n aria-labelledby={step.label ? `step-${index}` : undefined}\n className={\n allowSkip && viewedSteps.includes(index)\n ? 'cursor-pointer'\n : 'cursor-auto'\n }\n >\n {step.status === Status.SUCCESS ||\n (showCompletedIcons && bulletStatus === Status.COMPLETED) ? (\n <Icon is={Ok} />\n ) : (\n index + 1\n )}\n </StepperStepBullet>\n\n {step.label && !hideLabels && (\n <StepperStepLabel\n as=\"span\"\n id={`step-${index}`}\n direction={direction}\n status={bulletStatus}\n >\n {step.label}\n </StepperStepLabel>\n )}\n </StepperStepContainer>\n )\n })}\n </StepperStepsContainer>\n )\n}\n"],"names":["StepperStepsContainer","styled","Flex","StepperSteps","className","steps","goToStep","activeStep","viewedSteps","allowSkip","direction","hideLabels","completedSteps","showCompletedIcons","useStepper","getBulletStatus","index","activeBullet","Status","getSeparatorStatus","_a","bulletStatus","React","step","separatorStatus","StepperStepContainer","StepperStepBullet","Icon","Ok","StepperStepLabel"],"mappings":"mdAaA,MAAMA,EAAwBC,EAAOC,EAAM,CACzC,KAAM,CAAC,iBAAiB,EACxB,SAAU,CACR,UAAW,CACT,SAAU,CAAC,UAAU,EACrB,WAAY,CAAC,UAAU,CACzB,CACF,CACF,CAAC,EAEYC,EAAe,CAAC,CAAE,UAAAC,CAAU,IAA0B,CACjE,KAAM,CACJ,MAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,eAAAC,EACA,mBAAAC,CACF,EAAIC,EAAAA,EAEEC,EAAmBC,GAAkB,CACzC,MAAMC,EAAeZ,EAAMW,CAAK,EAEhC,OAAIC,EAAa,OAAeA,EAAa,OACzCL,EAAe,SAAWP,EAAM,OAAea,EAAO,QACtDX,IAAeS,GAASJ,EAAe,SAASL,CAAU,EACrDW,EAAO,SACZX,IAAeS,EAAcE,EAAO,OACpCN,EAAe,SAASI,CAAK,EAAUE,EAAO,UAC9CV,EAAY,SAASQ,CAAK,EAAUE,EAAO,OACxCA,EAAO,OAChB,EAEMC,EAAsBH,GAAkB,CAjDhD,IAAAI,EAkDI,MAAMC,GAAeD,EAAAf,EAAMW,CAAK,IAAX,YAAAI,EAAc,OAEnC,OAAIR,EAAe,SAAWP,EAAM,OAC3Ba,EAAO,QAGZG,IAAiBH,EAAO,QACnBA,EAAO,QAGZG,IAAiBH,EAAO,WAAaF,EAAQ,KAAK,IAAI,GAAGR,CAAW,EAC/DU,EAAO,OAGZG,IAAiBH,EAAO,OACnBA,EAAO,OAGTA,EAAO,OAChB,EAEA,OACEI,EAAA,cAACtB,EAAA,CAAsB,UAAWI,EAAW,UAAWM,GACrDL,EAAM,IAAI,CAACkB,EAAMP,IAAU,CAC1B,MAAMK,EAAeN,EAAgBC,CAAK,EACpCQ,EAAkBL,EAAmBH,CAAK,EAEhD,OACEM,EAAA,cAACG,EAAA,CACC,SAAU,EACV,IAAK,QAAQT,CAAK,GAClB,UAAWN,EACX,UAAWc,EACX,OAAQH,EACR,MAAO,CAAE,UAAWhB,EAAM,MAAO,EACjC,UACEK,IAAc,aACV,iCACA,iCAEN,YAAaD,CAEba,EAAAA,EAAA,cAACI,EAAA,CACC,GAAIjB,EAAY,SAAW,MAC3B,QAAS,IACPA,GAAaD,EAAY,SAASQ,CAAK,EACnCV,GAAA,KAAA,OAAAA,EAAWU,CACX,EAAA,OAEN,OAAQK,EACR,eAAcL,IAAUT,EAAa,OAAS,OAC9C,aAAagB,EAAK,MAA8B,GAAtB,QAAQP,EAAQ,CAAC,GAC3C,kBAAiBO,EAAK,MAAQ,QAAQP,CAAK,GAAK,OAChD,UACEP,GAAaD,EAAY,SAASQ,CAAK,EACnC,iBACA,eAGLO,EAAK,SAAWL,EAAO,SACvBL,GAAsBQ,IAAiBH,EAAO,UAC7CI,EAAA,cAACK,EAAA,CAAK,GAAIC,CAAAA,CAAI,EAEdZ,EAAQ,CAEZ,EAECO,EAAK,OAAS,CAACZ,GACdW,EAAA,cAACO,EAAA,CACC,GAAG,OACH,GAAI,QAAQb,CAAK,GACjB,UAAWN,EACX,OAAQW,GAEPE,EAAK,KACR,CAEJ,CAEJ,CAAC,CACH,CAEJ"}
1
+ {"version":3,"file":"StepperSteps.js","sources":["../../../src/components/stepper/StepperSteps.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Flex } from '../flex'\nimport { Icon } from '../icon'\nimport { useStepper } from './stepper-context/StepperContext'\nimport { StepperStepBullet } from './StepperStepBullet'\nimport { StepperStepContainer } from './StepperStepContainer'\nimport { StepperStepLabel } from './StepperStepLabel'\nimport { IStepperStepsProps, Status } from './types'\n\nconst StepperStepsContainer = styled(Flex, {\n base: ['justify-between'],\n variants: {\n direction: {\n vertical: ['flex-col'],\n horizontal: ['flex-row']\n }\n }\n})\n\nexport const StepperSteps = ({ className }: IStepperStepsProps) => {\n const {\n steps,\n goToStep,\n activeStep,\n viewedSteps,\n allowSkip,\n direction,\n hideLabels,\n completedSteps,\n showCompletedIcons\n } = useStepper()\n\n const getBulletStatus = (index: number) => {\n const activeBullet = steps[index]\n\n if (activeBullet.status) return activeBullet.status\n if (completedSteps.length === steps.length) return Status.SUCCESS\n if (activeStep === index && completedSteps.includes(activeStep))\n return Status.REVIEWED\n if (activeStep === index) return Status.ACTIVE\n if (completedSteps.includes(index)) return Status.COMPLETED\n if (viewedSteps.includes(index)) return Status.VIEWED\n return Status.DEFAULT\n }\n\n const getSeparatorStatus = (index: number) => {\n const bulletStatus = steps[index]?.status\n\n if (completedSteps.length === steps.length) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.SUCCESS) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.COMPLETED || index < Math.max(...viewedSteps)) {\n return Status.ACTIVE\n }\n\n if (bulletStatus === Status.VIEWED) {\n return Status.VIEWED\n }\n\n return Status.DEFAULT\n }\n\n return (\n <StepperStepsContainer className={className} direction={direction}>\n {steps.map((step, index) => {\n const bulletStatus = getBulletStatus(index)\n const separatorStatus = getSeparatorStatus(index)\n\n return (\n <StepperStepContainer\n tabIndex={0}\n key={`step_${index}`}\n direction={direction}\n separator={separatorStatus}\n status={bulletStatus}\n style={{ '--steps': steps.length || 0 }}\n className={\n direction === 'horizontal'\n ? 'w-[calc(100%/var(--steps))]'\n : 'h-[calc(100%/var(--steps))]'\n }\n canInteract={allowSkip}\n >\n <StepperStepBullet\n as={allowSkip ? 'button' : 'div'}\n onClick={() =>\n allowSkip && viewedSteps.includes(index)\n ? goToStep?.(index)\n : undefined\n }\n status={bulletStatus}\n aria-current={index === activeStep ? 'step' : undefined}\n aria-label={!step.label ? `step ${index + 1}` : ''}\n aria-labelledby={step.label ? `step-${index}` : undefined}\n className={\n allowSkip && viewedSteps.includes(index)\n ? 'cursor-pointer'\n : 'cursor-auto'\n }\n >\n {step.status === Status.SUCCESS ||\n (showCompletedIcons && bulletStatus === Status.COMPLETED) ? (\n <Icon is={Ok} />\n ) : (\n index + 1\n )}\n </StepperStepBullet>\n\n {step.label && !hideLabels && (\n <StepperStepLabel\n as=\"span\"\n id={`step-${index}`}\n direction={direction}\n status={bulletStatus}\n >\n {step.label}\n </StepperStepLabel>\n )}\n </StepperStepContainer>\n )\n })}\n </StepperStepsContainer>\n )\n}\n"],"names":["StepperStepsContainer","styled","Flex","StepperSteps","className","steps","goToStep","activeStep","viewedSteps","allowSkip","direction","hideLabels","completedSteps","showCompletedIcons","useStepper","getBulletStatus","index","activeBullet","Status","getSeparatorStatus","_a","bulletStatus","React","step","separatorStatus","StepperStepContainer","StepperStepBullet","Icon","Ok","StepperStepLabel"],"mappings":"mdAaA,MAAMA,EAAwBC,EAAOC,EAAM,CACzC,KAAM,CAAC,iBAAiB,EACxB,SAAU,CACR,UAAW,CACT,SAAU,CAAC,UAAU,EACrB,WAAY,CAAC,UAAU,CACzB,CACF,CACF,CAAC,EAEYC,EAAe,CAAC,CAAE,UAAAC,CAAU,IAA0B,CACjE,KAAM,CACJ,MAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,eAAAC,EACA,mBAAAC,CACF,EAAIC,EAAW,EAETC,EAAmBC,GAAkB,CACzC,MAAMC,EAAeZ,EAAMW,CAAK,EAEhC,OAAIC,EAAa,OAAeA,EAAa,OACzCL,EAAe,SAAWP,EAAM,OAAea,EAAO,QACtDX,IAAeS,GAASJ,EAAe,SAASL,CAAU,EACrDW,EAAO,SACZX,IAAeS,EAAcE,EAAO,OACpCN,EAAe,SAASI,CAAK,EAAUE,EAAO,UAC9CV,EAAY,SAASQ,CAAK,EAAUE,EAAO,OACxCA,EAAO,OAChB,EAEMC,EAAsBH,GAAkB,CAjDhD,IAAAI,EAkDI,MAAMC,GAAeD,EAAAf,EAAMW,CAAK,IAAX,KAAA,OAAAI,EAAc,OAEnC,OAAIR,EAAe,SAAWP,EAAM,OAC3Ba,EAAO,QAGZG,IAAiBH,EAAO,QACnBA,EAAO,QAGZG,IAAiBH,EAAO,WAAaF,EAAQ,KAAK,IAAI,GAAGR,CAAW,EAC/DU,EAAO,OAGZG,IAAiBH,EAAO,OACnBA,EAAO,OAGTA,EAAO,OAChB,EAEA,OACEI,EAAA,cAACtB,EAAA,CAAsB,UAAWI,EAAW,UAAWM,CAAAA,EACrDL,EAAM,IAAI,CAACkB,EAAMP,IAAU,CAC1B,MAAMK,EAAeN,EAAgBC,CAAK,EACpCQ,EAAkBL,EAAmBH,CAAK,EAEhD,OACEM,EAAA,cAACG,EAAA,CACC,SAAU,EACV,IAAK,QAAQT,CAAK,GAClB,UAAWN,EACX,UAAWc,EACX,OAAQH,EACR,MAAO,CAAE,UAAWhB,EAAM,QAAU,CAAE,EACtC,UACEK,IAAc,aACV,8BACA,8BAEN,YAAaD,CAEba,EAAAA,EAAA,cAACI,EAAA,CACC,GAAIjB,EAAY,SAAW,MAC3B,QAAS,IACPA,GAAaD,EAAY,SAASQ,CAAK,EACnCV,GAAA,KAAA,OAAAA,EAAWU,CACX,EAAA,OAEN,OAAQK,EACR,eAAcL,IAAUT,EAAa,OAAS,OAC9C,aAAagB,EAAK,MAA8B,GAAtB,QAAQP,EAAQ,CAAC,GAC3C,kBAAiBO,EAAK,MAAQ,QAAQP,CAAK,GAAK,OAChD,UACEP,GAAaD,EAAY,SAASQ,CAAK,EACnC,iBACA,eAGLO,EAAK,SAAWL,EAAO,SACvBL,GAAsBQ,IAAiBH,EAAO,UAC7CI,EAAA,cAACK,EAAA,CAAK,GAAIC,CAAAA,CAAI,EAEdZ,EAAQ,CAEZ,EAECO,EAAK,OAAS,CAACZ,GACdW,EAAA,cAACO,EAAA,CACC,GAAG,OACH,GAAI,QAAQb,CAAK,GACjB,UAAWN,EACX,OAAQW,GAEPE,EAAK,KACR,CAEJ,CAEJ,CAAC,CACH,CAEJ"}
@@ -1,2 +1,2 @@
1
- import{styled as t}from"../../styled.js";const e=t("td",{base:["border-t","border-t-grey-200","box-border","text-grey-800","font-body","leading-normal","text-left","align-middle","first:font-semibold"]});e.displayName="TableCell";export{e as TableCell};
1
+ import{styled as t}from"../../styled.js";const e=t("td",{base:["border-t","border-t-grey-100","box-border","text-grey-800","font-body","leading-normal","text-left","align-middle","first:font-semibold"]});e.displayName="TableCell";export{e as TableCell};
2
2
  //# sourceMappingURL=TableCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sources":["../../../src/components/table/TableCell.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nexport const TableCell = styled('td', {\n base: [\n 'border-t',\n 'border-t-grey-200',\n 'box-border',\n 'text-grey-800',\n 'font-body',\n 'leading-normal',\n 'text-left',\n 'align-middle',\n 'first:font-semibold'\n ]\n})\n\nTableCell.displayName = 'TableCell'\n"],"names":["TableCell","styled"],"mappings":"yCAEO,MAAMA,EAAYC,EAAO,KAAM,CACpC,KAAM,CACJ,WACA,oBACA,aACA,gBACA,YACA,iBACA,YACA,eACA,qBACF,CACF,CAAC,EAEDD,EAAU,YAAc"}
1
+ {"version":3,"file":"TableCell.js","sources":["../../../src/components/table/TableCell.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nexport const TableCell = styled('td', {\n base: [\n 'border-t',\n 'border-t-grey-100',\n 'box-border',\n 'text-grey-800',\n 'font-body',\n 'leading-normal',\n 'text-left',\n 'align-middle',\n 'first:font-semibold'\n ]\n})\n\nTableCell.displayName = 'TableCell'\n"],"names":["TableCell","styled"],"mappings":"yCAEO,MAAMA,EAAYC,EAAO,KAAM,CACpC,KAAM,CACJ,WACA,oBACA,aACA,gBACA,YACA,iBACA,YACA,eACA,qBACF,CACF,CAAC,EAEDD,EAAU,YAAc"}
@@ -1,2 +1,2 @@
1
- import c from"clsx";import e from"react";import{useStickyColumnsStyle as i}from"./useStickyColumnsCss.js";const d=({children:h,numberOfStickyColumns:t=0,className:f,...l})=>{const[_,n]=e.useState(!1),p=e.useRef(null),{columnsStyle:s}=i({numberOfStickyColumns:t,wrapperRef:p});return e.createElement("div",{onScroll:y=>{const o=y.currentTarget.scrollLeft>0;o!==_&&n(o)},role:"scrollbar",ref:p,style:s,className:c("overflow-auto","max-w-full","relative","overscroll-x-contain","[&_td,&_th]:bg-inherit",f,t===1&&["[&_td,&_th]:nth-of-type-[1]:sticky","[&_td,&_th]:nth-of-type-[1]:left-(--sticky-offset-left-1)","[&_td,&_th]:nth-of-type-[1]:width-(--sticky-column-width-1)","[&_td,&_th]:nth-of-type-[1]:z-2"],t===2&&["[&_td,&_th]:nth-of-type-[2]:sticky","[&_td,&_th]:nth-of-type-[2]:left-(--sticky-offset-left-2)","[&_td,&_th]:nth-of-type-[2]:width-(--sticky-column-width-2)","[&_td,&_th]:nth-of-type-[2]:z-2"],t===3&&["[&_td,&_th]:nth-of-type-[3]:sticky","[&_td,&_th]:nth-of-type-[3]:left-(--sticky-offset-left-3)","[&_td,&_th]:nth-of-type-[3]:width-(--sticky-column-width-3)","[&_td,&_th]:nth-of-type-[3]:z-2"],t===4&&["[&_td,&_th]:nth-of-type-[4]:sticky","[&_td,&_th]:nth-of-type-[4]:left-(--sticky-offset-left-4)","[&_td,&_th]:nth-of-type-[4]:width-(--sticky-column-width-4)","[&_td,&_th]:nth-of-type-[4]:z-2"],t===1&&_&&["[&_td,&_th]:nth-of-type-[1]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[1]:[clip-path:inset(0px_-10px_0px_0px)]"],t===2&&_&&["[&_td,&_th]:nth-of-type-[2]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[2]:[clip-path:inset(0px_-10px_0px_0px)]"],t===3&&_&&["[&_td,&_th]:nth-of-type-[3]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[3]:[clip-path:inset(0px_-10px_0px_0px)]"],t===4&&_&&["[&_td,&_th]:nth-of-type-[4]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[4]:[clip-path:inset(0px_-10px_0px_0px)]"]),...l},h)};export{d as TableStickyColumnsContainer};
1
+ import c from"clsx";import e from"react";import{useStickyColumnsStyle as i}from"./useStickyColumnsCss.js";const d=({children:o,numberOfStickyColumns:t=0,className:n,...l})=>{const[_,f]=e.useState(!1),p=e.useRef(null),{columnsStyle:s}=i({numberOfStickyColumns:t,wrapperRef:p});return e.createElement("div",{onScroll:y=>{const h=y.currentTarget.scrollLeft>0;h!==_&&f(h)},role:"scrollbar",ref:p,style:s,className:c("overflow-auto","max-w-full","relative","overscroll-x-contain","[&_td,&_th]:bg-inherit",n,t===1&&["[&_td,&_th]:nth-of-type-[1]:sticky","[&_td,&_th]:nth-of-type-[1]:left-(--sticky-offset-left-1)","[&_td,&_th]:nth-of-type-[1]:width-(--sticky-column-width-1)","[&_td,&_th]:nth-of-type-[1]:z-2"],t===2&&["[&_td,&_th]:nth-of-type-[2]:sticky","[&_td,&_th]:nth-of-type-[2]:left-(--sticky-offset-left-2)","[&_td,&_th]:nth-of-type-[2]:width-(--sticky-column-width-2)","[&_td,&_th]:nth-of-type-[2]:z-2"],t===3&&["[&_td,&_th]:nth-of-type-[3]:sticky","[&_td,&_th]:nth-of-type-[3]:left-(--sticky-offset-left-3)","[&_td,&_th]:nth-of-type-[3]:width-(--sticky-column-width-3)","[&_td,&_th]:nth-of-type-[3]:z-2"],t===4&&["[&_td,&_th]:nth-of-type-[4]:sticky","[&_td,&_th]:nth-of-type-[4]:left-(--sticky-offset-left-4)","[&_td,&_th]:nth-of-type-[4]:width-(--sticky-column-width-4)","[&_td,&_th]:nth-of-type-[4]:z-2"],t===1&&_&&["[&_td,&_th]:nth-of-type-[1]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[1]:[clip-path:inset(0px_-10px_0px_0px)]"],t===2&&_&&["[&_td,&_th]:nth-of-type-[2]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[2]:[clip-path:inset(0px_-10px_0px_0px)]"],t===3&&_&&["[&_td,&_th]:nth-of-type-[3]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[3]:[clip-path:inset(0px_-10px_0px_0px)]"],t===4&&_&&["[&_td,&_th]:nth-of-type-[4]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]","[&_td,&_th]:nth-of-type-[4]:[clip-path:inset(0px_-10px_0px_0px)]"]),...l},o)};export{d as TableStickyColumnsContainer};
2
2
  //# sourceMappingURL=TableStickyColumnsContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableStickyColumnsContainer.js","sources":["../../../src/components/table/TableStickyColumnsContainer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport React from 'react'\n\nimport { useStickyColumnsStyle } from './useStickyColumnsCss'\n\nexport const TableStickyColumnsContainer = ({\n children,\n numberOfStickyColumns = 0,\n className,\n ...restProps\n}: React.PropsWithChildren<{\n numberOfStickyColumns?: number\n className?: string\n}>) => {\n const [hasScroll, setHasScroll] = React.useState<boolean>(false)\n const wrapperRef = React.useRef(null)\n const { columnsStyle } = useStickyColumnsStyle({\n numberOfStickyColumns,\n wrapperRef\n })\n\n const handleScroll = (event: React.UIEvent<HTMLDivElement>) => {\n const newHasScroll = event.currentTarget.scrollLeft > 0\n if (newHasScroll !== hasScroll) {\n setHasScroll(newHasScroll)\n }\n }\n\n return (\n <div\n onScroll={handleScroll}\n role=\"scrollbar\"\n ref={wrapperRef}\n style={columnsStyle}\n className={clsx(\n 'overflow-auto',\n 'max-w-full',\n 'relative',\n 'overscroll-x-contain',\n '[&_td,&_th]:bg-inherit',\n className,\n numberOfStickyColumns === 1 && [\n '[&_td,&_th]:nth-of-type-[1]:sticky',\n '[&_td,&_th]:nth-of-type-[1]:left-(--sticky-offset-left-1)',\n '[&_td,&_th]:nth-of-type-[1]:width-(--sticky-column-width-1)',\n '[&_td,&_th]:nth-of-type-[1]:z-2'\n ],\n numberOfStickyColumns === 2 && [\n '[&_td,&_th]:nth-of-type-[2]:sticky',\n '[&_td,&_th]:nth-of-type-[2]:left-(--sticky-offset-left-2)',\n '[&_td,&_th]:nth-of-type-[2]:width-(--sticky-column-width-2)',\n '[&_td,&_th]:nth-of-type-[2]:z-2'\n ],\n numberOfStickyColumns === 3 && [\n '[&_td,&_th]:nth-of-type-[3]:sticky',\n '[&_td,&_th]:nth-of-type-[3]:left-(--sticky-offset-left-3)',\n '[&_td,&_th]:nth-of-type-[3]:width-(--sticky-column-width-3)',\n '[&_td,&_th]:nth-of-type-[3]:z-2'\n ],\n numberOfStickyColumns === 4 && [\n '[&_td,&_th]:nth-of-type-[4]:sticky',\n '[&_td,&_th]:nth-of-type-[4]:left-(--sticky-offset-left-4)',\n '[&_td,&_th]:nth-of-type-[4]:width-(--sticky-column-width-4)',\n '[&_td,&_th]:nth-of-type-[4]:z-2'\n ],\n numberOfStickyColumns === 1 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[1]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[1]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 2 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[2]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[2]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 3 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[3]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[3]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 4 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[4]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[4]:[clip-path:inset(0px_-10px_0px_0px)]'\n ]\n )}\n {...restProps}\n >\n {children}\n </div>\n )\n}\n"],"names":["TableStickyColumnsContainer","children","numberOfStickyColumns","className","restProps","hasScroll","setHasScroll","React","wrapperRef","columnsStyle","useStickyColumnsStyle","event","newHasScroll","clsx"],"mappings":"0GAKa,MAAAA,EAA8B,CAAC,CAC1C,SAAAC,EACA,sBAAAC,EAAwB,EACxB,UAAAC,EACA,GAAGC,CACL,IAGO,CACL,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAkB,EAAK,EACzDC,EAAaD,EAAM,OAAO,IAAI,EAC9B,CAAE,aAAAE,CAAa,EAAIC,EAAsB,CAC7C,sBAAAR,EACA,WAAAM,CACF,CAAC,EASD,OACED,EAAA,cAAC,MAAA,CACC,SATkBI,GAAyC,CAC7D,MAAMC,EAAeD,EAAM,cAAc,WAAa,EAClDC,IAAiBP,GACnBC,EAAaM,CAAY,CAE7B,EAKI,KAAK,YACL,IAAKJ,EACL,MAAOC,EACP,UAAWI,EACT,gBACA,aACA,WACA,uBACA,yBACAV,EACAD,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,CACJ,EACC,GAAGD,CAAAA,EAEHH,CACH,CAEJ"}
1
+ {"version":3,"file":"TableStickyColumnsContainer.js","sources":["../../../src/components/table/TableStickyColumnsContainer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport React from 'react'\n\nimport { useStickyColumnsStyle } from './useStickyColumnsCss'\n\nexport const TableStickyColumnsContainer = ({\n children,\n numberOfStickyColumns = 0,\n className,\n ...restProps\n}: React.PropsWithChildren<{\n numberOfStickyColumns?: number\n className?: string\n}>) => {\n const [hasScroll, setHasScroll] = React.useState<boolean>(false)\n const wrapperRef = React.useRef(null)\n const { columnsStyle } = useStickyColumnsStyle({\n numberOfStickyColumns,\n wrapperRef\n })\n\n const handleScroll = (event: React.UIEvent<HTMLDivElement>) => {\n const newHasScroll = event.currentTarget.scrollLeft > 0\n if (newHasScroll !== hasScroll) {\n setHasScroll(newHasScroll)\n }\n }\n\n return (\n <div\n onScroll={handleScroll}\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"scrollbar\"\n ref={wrapperRef}\n style={columnsStyle}\n className={clsx(\n 'overflow-auto',\n 'max-w-full',\n 'relative',\n 'overscroll-x-contain',\n '[&_td,&_th]:bg-inherit',\n className,\n numberOfStickyColumns === 1 && [\n '[&_td,&_th]:nth-of-type-[1]:sticky',\n '[&_td,&_th]:nth-of-type-[1]:left-(--sticky-offset-left-1)',\n '[&_td,&_th]:nth-of-type-[1]:width-(--sticky-column-width-1)',\n '[&_td,&_th]:nth-of-type-[1]:z-2'\n ],\n numberOfStickyColumns === 2 && [\n '[&_td,&_th]:nth-of-type-[2]:sticky',\n '[&_td,&_th]:nth-of-type-[2]:left-(--sticky-offset-left-2)',\n '[&_td,&_th]:nth-of-type-[2]:width-(--sticky-column-width-2)',\n '[&_td,&_th]:nth-of-type-[2]:z-2'\n ],\n numberOfStickyColumns === 3 && [\n '[&_td,&_th]:nth-of-type-[3]:sticky',\n '[&_td,&_th]:nth-of-type-[3]:left-(--sticky-offset-left-3)',\n '[&_td,&_th]:nth-of-type-[3]:width-(--sticky-column-width-3)',\n '[&_td,&_th]:nth-of-type-[3]:z-2'\n ],\n numberOfStickyColumns === 4 && [\n '[&_td,&_th]:nth-of-type-[4]:sticky',\n '[&_td,&_th]:nth-of-type-[4]:left-(--sticky-offset-left-4)',\n '[&_td,&_th]:nth-of-type-[4]:width-(--sticky-column-width-4)',\n '[&_td,&_th]:nth-of-type-[4]:z-2'\n ],\n numberOfStickyColumns === 1 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[1]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[1]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 2 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[2]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[2]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 3 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[3]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[3]:[clip-path:inset(0px_-10px_0px_0px)]'\n ],\n numberOfStickyColumns === 4 &&\n hasScroll && [\n '[&_td,&_th]:nth-of-type-[4]:shadow-[var(--color-alpha-200)_-2px_-3px_9px_1px]',\n '[&_td,&_th]:nth-of-type-[4]:[clip-path:inset(0px_-10px_0px_0px)]'\n ]\n )}\n {...restProps}\n >\n {children}\n </div>\n )\n}\n"],"names":["TableStickyColumnsContainer","children","numberOfStickyColumns","className","restProps","hasScroll","setHasScroll","React","wrapperRef","columnsStyle","useStickyColumnsStyle","event","newHasScroll","clsx"],"mappings":"0GAKa,MAAAA,EAA8B,CAAC,CAC1C,SAAAC,EACA,sBAAAC,EAAwB,EACxB,UAAAC,EACA,GAAGC,CACL,IAGO,CACL,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAkB,EAAK,EACzDC,EAAaD,EAAM,OAAO,IAAI,EAC9B,CAAE,aAAAE,CAAa,EAAIC,EAAsB,CAC7C,sBAAAR,EACA,WAAAM,CACF,CAAC,EASD,OACED,EAAA,cAAC,MAAA,CACC,SATkBI,GAAyC,CAC7D,MAAMC,EAAeD,EAAM,cAAc,WAAa,EAClDC,IAAiBP,GACnBC,EAAaM,CAAY,CAE7B,EAMI,KAAK,YACL,IAAKJ,EACL,MAAOC,EACP,UAAWI,EACT,gBACA,aACA,WACA,uBACA,yBACAV,EACAD,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GAAK,CAC7B,qCACA,4DACA,8DACA,iCACF,EACAA,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,EACFH,IAA0B,GACxBG,GAAa,CACX,gFACA,kEACF,CACJ,EACC,GAAGD,CAAAA,EAEHH,CACH,CAEJ"}
@@ -1,2 +1,2 @@
1
- import l from"clsx";import*as e from"react";import{ToggleGroup as t}from"../../utilities/radix-overrides/toggle-group/index.js";const a=e.forwardRef((o,r)=>e.createElement(t.Root,{ref:r,...o,className:l(o.className,"flex","gap-2",o.orientation==="horizontal"?"flex-row":"flex-col","flex-wrap")}));export{a as TileToggleGroupRoot};
1
+ import t from"clsx";import*as e from"react";import{ToggleGroup as a}from"../../utilities/radix-overrides/toggle-group/index.js";const l=e.forwardRef((o,r)=>e.createElement(a.Root,{ref:r,...o,className:t(o.className,"flex","gap-2",o.orientation==="horizontal"&&"flex-row",o.orientation==="vertical"&&"flex-col","flex-wrap")}));export{l as TileToggleGroupRoot};
2
2
  //# sourceMappingURL=TileToggleGroupRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TileToggleGroupRoot.js","sources":["../../../src/components/tile-toggle-group/TileToggleGroupRoot.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport * as React from 'react'\n\nimport { TileGroup } from '~/components/tile'\nimport { ToggleGroup } from '~/utilities/radix-overrides/toggle-group'\n\ntype TTileToggleGroupRootProps = React.ComponentProps<typeof TileGroup> &\n React.ComponentProps<typeof ToggleGroup.Root>\n\nexport const TileToggleGroupRoot = React.forwardRef<\n HTMLDivElement,\n TTileToggleGroupRootProps\n>((props, ref) => (\n <ToggleGroup.Root\n ref={ref}\n {...props}\n className={clsx(\n props.className,\n 'flex',\n 'gap-2',\n props.orientation === 'horizontal' ? 'flex-row' : 'flex-col',\n 'flex-wrap'\n )}\n />\n))\n"],"names":["TileToggleGroupRoot","React","props","ref","ToggleGroup","clsx"],"mappings":"gIASO,MAAMA,EAAsBC,EAAM,WAGvC,CAACC,EAAOC,IACRF,EAAA,cAACG,EAAY,KAAZ,CACC,IAAKD,EACJ,GAAGD,EACJ,UAAWG,EACTH,EAAM,UACN,OACA,QACAA,EAAM,cAAgB,aAAe,WAAa,WAClD,WACF,EACF,CACD"}
1
+ {"version":3,"file":"TileToggleGroupRoot.js","sources":["../../../src/components/tile-toggle-group/TileToggleGroupRoot.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport * as React from 'react'\n\nimport { TileGroup } from '~/components/tile'\nimport { ToggleGroup } from '~/utilities/radix-overrides/toggle-group'\n\ntype TTileToggleGroupRootProps = React.ComponentProps<typeof TileGroup> &\n React.ComponentProps<typeof ToggleGroup.Root>\n\nexport const TileToggleGroupRoot = React.forwardRef<\n HTMLDivElement,\n TTileToggleGroupRootProps\n>((props, ref) => (\n <ToggleGroup.Root\n ref={ref}\n {...props}\n className={clsx(\n props.className,\n 'flex',\n 'gap-2',\n props.orientation === 'horizontal' && 'flex-row',\n props.orientation === 'vertical' && 'flex-col',\n 'flex-wrap'\n )}\n />\n))\n"],"names":["TileToggleGroupRoot","React","props","ref","ToggleGroup","clsx"],"mappings":"gIASa,MAAAA,EAAsBC,EAAM,WAGvC,CAACC,EAAOC,IACRF,EAAA,cAACG,EAAY,KAAZ,CACC,IAAKD,EACJ,GAAGD,EACJ,UAAWG,EACTH,EAAM,UACN,OACA,QACAA,EAAM,cAAgB,cAAgB,WACtCA,EAAM,cAAgB,YAAc,WACpC,WACF,EACF,CACD"}
@@ -1,2 +1,2 @@
1
- import*as s from"react";import{styled as n}from"../../styled.js";import{Flex as a}from"../flex/Flex.js";import{ToastCloseButton as i}from"./ToastCloseButton.js";import{ToastIcon as m}from"./ToastIcon.js";import{useToastContext as p}from"./ToastProvider.js";const e=n(a,{base:["pointer-events-auto","rounded-xl","shadow-md","box-border","text-white","min-h-12","relative","px-4","py-1","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[colors,transform]"],variants:{type:{loading:["bg-info"],blank:["bg-info"],success:["bg-success"],error:["bg-danger"]}}}),o=t=>{const{type:r}=p();return s.createElement(e,{align:"center",type:t.type||r,...t})};o.Icon=m,o.Close=i;export{e as StyledToast,o as Toast};
1
+ import*as s from"react";import{styled as n}from"../../styled.js";import{Flex as a}from"../flex/Flex.js";import{ToastCloseButton as i}from"./ToastCloseButton.js";import{ToastIcon as m}from"./ToastIcon.js";import{useToastContext as p}from"./ToastProvider.js";const e=n(a,{base:["pointer-events-auto","rounded-lg","shadow-md","box-border","text-white","min-h-12","relative","px-4","py-1","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[colors,transform]"],variants:{type:{loading:["bg-info"],blank:["bg-info"],success:["bg-success"],error:["bg-danger"]}}}),o=t=>{const{type:r}=p();return s.createElement(e,{align:"center",type:t.type||r,...t})};o.Icon=m,o.Close=i;export{e as StyledToast,o as Toast};
2
2
  //# sourceMappingURL=Toast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sources":["../../../src/components/toast/Toast.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Flex } from '../flex'\nimport { ToastCloseButton } from './ToastCloseButton'\nimport { ToastIcon } from './ToastIcon'\nimport { useToastContext } from './ToastProvider'\n\nexport const StyledToast = styled(Flex, {\n base: [\n 'pointer-events-auto',\n 'rounded-xl',\n 'shadow-md',\n 'box-border',\n 'text-white',\n 'min-h-12',\n 'relative',\n 'px-4',\n 'py-1',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[colors,transform]'\n ],\n variants: {\n type: {\n loading: ['bg-info'],\n blank: ['bg-info'],\n success: ['bg-success'],\n error: ['bg-danger']\n }\n }\n})\n\nexport const Toast = (props: React.ComponentProps<typeof StyledToast>) => {\n const { type } = useToastContext()\n return <StyledToast align=\"center\" type={props.type || type} {...props} />\n}\n\nToast.Icon = ToastIcon\nToast.Close = ToastCloseButton\n"],"names":["StyledToast","styled","Flex","Toast","props","type","useToastContext","React","ToastIcon","ToastCloseButton"],"mappings":"uQASaA,EAAcC,EAAOC,EAAM,CACtC,KAAM,CACJ,sBACA,aACA,YACA,aACA,aACA,WACA,WACA,OACA,OACA,2BACA,uBACA,2CACF,EACA,SAAU,CACR,KAAM,CACJ,QAAS,CAAC,SAAS,EACnB,MAAO,CAAC,SAAS,EACjB,QAAS,CAAC,YAAY,EACtB,MAAO,CAAC,WAAW,CACrB,CACF,CACF,CAAC,EAEYC,EAASC,GAAoD,CACxE,KAAM,CAAE,KAAAC,CAAK,EAAIC,EACjB,EAAA,OAAOC,EAAA,cAACP,EAAA,CAAY,MAAM,SAAS,KAAMI,EAAM,MAAQC,EAAO,GAAGD,CAAO,CAAA,CAC1E,EAEAD,EAAM,KAAOK,EACbL,EAAM,MAAQM"}
1
+ {"version":3,"file":"Toast.js","sources":["../../../src/components/toast/Toast.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Flex } from '../flex'\nimport { ToastCloseButton } from './ToastCloseButton'\nimport { ToastIcon } from './ToastIcon'\nimport { useToastContext } from './ToastProvider'\n\nexport const StyledToast = styled(Flex, {\n base: [\n 'pointer-events-auto',\n 'rounded-lg',\n 'shadow-md',\n 'box-border',\n 'text-white',\n 'min-h-12',\n 'relative',\n 'px-4',\n 'py-1',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[colors,transform]'\n ],\n variants: {\n type: {\n loading: ['bg-info'],\n blank: ['bg-info'],\n success: ['bg-success'],\n error: ['bg-danger']\n }\n }\n})\n\nexport const Toast = (props: React.ComponentProps<typeof StyledToast>) => {\n const { type } = useToastContext()\n return <StyledToast align=\"center\" type={props.type || type} {...props} />\n}\n\nToast.Icon = ToastIcon\nToast.Close = ToastCloseButton\n"],"names":["StyledToast","styled","Flex","Toast","props","type","useToastContext","React","ToastIcon","ToastCloseButton"],"mappings":"uQASaA,EAAcC,EAAOC,EAAM,CACtC,KAAM,CACJ,sBACA,aACA,YACA,aACA,aACA,WACA,WACA,OACA,OACA,2BACA,uBACA,2CACF,EACA,SAAU,CACR,KAAM,CACJ,QAAS,CAAC,SAAS,EACnB,MAAO,CAAC,SAAS,EACjB,QAAS,CAAC,YAAY,EACtB,MAAO,CAAC,WAAW,CACrB,CACF,CACF,CAAC,EAEYC,EAASC,GAAoD,CACxE,KAAM,CAAE,KAAAC,CAAK,EAAIC,EACjB,EAAA,OAAOC,EAAA,cAACP,EAAA,CAAY,MAAM,SAAS,KAAMI,EAAM,MAAQC,EAAO,GAAGD,CAAO,CAAA,CAC1E,EAEAD,EAAM,KAAOK,EACbL,EAAM,MAAQM"}
@@ -1,20 +1,13 @@
1
+ import * as ToggleGroup from '@radix-ui/react-toggle-group';
1
2
  import * as React from 'react';
2
- export declare const StyledButton: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-toggle-group").ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "theme"> & {
3
- theme?: "standard" | "modern" | undefined;
4
- } & {
5
- as?: React.ElementType;
6
- }, "theme" | "size" | "isIconOnly"> & {
3
+ export declare const StyledButton: React.ForwardRefExoticComponent<Omit<ToggleGroup.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "theme" | "size" | "isIconOnly"> & {
7
4
  size?: ("sm" | "md" | "lg" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "sm" | "md" | "lg">>) | undefined;
8
5
  isIconOnly?: (boolean | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", boolean>>) | undefined;
9
6
  theme?: ("standard" | "modern" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "standard" | "modern">>) | undefined;
10
7
  } & {
11
8
  as?: React.ElementType;
12
9
  }>;
13
- export declare const ToggleGroupButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@radix-ui/react-toggle-group").ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "theme"> & {
14
- theme?: "standard" | "modern" | undefined;
15
- } & {
16
- as?: React.ElementType;
17
- }, "theme" | "size" | "isIconOnly"> & {
10
+ export declare const ToggleGroupButton: React.ForwardRefExoticComponent<Omit<Omit<ToggleGroup.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "theme" | "size" | "isIconOnly"> & {
18
11
  size?: ("sm" | "md" | "lg" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "sm" | "md" | "lg">>) | undefined;
19
12
  isIconOnly?: (boolean | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", boolean>>) | undefined;
20
13
  theme?: ("standard" | "modern" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "standard" | "modern">>) | undefined;
@@ -1,2 +1,2 @@
1
- import*as n from"react";import{styled as y}from"../../styled.js";import{Icon as i}from"../icon/Icon.js";import{ToggleGroupItem as f}from"./ToggleGroupItem.js";const l=y(f,{base:["grow","flex","items-center","justify-center","font-semibold","leading-none","py-1"],variants:{size:{sm:["*:not-last:mr-2","min-h-8","px-4","text-sm"],md:["*:not-last:mr-3","min-h-10","px-8","text-md"],lg:["*:not-last:mr-3","min-h-12","px-8","text-lg"]},isIconOnly:{true:[]},theme:{standard:[],modern:[]}},compoundVariants:[{isIconOnly:!0,size:"sm",class:["min-w-8","p-0"]},{isIconOnly:!0,size:"md",class:["min-w-10","p-0"]},{isIconOnly:!0,size:"lg",class:["min-w-12","p-0"]},{isIconOnly:!0,size:"sm",theme:"modern",class:["min-w-10","p-0"]},{isIconOnly:!0,size:"md",theme:"modern",class:["min-w-12","p-0"]},{isIconOnly:!0,size:"lg",theme:"modern",class:["min-w-15","p-0"]}]},{enabledResponsiveVariants:!0}),g=n.forwardRef(({size:s="md",theme:r="standard",children:a,...p},d)=>{var m;const t=n.Children.toArray(a),o=t.length<=1,c=o&&n.isValidElement(t[0])&&((m=t[0])==null?void 0:m.type)===i;return n.createElement(l,{ref:d,size:s,isIconOnly:c,theme:r,...p},t.map(e=>!o&&(typeof e=="string"||typeof e=="number")?n.createElement("span",{key:e},e):n.isValidElement(e)&&(e==null?void 0:e.type)===i?n.cloneElement(e,{...e.props,size:s}):e))});export{l as StyledButton,g as ToggleGroupButton};
1
+ import*as y from"@radix-ui/react-toggle-group";import*as n from"react";import{styled as f}from"../../styled.js";import{Icon as m}from"../icon/Icon.js";import{standardVariant as u,modernVariant as h}from"./ToggleGroupItem.js";const r=f(y.Item,{base:["cursor-pointer","disabled:cursor-not-allowed","disabled:opacity-30","grow","flex","items-center","justify-center","font-semibold","leading-none","py-1"],variants:{size:{sm:["*:not-last:mr-2","min-h-8","px-4","text-sm"],md:["*:not-last:mr-3","min-h-10","px-8","text-md"],lg:["*:not-last:mr-3","min-h-12","px-8","text-lg"]},isIconOnly:{true:[]},theme:{standard:u,modern:h}},compoundVariants:[{isIconOnly:!0,size:"sm",class:["min-w-8","p-0"]},{isIconOnly:!0,size:"md",class:["min-w-10","p-0"]},{isIconOnly:!0,size:"lg",class:["min-w-12","p-0"]},{isIconOnly:!0,size:"sm",theme:"modern",class:["min-w-10","p-0"]},{isIconOnly:!0,size:"md",theme:"modern",class:["min-w-12","p-0"]},{isIconOnly:!0,size:"lg",theme:"modern",class:["min-w-15","p-0"]}]},{enabledResponsiveVariants:!0}),g=n.forwardRef(({size:s="md",theme:l="standard",children:a,...d},p)=>{var o;const t=n.Children.toArray(a),i=t.length<=1,c=i&&n.isValidElement(t[0])&&((o=t[0])==null?void 0:o.type)===m;return n.createElement(r,{ref:p,size:s,isIconOnly:c,theme:l,...d},t.map(e=>!i&&(typeof e=="string"||typeof e=="number")?n.createElement("span",{key:e},e):n.isValidElement(e)&&(e==null?void 0:e.type)===m?n.cloneElement(e,{...e.props,size:s}):e))});export{r as StyledButton,g as ToggleGroupButton};
2
2
  //# sourceMappingURL=ToggleGroupButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroupButton.js","sources":["../../../src/components/toggle-group/ToggleGroupButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Icon } from '../icon'\nimport { ToggleGroupItem } from './ToggleGroupItem'\n\nexport const StyledButton = styled(\n ToggleGroupItem,\n {\n base: [\n 'grow',\n 'flex',\n 'items-center',\n 'justify-center',\n 'font-semibold',\n 'leading-none',\n 'py-1'\n ],\n variants: {\n size: {\n sm: ['*:not-last:mr-2', 'min-h-8', 'px-4', 'text-sm'],\n md: ['*:not-last:mr-3', 'min-h-10', 'px-8', 'text-md'],\n lg: ['*:not-last:mr-3', 'min-h-12', 'px-8', 'text-lg']\n },\n isIconOnly: {\n true: []\n },\n theme: {\n standard: [],\n modern: []\n }\n },\n compoundVariants: [\n {\n isIconOnly: true,\n size: 'sm',\n class: ['min-w-8', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'md',\n class: ['min-w-10', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'lg',\n class: ['min-w-12', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'sm',\n theme: 'modern',\n class: ['min-w-10', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'md',\n theme: 'modern',\n class: ['min-w-12', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'lg',\n theme: 'modern',\n class: ['min-w-15', 'p-0']\n }\n ]\n },\n { enabledResponsiveVariants: true }\n)\n\nexport const ToggleGroupButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof StyledButton>\n>(({ size = 'md', theme = 'standard', children, ...rest }, ref) => {\n const childrenArray = React.Children.toArray(children)\n const isSingleChild = childrenArray.length <= 1\n const isIconOnly =\n isSingleChild &&\n React.isValidElement(childrenArray[0]) &&\n childrenArray[0]?.type === Icon\n\n return (\n <StyledButton\n ref={ref}\n size={size}\n isIconOnly={isIconOnly}\n theme={theme}\n {...rest}\n >\n {\n childrenArray.map((child) => {\n if (\n !isSingleChild &&\n (typeof child === 'string' || typeof child === 'number')\n )\n return <span key={child}>{child}</span>\n if (React.isValidElement(child)) {\n if (child?.type === Icon)\n return React.cloneElement(child, { ...child.props, size })\n }\n return child\n }) as React.ReactElement[]\n }\n </StyledButton>\n )\n})\n"],"names":["StyledButton","styled","ToggleGroupItem","ToggleGroupButton","React","size","theme","children","rest","ref","_a","childrenArray","isSingleChild","isIconOnly","Icon","child"],"mappings":"+JAOa,MAAAA,EAAeC,EAC1BC,EACA,CACE,KAAM,CACJ,OACA,OACA,eACA,iBACA,gBACA,eACA,MACF,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,kBAAmB,UAAW,OAAQ,SAAS,EACpD,GAAI,CAAC,kBAAmB,WAAY,OAAQ,SAAS,EACrD,GAAI,CAAC,kBAAmB,WAAY,OAAQ,SAAS,CACvD,EACA,WAAY,CACV,KAAM,CACR,CAAA,EACA,MAAO,CACL,SAAU,CAAC,EACX,OAAQ,CAAA,CACV,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,UAAW,KAAK,CAC1B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAEaC,EAAoBC,EAAM,WAGrC,CAAC,CAAE,KAAAC,EAAO,KAAM,MAAAC,EAAQ,WAAY,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAAQ,CA3EnE,IAAAC,EA4EE,MAAMC,EAAgBP,EAAM,SAAS,QAAQG,CAAQ,EAC/CK,EAAgBD,EAAc,QAAU,EACxCE,EACJD,GACAR,EAAM,eAAeO,EAAc,CAAC,CAAC,KACrCD,EAAAC,EAAc,CAAC,IAAf,KAAAD,OAAAA,EAAkB,QAASI,EAE7B,OACEV,EAAA,cAACJ,EAAA,CACC,IAAKS,EACL,KAAMJ,EACN,WAAYQ,EACZ,MAAOP,EACN,GAAGE,CAAAA,EAGFG,EAAc,IAAKI,GAEf,CAACH,IACA,OAAOG,GAAU,UAAY,OAAOA,GAAU,UAExCX,EAAA,cAAC,OAAA,CAAK,IAAKW,CAAAA,EAAQA,CAAM,EAC9BX,EAAM,eAAeW,CAAK,IACxBA,GAAA,KAAA,OAAAA,EAAO,QAASD,EACXV,EAAM,aAAaW,EAAO,CAAE,GAAGA,EAAM,MAAO,KAAAV,CAAK,CAAC,EAEtDU,CACR,CAEL,CAEJ,CAAC"}
1
+ {"version":3,"file":"ToggleGroupButton.js","sources":["../../../src/components/toggle-group/ToggleGroupButton.tsx"],"sourcesContent":["import * as ToggleGroup from '@radix-ui/react-toggle-group'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Icon } from '../icon'\nimport { modernVariant, standardVariant } from './ToggleGroupItem'\n\nexport const StyledButton = styled(\n ToggleGroup.Item,\n {\n base: [\n 'cursor-pointer',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'grow',\n 'flex',\n 'items-center',\n 'justify-center',\n 'font-semibold',\n 'leading-none',\n 'py-1'\n ],\n variants: {\n size: {\n sm: ['*:not-last:mr-2', 'min-h-8', 'px-4', 'text-sm'],\n md: ['*:not-last:mr-3', 'min-h-10', 'px-8', 'text-md'],\n lg: ['*:not-last:mr-3', 'min-h-12', 'px-8', 'text-lg']\n },\n isIconOnly: {\n true: []\n },\n theme: {\n standard: standardVariant,\n modern: modernVariant\n }\n },\n compoundVariants: [\n {\n isIconOnly: true,\n size: 'sm',\n class: ['min-w-8', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'md',\n class: ['min-w-10', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'lg',\n class: ['min-w-12', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'sm',\n theme: 'modern',\n class: ['min-w-10', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'md',\n theme: 'modern',\n class: ['min-w-12', 'p-0']\n },\n {\n isIconOnly: true,\n size: 'lg',\n theme: 'modern',\n class: ['min-w-15', 'p-0']\n }\n ]\n },\n { enabledResponsiveVariants: true }\n)\n\nexport const ToggleGroupButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof StyledButton>\n>(({ size = 'md', theme = 'standard', children, ...rest }, ref) => {\n const childrenArray = React.Children.toArray(children)\n const isSingleChild = childrenArray.length <= 1\n const isIconOnly =\n isSingleChild &&\n React.isValidElement(childrenArray[0]) &&\n childrenArray[0]?.type === Icon\n\n return (\n <StyledButton\n ref={ref}\n size={size}\n isIconOnly={isIconOnly}\n theme={theme}\n {...rest}\n >\n {\n childrenArray.map((child) => {\n if (\n !isSingleChild &&\n (typeof child === 'string' || typeof child === 'number')\n )\n return <span key={child}>{child}</span>\n if (React.isValidElement(child)) {\n if (child?.type === Icon)\n return React.cloneElement(child, { ...child.props, size })\n }\n return child\n }) as React.ReactElement[]\n }\n </StyledButton>\n )\n})\n"],"names":["StyledButton","styled","ToggleGroup","standardVariant","modernVariant","ToggleGroupButton","React","size","theme","children","rest","ref","_a","childrenArray","isSingleChild","isIconOnly","Icon","child"],"mappings":"iOAQO,MAAMA,EAAeC,EAC1BC,EAAY,KACZ,CACE,KAAM,CACJ,iBACA,8BACA,sBACA,OACA,OACA,eACA,iBACA,gBACA,eACA,MACF,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,kBAAmB,UAAW,OAAQ,SAAS,EACpD,GAAI,CAAC,kBAAmB,WAAY,OAAQ,SAAS,EACrD,GAAI,CAAC,kBAAmB,WAAY,OAAQ,SAAS,CACvD,EACA,WAAY,CACV,KAAM,CAAA,CACR,EACA,MAAO,CACL,SAAUC,EACV,OAAQC,CACV,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,UAAW,KAAK,CAC1B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,EACA,CACE,WAAY,GACZ,KAAM,KACN,MAAO,SACP,MAAO,CAAC,WAAY,KAAK,CAC3B,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAEaC,EAAoBC,EAAM,WAGrC,CAAC,CAAE,KAAAC,EAAO,KAAM,MAAAC,EAAQ,WAAY,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAAQ,CA/EnE,IAAAC,EAgFE,MAAMC,EAAgBP,EAAM,SAAS,QAAQG,CAAQ,EAC/CK,EAAgBD,EAAc,QAAU,EACxCE,EACJD,GACAR,EAAM,eAAeO,EAAc,CAAC,CAAC,KACrCD,EAAAC,EAAc,CAAC,IAAf,KAAAD,OAAAA,EAAkB,QAASI,EAE7B,OACEV,EAAA,cAACN,EAAA,CACC,IAAKW,EACL,KAAMJ,EACN,WAAYQ,EACZ,MAAOP,EACN,GAAGE,CAAAA,EAGFG,EAAc,IAAKI,GAEf,CAACH,IACA,OAAOG,GAAU,UAAY,OAAOA,GAAU,UAExCX,EAAA,cAAC,OAAK,CAAA,IAAKW,CAAQA,EAAAA,CAAM,EAC9BX,EAAM,eAAeW,CAAK,IACxBA,GAAA,YAAAA,EAAO,QAASD,EACXV,EAAM,aAAaW,EAAO,CAAE,GAAGA,EAAM,MAAO,KAAAV,CAAK,CAAC,EAEtDU,CACR,CAEL,CAEJ,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import * as ToggleGroup from '@radix-ui/react-toggle-group';
2
+ export declare const standardVariant: string[];
3
+ export declare const modernVariant: string[];
2
4
  export declare const ToggleGroupItem: import("react").ForwardRefExoticComponent<Omit<ToggleGroup.ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>, "theme"> & {
3
5
  theme?: "standard" | "modern" | undefined;
4
6
  } & {
@@ -1,2 +1,2 @@
1
- import*as e from"@radix-ui/react-toggle-group";import{styled as o}from"../../styled.js";const t=o(e.Item,{base:["cursor-pointer","disabled:cursor-not-allowed","disabled:opacity-30"],variants:{theme:{standard:["before:bg-grey-600","bg-white","border","border-grey-600","data-[state=on]:border-current!","data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]","data-[state=on]:text-primary-800","not-disabled:data-[state=on]:before:bg-none","not-disabled:focus-visible:before:bg-none","not-disabled:focus-visible:data-[state=off]:border-grey-600!","not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]","not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:before:bg-none","not-disabled:hover:border-current!","not-disabled:hover:text-primary-900","text-grey-800"],modern:["bg-grey-200","border-none","data-[state=on]:bg-white","data-[state=on]:border!","data-[state=on]:border-grey-200!","data-[state=on]:shadow-none!","data-[state=on]:text-grey-800","not-disabled:focus-visible:data-[state=off]:border-grey-600!","not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:text-primary-900","overflow-hidden","rounded-md"]}},defaultVariants:{theme:"standard"}});export{t as ToggleGroupItem};
1
+ import*as t from"@radix-ui/react-toggle-group";import{styled as a}from"../../styled.js";const e=["before:bg-grey-600","bg-white","border","border-grey-600","data-[state=on]:border-current!","data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]","data-[state=on]:text-primary-800","not-disabled:data-[state=on]:before:bg-none","not-disabled:focus-visible:before:bg-none","not-disabled:focus-visible:data-[state=off]:border-grey-600!","not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]","not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:before:bg-none","not-disabled:hover:border-current!","not-disabled:hover:text-primary-900","text-grey-800"],o=["bg-grey-200","border-0","data-[state=on]:bg-white","data-[state=on]:border!","data-[state=on]:border-grey-200!","data-[state=on]:shadow-none!","data-[state=on]:text-grey-800","not-disabled:focus-visible:data-[state=off]:border-grey-600!","not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]","not-disabled:focus-visible:outline-none","not-disabled:focus-visible:relative","not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]","not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]","not-disabled:focus-visible:z-1","not-disabled:hover:text-primary-900","overflow-hidden","rounded-md"],d=a(t.Item,{base:["cursor-pointer","disabled:cursor-not-allowed","disabled:opacity-30"],variants:{theme:{standard:e,modern:o}},defaultVariants:{theme:"standard"}});export{d as ToggleGroupItem,o as modernVariant,e as standardVariant};
2
2
  //# sourceMappingURL=ToggleGroupItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroupItem.js","sources":["../../../src/components/toggle-group/ToggleGroupItem.tsx"],"sourcesContent":["import * as ToggleGroup from '@radix-ui/react-toggle-group'\n\nimport { styled } from '~/styled'\n\nexport const ToggleGroupItem = styled(ToggleGroup.Item, {\n base: [\n 'cursor-pointer',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ],\n variants: {\n theme: {\n standard: [\n 'before:bg-grey-600',\n 'bg-white',\n 'border',\n 'border-grey-600',\n 'data-[state=on]:border-current!',\n 'data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]',\n 'data-[state=on]:text-primary-800',\n 'not-disabled:data-[state=on]:before:bg-none',\n 'not-disabled:focus-visible:before:bg-none',\n 'not-disabled:focus-visible:data-[state=off]:border-grey-600!',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:before:bg-none',\n 'not-disabled:hover:border-current!',\n 'not-disabled:hover:text-primary-900',\n 'text-grey-800'\n ],\n modern: [\n 'bg-grey-200',\n 'border-none',\n 'data-[state=on]:bg-white',\n 'data-[state=on]:border!',\n 'data-[state=on]:border-grey-200!',\n 'data-[state=on]:shadow-none!',\n 'data-[state=on]:text-grey-800',\n 'not-disabled:focus-visible:data-[state=off]:border-grey-600!',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:text-primary-900',\n 'overflow-hidden',\n 'rounded-md'\n ]\n }\n },\n defaultVariants: {\n theme: 'standard'\n }\n})\n"],"names":["ToggleGroupItem","styled","ToggleGroup"],"mappings":"wFAIO,MAAMA,EAAkBC,EAAOC,EAAY,KAAM,CACtD,KAAM,CACJ,iBACA,8BACA,qBACF,EACA,SAAU,CACR,MAAO,CACL,SAAU,CACR,qBACA,WACA,SACA,kBACA,kCACA,8DACA,mCACA,8CACA,4CACA,+DACA,+FACA,yFACA,4EACA,0CACA,sCACA,+EACA,4DACA,iCACA,oCACA,qCACA,sCACA,eACF,EACA,OAAQ,CACN,cACA,cACA,2BACA,0BACA,mCACA,+BACA,gCACA,+DACA,+FACA,+GACA,0CACA,sCACA,+EACA,4DACA,iCACA,sCACA,kBACA,YACF,CACF,CACF,EACA,gBAAiB,CACf,MAAO,UACT,CACF,CAAC"}
1
+ {"version":3,"file":"ToggleGroupItem.js","sources":["../../../src/components/toggle-group/ToggleGroupItem.tsx"],"sourcesContent":["import * as ToggleGroup from '@radix-ui/react-toggle-group'\n\nimport { styled } from '~/styled'\n\nexport const standardVariant = [\n 'before:bg-grey-600',\n 'bg-white',\n 'border',\n 'border-grey-600',\n 'data-[state=on]:border-current!',\n 'data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]',\n 'data-[state=on]:text-primary-800',\n 'not-disabled:data-[state=on]:before:bg-none',\n 'not-disabled:focus-visible:before:bg-none',\n 'not-disabled:focus-visible:data-[state=off]:border-grey-600!',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:before:bg-none',\n 'not-disabled:hover:border-current!',\n 'not-disabled:hover:text-primary-900',\n 'text-grey-800'\n]\n\nexport const modernVariant = [\n 'bg-grey-200',\n 'border-0',\n 'data-[state=on]:bg-white',\n 'data-[state=on]:border!',\n 'data-[state=on]:border-grey-200!',\n 'data-[state=on]:shadow-none!',\n 'data-[state=on]:text-grey-800',\n 'not-disabled:focus-visible:data-[state=off]:border-grey-600!',\n 'not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:text-primary-900',\n 'overflow-hidden',\n 'rounded-md'\n]\n\nexport const ToggleGroupItem = styled(ToggleGroup.Item, {\n base: [\n 'cursor-pointer',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ],\n variants: {\n theme: {\n standard: standardVariant,\n modern: modernVariant\n }\n },\n defaultVariants: {\n theme: 'standard'\n }\n})\n"],"names":["standardVariant","modernVariant","ToggleGroupItem","styled","ToggleGroup"],"mappings":"wFAIa,MAAAA,EAAkB,CAC7B,qBACA,WACA,SACA,kBACA,kCACA,8DACA,mCACA,8CACA,4CACA,+DACA,+FACA,yFACA,4EACA,0CACA,sCACA,+EACA,4DACA,iCACA,oCACA,qCACA,sCACA,eACF,EAEaC,EAAgB,CAC3B,cACA,WACA,2BACA,0BACA,mCACA,+BACA,gCACA,+DACA,+FACA,+GACA,0CACA,sCACA,+EACA,4DACA,iCACA,sCACA,kBACA,YACF,EAEaC,EAAkBC,EAAOC,EAAY,KAAM,CACtD,KAAM,CACJ,iBACA,8BACA,qBACF,EACA,SAAU,CACR,MAAO,CACL,SAAUJ,EACV,OAAQC,CACV,CACF,EACA,gBAAiB,CACf,MAAO,UACT,CACF,CAAC"}
@@ -4,11 +4,7 @@ export declare const ToggleGroup: {
4
4
  } & {
5
5
  as?: import("react").ElementType;
6
6
  }>;
7
- Button: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@radix-ui/react-toggle-group").ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>, "theme"> & {
8
- theme?: "standard" | "modern" | undefined;
9
- } & {
10
- as?: import("react").ElementType;
11
- }, "theme" | "size" | "isIconOnly"> & {
7
+ Button: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-toggle-group").ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>, "theme" | "size" | "isIconOnly"> & {
12
8
  size?: ("sm" | "md" | "lg" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "sm" | "md" | "lg">>) | undefined;
13
9
  isIconOnly?: (boolean | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", boolean>>) | undefined;
14
10
  theme?: ("standard" | "modern" | Partial<Record<"@initial" | "@sm" | "@md" | "@lg" | "@xl", "standard" | "modern">>) | undefined;