@magiclabs/ui-components 1.23.1 → 1.23.2

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 (103) hide show
  1. package/dist/cjs/components/containers/card.js +1 -1
  2. package/dist/cjs/components/containers/card.js.map +1 -1
  3. package/dist/cjs/components/containers/drawer.js +1 -1
  4. package/dist/cjs/components/containers/drawer.js.map +1 -1
  5. package/dist/cjs/components/external/paypal-button.js +1 -1
  6. package/dist/cjs/components/external/paypal-button.js.map +1 -1
  7. package/dist/cjs/components/feedback/toast-provider.js +1 -1
  8. package/dist/cjs/components/feedback/toast-provider.js.map +1 -1
  9. package/dist/cjs/components/feedback/tooltip.js +1 -1
  10. package/dist/cjs/components/feedback/tooltip.js.map +1 -1
  11. package/dist/cjs/components/info/text-box.js +1 -1
  12. package/dist/cjs/components/info/text-box.js.map +1 -1
  13. package/dist/cjs/components/inputs/phone-input.js +1 -1
  14. package/dist/cjs/components/inputs/phone-input.js.map +1 -1
  15. package/dist/cjs/components/inputs/text-input.js +1 -1
  16. package/dist/cjs/components/inputs/text-input.js.map +1 -1
  17. package/dist/cjs/components/list-items/navigation-button.js +1 -1
  18. package/dist/cjs/components/list-items/navigation-button.js.map +1 -1
  19. package/dist/cjs/components/list-items/token-list-item.js +1 -1
  20. package/dist/cjs/components/list-items/token-list-item.js.map +1 -1
  21. package/dist/cjs/components/primitives/checkbox.js +1 -1
  22. package/dist/cjs/components/primitives/checkbox.js.map +1 -1
  23. package/dist/cjs/components/primitives/dropdown-selector.js +1 -1
  24. package/dist/cjs/components/primitives/dropdown-selector.js.map +1 -1
  25. package/dist/cjs/components/primitives/radio.js +1 -1
  26. package/dist/cjs/components/primitives/radio.js.map +1 -1
  27. package/dist/cjs/components/primitives/switch.js +1 -1
  28. package/dist/cjs/components/primitives/switch.js.map +1 -1
  29. package/dist/cjs/components/primitives/text.js +1 -1
  30. package/dist/cjs/components/primitives/text.js.map +1 -1
  31. package/dist/cjs/recipes/callout.js +1 -1
  32. package/dist/cjs/recipes/callout.js.map +1 -1
  33. package/dist/cjs/recipes/card.js +1 -1
  34. package/dist/cjs/recipes/card.js.map +1 -1
  35. package/dist/cjs/recipes/text.js +1 -1
  36. package/dist/cjs/recipes/text.js.map +1 -1
  37. package/dist/cjs/styles/semantic-tokens.js +1 -1
  38. package/dist/cjs/styles/semantic-tokens.js.map +1 -1
  39. package/dist/es/components/containers/card.js +1 -1
  40. package/dist/es/components/containers/card.js.map +1 -1
  41. package/dist/es/components/containers/drawer.js +1 -1
  42. package/dist/es/components/containers/drawer.js.map +1 -1
  43. package/dist/es/components/external/paypal-button.js +1 -1
  44. package/dist/es/components/external/paypal-button.js.map +1 -1
  45. package/dist/es/components/feedback/toast-provider.js +1 -1
  46. package/dist/es/components/feedback/toast-provider.js.map +1 -1
  47. package/dist/es/components/feedback/tooltip.js +1 -1
  48. package/dist/es/components/feedback/tooltip.js.map +1 -1
  49. package/dist/es/components/info/text-box.js +1 -1
  50. package/dist/es/components/info/text-box.js.map +1 -1
  51. package/dist/es/components/inputs/phone-input.js +1 -1
  52. package/dist/es/components/inputs/phone-input.js.map +1 -1
  53. package/dist/es/components/inputs/text-input.js +1 -1
  54. package/dist/es/components/inputs/text-input.js.map +1 -1
  55. package/dist/es/components/layouts/dialogue.js +1 -1
  56. package/dist/es/components/layouts/error.js +1 -1
  57. package/dist/es/components/list-items/navigation-button.js +1 -1
  58. package/dist/es/components/list-items/navigation-button.js.map +1 -1
  59. package/dist/es/components/list-items/token-list-item.js +1 -1
  60. package/dist/es/components/list-items/token-list-item.js.map +1 -1
  61. package/dist/es/components/primitives/checkbox.js +1 -1
  62. package/dist/es/components/primitives/checkbox.js.map +1 -1
  63. package/dist/es/components/primitives/dropdown-selector.js +1 -1
  64. package/dist/es/components/primitives/dropdown-selector.js.map +1 -1
  65. package/dist/es/components/primitives/radio.js +1 -1
  66. package/dist/es/components/primitives/radio.js.map +1 -1
  67. package/dist/es/components/primitives/switch.js +1 -1
  68. package/dist/es/components/primitives/switch.js.map +1 -1
  69. package/dist/es/components/primitives/text.js +1 -1
  70. package/dist/es/components/primitives/text.js.map +1 -1
  71. package/dist/es/components/sections/verify-pincode.js +1 -1
  72. package/dist/es/recipes/callout.js +1 -1
  73. package/dist/es/recipes/callout.js.map +1 -1
  74. package/dist/es/recipes/card.js +1 -1
  75. package/dist/es/recipes/card.js.map +1 -1
  76. package/dist/es/recipes/text.js +1 -1
  77. package/dist/es/recipes/text.js.map +1 -1
  78. package/dist/es/styles/semantic-tokens.js +1 -1
  79. package/dist/es/styles/semantic-tokens.js.map +1 -1
  80. package/dist/panda.buildinfo.json +1 -1
  81. package/dist/types/components/containers/card.d.ts +2 -0
  82. package/dist/types/components/containers/card.d.ts.map +1 -1
  83. package/dist/types/components/external/paypal-button.d.ts.map +1 -1
  84. package/dist/types/components/feedback/toast-provider.d.ts.map +1 -1
  85. package/dist/types/components/feedback/tooltip.d.ts +2 -0
  86. package/dist/types/components/feedback/tooltip.d.ts.map +1 -1
  87. package/dist/types/components/info/text-box.d.ts +1 -0
  88. package/dist/types/components/info/text-box.d.ts.map +1 -1
  89. package/dist/types/components/inputs/phone-input.d.ts.map +1 -1
  90. package/dist/types/components/list-items/token-list-item.d.ts.map +1 -1
  91. package/dist/types/components/primitives/checkbox.d.ts.map +1 -1
  92. package/dist/types/components/primitives/dropdown-selector.d.ts.map +1 -1
  93. package/dist/types/components/primitives/switch.d.ts.map +1 -1
  94. package/dist/types/components/primitives/text.d.ts +5 -0
  95. package/dist/types/components/primitives/text.d.ts.map +1 -1
  96. package/dist/types/recipes/callout.d.ts.map +1 -1
  97. package/dist/types/recipes/card.d.ts +11 -0
  98. package/dist/types/recipes/card.d.ts.map +1 -1
  99. package/dist/types/recipes/text.d.ts +0 -4
  100. package/dist/types/recipes/text.d.ts.map +1 -1
  101. package/dist/types/styles/semantic-tokens.d.ts +6 -0
  102. package/dist/types/styles/semantic-tokens.d.ts.map +1 -1
  103. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, useCallback, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({ name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, tokenIcon, logoUrl }: ListContentProps) => {\n return (\n <HStack w=\"full\" justify=\"space-between\">\n <HStack gap={2}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 30,\n height: 30,\n },\n }\n ) : logoUrl ? (\n <img width={30} height={30} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={30} height={30} />\n )}\n <Text styles={{ fontWeight: '500', textTransform: 'capitalize' }}>{name}</Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem', fontWeight: '500' }}>\n {fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem', color: token('colors.text.secondary') }}>\n {tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase = (props: TokenListItemProps) => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n const { buttonProps } = useButton({ ...props, onPress: handlePress }, ref);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <button\n ref={ref}\n {...mergeProps(buttonProps, focusProps)}\n className={css({\n w: 'full',\n p: 4,\n minH: 20,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 1,\n cursor: 'pointer',\n })}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n />\n </button>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","_jsxs","HStack","IconGenericToken","Text","VStack","token","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","mergeProps","css","TokenListItem"],"mappings":"stBAiBA,MAAMA,EAAYC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAACC,EAAM,CAAA,SACJC,EAAS,IAAIJ,EAAUK,GACfC,EAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,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M,IAAIjC,CAAS,EAErC,OAAIsB,EAEAlB,EACE,SAAA,CAAA,IAAKmB,KACDW,EAAWP,EAAaG,CAAU,EACtC,UAAWK,EAAI,CACb,EAAG,OACH,EAAG,EACH,KAAM,GACN,GAAI,qBACJ,WAAY,wBACZ,OAAQ,CAAE,GAAI,mBAAqB,EACnC,QAAS,KACT,aAAc,aACd,aAAcN,EAAiB,QAAU,OACzC,aAAc,QACd,cAAe,EACf,OAAQ,UACT,EAAC,SAEFzB,EAACK,EACC,CAAA,KAAMC,EACN,sBAAuBC,EACvB,uBAAwBC,EACxB,UAAWC,EACX,QAASC,CAAO,CAAA,CAEX,CAAA,EAIXV,EAACK,EACC,CAAA,KAAMC,EACN,sBAAuBC,EACvB,uBAAwBC,EACxB,UAAWC,EACX,QAASC,CACT,CAAA,CAEN,CAAC,CACH,EAEasB,EAAgB,OAAO,OAAOf,EAAmB,CAAE,UAAArB,CAAS,CAAE"}
1
+ {"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, useCallback, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({ name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, tokenIcon, logoUrl }: ListContentProps) => {\n return (\n <HStack w=\"full\" justify=\"space-between\">\n <HStack gap={2}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 30,\n height: 30,\n },\n }\n ) : logoUrl ? (\n <img width={30} height={30} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={30} height={30} />\n )}\n <Text fontWeight=\"medium\" styles={{ textTransform: 'capitalize' }}>\n {name}\n </Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" fontWeight=\"medium\" styles={{ lineHeight: '1.5rem' }}>\n {fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" color=\"text.secondary\" styles={{ lineHeight: '1.5rem' }}>\n {tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase = (props: TokenListItemProps) => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n const { buttonProps } = useButton({ ...props, onPress: handlePress }, ref);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <button\n ref={ref}\n {...mergeProps(buttonProps, focusProps)}\n className={css({\n w: 'full',\n p: 4,\n minH: 20,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 1,\n cursor: 'pointer',\n })}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n />\n </button>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","_jsxs","HStack","IconGenericToken","Text","VStack","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","mergeProps","css","TokenListItem"],"mappings":"ssBAgBA,MAAMA,EAAYC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAACC,EAAM,CAAA,SACJC,EAAS,IAAIJ,EAAUK,GACfC,EAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,CAAE,KAAAC,EAAM,sBAAAC,EAAuB,uBAAAC,EAAwB,UAAAC,EAAW,QAAAC,CAAO,IAE1FC,EAACC,EAAM,CAAC,EAAE,OAAO,QAAQ,0BACvBD,EAACC,EAAO,CAAA,IAAK,YACVH,EACC,CACE,GAAGA,EACH,MAAO,CACL,GAAGA,EAAU,MACb,MAAO,GACP,OAAQ,EACT,GAEDC,EACFV,EAAA,MAAA,CAAK,MAAO,GAAI,OAAQ,GAAI,IAAKU,EAAS,IAAK,GAAGJ,CAAI,OAAO,CAAA,EAE7DN,EAACa,EAAiB,CAAA,MAAO,GAAI,OAAQ,EAAM,CAAA,EAE7Cb,EAACc,EAAI,CAAC,WAAW,SAAS,OAAQ,CAAE,cAAe,YAAc,EAAA,SAC9DR,CACI,CAAA,CAAA,CAAA,CAAA,EAETK,EAACI,EAAM,CAAC,IAAK,EAAG,WAAW,WAAU,SAAA,CACnCf,EAACc,EAAK,CAAA,KAAK,KAAK,WAAW,SAAS,OAAQ,CAAE,WAAY,QAAQ,EAC/D,SAAAP,CACI,CAAA,EACPP,EAACc,EAAK,CAAA,KAAK,KAAK,MAAM,iBAAiB,OAAQ,CAAE,WAAY,QAAQ,EAClE,SAAAN,CACI,CAAA,CAAA,CAAA,CAAA,CACA,CACF,CAAA,EAIPQ,EAAqBjB,GAA6B,CACtD,KAAM,CAAE,KAAAO,EAAM,sBAAAC,EAAuB,uBAAAC,EAAwB,QAAAE,EAAS,QAAAO,CAAS,EAAGlB,EAE5EmB,EAAMC,EAAO,IAAI,EAEjBC,EAAcC,EAAY,IAAK,CACnCJ,IACF,CAAA,EAAG,CAACA,CAAO,CAAC,EAEN,CAAE,YAAAK,CAAW,EAAKC,EAAU,CAAE,GAAGxB,EAAO,QAASqB,GAAeF,CAAG,EACnE,CAAE,eAAAM,EAAgB,WAAAC,GAAeC,IAEvC,OAAOC,EAAW5B,EAAM,SAAU6B,GAAQ,CACxC,MAAMnB,EAAYmB,EAAM,IAAIhC,CAAS,EAErC,OAAIqB,EAEAjB,EACE,SAAA,CAAA,IAAKkB,KACDW,EAAWP,EAAaG,CAAU,EACtC,UAAWK,EAAI,CACb,EAAG,OACH,EAAG,EACH,KAAM,GACN,GAAI,qBACJ,WAAY,wBACZ,OAAQ,CAAE,GAAI,mBAAqB,EACnC,QAAS,KACT,aAAc,aACd,aAAcN,EAAiB,QAAU,OACzC,aAAc,QACd,cAAe,EACf,OAAQ,UACT,EAAC,SAEFxB,EAACK,EACC,CAAA,KAAMC,EACN,sBAAuBC,EACvB,uBAAwBC,EACxB,UAAWC,EACX,QAASC,CAAO,CAAA,CAEX,CAAA,EAIXV,EAACK,EACC,CAAA,KAAMC,EACN,sBAAuBC,EACvB,uBAAwBC,EACxB,UAAWC,EACX,QAASC,CACT,CAAA,CAEN,CAAC,CACH,EAEaqB,EAAgB,OAAO,OAAOf,EAAmB,CAAE,UAAApB,CAAS,CAAE"}
@@ -1,2 +1,2 @@
1
- import{jsxs as d,jsx as e}from"react/jsx-runtime";import{token as y}from"@styled/tokens";import k from"../icons/ico-checkmark.js";import C from"./text.js";import{useToggleState as S}from"../../hooks/useToggleState.js";import{css as o}from"@styled/css";import{Flex as j}from"@styled/jsx/flex";import{forwardRef as v,useRef as N,useEffect as w}from"react";import{useCheckbox as I,useFocusRing as F,VisuallyHidden as P,mergeProps as R}from"react-aria";const m=v((l,u)=>{const{label:s,indeterminate:r=!1,disabled:n=!1,checked:b,"aria-label":p,...f}=l,t=S({...l,isSelected:b}),h=N(null),i=u||h;w(()=>{const c="current"in i?i.current:null;c&&(c.indeterminate=!!r)},[r,i]);const{inputProps:g}=I({...f,"aria-label":s||p||"Checkbox",isDisabled:n,isIndeterminate:r},t,i),{isFocusVisible:a,focusProps:x}=F();return d("label",{className:o({display:"flex",alignItems:"center",rounded:"sm",opacity:n?.3:1}),children:[e(P,{children:e("input",{...R(g,x),ref:i})}),e("div",{className:o({display:"flex",alignItems:"center",justifyContent:"center",width:5,height:5,bg:t.isSelected?"brand.base":"transparent",borderWidth:"thick",borderColor:t.isSelected||a?"brand.base":"text.tertiary",transition:"background-color 0.2s ease, border-color 0.2s ease",_hover:{cursor:"pointer",borderColor:"brand.base"},pointerEvents:n?"none":"auto",rounded:"sm",boxSizing:"border-box",outlineColor:a?"brand.base":"transparent",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5}),children:d("span",{children:[t.isSelected&&!r&&e(k,{height:16,width:16,color:y("colors.surface.primary")}),t.isSelected&&!!r&&e(j,{justifyContent:"center",alignItems:"center",children:e("div",{className:o({w:2.5,h:.5,bg:"surface.primary"})})})]})}),s&&e("div",{className:o({ml:3}),children:e(C,{styles:{fontWeight:500,lineHeight:1},children:s})})]})});m.displayName="Checkbox";export{m as default};
1
+ import{jsxs as d,jsx as e}from"react/jsx-runtime";import{token as y}from"@styled/tokens";import k from"../icons/ico-checkmark.js";import C from"./text.js";import{useToggleState as S}from"../../hooks/useToggleState.js";import{css as o}from"@styled/css";import{Flex as v}from"@styled/jsx/flex";import{forwardRef as N,useRef as j,useEffect as w}from"react";import{useCheckbox as I,useFocusRing as F,VisuallyHidden as P,mergeProps as R}from"react-aria";const m=N((l,u)=>{const{label:s,indeterminate:r=!1,disabled:n=!1,checked:b,"aria-label":p,...f}=l,t=S({...l,isSelected:b}),h=j(null),i=u||h;w(()=>{const c="current"in i?i.current:null;c&&(c.indeterminate=!!r)},[r,i]);const{inputProps:g}=I({...f,"aria-label":s||p||"Checkbox",isDisabled:n,isIndeterminate:r},t,i),{isFocusVisible:a,focusProps:x}=F();return d("label",{className:o({display:"flex",alignItems:"center",rounded:"sm",opacity:n?.3:1}),children:[e(P,{children:e("input",{...R(g,x),ref:i})}),e("div",{className:o({display:"flex",alignItems:"center",justifyContent:"center",width:5,height:5,bg:t.isSelected?"brand.base":"transparent",borderWidth:"thick",borderColor:t.isSelected||a?"brand.base":"text.tertiary",transition:"background-color 0.2s ease, border-color 0.2s ease",_hover:{cursor:"pointer",borderColor:"brand.base"},pointerEvents:n?"none":"auto",rounded:"sm",boxSizing:"border-box",outlineColor:a?"brand.base":"transparent",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5}),children:d("span",{children:[t.isSelected&&!r&&e(k,{height:16,width:16,color:y("colors.surface.primary")}),t.isSelected&&!!r&&e(v,{justifyContent:"center",alignItems:"center",children:e("div",{className:o({w:2.5,h:.5,bg:"surface.primary"})})})]})}),s&&e("div",{className:o({ml:3}),children:e(C,{fontWeight:"medium",styles:{lineHeight:1},children:s})})]})});m.displayName="Checkbox";export{m as default};
2
2
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../../../src/components/primitives/checkbox.tsx"],"sourcesContent":["import { IcoCheckmark } from '@components/icons';\nimport Text from '@components/primitives/text';\nimport { useToggleState } from '@hooks/useToggleState';\nimport { css } from '@styled/css';\nimport { Flex } from '@styled/jsx/flex';\nimport { token } from '@styled/tokens';\nimport { forwardRef, useEffect, useRef } from 'react';\nimport { VisuallyHidden, mergeProps, useCheckbox, useFocusRing, type AriaCheckboxProps } from 'react-aria';\n\nexport type CheckboxProps = AriaCheckboxProps & {\n label?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n checked?: boolean;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, forwardedRef) => {\n const { label, indeterminate = false, disabled = false, checked, 'aria-label': ariaLabel, ...otherProps } = props;\n const state = useToggleState({ ...props, isSelected: checked });\n const internalRef = useRef<HTMLInputElement>(null);\n const ref = forwardedRef || internalRef;\n\n useEffect(() => {\n const currentRef = 'current' in ref ? ref.current : null;\n if (currentRef) {\n currentRef.indeterminate = !!indeterminate;\n }\n }, [indeterminate, ref]);\n\n const { inputProps } = useCheckbox(\n {\n ...otherProps,\n 'aria-label': label || ariaLabel || 'Checkbox',\n isDisabled: disabled,\n isIndeterminate: indeterminate,\n },\n state,\n ref as React.RefObject<HTMLInputElement>,\n );\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return (\n <label\n className={css({\n display: 'flex',\n alignItems: 'center',\n rounded: 'sm',\n opacity: disabled ? 0.3 : 1,\n })}\n >\n <VisuallyHidden>\n <input {...mergeProps(inputProps, focusProps)} ref={ref} />\n </VisuallyHidden>\n <div\n className={css({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 5,\n height: 5,\n bg: state.isSelected ? 'brand.base' : 'transparent',\n borderWidth: 'thick',\n borderColor: state.isSelected || isFocusVisible ? 'brand.base' : 'text.tertiary',\n transition: 'background-color 0.2s ease, border-color 0.2s ease',\n _hover: {\n cursor: 'pointer',\n borderColor: 'brand.base',\n },\n pointerEvents: disabled ? 'none' : 'auto',\n rounded: 'sm',\n boxSizing: 'border-box',\n outlineColor: isFocusVisible ? 'brand.base' : 'transparent',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n })}\n >\n <span>\n {state.isSelected && !indeterminate && (\n <IcoCheckmark height={16} width={16} color={token('colors.surface.primary')} />\n )}\n {state.isSelected && !!indeterminate && (\n <Flex justifyContent=\"center\" alignItems=\"center\">\n <div\n className={css({\n w: 2.5,\n h: 0.5,\n bg: 'surface.primary',\n })}\n />\n </Flex>\n )}\n </span>\n </div>\n {label && (\n <div className={css({ ml: 3 })}>\n <Text styles={{ fontWeight: 500, lineHeight: 1 }}>{label}</Text>\n </div>\n )}\n </label>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","forwardRef","props","forwardedRef","label","indeterminate","disabled","checked","ariaLabel","otherProps","state","useToggleState","internalRef","useRef","ref","useEffect","currentRef","inputProps","useCheckbox","isFocusVisible","focusProps","useFocusRing","_jsxs","css","_jsx","VisuallyHidden","mergeProps","IcoCheckmark","token","Flex","Text"],"mappings":"ucAgBMA,EAAWC,EAA4C,CAACC,EAAOC,IAAgB,CACnF,KAAM,CAAE,MAAAC,EAAO,cAAAC,EAAgB,GAAO,SAAAC,EAAW,GAAO,QAAAC,EAAS,aAAcC,EAAW,GAAGC,CAAU,EAAKP,EACtGQ,EAAQC,EAAe,CAAE,GAAGT,EAAO,WAAYK,CAAO,CAAE,EACxDK,EAAcC,EAAyB,IAAI,EAC3CC,EAAMX,GAAgBS,EAE5BG,EAAU,IAAK,CACb,MAAMC,EAAa,YAAaF,EAAMA,EAAI,QAAU,KAChDE,IACFA,EAAW,cAAgB,CAAC,CAACX,EAEjC,EAAG,CAACA,EAAeS,CAAG,CAAC,EAEvB,KAAM,CAAE,WAAAG,CAAY,EAAGC,EACrB,CACE,GAAGT,EACH,aAAcL,GAASI,GAAa,WACpC,WAAYF,EACZ,gBAAiBD,CAClB,EACDK,EACAI,CAAwC,EAEpC,CAAE,eAAAK,EAAgB,WAAAC,GAAeC,IAEvC,OACEC,EAAA,QAAA,CACE,UAAWC,EAAI,CACb,QAAS,OACT,WAAY,SACZ,QAAS,KACT,QAASjB,EAAW,GAAM,EAC3B,EAAC,SAAA,CAEFkB,EAACC,EAAc,CAAA,SACbD,cAAWE,EAAWT,EAAYG,CAAU,EAAG,IAAKN,CAAO,CAAA,CAAA,CAAA,EAE7DU,EACE,MAAA,CAAA,UAAWD,EAAI,CACb,QAAS,OACT,WAAY,SACZ,eAAgB,SAChB,MAAO,EACP,OAAQ,EACR,GAAIb,EAAM,WAAa,aAAe,cACtC,YAAa,QACb,YAAaA,EAAM,YAAcS,EAAiB,aAAe,gBACjE,WAAY,qDACZ,OAAQ,CACN,OAAQ,UACR,YAAa,YACd,EACD,cAAeb,EAAW,OAAS,OACnC,QAAS,KACT,UAAW,aACX,aAAca,EAAiB,aAAe,cAC9C,aAAc,QACd,aAAc,QACd,cAAe,GAChB,EAAC,SAEFG,EACG,OAAA,CAAA,SAAA,CAAAZ,EAAM,YAAc,CAACL,GACpBmB,EAACG,GAAa,OAAQ,GAAI,MAAO,GAAI,MAAOC,EAAM,wBAAwB,IAE3ElB,EAAM,YAAc,CAAC,CAACL,GACrBmB,EAACK,GAAK,eAAe,SAAS,WAAW,SAAQ,SAC/CL,EACE,MAAA,CAAA,UAAWD,EAAI,CACb,EAAG,IACH,EAAG,GACH,GAAI,iBACL,CAAA,GAEE,CAAA,CACR,GAEC,CAAA,EACLnB,GACCoB,SAAK,UAAWD,EAAI,CAAE,GAAI,EAAG,EAAC,SAC5BC,EAACM,GAAK,OAAQ,CAAE,WAAY,IAAK,WAAY,CAAC,WAAK1B,CAAK,CAAA,GAE3D,CAAA,CAAA,CAGP,CAAC,EAEDJ,EAAS,YAAc"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../../../src/components/primitives/checkbox.tsx"],"sourcesContent":["import { IcoCheckmark } from '@components/icons';\nimport Text from '@components/primitives/text';\nimport { useToggleState } from '@hooks/useToggleState';\nimport { css } from '@styled/css';\nimport { Flex } from '@styled/jsx/flex';\nimport { token } from '@styled/tokens';\nimport { forwardRef, useEffect, useRef } from 'react';\nimport { VisuallyHidden, mergeProps, useCheckbox, useFocusRing, type AriaCheckboxProps } from 'react-aria';\n\nexport type CheckboxProps = AriaCheckboxProps & {\n label?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n checked?: boolean;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, forwardedRef) => {\n const { label, indeterminate = false, disabled = false, checked, 'aria-label': ariaLabel, ...otherProps } = props;\n const state = useToggleState({ ...props, isSelected: checked });\n const internalRef = useRef<HTMLInputElement>(null);\n const ref = forwardedRef || internalRef;\n\n useEffect(() => {\n const currentRef = 'current' in ref ? ref.current : null;\n if (currentRef) {\n currentRef.indeterminate = !!indeterminate;\n }\n }, [indeterminate, ref]);\n\n const { inputProps } = useCheckbox(\n {\n ...otherProps,\n 'aria-label': label || ariaLabel || 'Checkbox',\n isDisabled: disabled,\n isIndeterminate: indeterminate,\n },\n state,\n ref as React.RefObject<HTMLInputElement>,\n );\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return (\n <label\n className={css({\n display: 'flex',\n alignItems: 'center',\n rounded: 'sm',\n opacity: disabled ? 0.3 : 1,\n })}\n >\n <VisuallyHidden>\n <input {...mergeProps(inputProps, focusProps)} ref={ref} />\n </VisuallyHidden>\n <div\n className={css({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 5,\n height: 5,\n bg: state.isSelected ? 'brand.base' : 'transparent',\n borderWidth: 'thick',\n borderColor: state.isSelected || isFocusVisible ? 'brand.base' : 'text.tertiary',\n transition: 'background-color 0.2s ease, border-color 0.2s ease',\n _hover: {\n cursor: 'pointer',\n borderColor: 'brand.base',\n },\n pointerEvents: disabled ? 'none' : 'auto',\n rounded: 'sm',\n boxSizing: 'border-box',\n outlineColor: isFocusVisible ? 'brand.base' : 'transparent',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n })}\n >\n <span>\n {state.isSelected && !indeterminate && (\n <IcoCheckmark height={16} width={16} color={token('colors.surface.primary')} />\n )}\n {state.isSelected && !!indeterminate && (\n <Flex justifyContent=\"center\" alignItems=\"center\">\n <div\n className={css({\n w: 2.5,\n h: 0.5,\n bg: 'surface.primary',\n })}\n />\n </Flex>\n )}\n </span>\n </div>\n {label && (\n <div className={css({ ml: 3 })}>\n <Text fontWeight=\"medium\" styles={{ lineHeight: 1 }}>\n {label}\n </Text>\n </div>\n )}\n </label>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","forwardRef","props","forwardedRef","label","indeterminate","disabled","checked","ariaLabel","otherProps","state","useToggleState","internalRef","useRef","ref","useEffect","currentRef","inputProps","useCheckbox","isFocusVisible","focusProps","useFocusRing","_jsxs","css","_jsx","VisuallyHidden","mergeProps","IcoCheckmark","token","Flex","Text"],"mappings":"ucAgBMA,EAAWC,EAA4C,CAACC,EAAOC,IAAgB,CACnF,KAAM,CAAE,MAAAC,EAAO,cAAAC,EAAgB,GAAO,SAAAC,EAAW,GAAO,QAAAC,EAAS,aAAcC,EAAW,GAAGC,CAAU,EAAKP,EACtGQ,EAAQC,EAAe,CAAE,GAAGT,EAAO,WAAYK,CAAO,CAAE,EACxDK,EAAcC,EAAyB,IAAI,EAC3CC,EAAMX,GAAgBS,EAE5BG,EAAU,IAAK,CACb,MAAMC,EAAa,YAAaF,EAAMA,EAAI,QAAU,KAChDE,IACFA,EAAW,cAAgB,CAAC,CAACX,EAEjC,EAAG,CAACA,EAAeS,CAAG,CAAC,EAEvB,KAAM,CAAE,WAAAG,CAAY,EAAGC,EACrB,CACE,GAAGT,EACH,aAAcL,GAASI,GAAa,WACpC,WAAYF,EACZ,gBAAiBD,CAClB,EACDK,EACAI,CAAwC,EAEpC,CAAE,eAAAK,EAAgB,WAAAC,GAAeC,IAEvC,OACEC,EAAA,QAAA,CACE,UAAWC,EAAI,CACb,QAAS,OACT,WAAY,SACZ,QAAS,KACT,QAASjB,EAAW,GAAM,EAC3B,EAAC,SAAA,CAEFkB,EAACC,EAAc,CAAA,SACbD,cAAWE,EAAWT,EAAYG,CAAU,EAAG,IAAKN,CAAO,CAAA,CAAA,CAAA,EAE7DU,EACE,MAAA,CAAA,UAAWD,EAAI,CACb,QAAS,OACT,WAAY,SACZ,eAAgB,SAChB,MAAO,EACP,OAAQ,EACR,GAAIb,EAAM,WAAa,aAAe,cACtC,YAAa,QACb,YAAaA,EAAM,YAAcS,EAAiB,aAAe,gBACjE,WAAY,qDACZ,OAAQ,CACN,OAAQ,UACR,YAAa,YACd,EACD,cAAeb,EAAW,OAAS,OACnC,QAAS,KACT,UAAW,aACX,aAAca,EAAiB,aAAe,cAC9C,aAAc,QACd,aAAc,QACd,cAAe,GAChB,EAAC,SAEFG,EACG,OAAA,CAAA,SAAA,CAAAZ,EAAM,YAAc,CAACL,GACpBmB,EAACG,GAAa,OAAQ,GAAI,MAAO,GAAI,MAAOC,EAAM,wBAAwB,IAE3ElB,EAAM,YAAc,CAAC,CAACL,GACrBmB,EAACK,GAAK,eAAe,SAAS,WAAW,SAAQ,SAC/CL,EACE,MAAA,CAAA,UAAWD,EAAI,CACb,EAAG,IACH,EAAG,GACH,GAAI,iBACL,CAAA,GAEE,CAAA,CACR,GAEC,CAAA,EACLnB,GACCoB,SAAK,UAAWD,EAAI,CAAE,GAAI,EAAG,EAAC,SAC5BC,EAACM,GAAK,WAAW,SAAS,OAAQ,CAAE,WAAY,CAAC,WAC9C1B,CAAK,CAAA,GAGX,CAAA,CAAA,CAGP,CAAC,EAEDJ,EAAS,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsxs as b,jsx as o}from"react/jsx-runtime";import"../feedback/callout.js";import{css as W}from"@styled/css";import{HStack as C,Box as $,VStack as U}from"@styled/jsx";import"../feedback/progress-bar.js";import{token as g}from"@styled/tokens";import Y from"../icons/ico-caret-down.js";import q from"../icons/ico-caret-up.js";import G from"../icons/ico-checkmark.js";import J from"../icons/ico-question-circle-fill.js";import"./button.js";import"./checkbox.js";import"./popover.js";import"./radio.js";import"./segmented-control.js";import"./switch.js";import D from"./text.js";import"./portal.js";import{createContext as Q,useContext as X,useCallback as O,useState as j,useRef as A,useMemo as Z,Children as m,useEffect as ee,cloneElement as te}from"react";import"../../hooks/useToast.js";import"../../recipes/toast.js";import re from"../feedback/tooltip.js";import{useButton as oe,useFocusRing as le,useKeyboard as ie,mergeProps as ne}from"react-aria";const F={sm:{caret:16,check:14,height:"2.625rem",top:48,width:"0.75rem",mult:2.25},md:{caret:17,check:15,height:"2.8125rem",top:52,width:"0.85rem",mult:2.25},lg:{caret:18,check:16,height:"3rem",top:55,width:"1rem",mult:2.5}},L=Q({selectedOption:null,setSelectedOption:()=>{}}),N=({value:r,label:s,size:d="lg",isFocused:x})=>{const{selectedOption:p,setSelectedOption:u}=X(L),n=p?.value===r,l=F[d],k=O(()=>{u({value:r,label:s})},[u,r,s]);return b(C,{py:1.5,gap:2,bg:n?"brand.base":x?"brand.lightest":"",_hover:n?{}:{bg:"brand.lightest"},onClick:k,style:{paddingLeft:l.width,paddingRight:l.width},children:[o($,{style:{width:l.width},children:n&&o(G,{width:l.check,height:l.check,color:g("colors.surface.primary")})}),o(D,{size:d,styles:{fontWeight:500,color:g(`colors.${n?"surface":"text"}.primary`)},children:s})]})},R=({children:r,onSelect:s,label:d,placeholder:x="Select one",selectedValue:p,size:u="lg",tooltipContent:n,disabled:l,viewMax:k=5,..._})=>{const[h,w]=j(!1),[t,f]=j(null),y=A(null),S=A(null),a=F[u],B=k*a.mult+1,H=O(()=>{w(e=>!e),h||(f(null),setTimeout(()=>{var e;return(e=S.current)===null||e===void 0?void 0:e.focus()}))},[h]),I=O(e=>{s(e.value),w(!1)},[s]),z=Z(()=>{const e=m.toArray(r).find(i=>i.props.value===p);return e?e.props.label:x},[p,r]),{buttonProps:K}=oe({..._,isDisabled:l,onPress:H},y),{focusProps:V,isFocusVisible:M}=le(),{keyboardProps:T}=ie({onKeyDown:e=>{var i,c;if(!h)return;let v=t;const E=m.toArray(r);switch(e.key){case"ArrowUp":e.preventDefault(),t===null?f(m.count(r)-1):(v=t>0?t-1:m.count(r)-1,f(v));break;case"ArrowDown":e.preventDefault(),t===null?f(0):(v=t<m.count(r)-1?t+1:0,f(v));break;case"Enter":if(e.preventDefault(),(i=y.current)===null||i===void 0||i.focus(),t===null)return;if(t>=0&&t<E.length){const P=E[t];P&&s(P.props.value)}break;case"Escape":w(!1),(c=y.current)===null||c===void 0||c.focus();break}}});return ee(()=>{const e=i=>{var c;!((c=S.current)===null||c===void 0)&&c.contains(i.target)||w(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),o(L.Provider,{value:{selectedOption:{value:p??"",label:z},setSelectedOption:I},children:b(U,{gap:2,w:"full",alignItems:"flex-start",children:[(d||n)&&b(C,{gap:2,opacity:l?.3:"",transition:"all linear 120ms",children:[d&&o(D,{size:"sm",styles:{fontWeight:500},children:d}),n&&o(re,{isDisabled:l,content:n,children:o(J,{className:W({w:4,h:4,color:"neutral.primary"})})})]}),b("button",{className:W({w:"full",h:"fit-content",borderWidth:"thin",borderColor:"neutral.secondary",rounded:"xl",transition:"all linear 120ms",position:"relative",cursor:"pointer",outlineColor:"brand.base",outlineStyle:M?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_hover:{borderColor:"neutral.primary"},_disabled:{opacity:.3,pointerEvents:"none"}}),ref:y,...ne(K,V,T),children:[b(C,{w:"full",p:4,justifyContent:"space-between",style:{height:a.height},children:[o(D,{size:u,styles:{color:g(`colors.text.${p?"primary":"tertiary"}`)},children:z}),h?o(q,{width:a.caret,height:a.caret,color:g("colors.brand.base")}):o(Y,{width:a.caret,height:a.caret,color:g("colors.brand.base")})]}),h&&o($,{ref:S,tabIndex:-1,py:2,bg:"surface.primary",position:"absolute",w:"full",rounded:"input",boxShadow:"4px 8px 20px 0px rgba(0, 0, 0, 0.15)",style:{maxHeight:`${B}rem`,top:a.top},overflowY:"auto",outline:"none",zIndex:"max",children:m.map(r,(e,i)=>te(e,{isFocused:i===t,size:u}))})]})]})})};N.displayName="DropdownOption",R.displayName="DropdownSelector";export{N as DropdownOption,R as DropdownSelector};
1
+ import{jsxs as b,jsx as o}from"react/jsx-runtime";import"../feedback/callout.js";import{css as A}from"@styled/css";import{HStack as S,Box as W,VStack as T}from"@styled/jsx";import"../feedback/progress-bar.js";import{token as D}from"@styled/tokens";import U from"../icons/ico-caret-down.js";import Y from"../icons/ico-caret-up.js";import G from"../icons/ico-checkmark.js";import J from"../icons/ico-question-circle-fill.js";import"./button.js";import"./checkbox.js";import"./popover.js";import"./radio.js";import"./segmented-control.js";import"./switch.js";import C from"./text.js";import"./portal.js";import{createContext as Q,useContext as X,useCallback as O,useState as B,useRef as F,useMemo as Z,Children as m,useEffect as ee,cloneElement as te}from"react";import"../../hooks/useToast.js";import"../../recipes/toast.js";import re from"../feedback/tooltip.js";import{useButton as oe,useFocusRing as le,useKeyboard as ie,mergeProps as ne}from"react-aria";const L={sm:{caret:16,check:14,height:"2.625rem",top:48,width:"0.75rem",mult:2.25},md:{caret:17,check:15,height:"2.8125rem",top:52,width:"0.85rem",mult:2.25},lg:{caret:18,check:16,height:"3rem",top:55,width:"1rem",mult:2.5}},N=Q({selectedOption:null,setSelectedOption:()=>{}}),R=({value:r,label:s,size:d="lg",isFocused:y})=>{const{selectedOption:u,setSelectedOption:p}=X(N),n=u?.value===r,l=L[d],x=O(()=>{p({value:r,label:s})},[p,r,s]);return b(S,{py:1.5,gap:2,bg:n?"brand.base":y?"brand.lightest":"",_hover:n?{}:{bg:"brand.lightest"},onClick:x,style:{paddingLeft:l.width,paddingRight:l.width},children:[o(W,{style:{width:l.width},children:n&&o(G,{width:l.check,height:l.check,color:D("colors.text.quaternary")})}),o(C,{size:d,fontWeight:"medium",color:n?"text.quaternary":"text.primary",styles:{textAlign:"left"},children:s})]})},_=({children:r,onSelect:s,label:d,placeholder:y="Select one",selectedValue:u,size:p="lg",tooltipContent:n,disabled:l,viewMax:x=5,...j})=>{const[h,g]=B(!1),[t,f]=B(null),w=F(null),k=F(null),a=L[p],q=x*a.mult+1,H=O(()=>{g(e=>!e),h||(f(null),setTimeout(()=>{var e;return(e=k.current)===null||e===void 0?void 0:e.focus()}))},[h]),I=O(e=>{s(e.value),g(!1)},[s]),z=Z(()=>{const e=m.toArray(r).find(i=>i.props.value===u);return e?e.props.label:y},[u,r]),{buttonProps:K}=oe({...j,isDisabled:l,onPress:H},w),{focusProps:V,isFocusVisible:$}=le(),{keyboardProps:M}=ie({onKeyDown:e=>{var i,c;if(!h)return;let v=t;const E=m.toArray(r);switch(e.key){case"ArrowUp":e.preventDefault(),t===null?f(m.count(r)-1):(v=t>0?t-1:m.count(r)-1,f(v));break;case"ArrowDown":e.preventDefault(),t===null?f(0):(v=t<m.count(r)-1?t+1:0,f(v));break;case"Enter":if(e.preventDefault(),(i=w.current)===null||i===void 0||i.focus(),t===null)return;if(t>=0&&t<E.length){const P=E[t];P&&s(P.props.value)}break;case"Escape":g(!1),(c=w.current)===null||c===void 0||c.focus();break}}});return ee(()=>{const e=i=>{var c;!((c=k.current)===null||c===void 0)&&c.contains(i.target)||g(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),o(N.Provider,{value:{selectedOption:{value:u??"",label:z},setSelectedOption:I},children:b(T,{gap:2,w:"full",alignItems:"flex-start",children:[(d||n)&&b(S,{gap:2,opacity:l?.3:"",transition:"all linear 120ms",children:[d&&o(C,{size:"sm",fontWeight:"medium",children:d}),n&&o(re,{isDisabled:l,content:n,children:o(J,{className:A({w:4,h:4,color:"neutral.primary"})})})]}),b("button",{className:A({w:"full",h:"fit-content",bg:"surface.primary",borderWidth:"thin",borderColor:"neutral.secondary",rounded:"xl",transition:"all linear 120ms",position:"relative",cursor:"pointer",outlineColor:"brand.base",outlineStyle:$?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_hover:{borderColor:"neutral.primary"},_disabled:{opacity:.3,pointerEvents:"none"}}),ref:w,...ne(K,V,M),children:[b(S,{w:"full",p:4,justifyContent:"space-between",style:{height:a.height},children:[o(C,{size:p,color:u?"text.primary":"text.tertiary",children:z}),h?o(Y,{width:a.caret,height:a.caret,color:D("colors.brand.base")}):o(U,{width:a.caret,height:a.caret,color:D("colors.brand.base")})]}),h&&o(W,{ref:k,tabIndex:-1,py:2,bg:"surface.primary",position:"absolute",w:"full",rounded:"input",boxShadow:"4px 8px 20px 0px rgba(0, 0, 0, 0.15)",style:{maxHeight:`${q}rem`,top:a.top},overflowY:"auto",outline:"none",zIndex:"max",children:m.map(r,(e,i)=>te(e,{isFocused:i===t,size:p}))})]})]})})};R.displayName="DropdownOption",_.displayName="DropdownSelector";export{R as DropdownOption,_ as DropdownSelector};
2
2
  //# sourceMappingURL=dropdown-selector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-selector.js","sources":["../../../../src/components/primitives/dropdown-selector.tsx"],"sourcesContent":["import { Tooltip } from '@components/feedback';\nimport { IcoCaretDown, IcoCaretUp, IcoCheckmark, IcoQuestionCircleFill } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Box, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport {\n Children,\n cloneElement,\n createContext,\n ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing, useKeyboard } from 'react-aria';\n\nexport interface DropdownSelectorProps extends AriaButtonProps {\n children: ReactNode;\n onSelect: (value: string) => void;\n label?: string;\n placeholder?: string;\n selectedValue?: string;\n size?: 'sm' | 'md' | 'lg';\n tooltipContent?: string;\n disabled?: boolean;\n viewMax?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;\n}\n\nexport interface DropdownOptionProps {\n value: string;\n label: string;\n isFocused?: boolean;\n size?: DropdownSelectorProps['size'];\n}\n\ninterface OptionData {\n value: string;\n label: string;\n}\n\nexport interface DropdownContextType {\n selectedOption: OptionData | null;\n setSelectedOption: (option: OptionData) => void;\n}\n\nconst SIZES = {\n sm: { caret: 16, check: 14, height: '2.625rem', top: 48, width: '0.75rem', mult: 2.25 },\n md: { caret: 17, check: 15, height: '2.8125rem', top: 52, width: '0.85rem', mult: 2.25 },\n lg: { caret: 18, check: 16, height: '3rem', top: 55, width: '1rem', mult: 2.5 },\n};\n\nconst DropdownContext = createContext<DropdownContextType>({\n selectedOption: null,\n setSelectedOption: () => {},\n});\n\nexport const DropdownOption = ({ value, label, size = 'lg', isFocused }: DropdownOptionProps) => {\n const { selectedOption, setSelectedOption } = useContext(DropdownContext);\n const isSelected = selectedOption?.value === value;\n const sizeProps = SIZES[size];\n\n const handleSelectOption = useCallback(() => {\n setSelectedOption({ value, label });\n }, [setSelectedOption, value, label]);\n\n return (\n <HStack\n py={1.5}\n gap={2}\n bg={isSelected ? 'brand.base' : isFocused ? 'brand.lightest' : ''}\n _hover={!isSelected ? { bg: 'brand.lightest' } : {}}\n onClick={handleSelectOption}\n style={{ paddingLeft: sizeProps.width, paddingRight: sizeProps.width }}\n >\n <Box style={{ width: sizeProps.width }}>\n {isSelected && (\n <IcoCheckmark width={sizeProps.check} height={sizeProps.check} color={token('colors.surface.primary')} />\n )}\n </Box>\n <Text size={size} styles={{ fontWeight: 500, color: token(`colors.${isSelected ? 'surface' : 'text'}.primary`) }}>\n {label}\n </Text>\n </HStack>\n );\n};\n\nexport const DropdownSelector = ({\n children,\n onSelect,\n label,\n placeholder = 'Select one',\n selectedValue,\n size = 'lg',\n tooltipContent,\n disabled,\n viewMax = 5,\n ...props\n}: DropdownSelectorProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const sizeProps = SIZES[size];\n const maxHeight = viewMax * sizeProps.mult + 1;\n\n const toggleDropdown = useCallback(() => {\n setIsOpen(prev => !prev);\n if (!isOpen) {\n setFocusedIndex(null);\n setTimeout(() => dropdownRef.current?.focus());\n }\n }, [isOpen]);\n\n const handleSelect = useCallback(\n (option: OptionData) => {\n onSelect(option.value);\n setIsOpen(false);\n },\n [onSelect],\n );\n\n const selectedLabel = useMemo(() => {\n const childElements = Children.toArray(children) as ReactElement<DropdownOptionProps>[];\n const matchedChild = childElements.find(child => child.props.value === selectedValue);\n return matchedChild ? matchedChild.props.label : placeholder;\n }, [selectedValue, children]);\n\n const { buttonProps } = useButton(\n {\n ...props,\n isDisabled: disabled,\n onPress: toggleDropdown,\n },\n buttonRef,\n );\n\n const { focusProps, isFocusVisible } = useFocusRing();\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: event => {\n if (!isOpen) return;\n\n let newFocusedIndex = focusedIndex;\n const childArray = Children.toArray(children);\n\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n if (focusedIndex === null) {\n setFocusedIndex(Children.count(children) - 1);\n } else {\n newFocusedIndex = focusedIndex > 0 ? focusedIndex - 1 : Children.count(children) - 1;\n setFocusedIndex(newFocusedIndex);\n }\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (focusedIndex === null) {\n setFocusedIndex(0);\n } else {\n newFocusedIndex = focusedIndex < Children.count(children) - 1 ? focusedIndex + 1 : 0;\n setFocusedIndex(newFocusedIndex);\n }\n break;\n case 'Enter':\n event.preventDefault();\n buttonRef.current?.focus();\n if (focusedIndex === null) return;\n if (focusedIndex >= 0 && focusedIndex < childArray.length) {\n const selectedChild = childArray[focusedIndex] as ReactElement<DropdownOptionProps>;\n if (selectedChild) {\n onSelect(selectedChild.props.value);\n }\n }\n break;\n case 'Escape':\n setIsOpen(false);\n buttonRef.current?.focus();\n break;\n default:\n break;\n }\n },\n });\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n if (!dropdownRef.current?.contains(event.target as Node)) {\n setIsOpen(false);\n }\n };\n\n document.addEventListener('mousedown', handleClick);\n\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, []);\n\n return (\n <DropdownContext.Provider\n value={{ selectedOption: { value: selectedValue ?? '', label: selectedLabel }, setSelectedOption: handleSelect }}\n >\n <VStack gap={2} w=\"full\" alignItems=\"flex-start\">\n {(label || tooltipContent) && (\n <HStack gap={2} opacity={disabled ? 0.3 : ''} transition={'all linear 120ms'}>\n {label && (\n <Text size=\"sm\" styles={{ fontWeight: 500 }}>\n {label}\n </Text>\n )}\n\n {tooltipContent && (\n <Tooltip isDisabled={disabled} content={tooltipContent}>\n <IcoQuestionCircleFill className={css({ w: 4, h: 4, color: 'neutral.primary' })} />\n </Tooltip>\n )}\n </HStack>\n )}\n\n <button\n className={css({\n w: 'full',\n h: 'fit-content',\n borderWidth: 'thin',\n borderColor: 'neutral.secondary',\n rounded: 'xl',\n transition: 'all linear 120ms',\n position: 'relative',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n _hover: { borderColor: 'neutral.primary' },\n _disabled: { opacity: 0.3, pointerEvents: 'none' },\n })}\n ref={buttonRef}\n {...mergeProps(buttonProps, focusProps, keyboardProps)}\n >\n <HStack w=\"full\" p={4} justifyContent=\"space-between\" style={{ height: sizeProps.height }}>\n <Text size={size} styles={{ color: token(`colors.text.${selectedValue ? 'primary' : 'tertiary'}`) }}>\n {selectedLabel}\n </Text>\n {isOpen ? (\n <IcoCaretUp width={sizeProps.caret} height={sizeProps.caret} color={token('colors.brand.base')} />\n ) : (\n <IcoCaretDown width={sizeProps.caret} height={sizeProps.caret} color={token('colors.brand.base')} />\n )}\n </HStack>\n\n {isOpen && (\n <Box\n ref={dropdownRef}\n tabIndex={-1}\n py={2}\n bg=\"surface.primary\"\n position=\"absolute\"\n w=\"full\"\n rounded=\"input\"\n boxShadow=\"4px 8px 20px 0px rgba(0, 0, 0, 0.15)\"\n style={{ maxHeight: `${maxHeight}rem`, top: sizeProps.top }}\n overflowY=\"auto\"\n outline=\"none\"\n zIndex=\"max\"\n >\n {Children.map(children, (child, index) =>\n cloneElement(child as ReactElement<DropdownOptionProps>, {\n isFocused: index === focusedIndex,\n size,\n }),\n )}\n </Box>\n )}\n </button>\n </VStack>\n </DropdownContext.Provider>\n );\n};\n\nDropdownOption.displayName = 'DropdownOption';\nDropdownSelector.displayName = 'DropdownSelector';\n"],"names":["SIZES","DropdownContext","createContext","DropdownOption","value","label","size","isFocused","selectedOption","setSelectedOption","useContext","isSelected","sizeProps","handleSelectOption","useCallback","_jsxs","HStack","_jsx","Box","IcoCheckmark","token","Text","DropdownSelector","children","onSelect","placeholder","selectedValue","tooltipContent","disabled","viewMax","props","isOpen","setIsOpen","useState","focusedIndex","setFocusedIndex","buttonRef","useRef","dropdownRef","maxHeight","toggleDropdown","prev","_a","handleSelect","option","selectedLabel","useMemo","matchedChild","Children","child","buttonProps","useButton","focusProps","isFocusVisible","useFocusRing","keyboardProps","useKeyboard","event","newFocusedIndex","childArray","selectedChild","_b","useEffect","handleClick","VStack","Tooltip","IcoQuestionCircleFill","css","mergeProps","IcoCaretUp","IcoCaretDown","index","cloneElement"],"mappings":"47BAkDA,MAAMA,EAAQ,CACZ,GAAI,CAAE,MAAO,GAAI,MAAO,GAAI,OAAQ,WAAY,IAAK,GAAI,MAAO,UAAW,KAAM,IAAM,EACvF,GAAI,CAAE,MAAO,GAAI,MAAO,GAAI,OAAQ,YAAa,IAAK,GAAI,MAAO,UAAW,KAAM,IAAM,EACxF,GAAI,CAAE,MAAO,GAAI,MAAO,GAAI,OAAQ,OAAQ,IAAK,GAAI,MAAO,OAAQ,KAAM,GAAK,GAG3EC,EAAkBC,EAAmC,CACzD,eAAgB,KAChB,kBAAmB,IAAK,EACzB,CAAA,EAEYC,EAAiB,CAAC,CAAE,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAO,KAAM,UAAAC,CAAS,IAA2B,CAC9F,KAAM,CAAE,eAAAC,EAAgB,kBAAAC,CAAiB,EAAKC,EAAWT,CAAe,EAClEU,EAAaH,GAAgB,QAAUJ,EACvCQ,EAAYZ,EAAMM,CAAI,EAEtBO,EAAqBC,EAAY,IAAK,CAC1CL,EAAkB,CAAE,MAAAL,EAAO,MAAAC,CAAK,CAAE,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WlB,EAAaE,EAAYG,CAAa,EAAC,SAAA,CAEtDxC,EAACC,EAAM,CAAC,EAAE,OAAO,EAAG,EAAG,eAAe,gBAAgB,MAAO,CAAE,OAAQJ,EAAU,QAC/E,SAAA,CAAAK,EAACI,EAAI,CAAC,KAAMf,EAAM,OAAQ,CAAE,MAAOc,EAAM,eAAeM,EAAgB,UAAY,UAAU,EAAE,CAAG,EAAA,SAChGmB,CAAa,CAAA,EAEfd,EACCd,EAACoD,EAAU,CAAC,MAAOzD,EAAU,MAAO,OAAQA,EAAU,MAAO,MAAOQ,EAAM,mBAAmB,CAAK,CAAA,EAElGH,EAACqD,EAAY,CAAC,MAAO1D,EAAU,MAAO,OAAQA,EAAU,MAAO,MAAOQ,EAAM,mBAAmB,CAAC,CAAA,CACjG,CACM,CAAA,EAERW,GACCd,EAACC,EACC,CAAA,IAAKoB,EACL,SAAU,GACV,GAAI,EACJ,GAAG,kBACH,SAAS,WACT,EAAE,OACF,QAAQ,QACR,UAAU,uCACV,MAAO,CAAE,UAAW,GAAGC,CAAS,MAAO,IAAK3B,EAAU,GAAG,EACzD,UAAU,OACV,QAAQ,OACR,OAAO,MAAK,SAEXoC,EAAS,IAAIzB,EAAU,CAAC0B,EAAOsB,IAC9BC,GAAavB,EAA4C,CACvD,UAAWsB,IAAUrC,EACrB,KAAA5B,CACD,CAAA,CAAC,CAEA,CAAA,CACP,GACM,CACF,CAAA,CAAA,CAAA,CAGf,EAEAH,EAAe,YAAc,iBAC7BmB,EAAiB,YAAc"}
1
+ {"version":3,"file":"dropdown-selector.js","sources":["../../../../src/components/primitives/dropdown-selector.tsx"],"sourcesContent":["import { Tooltip } from '@components/feedback';\nimport { IcoCaretDown, IcoCaretUp, IcoCheckmark, IcoQuestionCircleFill } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Box, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport {\n Children,\n cloneElement,\n createContext,\n ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing, useKeyboard } from 'react-aria';\n\nexport interface DropdownSelectorProps extends AriaButtonProps {\n children: ReactNode;\n onSelect: (value: string) => void;\n label?: string;\n placeholder?: string;\n selectedValue?: string;\n size?: 'sm' | 'md' | 'lg';\n tooltipContent?: string;\n disabled?: boolean;\n viewMax?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;\n}\n\nexport interface DropdownOptionProps {\n value: string;\n label: string;\n isFocused?: boolean;\n size?: DropdownSelectorProps['size'];\n}\n\ninterface OptionData {\n value: string;\n label: string;\n}\n\nexport interface DropdownContextType {\n selectedOption: OptionData | null;\n setSelectedOption: (option: OptionData) => void;\n}\n\nconst SIZES = {\n sm: { caret: 16, check: 14, height: '2.625rem', top: 48, width: '0.75rem', mult: 2.25 },\n md: { caret: 17, check: 15, height: '2.8125rem', top: 52, width: '0.85rem', mult: 2.25 },\n lg: { caret: 18, check: 16, height: '3rem', top: 55, width: '1rem', mult: 2.5 },\n};\n\nconst DropdownContext = createContext<DropdownContextType>({\n selectedOption: null,\n setSelectedOption: () => {},\n});\n\nexport const DropdownOption = ({ value, label, size = 'lg', isFocused }: DropdownOptionProps) => {\n const { selectedOption, setSelectedOption } = useContext(DropdownContext);\n const isSelected = selectedOption?.value === value;\n const sizeProps = SIZES[size];\n\n const handleSelectOption = useCallback(() => {\n setSelectedOption({ value, label });\n }, [setSelectedOption, value, label]);\n\n return (\n <HStack\n py={1.5}\n gap={2}\n bg={isSelected ? 'brand.base' : isFocused ? 'brand.lightest' : ''}\n _hover={!isSelected ? { bg: 'brand.lightest' } : {}}\n onClick={handleSelectOption}\n style={{ paddingLeft: sizeProps.width, paddingRight: sizeProps.width }}\n >\n <Box style={{ width: sizeProps.width }}>\n {isSelected && (\n <IcoCheckmark width={sizeProps.check} height={sizeProps.check} color={token('colors.text.quaternary')} />\n )}\n </Box>\n <Text\n size={size}\n fontWeight=\"medium\"\n color={isSelected ? 'text.quaternary' : 'text.primary'}\n styles={{ textAlign: 'left' }}\n >\n {label}\n </Text>\n </HStack>\n );\n};\n\nexport const DropdownSelector = ({\n children,\n onSelect,\n label,\n placeholder = 'Select one',\n selectedValue,\n size = 'lg',\n tooltipContent,\n disabled,\n viewMax = 5,\n ...props\n}: DropdownSelectorProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const sizeProps = SIZES[size];\n const maxHeight = viewMax * sizeProps.mult + 1;\n\n const toggleDropdown = useCallback(() => {\n setIsOpen(prev => !prev);\n if (!isOpen) {\n setFocusedIndex(null);\n setTimeout(() => dropdownRef.current?.focus());\n }\n }, [isOpen]);\n\n const handleSelect = useCallback(\n (option: OptionData) => {\n onSelect(option.value);\n setIsOpen(false);\n },\n [onSelect],\n );\n\n const selectedLabel = useMemo(() => {\n const childElements = Children.toArray(children) as ReactElement<DropdownOptionProps>[];\n const matchedChild = childElements.find(child => child.props.value === selectedValue);\n return matchedChild ? matchedChild.props.label : placeholder;\n }, [selectedValue, children]);\n\n const { buttonProps } = useButton(\n {\n ...props,\n isDisabled: disabled,\n onPress: toggleDropdown,\n },\n buttonRef,\n );\n\n const { focusProps, isFocusVisible } = useFocusRing();\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: event => {\n if (!isOpen) return;\n\n let newFocusedIndex = focusedIndex;\n const childArray = Children.toArray(children);\n\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n if (focusedIndex === null) {\n setFocusedIndex(Children.count(children) - 1);\n } else {\n newFocusedIndex = focusedIndex > 0 ? focusedIndex - 1 : Children.count(children) - 1;\n setFocusedIndex(newFocusedIndex);\n }\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (focusedIndex === null) {\n setFocusedIndex(0);\n } else {\n newFocusedIndex = focusedIndex < Children.count(children) - 1 ? focusedIndex + 1 : 0;\n setFocusedIndex(newFocusedIndex);\n }\n break;\n case 'Enter':\n event.preventDefault();\n buttonRef.current?.focus();\n if (focusedIndex === null) return;\n if (focusedIndex >= 0 && focusedIndex < childArray.length) {\n const selectedChild = childArray[focusedIndex] as ReactElement<DropdownOptionProps>;\n if (selectedChild) {\n onSelect(selectedChild.props.value);\n }\n }\n break;\n case 'Escape':\n setIsOpen(false);\n buttonRef.current?.focus();\n break;\n default:\n break;\n }\n },\n });\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n if (!dropdownRef.current?.contains(event.target as Node)) {\n setIsOpen(false);\n }\n };\n\n document.addEventListener('mousedown', handleClick);\n\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, []);\n\n return (\n <DropdownContext.Provider\n value={{ selectedOption: { value: selectedValue ?? '', label: selectedLabel }, setSelectedOption: handleSelect }}\n >\n <VStack gap={2} w=\"full\" alignItems=\"flex-start\">\n {(label || tooltipContent) && (\n <HStack gap={2} opacity={disabled ? 0.3 : ''} transition={'all linear 120ms'}>\n {label && (\n <Text size=\"sm\" fontWeight=\"medium\">\n {label}\n </Text>\n )}\n\n {tooltipContent && (\n <Tooltip isDisabled={disabled} content={tooltipContent}>\n <IcoQuestionCircleFill className={css({ w: 4, h: 4, color: 'neutral.primary' })} />\n </Tooltip>\n )}\n </HStack>\n )}\n\n <button\n className={css({\n w: 'full',\n h: 'fit-content',\n bg: 'surface.primary',\n borderWidth: 'thin',\n borderColor: 'neutral.secondary',\n rounded: 'xl',\n transition: 'all linear 120ms',\n position: 'relative',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n _hover: { borderColor: 'neutral.primary' },\n _disabled: { opacity: 0.3, pointerEvents: 'none' },\n })}\n ref={buttonRef}\n {...mergeProps(buttonProps, focusProps, keyboardProps)}\n >\n <HStack w=\"full\" p={4} justifyContent=\"space-between\" style={{ height: sizeProps.height }}>\n <Text size={size} color={selectedValue ? 'text.primary' : 'text.tertiary'}>\n {selectedLabel}\n </Text>\n {isOpen ? (\n <IcoCaretUp width={sizeProps.caret} height={sizeProps.caret} color={token('colors.brand.base')} />\n ) : (\n <IcoCaretDown width={sizeProps.caret} height={sizeProps.caret} color={token('colors.brand.base')} />\n )}\n </HStack>\n\n {isOpen && (\n <Box\n ref={dropdownRef}\n tabIndex={-1}\n py={2}\n bg=\"surface.primary\"\n position=\"absolute\"\n w=\"full\"\n rounded=\"input\"\n boxShadow=\"4px 8px 20px 0px rgba(0, 0, 0, 0.15)\"\n style={{ maxHeight: `${maxHeight}rem`, top: sizeProps.top }}\n overflowY=\"auto\"\n outline=\"none\"\n zIndex=\"max\"\n >\n {Children.map(children, (child, index) =>\n cloneElement(child as ReactElement<DropdownOptionProps>, {\n isFocused: index === focusedIndex,\n size,\n }),\n )}\n </Box>\n )}\n </button>\n </VStack>\n </DropdownContext.Provider>\n );\n};\n\nDropdownOption.displayName = 'DropdownOption';\nDropdownSelector.displayName = 'DropdownSelector';\n"],"names":["SIZES","DropdownContext","createContext","DropdownOption","value","label","size","isFocused","selectedOption","setSelectedOption","useContext","isSelected","sizeProps","handleSelectOption","useCallback","_jsxs","HStack","_jsx","Box","IcoCheckmark","token","Text","DropdownSelector","children","onSelect","placeholder","selectedValue","tooltipContent","disabled","viewMax","props","isOpen","setIsOpen","useState","focusedIndex","setFocusedIndex","buttonRef","useRef","dropdownRef","maxHeight","toggleDropdown","prev","_a","handleSelect","option","selectedLabel","useMemo","matchedChild","Children","child","buttonProps","useButton","focusProps","isFocusVisible","useFocusRing","keyboardProps","useKeyboard","event","newFocusedIndex","childArray","selectedChild","_b","useEffect","handleClick","VStack","Tooltip","IcoQuestionCircleFill","css","mergeProps","IcoCaretUp","IcoCaretDown","index","cloneElement"],"mappings":"47BAkDA,MAAMA,EAAQ,CACZ,GAAI,CAAE,MAAO,GAA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oC,EAAS,IAAIzB,EAAU,CAAC0B,EAAOsB,IAC9BC,GAAavB,EAA4C,CACvD,UAAWsB,IAAUrC,EACrB,KAAA5B,CACD,CAAA,CAAC,CAEA,CAAA,CACP,GACM,CACF,CAAA,CAAA,CAAA,CAGf,EAEAH,EAAe,YAAc,iBAC7BmB,EAAiB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsxs as C,jsx as e}from"react/jsx-runtime";import V from"./text.js";import{Flex as c,Circle as v,Box as P}from"@styled/jsx";import{flex as R}from"@styled/patterns";import{createContext as j,forwardRef as k,useContext as S,useRef as w,useCallback as u}from"react";import{useHover as F,useFocusRing as I,usePress as N,VisuallyHidden as W,mergeProps as z}from"react-aria";const p=j({selectedValue:void 0,setSelectedValue:()=>{}}),m=i=>{const{children:s,onChange:t,selectedValue:o,vertical:r}=i,n=u(a=>{t(a)},[t]);return e(c,{direction:r?"column":"row",gap:r?5:10,role:"radiogroup",children:e(p.Provider,{value:{selectedValue:o,setSelectedValue:n},children:s})})},h=k((i,s)=>{const{label:t,value:o}=i,r=S(p),n=w(null),a=s||n,b=u(()=>{r.setSelectedValue(o)},[r,o]),{hoverProps:f}=F({}),{focusProps:x,isFocusVisible:d}=I(),{pressProps:g}=N({onPress:b}),l=r.selectedValue===o,y=l?0:-1;return C("label",{className:R({alignItems:"center"}),children:[e(W,{children:e("input",{...z(g,x,f),ref:a,type:"radio",checked:l,tabIndex:y,readOnly:!0})}),e(c,{justifyContent:"center",alignItems:"center",borderWidth:"thick",borderColor:d||l?"brand.base":"text.tertiary",transition:"border-color 0.2s ease",outlineColor:"brand.base",outlineStyle:d?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_hover:{borderColor:"brand.base"},cursor:"pointer",w:6,h:6,rounded:"full","aria-hidden":"true",children:l&&e(v,{size:3,bg:"brand.base"})}),e(P,{ml:3,children:e(V,{size:"lg",styles:{fontWeight:500},children:t})})]})});m.displayName="RadioGroup",h.displayName="Radio";export{h as Radio,m as RadioGroup};
1
+ import{jsxs as V,jsx as e}from"react/jsx-runtime";import v from"./text.js";import{Flex as c,Circle as y,Box as P}from"@styled/jsx";import{flex as R}from"@styled/patterns";import{createContext as k,forwardRef as S,useContext as j,useRef as w,useCallback as u}from"react";import{useHover as F,useFocusRing as I,usePress as N,VisuallyHidden as W,mergeProps as z}from"react-aria";const m=k({selectedValue:void 0,setSelectedValue:()=>{}}),p=i=>{const{children:s,onChange:t,selectedValue:o,vertical:r}=i,n=u(a=>{t(a)},[t]);return e(c,{direction:r?"column":"row",gap:r?5:10,role:"radiogroup",children:e(m.Provider,{value:{selectedValue:o,setSelectedValue:n},children:s})})},h=S((i,s)=>{const{label:t,value:o}=i,r=j(m),n=w(null),a=s||n,b=u(()=>{r.setSelectedValue(o)},[r,o]),{hoverProps:f}=F({}),{focusProps:x,isFocusVisible:d}=I(),{pressProps:g}=N({onPress:b}),l=r.selectedValue===o,C=l?0:-1;return V("label",{className:R({alignItems:"center"}),children:[e(W,{children:e("input",{...z(g,x,f),ref:a,type:"radio",checked:l,tabIndex:C,readOnly:!0})}),e(c,{justifyContent:"center",alignItems:"center",borderWidth:"thick",borderColor:d||l?"brand.base":"text.tertiary",transition:"border-color 0.2s ease",outlineColor:"brand.base",outlineStyle:d?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_hover:{borderColor:"brand.base"},cursor:"pointer",w:6,h:6,rounded:"full","aria-hidden":"true",children:l&&e(y,{size:3,bg:"brand.base"})}),e(P,{ml:3,children:e(v,{size:"lg",fontWeight:"medium",children:t})})]})});p.displayName="RadioGroup",h.displayName="Radio";export{h as Radio,p as RadioGroup};
2
2
  //# sourceMappingURL=radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sources":["../../../../src/components/primitives/radio.tsx"],"sourcesContent":["import Text from '@components/primitives/text';\nimport { Box, Circle, Flex } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { PropsWithChildren, createContext, forwardRef, useCallback, useContext, useRef } from 'react';\nimport {\n AriaRadioGroupProps,\n AriaRadioProps,\n VisuallyHidden,\n mergeProps,\n useFocusRing,\n useHover,\n usePress,\n} from 'react-aria';\n\nexport interface RadioGroupProps extends AriaRadioGroupProps, PropsWithChildren {\n onChange: (value: string) => void;\n selectedValue?: string;\n vertical?: boolean;\n}\n\nexport interface RadioProps extends AriaRadioProps {\n label?: string;\n}\n\nconst RadioContext = createContext<{\n selectedValue: string | undefined;\n setSelectedValue: (value: string) => void;\n}>({\n selectedValue: undefined,\n setSelectedValue: () => {},\n});\n\nexport const RadioGroup = (props: RadioGroupProps) => {\n const { children, onChange, selectedValue, vertical } = props;\n\n const handleSelect = useCallback(\n (value: string) => {\n onChange(value);\n },\n [onChange],\n );\n\n return (\n <Flex direction={vertical ? 'column' : 'row'} gap={vertical ? 5 : 10} role=\"radiogroup\">\n <RadioContext.Provider value={{ selectedValue, setSelectedValue: handleSelect }}>\n {children}\n </RadioContext.Provider>\n </Flex>\n );\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>((props, forwardedRef) => {\n const { label, value } = props;\n const state = useContext(RadioContext);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const ref = forwardedRef || internalRef;\n\n const handlePress = useCallback(() => {\n state.setSelectedValue(value);\n }, [state, value]);\n\n const { hoverProps } = useHover({});\n const { focusProps, isFocusVisible } = useFocusRing();\n const { pressProps } = usePress({\n onPress: handlePress,\n });\n\n const isSelected = state.selectedValue === value;\n\n const tabIndex = isSelected ? 0 : -1;\n\n return (\n <label className={flex({ alignItems: 'center' })}>\n <VisuallyHidden>\n <input\n {...mergeProps(pressProps, focusProps, hoverProps)}\n ref={ref}\n type=\"radio\"\n checked={isSelected}\n tabIndex={tabIndex}\n readOnly\n />\n </VisuallyHidden>\n <Flex\n justifyContent=\"center\"\n alignItems=\"center\"\n borderWidth=\"thick\"\n borderColor={isFocusVisible || isSelected ? 'brand.base' : 'text.tertiary'}\n transition=\"border-color 0.2s ease\"\n outlineColor=\"brand.base\"\n outlineStyle={isFocusVisible ? 'solid' : 'none'}\n outlineWidth=\"thick\"\n outlineOffset={0.5}\n _hover={{ borderColor: 'brand.base' }}\n cursor=\"pointer\"\n w={6}\n h={6}\n rounded=\"full\"\n aria-hidden=\"true\"\n >\n {isSelected && <Circle size={3} bg=\"brand.base\" />}\n </Flex>\n <Box ml={3}>\n <Text size=\"lg\" styles={{ fontWeight: 500 }}>\n {label}\n </Text>\n </Box>\n </label>\n );\n});\n\nRadioGroup.displayName = 'RadioGroup';\nRadio.displayName = 'Radio';\n"],"names":["RadioContext","createContext","RadioGroup","props","children","onChange","selectedValue","vertical","handleSelect","useCallback","value","_jsx","Flex","Radio","forwardRef","forwardedRef","label","state","useContext","internalRef","useRef","ref","handlePress","hoverProps","useHover","focusProps","isFocusVisible","useFocusRing","pressProps","usePress","isSelected","tabIndex","_jsxs","flex","VisuallyHidden","mergeProps","Circle","Box","Text"],"mappings":"wXAwBA,MAAMA,EAAeC,EAGlB,CACD,cAAe,OACf,iBAAkB,IAAK,CACxB,CAAA,CAAA,EAEYC,EAAcC,GAA0B,CACnD,KAAM,CAAE,SAAAC,EAAU,SAAAC,EAAU,cAAAC,EAAe,SAAAC,CAAQ,EAAKJ,EAElDK,EAAeC,EAClBC,GAAiB,CAChBL,EAASK,CAAK,CAChB,EACA,CAACL,CAAQ,CAAC,EAGZ,OACEM,EAACC,EAAI,CAAC,UAAWL,EAAW,SAAW,MAAO,IAAKA,EAAW,EAAI,GAAI,KAAK,aAAY,SACrFI,EAACX,EAAa,SAAQ,CAAC,MAAO,CAAE,cAAAM,EAAe,iBAAkBE,CAAY,WAC1EJ,CAAQ,CAAA,CAEN,CAAA,CAEX,EAEaS,EAAQC,EAAyC,CAACX,EAAOY,IAAgB,CACpF,KAAM,CAAE,MAAAC,EAAO,MAAAN,CAAO,EAAGP,EACnBc,EAAQC,EAAWlB,CAAY,EAE/BmB,EAAcC,EAAyB,IAAI,EAC3CC,EAAMN,GAAgBI,EAEtBG,EAAcb,EAAY,IAAK,CACnCQ,EAAM,iBAAiBP,CAAK,CAC9B,EAAG,CAACO,EAAOP,CAAK,CAAC,EAEX,CAAE,WAAAa,CAAY,EAAGC,EAAS,CAAE,CAAA,EAC5B,CAAE,WAAAC,EAAY,eAAAC,GAAmBC,IACjC,CAAE,WAAAC,CAAY,EAAGC,EAAS,CAC9B,QAASP,CACV,CAAA,EAEKQ,EAAab,EAAM,gBAAkBP,EAErCqB,EAAWD,EAAa,EAAI,GAElC,OACEE,EAAO,QAAA,CAAA,UAAWC,EAAK,CAAE,WAAY,SAAU,EAAC,SAAA,CAC9CtB,EAACuB,EAAc,CAAA,SACbvB,cACMwB,EAAWP,EAAYH,EAAYF,CAAU,EACjD,IAAKF,EACL,KAAK,QACL,QAASS,EACT,SAAUC,EACV,aAEa,CAAA,EACjBpB,EAACC,EAAI,CACH,eAAe,SACf,WAAW,SACX,YAAY,QACZ,YAAac,GAAkBI,EAAa,aAAe,gBAC3D,WAAW,yBACX,aAAa,aACb,aAAcJ,EAAiB,QAAU,OACzC,aAAa,QACb,cAAe,GACf,OAAQ,CAAE,YAAa,cACvB,OAAO,UACP,EAAG,EACH,EAAG,EACH,QAAQ,qBACI,OAAM,SAEjBI,GAAcnB,EAACyB,EAAM,CAAC,KAAM,EAAG,GAAG,YAAY,CAAA,IAEjDzB,EAAC0B,EAAI,CAAA,GAAI,EAAC,SACR1B,EAAC2B,GAAK,KAAK,KAAK,OAAQ,CAAE,WAAY,KACnC,SAAAtB,GAEC,CAAA,CAAA,CAAA,CAAA,CAGZ,CAAC,EAEDd,EAAW,YAAc,aACzBW,EAAM,YAAc"}
1
+ {"version":3,"file":"radio.js","sources":["../../../../src/components/primitives/radio.tsx"],"sourcesContent":["import Text from '@components/primitives/text';\nimport { Box, Circle, Flex } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { PropsWithChildren, createContext, forwardRef, useCallback, useContext, useRef } from 'react';\nimport {\n AriaRadioGroupProps,\n AriaRadioProps,\n VisuallyHidden,\n mergeProps,\n useFocusRing,\n useHover,\n usePress,\n} from 'react-aria';\n\nexport interface RadioGroupProps extends AriaRadioGroupProps, PropsWithChildren {\n onChange: (value: string) => void;\n selectedValue?: string;\n vertical?: boolean;\n}\n\nexport interface RadioProps extends AriaRadioProps {\n label?: string;\n}\n\nconst RadioContext = createContext<{\n selectedValue: string | undefined;\n setSelectedValue: (value: string) => void;\n}>({\n selectedValue: undefined,\n setSelectedValue: () => {},\n});\n\nexport const RadioGroup = (props: RadioGroupProps) => {\n const { children, onChange, selectedValue, vertical } = props;\n\n const handleSelect = useCallback(\n (value: string) => {\n onChange(value);\n },\n [onChange],\n );\n\n return (\n <Flex direction={vertical ? 'column' : 'row'} gap={vertical ? 5 : 10} role=\"radiogroup\">\n <RadioContext.Provider value={{ selectedValue, setSelectedValue: handleSelect }}>\n {children}\n </RadioContext.Provider>\n </Flex>\n );\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>((props, forwardedRef) => {\n const { label, value } = props;\n const state = useContext(RadioContext);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const ref = forwardedRef || internalRef;\n\n const handlePress = useCallback(() => {\n state.setSelectedValue(value);\n }, [state, value]);\n\n const { hoverProps } = useHover({});\n const { focusProps, isFocusVisible } = useFocusRing();\n const { pressProps } = usePress({\n onPress: handlePress,\n });\n\n const isSelected = state.selectedValue === value;\n\n const tabIndex = isSelected ? 0 : -1;\n\n return (\n <label className={flex({ alignItems: 'center' })}>\n <VisuallyHidden>\n <input\n {...mergeProps(pressProps, focusProps, hoverProps)}\n ref={ref}\n type=\"radio\"\n checked={isSelected}\n tabIndex={tabIndex}\n readOnly\n />\n </VisuallyHidden>\n <Flex\n justifyContent=\"center\"\n alignItems=\"center\"\n borderWidth=\"thick\"\n borderColor={isFocusVisible || isSelected ? 'brand.base' : 'text.tertiary'}\n transition=\"border-color 0.2s ease\"\n outlineColor=\"brand.base\"\n outlineStyle={isFocusVisible ? 'solid' : 'none'}\n outlineWidth=\"thick\"\n outlineOffset={0.5}\n _hover={{ borderColor: 'brand.base' }}\n cursor=\"pointer\"\n w={6}\n h={6}\n rounded=\"full\"\n aria-hidden=\"true\"\n >\n {isSelected && <Circle size={3} bg=\"brand.base\" />}\n </Flex>\n <Box ml={3}>\n <Text size=\"lg\" fontWeight=\"medium\">\n {label}\n </Text>\n </Box>\n </label>\n );\n});\n\nRadioGroup.displayName = 'RadioGroup';\nRadio.displayName = 'Radio';\n"],"names":["RadioContext","createContext","RadioGroup","props","children","onChange","selectedValue","vertical","handleSelect","useCallback","value","_jsx","Flex","Radio","forwardRef","forwardedRef","label","state","useContext","internalRef","useRef","ref","handlePress","hoverProps","useHover","focusProps","isFocusVisible","useFocusRing","pressProps","usePress","isSelected","tabIndex","_jsxs","flex","VisuallyHidden","mergeProps","Circle","Box","Text"],"mappings":"wXAwBA,MAAMA,EAAeC,EAGlB,CACD,cAAe,OACf,iBAAkB,IAAK,CACxB,CAAA,CAAA,EAEYC,EAAcC,GAA0B,CACnD,KAAM,CAAE,SAAAC,EAAU,SAAAC,EAAU,cAAAC,EAAe,SAAAC,CAAQ,EAAKJ,EAElDK,EAAeC,EAClBC,GAAiB,CAChBL,EAASK,CAAK,CAChB,EACA,CAACL,CAAQ,CAAC,EAGZ,OACEM,EAACC,EAAI,CAAC,UAAWL,EAAW,SAAW,MAAO,IAAKA,EAAW,EAAI,GAAI,KAAK,aAAY,SACrFI,EAACX,EAAa,SAAQ,CAAC,MAAO,CAAE,cAAAM,EAAe,iBAAkBE,CAAY,WAC1EJ,CAAQ,CAAA,CAEN,CAAA,CAEX,EAEaS,EAAQC,EAAyC,CAACX,EAAOY,IAAgB,CACpF,KAAM,CAAE,MAAAC,EAAO,MAAAN,CAAO,EAAGP,EACnBc,EAAQC,EAAWlB,CAAY,EAE/BmB,EAAcC,EAAyB,IAAI,EAC3CC,EAAMN,GAAgBI,EAEtBG,EAAcb,EAAY,IAAK,CACnCQ,EAAM,iBAAiBP,CAAK,CAC9B,EAAG,CAACO,EAAOP,CAAK,CAAC,EAEX,CAAE,WAAAa,CAAY,EAAGC,EAAS,CAAE,CAAA,EAC5B,CAAE,WAAAC,EAAY,eAAAC,GAAmBC,IACjC,CAAE,WAAAC,CAAY,EAAGC,EAAS,CAC9B,QAASP,CACV,CAAA,EAEKQ,EAAab,EAAM,gBAAkBP,EAErCqB,EAAWD,EAAa,EAAI,GAElC,OACEE,EAAO,QAAA,CAAA,UAAWC,EAAK,CAAE,WAAY,SAAU,EAAC,SAAA,CAC9CtB,EAACuB,EAAc,CAAA,SACbvB,cACMwB,EAAWP,EAAYH,EAAYF,CAAU,EACjD,IAAKF,EACL,KAAK,QACL,QAASS,EACT,SAAUC,EACV,SACA,EAAA,CAAA,CAAA,CAAA,EAEJpB,EAACC,EACC,CAAA,eAAe,SACf,WAAW,SACX,YAAY,QACZ,YAAac,GAAkBI,EAAa,aAAe,gBAC3D,WAAW,yBACX,aAAa,aACb,aAAcJ,EAAiB,QAAU,OACzC,aAAa,QACb,cAAe,GACf,OAAQ,CAAE,YAAa,cACvB,OAAO,UACP,EAAG,EACH,EAAG,EACH,QAAQ,OACI,cAAA,gBAEXI,GAAcnB,EAACyB,GAAO,KAAM,EAAG,GAAG,cAC9B,CAAA,EACPzB,EAAC0B,EAAG,CAAC,GAAI,EACP,SAAA1B,EAAC2B,EAAK,CAAA,KAAK,KAAK,WAAW,SACxB,SAAAtB,GAEC,CAAA,CAAA,CAAA,CAAA,CAGZ,CAAC,EAEDd,EAAW,YAAc,aACzBW,EAAM,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsxs as f,jsx as t}from"react/jsx-runtime";import g from"./text.js";import{useToggleState as h}from"../../hooks/useToggleState.js";import{css as i}from"@styled/css";import{Flex as S}from"@styled/jsx/flex";import{circle as k}from"@styled/patterns";import{forwardRef as x,useRef as y}from"react";import{useToggleButton as v,useFocusRing as w,mergeProps as N}from"react-aria";const o=x((s,l)=>{const{checked:a,disabled:n=!1,label:r,...d}=s,c=y(null),m=l||c,e=h({...s,isSelected:a}),{buttonProps:p}=v({...d,isDisabled:n},e,m),{isFocusVisible:u,focusProps:b}=w();return f(S,{alignItems:"center",children:[r&&t("div",{className:i({mr:2}),children:t(g,{styles:{fontWeight:500,lineHeight:1},children:r})}),t("button",{...N(p,b),className:i({px:.5,h:5,width:11,_disabled:{opacity:.3,pointerEvents:"none"},bg:e.isSelected?"brand.base":"neutral.primary",_hover:{bg:e.isSelected?"brand.base":"ink.70",_dark:{bg:e.isSelected?"brand.base":"slate.4"}},transition:"background-color 0.2s ease",rounded:"full",outlineColor:u?"brand.base":"transparent",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5,cursor:"pointer"}),children:t("span",{className:k({h:4,w:4,bg:"paper",position:"relative",left:e.isSelected?6:0,transition:"left 0.2s ease"})})})]})});o.displayName="Switch";export{o as default};
1
+ import{jsxs as f,jsx as t}from"react/jsx-runtime";import g from"./text.js";import{useToggleState as h}from"../../hooks/useToggleState.js";import{css as r}from"@styled/css";import{Flex as S}from"@styled/jsx/flex";import{circle as k}from"@styled/patterns";import{forwardRef as x,useRef as y}from"react";import{useToggleButton as v,useFocusRing as w,mergeProps as N}from"react-aria";const o=x((s,l)=>{const{checked:a,disabled:n=!1,label:i,...d}=s,c=y(null),m=l||c,e=h({...s,isSelected:a}),{buttonProps:p}=v({...d,isDisabled:n},e,m),{isFocusVisible:u,focusProps:b}=w();return f(S,{alignItems:"center",children:[i&&t("div",{className:r({mr:2}),children:t(g,{fontWeight:"medium",styles:{lineHeight:1},children:i})}),t("button",{...N(p,b),className:r({px:.5,h:5,width:11,_disabled:{opacity:.3,pointerEvents:"none"},bg:e.isSelected?"brand.base":"neutral.primary",_hover:{bg:e.isSelected?"brand.base":"ink.70",_dark:{bg:e.isSelected?"brand.base":"slate.4"}},transition:"background-color 0.2s ease",rounded:"full",outlineColor:u?"brand.base":"transparent",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5,cursor:"pointer"}),children:t("span",{className:k({h:4,w:4,bg:"paper",position:"relative",left:e.isSelected?6:0,transition:"left 0.2s ease"})})})]})});o.displayName="Switch";export{o as default};
2
2
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sources":["../../../../src/components/primitives/switch.tsx"],"sourcesContent":["import Text from '@components/primitives/text';\nimport { useToggleState } from '@hooks/useToggleState';\nimport { css } from '@styled/css';\nimport { Flex } from '@styled/jsx/flex';\nimport { circle } from '@styled/patterns';\nimport { forwardRef, useRef } from 'react';\nimport { mergeProps, useFocusRing, useToggleButton, type AriaToggleButtonProps } from 'react-aria';\n\nexport type SwitchProps = AriaToggleButtonProps & {\n checked?: boolean;\n disabled?: boolean;\n label?: string;\n};\n\nconst Switch = forwardRef<HTMLButtonElement, SwitchProps>((props, forwardedRef) => {\n const { checked, disabled = false, label, ...otherProps } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const state = useToggleState({ ...props, isSelected: checked });\n\n const { buttonProps } = useToggleButton(\n { ...otherProps, isDisabled: disabled },\n state,\n ref as React.RefObject<HTMLButtonElement>,\n );\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return (\n <Flex alignItems=\"center\">\n {label && (\n <div className={css({ mr: 2 })}>\n <Text styles={{ fontWeight: 500, lineHeight: 1 }}>{label}</Text>\n </div>\n )}\n <button\n {...mergeProps(buttonProps, focusProps)}\n className={css({\n px: 0.5,\n h: 5,\n width: 11,\n _disabled: {\n opacity: 0.3,\n pointerEvents: 'none',\n },\n bg: state.isSelected ? 'brand.base' : 'neutral.primary',\n _hover: {\n bg: !state.isSelected ? 'ink.70' : 'brand.base',\n _dark: {\n bg: !state.isSelected ? 'slate.4' : 'brand.base',\n },\n },\n transition: 'background-color 0.2s ease',\n rounded: 'full',\n outlineColor: isFocusVisible ? 'brand.base' : 'transparent',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n cursor: 'pointer',\n })}\n >\n <span\n className={circle({\n h: 4,\n w: 4,\n bg: 'paper',\n position: 'relative',\n left: state.isSelected ? 6 : 0,\n transition: 'left 0.2s ease',\n })}\n />\n </button>\n </Flex>\n );\n});\n\nSwitch.displayName = 'Switch';\n\nexport default Switch;\n"],"names":["Switch","forwardRef","props","forwardedRef","checked","disabled","label","otherProps","internalRef","useRef","ref","state","useToggleState","buttonProps","useToggleButton","isFocusVisible","focusProps","useFocusRing","_jsxs","Flex","_jsx","css","Text","mergeProps","circle"],"mappings":"4XAcA,MAAMA,EAASC,EAA2C,CAACC,EAAOC,IAAgB,CAChF,KAAM,CAAE,QAAAC,EAAS,SAAAC,EAAW,GAAO,MAAAC,EAAO,GAAGC,CAAY,EAAGL,EAEtDM,EAAcC,EAAO,IAAI,EACzBC,EAAMP,GAAgBK,EAEtBG,EAAQC,EAAe,CAAE,GAAGV,EAAO,WAAYE,CAAO,CAAE,EAExD,CAAE,YAAAS,CAAW,EAAKC,EACtB,CAAE,GAAGP,EAAY,WAAYF,CAAU,EACvCM,EACAD,CAAyC,EAErC,CAAE,eAAAK,EAAgB,WAAAC,GAAeC,IAEvC,OACEC,EAACC,EAAK,CAAA,WAAW,SAAQ,SAAA,CACtBb,GACCc,EAAA,MAAA,CAAK,UAAWC,EAAI,CAAE,GAAI,CAAC,CAAE,EAAC,SAC5BD,EAACE,EAAK,CAAA,OAAQ,CAAE,WAAY,IAAK,WAAY,CAAC,EAAK,SAAAhB,CAAa,CAAA,CAAA,CAAA,EAGpEc,EAAA,SAAA,CAAA,GACMG,EAAWV,EAAaG,CAAU,EACtC,UAAWK,EAAI,CACb,GAAI,GACJ,EAAG,EACH,MAAO,GACP,UAAW,CACT,QAAS,GACT,cAAe,MAChB,EACD,GAAIV,EAAM,WAAa,aAAe,kBACtC,OAAQ,CACN,GAAKA,EAAM,WAAwB,aAAX,SACxB,MAAO,CACL,GAAKA,EAAM,WAAyB,aAAZ,SACzB,CACF,EACD,WAAY,6BACZ,QAAS,OACT,aAAcI,EAAiB,aAAe,cAC9C,aAAc,QACd,aAAc,QACd,cAAe,GACf,OAAQ,SACT,CAAA,EAED,SAAAK,EAAA,OAAA,CACE,UAAWI,EAAO,CAChB,EAAG,EACH,EAAG,EACH,GAAI,QACJ,SAAU,WACV,KAAMb,EAAM,WAAa,EAAI,EAC7B,WAAY,gBACb,CAAA,CACD,CAAA,CAAA,CAAA,CACK,CACJ,CAAA,CAEX,CAAC,EAEDX,EAAO,YAAc"}
1
+ {"version":3,"file":"switch.js","sources":["../../../../src/components/primitives/switch.tsx"],"sourcesContent":["import Text from '@components/primitives/text';\nimport { useToggleState } from '@hooks/useToggleState';\nimport { css } from '@styled/css';\nimport { Flex } from '@styled/jsx/flex';\nimport { circle } from '@styled/patterns';\nimport { forwardRef, useRef } from 'react';\nimport { mergeProps, useFocusRing, useToggleButton, type AriaToggleButtonProps } from 'react-aria';\n\nexport type SwitchProps = AriaToggleButtonProps & {\n checked?: boolean;\n disabled?: boolean;\n label?: string;\n};\n\nconst Switch = forwardRef<HTMLButtonElement, SwitchProps>((props, forwardedRef) => {\n const { checked, disabled = false, label, ...otherProps } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const state = useToggleState({ ...props, isSelected: checked });\n\n const { buttonProps } = useToggleButton(\n { ...otherProps, isDisabled: disabled },\n state,\n ref as React.RefObject<HTMLButtonElement>,\n );\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return (\n <Flex alignItems=\"center\">\n {label && (\n <div className={css({ mr: 2 })}>\n <Text fontWeight=\"medium\" styles={{ lineHeight: 1 }}>\n {label}\n </Text>\n </div>\n )}\n <button\n {...mergeProps(buttonProps, focusProps)}\n className={css({\n px: 0.5,\n h: 5,\n width: 11,\n _disabled: {\n opacity: 0.3,\n pointerEvents: 'none',\n },\n bg: state.isSelected ? 'brand.base' : 'neutral.primary',\n _hover: {\n bg: !state.isSelected ? 'ink.70' : 'brand.base',\n _dark: {\n bg: !state.isSelected ? 'slate.4' : 'brand.base',\n },\n },\n transition: 'background-color 0.2s ease',\n rounded: 'full',\n outlineColor: isFocusVisible ? 'brand.base' : 'transparent',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n cursor: 'pointer',\n })}\n >\n <span\n className={circle({\n h: 4,\n w: 4,\n bg: 'paper',\n position: 'relative',\n left: state.isSelected ? 6 : 0,\n transition: 'left 0.2s ease',\n })}\n />\n </button>\n </Flex>\n );\n});\n\nSwitch.displayName = 'Switch';\n\nexport default Switch;\n"],"names":["Switch","forwardRef","props","forwardedRef","checked","disabled","label","otherProps","internalRef","useRef","ref","state","useToggleState","buttonProps","useToggleButton","isFocusVisible","focusProps","useFocusRing","_jsxs","Flex","_jsx","css","Text","mergeProps","circle"],"mappings":"4XAcA,MAAMA,EAASC,EAA2C,CAACC,EAAOC,IAAgB,CAChF,KAAM,CAAE,QAAAC,EAAS,SAAAC,EAAW,GAAO,MAAAC,EAAO,GAAGC,CAAY,EAAGL,EAEtDM,EAAcC,EAAO,IAAI,EACzBC,EAAMP,GAAgBK,EAEtBG,EAAQC,EAAe,CAAE,GAAGV,EAAO,WAAYE,CAAO,CAAE,EAExD,CAAE,YAAAS,CAAW,EAAKC,EACtB,CAAE,GAAGP,EAAY,WAAYF,CAAU,EACvCM,EACAD,CAAyC,EAErC,CAAE,eAAAK,EAAgB,WAAAC,GAAeC,IAEvC,OACEC,EAACC,EAAK,CAAA,WAAW,SAAQ,SAAA,CACtBb,GACCc,EAAA,MAAA,CAAK,UAAWC,EAAI,CAAE,GAAI,CAAC,CAAE,EAAC,SAC5BD,EAACE,EAAK,CAAA,WAAW,SAAS,OAAQ,CAAE,WAAY,CAAC,EAC9C,SAAAhB,CACI,CAAA,CAAA,CAAA,EAGXc,EAAA,SAAA,CAAA,GACMG,EAAWV,EAAaG,CAAU,EACtC,UAAWK,EAAI,CACb,GAAI,GACJ,EAAG,EACH,MAAO,GACP,UAAW,CACT,QAAS,GACT,cAAe,MAChB,EACD,GAAIV,EAAM,WAAa,aAAe,kBACtC,OAAQ,CACN,GAAKA,EAAM,WAAwB,aAAX,SACxB,MAAO,CACL,GAAKA,EAAM,WAAyB,aAAZ,SACzB,CACF,EACD,WAAY,6BACZ,QAAS,OACT,aAAcI,EAAiB,aAAe,cAC9C,aAAc,QACd,aAAc,QACd,cAAe,GACf,OAAQ,SACT,CAAA,EAED,SAAAK,EAAA,OAAA,CACE,UAAWI,EAAO,CAChB,EAAG,EACH,EAAG,EACH,GAAI,QACJ,SAAU,WACV,KAAMb,EAAM,WAAa,EAAI,EAC7B,WAAY,gBACb,CAAA,CACD,CAAA,CAAA,CAAA,CACK,CACJ,CAAA,CAEX,CAAC,EAEDX,EAAO,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsx as l}from"react/jsx-runtime";import{text as m}from"../../recipes/text.js";import{css as r}from"@styled/css";import{forwardRef as c}from"react";const i={color:"text.primary"},p=c(({children:e,styles:t={},scale:s},a)=>l("h1",{ref:a,className:r({textStyle:s?"h1-scaled":"h1",textWrap:"pretty",...i}),style:t,children:e})),x=c(({children:e,styles:t={},scale:s},a)=>l("h2",{ref:a,className:r({textStyle:s?"h2-scaled":"h2",textWrap:"pretty",...i}),style:t,children:e})),o=c(({children:e,styles:t={},scale:s},a)=>l("h3",{ref:a,className:r({textStyle:s?"h3-scaled":"h3",textWrap:"pretty",...i}),style:t,children:e})),N=c(({children:e,styles:t={},scale:s},a)=>l("h4",{ref:a,className:r({textStyle:s?"h4-scaled":"h4",textWrap:"pretty",...i}),style:t,children:e})),f=c(({children:e,styles:t={},scale:s},a)=>l("h5",{ref:a,className:r({textStyle:s?"h5-scaled":"h5",textWrap:"pretty",...i}),style:t,children:e})),H=c(({children:e,styles:t={},scale:s},a)=>l("h6",{ref:a,className:r({textStyle:s?"h6-scaled":"h6",textWrap:"pretty",color:"text.secondary"}),style:t,children:e})),T=c(({children:e,styles:t={},variant:s="text",size:a="md",truncate:n=!1},y)=>{const d=m({mono:!0,variant:s,size:a});return l("span",{ref:y,className:`${d} ${r({truncate:n})}`,style:t,children:e})}),u=c(({children:e,styles:t={},scale:s,inline:a=!1,variant:n="text",size:y="md",truncate:d=!1},S)=>{const W=m({variant:n,size:y,scale:s}),h={ref:S,className:`${W} ${r({truncate:d})}`,style:t};return a?l("span",{...h,children:e}):l("p",{...h,children:e})}),v=Object.assign(u,{H1:p,H2:x,H3:o,H4:N,H5:f,H6:H,Mono:T});u.displayName="Text",p.displayName="Text.H1",x.displayName="Text.H2",o.displayName="Text.H3",N.displayName="Text.H4",f.displayName="Text.H5",H.displayName="Text.H6",T.displayName="Text.Mono";var $=v;export{$ as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{text as v}from"../../recipes/text.js";import{css as i,cx as z}from"@styled/css";import{forwardRef as o}from"react";const h="text.primary",m=o(({children:e,styles:l={},scale:s,color:a=h,...c},t)=>r("h1",{ref:t,className:i({textStyle:s?"h1-scaled":"h1",color:a,...c}),style:l,children:e})),y=o(({children:e,styles:l={},scale:s,color:a=h,...c},t)=>r("h2",{ref:t,className:i({textStyle:s?"h2-scaled":"h2",color:a,...c}),style:l,children:e})),x=o(({children:e,styles:l={},scale:s,color:a=h,...c},t)=>r("h3",{ref:t,className:i({textStyle:s?"h3-scaled":"h3",color:a,...c}),style:l,children:e})),f=o(({children:e,styles:l={},scale:s,color:a=h,...c},t)=>r("h4",{ref:t,className:i({textStyle:s?"h4-scaled":"h4",color:a,...c}),style:l,children:e})),p=o(({children:e,styles:l={},scale:s,color:a=h,...c},t)=>r("h5",{ref:t,className:i({textStyle:s?"h5-scaled":"h5",color:a,...c}),style:l,children:e})),N=o(({children:e,styles:l={},scale:s,color:a="text.secondary",...c},t)=>r("h6",{ref:t,className:i({textStyle:s?"h6-scaled":"h6",color:a,...c}),style:l,children:e})),n=o(({children:e,styles:l={},scale:s,inline:a=!1,mono:c=!1,variant:t="text",size:T="md",truncate:S=!1,fontWeight:u,...g},b)=>{const j=v({mono:c,variant:t,size:T,scale:s}),d={ref:b,className:z(j,i({truncate:S,fontWeight:u??(t!=="text"?"medium":"normal"),...g})),style:l};return a?r("span",{...d,children:e}):r("p",{...d,children:e})}),H=o((e,l)=>r(n,{ref:l,mono:!0,...e})),M=Object.assign(n,{H1:m,H2:y,H3:x,H4:f,H5:p,H6:N,Mono:H});n.displayName="Text",m.displayName="Text.H1",y.displayName="Text.H2",x.displayName="Text.H3",f.displayName="Text.H4",p.displayName="Text.H5",N.displayName="Text.H6",H.displayName="Text.Mono";export{M as default};
2
2
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sources":["../../../../src/components/primitives/text.tsx"],"sourcesContent":["import { text } from '@recipes/text';\nimport { css } from '@styled/css';\nimport { CSSProperties, PropsWithChildren, forwardRef } from 'react';\n\nexport type TextStyles = {\n color?: CSSProperties['color'];\n fontWeight?: CSSProperties['fontWeight'];\n fontSize?: CSSProperties['fontSize'];\n lineHeight?: CSSProperties['lineHeight'];\n letterSpacing?: CSSProperties['letterSpacing'];\n textAlign?: CSSProperties['textAlign'];\n textDecoration?: CSSProperties['textDecoration'];\n textTransform?: CSSProperties['textTransform'];\n};\n\nexport interface TextProps extends PropsWithChildren {\n styles?: TextStyles;\n scale?: boolean;\n}\n\nexport interface BodyProps extends TextProps {\n inline?: boolean;\n variant?: 'text' | 'error' | 'info' | 'success' | 'warning';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n truncate?: boolean;\n}\n\nconst defaultColor = { color: 'text.primary' };\n\nconst TextH1 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h1\n ref={ref}\n className={css({ textStyle: scale ? 'h1-scaled' : 'h1', textWrap: 'pretty', ...defaultColor })}\n style={styles}\n >\n {children}\n </h1>\n));\n\nconst TextH2 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h2\n ref={ref}\n className={css({ textStyle: scale ? 'h2-scaled' : 'h2', textWrap: 'pretty', ...defaultColor })}\n style={styles}\n >\n {children}\n </h2>\n));\n\nconst TextH3 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h3\n ref={ref}\n className={css({ textStyle: scale ? 'h3-scaled' : 'h3', textWrap: 'pretty', ...defaultColor })}\n style={styles}\n >\n {children}\n </h3>\n));\n\nconst TextH4 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h4\n ref={ref}\n className={css({ textStyle: scale ? 'h4-scaled' : 'h4', textWrap: 'pretty', ...defaultColor })}\n style={styles}\n >\n {children}\n </h4>\n));\n\nconst TextH5 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h5\n ref={ref}\n className={css({ textStyle: scale ? 'h5-scaled' : 'h5', textWrap: 'pretty', ...defaultColor })}\n style={styles}\n >\n {children}\n </h5>\n));\n\nconst TextH6 = forwardRef<HTMLHeadingElement, TextProps>(({ children, styles = {}, scale }, ref) => (\n <h6\n ref={ref}\n className={css({ textStyle: scale ? 'h6-scaled' : 'h6', textWrap: 'pretty', color: 'text.secondary' })}\n style={styles}\n >\n {children}\n </h6>\n));\n\nconst TextMono = forwardRef<HTMLParagraphElement, BodyProps>(\n ({ children, styles = {}, variant = 'text', size = 'md', truncate = false }, ref) => {\n const classStyles = text({ mono: true, variant, size });\n\n return (\n <span ref={ref} className={`${classStyles} ${css({ truncate })}`} style={styles}>\n {children}\n </span>\n );\n },\n);\n\nconst Body = forwardRef<HTMLParagraphElement, BodyProps>(\n ({ children, styles = {}, scale, inline = false, variant = 'text', size = 'md', truncate = false }, ref) => {\n const classStyles = text({ variant, size, scale });\n const bodyProps = {\n ref,\n className: `${classStyles} ${css({ truncate })}`,\n style: styles,\n };\n\n if (inline) {\n return <span {...bodyProps}>{children}</span>;\n }\n\n return <p {...bodyProps}>{children}</p>;\n },\n);\n\nconst Text = Object.assign(Body, {\n H1: TextH1,\n H2: TextH2,\n H3: TextH3,\n H4: TextH4,\n H5: TextH5,\n H6: TextH6,\n Mono: TextMono,\n});\n\nBody.displayName = 'Text';\nTextH1.displayName = 'Text.H1';\nTextH2.displayName = 'Text.H2';\nTextH3.displayName = 'Text.H3';\nTextH4.displayName = 'Text.H4';\nTextH5.displayName = 'Text.H5';\nTextH6.displayName = 'Text.H6';\nTextMono.displayName = 'Text.Mono';\n\nexport default Text;\n"],"names":["defaultColor","TextH1","forwardRef","children","styles","scale","ref","_jsx","css","TextH2","TextH3","TextH4","TextH5","TextH6","TextMono","variant","size","truncate","classStyles","text","Body","inline","bodyProps","Text"],"mappings":"0JA2BA,MAAMA,EAAe,CAAE,MAAO,gBAExBC,EAASC,EAA0C,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,GAAI,MAAAC,CAAO,EAAEC,IAC1FC,EAAA,KAAA,CACE,IAAKD,EACL,UAAWE,EAAI,CAAE,UAAWH,EAAQ,YAAc,KAAM,SAAU,SAAU,GAAGL,CAAY,CAAE,EAC7F,MAAOI,EAAM,SAEZD,CAAQ,CAAA,CAEZ,EAEKM,EAASP,EAA0C,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,CAAA,EAAI,MAAAC,CAAO,EAAEC,IAC1FC,EAAA,KAAA,CACE,IAAKD,EACL,UAAWE,EAAI,CAAE,UAAWH,EAAQ,YAAc,KAAM,SAAU,SAAU,GAAGL,CAAY,CAAE,EAC7F,MAAOI,EAAM,SAEZD,CAAQ,CAAA,CAEZ,EAEKO,EAASR,EAA0C,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,CAAA,EAAI,MAAAC,CAAO,EAAEC,IAC1FC,EAAA,KAAA,CACE,IAAKD,EACL,UAAWE,EAAI,CAAE,UAAWH,EAAQ,YAAc,KAAM,SAAU,SAAU,GAAGL,CAAY,CAAE,EAC7F,MAAOI,EAAM,SAEZD,CAAQ,CAAA,CAEZ,EAEKQ,EAAST,EAA0C,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,CAAA,EAAI,MAAAC,CAAO,EAAEC,IAC1FC,EAAA,KAAA,CACE,IAAKD,EACL,U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AAC,EAAM,MAAAX,CAAO,CAAA,EAC3CiB,EAAY,CAChB,IAAAhB,EACA,UAAW,GAAGY,CAAW,IAAIV,EAAI,CAAE,SAAAS,CAAU,CAAA,CAAC,GAC9C,MAAOb,GAGT,OAAIiB,EACKd,EAAU,OAAA,CAAA,GAAAe,EAAY,SAAAnB,IAGxBI,EAAO,IAAA,CAAA,GAAAe,EAAY,SAAAnB,GAC5B,CAAC,EAGGoB,EAAO,OAAO,OAAOH,EAAM,CAC/B,GAAInB,EACJ,GAAIQ,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,EACJ,KAAMC,CACP,CAAA,EAEDM,EAAK,YAAc,OACnBnB,EAAO,YAAc,UACrBQ,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAS,YAAc,YAEvB,MAAeS"}
1
+ {"version":3,"file":"text.js","sources":["../../../../src/components/primitives/text.tsx"],"sourcesContent":["import { text } from '@recipes/text';\nimport { css, cx } from '@styled/css';\nimport { CSSProperties, PropsWithChildren, forwardRef } from 'react';\n\nexport type TextStyles = {\n color?: CSSProperties['color'];\n fontWeight?: CSSProperties['fontWeight'];\n fontSize?: CSSProperties['fontSize'];\n lineHeight?: CSSProperties['lineHeight'];\n letterSpacing?: CSSProperties['letterSpacing'];\n textAlign?: CSSProperties['textAlign'];\n textDecoration?: CSSProperties['textDecoration'];\n textTransform?: CSSProperties['textTransform'];\n textWrap?: CSSProperties['textWrap'];\n maxWidth?: CSSProperties['maxWidth'];\n};\n\nexport interface TextProps extends PropsWithChildren {\n styles?: TextStyles;\n scale?: boolean;\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';\n color?: 'text.primary' | 'text.secondary' | 'text.tertiary' | 'text.quaternary';\n}\n\nexport interface BodyProps extends TextProps {\n inline?: boolean;\n mono?: boolean;\n variant?: 'text' | 'error' | 'info' | 'success' | 'warning';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n truncate?: boolean;\n}\n\nconst defaultColor = 'text.primary';\n\nconst TextH1 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = defaultColor, ...props }, ref) => (\n <h1 ref={ref} className={css({ textStyle: scale ? 'h1-scaled' : 'h1', color, ...props })} style={styles}>\n {children}\n </h1>\n ),\n);\n\nconst TextH2 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = defaultColor, ...props }, ref) => (\n <h2 ref={ref} className={css({ textStyle: scale ? 'h2-scaled' : 'h2', color, ...props })} style={styles}>\n {children}\n </h2>\n ),\n);\n\nconst TextH3 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = defaultColor, ...props }, ref) => (\n <h3 ref={ref} className={css({ textStyle: scale ? 'h3-scaled' : 'h3', color, ...props })} style={styles}>\n {children}\n </h3>\n ),\n);\n\nconst TextH4 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = defaultColor, ...props }, ref) => (\n <h4 ref={ref} className={css({ textStyle: scale ? 'h4-scaled' : 'h4', color, ...props })} style={styles}>\n {children}\n </h4>\n ),\n);\n\nconst TextH5 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = defaultColor, ...props }, ref) => (\n <h5 ref={ref} className={css({ textStyle: scale ? 'h5-scaled' : 'h5', color, ...props })} style={styles}>\n {children}\n </h5>\n ),\n);\n\nconst TextH6 = forwardRef<HTMLHeadingElement, TextProps>(\n ({ children, styles = {}, scale, color = 'text.secondary', ...props }, ref) => (\n <h6 ref={ref} className={css({ textStyle: scale ? 'h6-scaled' : 'h6', color, ...props })} style={styles}>\n {children}\n </h6>\n ),\n);\n\nconst Body = forwardRef<HTMLParagraphElement, BodyProps>(\n (\n {\n children,\n styles = {},\n scale,\n inline = false,\n mono = false,\n variant = 'text',\n size = 'md',\n truncate = false,\n fontWeight,\n ...props\n },\n ref,\n ) => {\n const classStyles = text({ mono, variant, size, scale });\n const fontWeightStyle = fontWeight ?? (variant !== 'text' ? 'medium' : 'normal');\n const bodyProps = {\n ref,\n className: cx(classStyles, css({ truncate, fontWeight: fontWeightStyle, ...props })),\n style: styles,\n };\n\n if (inline) {\n return <span {...bodyProps}>{children}</span>;\n }\n\n return <p {...bodyProps}>{children}</p>;\n },\n);\n\nconst TextMono = forwardRef<HTMLParagraphElement, BodyProps>((props, ref) => {\n return <Body ref={ref} mono {...props} />;\n});\n\nconst Text = Object.assign(Body, {\n H1: TextH1,\n H2: TextH2,\n H3: TextH3,\n H4: TextH4,\n H5: TextH5,\n H6: TextH6,\n Mono: TextMono,\n});\n\nBody.displayName = 'Text';\nTextH1.displayName = 'Text.H1';\nTextH2.displayName = 'Text.H2';\nTextH3.displayName = 'Text.H3';\nTextH4.displayName = 'Text.H4';\nTextH5.displayName = 'Text.H5';\nTextH6.displayName = 'Text.H6';\nTextMono.displayName = 'Text.Mono';\n\nexport default Text;\n"],"names":["defaultColor","TextH1","forwardRef","children","styles","scale","color","props","ref","_jsx","css","TextH2","TextH3","TextH4","TextH5","TextH6","Body","inline","mono","variant","size","truncate","fontWeight","classStyles","text","bodyProps","cx","TextMono","Text"],"mappings":"kKAgCA,MAAMA,EAAe,eAEfC,EAASC,EACb,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,CAAE,EAAE,MAAAC,EAAO,MAAAC,EAAQN,EAAc,GAAGO,CAAK,EAAIC,IACjEC,EAAI,KAAA,CAAA,IAAKD,EAAK,UAAWE,EAAI,CAAE,UAAWL,EAAQ,YAAc,KAAM,MAAAC,EAAO,GAAGC,CAAO,CAAA,EAAG,MAAOH,EAC9F,SAAAD,CACE,CAAA,CACN,EAGGQ,EAAST,EACb,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAS,CAAE,EAAE,MAAAC,EAAO,MAAAC,EAAQN,EAAc,GAAGO,CAAK,EAAIC,IACjEC,EAAI,KAAA,CAAA,IAA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C9F,SAAAD,CACE,CAAA,CACN,EAGGa,EAAOd,EACX,CACE,CACE,SAAAC,EACA,OAAAC,EAAS,GACT,MAAAC,EACA,OAAAY,EAAS,GACT,KAAAC,EAAO,GACP,QAAAC,EAAU,OACV,KAAAC,EAAO,KACP,SAAAC,EAAW,GACX,WAAAC,EACA,GAAGf,GAELC,IACE,CACF,MAAMe,EAAcC,EAAK,CAAE,KAAAN,EAAM,QAAAC,EAAS,KAAAC,EAAM,MAAAf,CAAK,CAAE,EAEjDoB,EAAY,CAChB,IAAAjB,EACA,UAAWkB,EAAGH,EAAab,EAAI,CAAE,SAAAW,EAAU,WAHrBC,IAAeH,IAAY,OAAS,SAAW,UAGG,GAAGZ,CAAK,CAAE,CAAC,EACnF,MAAOH,GAGT,OAAIa,EACKR,EAAU,OAAA,CAAA,GAAAgB,EAAY,SAAAtB,IAGxBM,EAAO,IAAA,CAAA,GAAAgB,EAAY,SAAAtB,GAC5B,CAAC,EAGGwB,EAAWzB,EAA4C,CAACK,EAAOC,IAC5DC,EAACO,EAAI,CAAC,IAAKR,EAAK,KAAI,GAAA,GAAKD,CAAK,CAAA,CACtC,EAEKqB,EAAO,OAAO,OAAOZ,EAAM,CAC/B,GAAIf,EACJ,GAAIU,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,EACJ,GAAIC,EACJ,KAAMY,CACP,CAAA,EAEDX,EAAK,YAAc,OACnBf,EAAO,YAAc,UACrBU,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBC,EAAO,YAAc,UACrBY,EAAS,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsxs as f,jsx as o}from"react/jsx-runtime";import"../feedback/callout.js";import{LoadingSpinner as u}from"../feedback/loading-spinner.js";import"../feedback/progress-bar.js";import{token as C}from"@styled/tokens";import j from"../icons/ico-checkmark-circle-fill.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import x from"../primitives/text.js";import"../primitives/portal.js";import"react";import"../../hooks/useToast.js";import"../../recipes/toast.js";import{VStack as y,Center as S}from"@styled/jsx";import"../feedback/tooltip.js";import"../inputs/phone-input.js";import{PinCodeInput as b}from"../inputs/pincode-input.js";import"../inputs/text-input.js";import{createSlot as k,createHost as F}from"create-slots";const i=k(({children:r})=>r),L=r=>{const{isPending:e,isSuccess:n,onChange:m,onComplete:p,originName:s,pinLength:c,id:a,autoFocus:g,errorMessage:t,children:h}=r,d=()=>e?o(u,{size:36,strokeWidth:4}):n?o(j,{color:C("colors.brand.base"),width:36,height:36}):o(b,{originName:s,onChange:m,pinLength:c,onComplete:p,id:a,autoFocus:g});return F(h,l=>f(y,{gap:3,my:3,children:[o(S,{height:12,children:d()}),t&&o(x,{variant:"error",size:"sm",styles:{textAlign:"center"},children:t}),l.get(i)]}))},P=Object.assign(L,{RetryContent:i});export{P as VerifyPincode};
1
+ import{jsxs as f,jsx as o}from"react/jsx-runtime";import"../feedback/callout.js";import{LoadingSpinner as u}from"../feedback/loading-spinner.js";import"../feedback/progress-bar.js";import{token as C}from"@styled/tokens";import x from"../icons/ico-checkmark-circle-fill.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import y from"../primitives/text.js";import"../primitives/portal.js";import"react";import"../../hooks/useToast.js";import"../../recipes/toast.js";import{VStack as S,Center as b}from"@styled/jsx";import"../feedback/tooltip.js";import"../inputs/phone-input.js";import{PinCodeInput as j}from"../inputs/pincode-input.js";import"../inputs/text-input.js";import{createSlot as k,createHost as F}from"create-slots";const i=k(({children:r})=>r),L=r=>{const{isPending:e,isSuccess:n,onChange:m,onComplete:p,originName:s,pinLength:c,id:a,autoFocus:g,errorMessage:t,children:h}=r,d=()=>e?o(u,{size:36,strokeWidth:4}):n?o(x,{color:C("colors.brand.base"),width:36,height:36}):o(j,{originName:s,onChange:m,pinLength:c,onComplete:p,id:a,autoFocus:g});return F(h,l=>f(S,{gap:3,my:3,children:[o(b,{height:12,children:d()}),t&&o(y,{variant:"error",size:"sm",styles:{textAlign:"center"},children:t}),l.get(i)]}))},P=Object.assign(L,{RetryContent:i});export{P as VerifyPincode};
2
2
  //# sourceMappingURL=verify-pincode.js.map
@@ -1,2 +1,2 @@
1
- import{sva as o}from"@styled/css";const e=o({slots:["container","label","description","icon","button","focus"],base:{container:{px:4,py:3,rounded:10,w:"full"},button:{cursor:"pointer",outline:"none",_focusVisible:{outlineColor:"brand.base",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5,rounded:2}}},variants:{size:{sm:{label:{fontSize:"sm"}},md:{label:{fontSize:"md"}},lg:{label:{fontSize:"lg"}}},variant:{branded:{container:{bg:"brand.lightest",_focusVisible:{outlineColor:"brand.lightest"}},label:{color:"brand.darkest"},description:{color:"brand.darkest"},icon:{color:"brand.darkest"},button:{color:"brand.darkest"}},success:{container:{bg:"positive.lightest",_focusVisible:{outlineColor:"positive.lightest"}},label:{color:"positive.darkest"},description:{color:"positive.darkest"},icon:{color:"positive.darkest"},button:{color:"positive.darkest"}},error:{container:{bg:"negative.lightest",_focusVisible:{outlineColor:"negative.lightest"}},label:{color:"negative.darkest"},description:{color:"negative.darkest"},icon:{color:"negative.darkest"},button:{color:"negative.darkest"}},warning:{container:{bg:"warning.lightest",_focusVisible:{outlineColor:"warning.lightest"}},label:{color:"warning.darkest"},description:{color:"warning.darkest"},icon:{color:"warning.darkest"},button:{color:"warning.darkest"}},neutral:{container:{bg:"surface.secondary",_focusVisible:{outlineColor:"surface.secondary"}},label:{color:"text.secondary"},description:{color:"text.secondary"},icon:{color:"text.secondary"},button:{color:"text.secondary"}}},icon:{true:{description:{ml:7}}},dismissible:{true:{description:{mr:7}}},interactive:{true:{container:{cursor:"pointer",transition:"transform 0.2s ease, opacity 0.2s ease",_active:{transform:"scale(0.95)"},_hover:{opacity:.8},_focusVisible:{outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5}}}},description:{true:{label:{textTransform:"uppercase",fontSize:"xs",fontWeight:"semibold",letterSpacing:"0.06rem"}}},isDismissed:{true:{container:{animationFillMode:"forwards",animationName:"scaleOut",animationDuration:"150ms",_motionReduce:{scale:1}}}}}});export{e as callout};
1
+ import{sva as e}from"@styled/css";const o=e({slots:["container","label","description","icon","button","focus"],base:{container:{px:4,py:3,rounded:10,w:"full"},button:{cursor:"pointer",outline:"none",_focusVisible:{outlineColor:"brand.base",outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5,rounded:2}},label:{textAlign:"left"}},variants:{size:{sm:{label:{fontSize:"sm"}},md:{label:{fontSize:"md"}},lg:{label:{fontSize:"lg"}}},variant:{branded:{container:{bg:"brand.lightest",_focusVisible:{outlineColor:"brand.lightest"}},label:{color:"brand.darkest"},description:{color:"brand.darkest"},icon:{color:"brand.darkest"},button:{color:"brand.darkest"}},success:{container:{bg:"positive.lightest",_focusVisible:{outlineColor:"positive.lightest"}},label:{color:"positive.darkest"},description:{color:"positive.darkest"},icon:{color:"positive.darkest"},button:{color:"positive.darkest"}},error:{container:{bg:"negative.lightest",_focusVisible:{outlineColor:"negative.lightest"}},label:{color:"negative.darkest"},description:{color:"negative.darkest"},icon:{color:"negative.darkest"},button:{color:"negative.darkest"}},warning:{container:{bg:"warning.lightest",_focusVisible:{outlineColor:"warning.lightest"}},label:{color:"warning.darkest"},description:{color:"warning.darkest"},icon:{color:"warning.darkest"},button:{color:"warning.darkest"}},neutral:{container:{bg:"surface.secondary",_focusVisible:{outlineColor:"surface.secondary"}},label:{color:"text.secondary"},description:{color:"text.secondary"},icon:{color:"text.secondary"},button:{color:"text.secondary"}}},icon:{true:{description:{ml:7}}},dismissible:{true:{description:{mr:7}}},interactive:{true:{container:{cursor:"pointer",transition:"transform 0.2s ease, opacity 0.2s ease",_active:{transform:"scale(0.95)"},_hover:{opacity:.8},_focusVisible:{outlineStyle:"solid",outlineWidth:"thick",outlineOffset:.5}}}},description:{true:{label:{textTransform:"uppercase",fontSize:"xs",fontWeight:"semibold",letterSpacing:"0.06rem"}}},isDismissed:{true:{container:{animationFillMode:"forwards",animationName:"scaleOut",animationDuration:"150ms",_motionReduce:{scale:1}}}}}});export{o as callout};
2
2
  //# sourceMappingURL=callout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callout.js","sources":["../../../src/recipes/callout.ts"],"sourcesContent":["import { sva } from '@styled/css';\n\nexport const callout = sva({\n slots: ['container', 'label', 'description', 'icon', 'button', 'focus'],\n base: {\n container: {\n px: 4,\n py: 3,\n rounded: 10,\n w: 'full',\n },\n button: {\n cursor: 'pointer',\n outline: 'none',\n _focusVisible: {\n outlineColor: 'brand.base',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n rounded: 2,\n },\n },\n },\n variants: {\n size: {\n sm: {\n label: { fontSize: 'sm' },\n },\n md: {\n label: { fontSize: 'md' },\n },\n lg: {\n label: { fontSize: 'lg' },\n },\n },\n variant: {\n branded: {\n container: {\n bg: 'brand.lightest',\n _focusVisible: {\n outlineColor: 'brand.lightest',\n },\n },\n label: {\n color: 'brand.darkest',\n },\n description: {\n color: 'brand.darkest',\n },\n icon: {\n color: 'brand.darkest',\n },\n button: {\n color: 'brand.darkest',\n },\n },\n success: {\n container: {\n bg: 'positive.lightest',\n _focusVisible: {\n outlineColor: 'positive.lightest',\n },\n },\n label: {\n color: 'positive.darkest',\n },\n description: {\n color: 'positive.darkest',\n },\n icon: {\n color: 'positive.darkest',\n },\n button: {\n color: 'positive.darkest',\n },\n },\n error: {\n container: {\n bg: 'negative.lightest',\n _focusVisible: {\n outlineColor: 'negative.lightest',\n },\n },\n label: {\n color: 'negative.darkest',\n },\n description: {\n color: 'negative.darkest',\n },\n icon: {\n color: 'negative.darkest',\n },\n button: {\n color: 'negative.darkest',\n },\n },\n warning: {\n container: {\n bg: 'warning.lightest',\n _focusVisible: {\n outlineColor: 'warning.lightest',\n },\n },\n label: {\n color: 'warning.darkest',\n },\n description: {\n color: 'warning.darkest',\n },\n icon: {\n color: 'warning.darkest',\n },\n button: {\n color: 'warning.darkest',\n },\n },\n neutral: {\n container: {\n bg: 'surface.secondary',\n _focusVisible: {\n outlineColor: 'surface.secondary',\n },\n },\n label: {\n color: 'text.secondary',\n },\n description: {\n color: 'text.secondary',\n },\n icon: {\n color: 'text.secondary',\n },\n button: {\n color: 'text.secondary',\n },\n },\n },\n icon: {\n true: {\n description: {\n ml: 7,\n },\n },\n },\n dismissible: {\n true: {\n description: {\n mr: 7,\n },\n },\n },\n interactive: {\n true: {\n container: {\n cursor: 'pointer',\n transition: 'transform 0.2s ease, opacity 0.2s ease',\n _active: { transform: 'scale(0.95)' },\n _hover: {\n opacity: 0.8,\n },\n _focusVisible: {\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n },\n },\n },\n },\n description: {\n true: {\n label: {\n textTransform: 'uppercase',\n fontSize: 'xs',\n fontWeight: 'semibold',\n letterSpacing: '0.06rem',\n },\n },\n },\n isDismissed: {\n true: {\n container: {\n animationFillMode: 'forwards',\n animationName: 'scaleOut',\n animationDuration: '150ms',\n _motionReduce: { scale: 1 },\n },\n },\n },\n },\n});\n"],"names":["callout","sva"],"mappings":"kCAEa,MAAAA,EAAUC,EAAI,CACzB,MAAO,CAAC,YAAa,QAAS,cAAe,OAAQ,SAAU,OAAO,EACtE,KAAM,CACJ,UAAW,CACT,GAAI,EACJ,GAAI,EACJ,QAAS,GACT,EAAG,MACJ,EACD,OAAQ,CACN,OAAQ,UACR,QAAS,OACT,cAAe,CACb,aAAc,aACd,aAAc,QACd,aAAc,QACd,cAAe,GACf,QAAS,CACV,CACF,CACF,EACD,SAAU,CACR,KAAM,CACJ,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,EACD,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,EACD,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,CACF,EACD,QAAS,CACP,QAAS,CACP,UAAW,CACT,GAAI,iBACJ,cAAe,CACb,aAAc,gBACf,CACF,EACD,MAAO,CACL,MAAO,eACR,EACD,YAAa,CACX,MAAO,eACR,EACD,KAAM,CACJ,MAAO,eACR,EACD,OAAQ,CACN,MAAO,eACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,kBACR,EACD,YAAa,CACX,MAAO,kBACR,EACD,KAAM,CACJ,MAAO,kBACR,EACD,OAAQ,CACN,MAAO,kBACR,CACF,EACD,MAAO,CACL,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,kBACR,EACD,YAAa,CACX,MAAO,kBACR,EACD,KAAM,CACJ,MAAO,kBACR,EACD,OAAQ,CACN,MAAO,kBACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,mBACJ,cAAe,CACb,aAAc,kBACf,CACF,EACD,MAAO,CACL,MAAO,iBACR,EACD,YAAa,CACX,MAAO,iBACR,EACD,KAAM,CACJ,MAAO,iBACR,EACD,OAAQ,CACN,MAAO,iBACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,gBACR,EACD,YAAa,CACX,MAAO,gBACR,EACD,KAAM,CACJ,MAAO,gBACR,EACD,OAAQ,CACN,MAAO,gBACR,CACF,CACF,EACD,KAAM,CACJ,KAAM,CACJ,YAAa,CACX,GAAI,CACL,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,YAAa,CACX,GAAI,CACL,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,UAAW,CACT,OAAQ,UACR,WAAY,yCACZ,QAAS,CAAE,UAAW,aAAe,EACrC,OAAQ,CACN,QAAS,EACV,EACD,cAAe,CACb,aAAc,QACd,aAAc,QACd,cAAe,EAChB,CACF,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,MAAO,CACL,cAAe,YACf,SAAU,KACV,WAAY,WACZ,cAAe,SAChB,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,UAAW,CACT,kBAAmB,WACnB,cAAe,WACf,kBAAmB,QACnB,cAAe,CAAE,MAAO,CAAG,CAC5B,CACF,CACF,CACF,CACF,CAAA"}
1
+ {"version":3,"file":"callout.js","sources":["../../../src/recipes/callout.ts"],"sourcesContent":["import { sva } from '@styled/css';\n\nexport const callout = sva({\n slots: ['container', 'label', 'description', 'icon', 'button', 'focus'],\n base: {\n container: {\n px: 4,\n py: 3,\n rounded: 10,\n w: 'full',\n },\n button: {\n cursor: 'pointer',\n outline: 'none',\n _focusVisible: {\n outlineColor: 'brand.base',\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n rounded: 2,\n },\n },\n label: {\n textAlign: 'left',\n },\n },\n variants: {\n size: {\n sm: {\n label: { fontSize: 'sm' },\n },\n md: {\n label: { fontSize: 'md' },\n },\n lg: {\n label: { fontSize: 'lg' },\n },\n },\n variant: {\n branded: {\n container: {\n bg: 'brand.lightest',\n _focusVisible: {\n outlineColor: 'brand.lightest',\n },\n },\n label: {\n color: 'brand.darkest',\n },\n description: {\n color: 'brand.darkest',\n },\n icon: {\n color: 'brand.darkest',\n },\n button: {\n color: 'brand.darkest',\n },\n },\n success: {\n container: {\n bg: 'positive.lightest',\n _focusVisible: {\n outlineColor: 'positive.lightest',\n },\n },\n label: {\n color: 'positive.darkest',\n },\n description: {\n color: 'positive.darkest',\n },\n icon: {\n color: 'positive.darkest',\n },\n button: {\n color: 'positive.darkest',\n },\n },\n error: {\n container: {\n bg: 'negative.lightest',\n _focusVisible: {\n outlineColor: 'negative.lightest',\n },\n },\n label: {\n color: 'negative.darkest',\n },\n description: {\n color: 'negative.darkest',\n },\n icon: {\n color: 'negative.darkest',\n },\n button: {\n color: 'negative.darkest',\n },\n },\n warning: {\n container: {\n bg: 'warning.lightest',\n _focusVisible: {\n outlineColor: 'warning.lightest',\n },\n },\n label: {\n color: 'warning.darkest',\n },\n description: {\n color: 'warning.darkest',\n },\n icon: {\n color: 'warning.darkest',\n },\n button: {\n color: 'warning.darkest',\n },\n },\n neutral: {\n container: {\n bg: 'surface.secondary',\n _focusVisible: {\n outlineColor: 'surface.secondary',\n },\n },\n label: {\n color: 'text.secondary',\n },\n description: {\n color: 'text.secondary',\n },\n icon: {\n color: 'text.secondary',\n },\n button: {\n color: 'text.secondary',\n },\n },\n },\n icon: {\n true: {\n description: {\n ml: 7,\n },\n },\n },\n dismissible: {\n true: {\n description: {\n mr: 7,\n },\n },\n },\n interactive: {\n true: {\n container: {\n cursor: 'pointer',\n transition: 'transform 0.2s ease, opacity 0.2s ease',\n _active: { transform: 'scale(0.95)' },\n _hover: {\n opacity: 0.8,\n },\n _focusVisible: {\n outlineStyle: 'solid',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n },\n },\n },\n },\n description: {\n true: {\n label: {\n textTransform: 'uppercase',\n fontSize: 'xs',\n fontWeight: 'semibold',\n letterSpacing: '0.06rem',\n },\n },\n },\n isDismissed: {\n true: {\n container: {\n animationFillMode: 'forwards',\n animationName: 'scaleOut',\n animationDuration: '150ms',\n _motionReduce: { scale: 1 },\n },\n },\n },\n },\n});\n"],"names":["callout","sva"],"mappings":"kCAEa,MAAAA,EAAUC,EAAI,CACzB,MAAO,CAAC,YAAa,QAAS,cAAe,OAAQ,SAAU,OAAO,EACtE,KAAM,CACJ,UAAW,CACT,GAAI,EACJ,GAAI,EACJ,QAAS,GACT,EAAG,MACJ,EACD,OAAQ,CACN,OAAQ,UACR,QAAS,OACT,cAAe,CACb,aAAc,aACd,aAAc,QACd,aAAc,QACd,cAAe,GACf,QAAS,CACV,CACF,EACD,MAAO,CACL,UAAW,MACZ,CACF,EACD,SAAU,CACR,KAAM,CACJ,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,EACD,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,EACD,GAAI,CACF,MAAO,CAAE,SAAU,IAAM,CAC1B,CACF,EACD,QAAS,CACP,QAAS,CACP,UAAW,CACT,GAAI,iBACJ,cAAe,CACb,aAAc,gBACf,CACF,EACD,MAAO,CACL,MAAO,eACR,EACD,YAAa,CACX,MAAO,eACR,EACD,KAAM,CACJ,MAAO,eACR,EACD,OAAQ,CACN,MAAO,eACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,kBACR,EACD,YAAa,CACX,MAAO,kBACR,EACD,KAAM,CACJ,MAAO,kBACR,EACD,OAAQ,CACN,MAAO,kBACR,CACF,EACD,MAAO,CACL,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,kBACR,EACD,YAAa,CACX,MAAO,kBACR,EACD,KAAM,CACJ,MAAO,kBACR,EACD,OAAQ,CACN,MAAO,kBACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,mBACJ,cAAe,CACb,aAAc,kBACf,CACF,EACD,MAAO,CACL,MAAO,iBACR,EACD,YAAa,CACX,MAAO,iBACR,EACD,KAAM,CACJ,MAAO,iBACR,EACD,OAAQ,CACN,MAAO,iBACR,CACF,EACD,QAAS,CACP,UAAW,CACT,GAAI,oBACJ,cAAe,CACb,aAAc,mBACf,CACF,EACD,MAAO,CACL,MAAO,gBACR,EACD,YAAa,CACX,MAAO,gBACR,EACD,KAAM,CACJ,MAAO,gBACR,EACD,OAAQ,CACN,MAAO,gBACR,CACF,CACF,EACD,KAAM,CACJ,KAAM,CACJ,YAAa,CACX,GAAI,CACL,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,YAAa,CACX,GAAI,CACL,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,UAAW,CACT,OAAQ,UACR,WAAY,yCACZ,QAAS,CAAE,UAAW,aAAe,EACrC,OAAQ,CACN,QAAS,EACV,EACD,cAAe,CACb,aAAc,QACd,aAAc,QACd,cAAe,EAChB,CACF,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,MAAO,CACL,cAAe,YACf,SAAU,KACV,WAAY,WACZ,cAAe,SAChB,CACF,CACF,EACD,YAAa,CACX,KAAM,CACJ,UAAW,CACT,kBAAmB,WACnB,cAAe,WACf,kBAAmB,QACnB,cAAe,CAAE,MAAO,CAAG,CAC5B,CACF,CACF,CACF,CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- import{cva as e}from"@styled/css";const a=e({base:{bgColor:"surface.primary",borderRadius:"1rem"},variants:{asButton:{false:{cursor:"default"},true:{alignItems:"center",cursor:"pointer",h:"10.75rem",justifyContent:"center",p:4,transition:"all 0.1s ease",w:"10.75rem",_active:{transform:"scale(0.95)"}}},alignment:{center:{alignItems:"center"},left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}},alt:{true:{}},expand:{false:{overflow:"hidden"},true:{overflow:"visible",w:"full"}},gapType:{none:{gap:0},sm:{gap:4},md:{gap:5},lg:{gap:6}},heavyShadow:{false:{boxShadow:"0px 1px 2px rgba(189, 189, 189, 0.3)"},true:{boxShadow:"8px 8px 48px rgba(16, 15, 17, 0.14)"}},paddingType:{none:{p:0},sm:{px:4,py:3},md:{px:8,py:6},lg:{p:12}},widthMax:{true:{flex:1,maxW:"29.125rem",mdDown:{maxW:"full"}}}},compoundVariants:[{asButton:!0,alt:!0,css:{bgColor:"surface.tertiary",color:"text.secondary",_hover:{filter:"brightness(0.9)"}}}],defaultVariants:{alt:!1,expand:!1,gapType:"md",heavyShadow:!1,paddingType:"md",widthMax:!1}});export{a as card};
1
+ import{cva as e}from"@styled/css";const a=e({base:{bgColor:"surface.primary",borderRadius:"1rem"},variants:{asButton:{false:{cursor:"default"},true:{alignItems:"center",cursor:"pointer",h:"10.75rem",justifyContent:"center",p:4,transition:"all 0.1s ease",w:"10.75rem",_active:{transform:"scale(0.95)"}}},alignment:{center:{alignItems:"center"},left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}},alt:{true:{}},expand:{false:{overflow:"hidden"},true:{overflow:"visible",w:"full"}},gapType:{none:{gap:0},sm:{gap:4},md:{gap:5},lg:{gap:6}},heavyShadow:{false:{boxShadow:"0px 1px 2px rgba(189, 189, 189, 0.3)"},true:{boxShadow:"8px 8px 48px rgba(16, 15, 17, 0.14)"}},paddingType:{none:{p:0},sm:{px:4,py:3},md:{px:8,py:6},lg:{p:12}},widthMax:{true:{flex:1,maxW:"29.125rem",mdDown:{maxW:"full"}}},disabled:{true:{opacity:.3,pointerEvents:"none"}},validating:{true:{pointerEvents:"none"}}},compoundVariants:[{asButton:!0,alt:!0,css:{bgColor:"surface.tertiary",color:"text.secondary",_hover:{filter:"brightness(0.9)"}}}],defaultVariants:{alt:!1,expand:!1,gapType:"md",heavyShadow:!1,paddingType:"md",widthMax:!1}});export{a as card};
2
2
  //# sourceMappingURL=card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sources":["../../../src/recipes/card.ts"],"sourcesContent":["import { cva, type RecipeVariantProps } from '@styled/css';\n\nexport const card = cva({\n base: {\n bgColor: 'surface.primary',\n borderRadius: '1rem',\n },\n variants: {\n asButton: {\n false: {\n cursor: 'default',\n },\n true: {\n alignItems: 'center',\n cursor: 'pointer',\n h: '10.75rem',\n justifyContent: 'center',\n p: 4,\n transition: 'all 0.1s ease',\n w: '10.75rem',\n _active: { transform: 'scale(0.95)' },\n },\n },\n alignment: {\n center: {\n alignItems: 'center',\n },\n left: {\n alignItems: 'flex-start',\n },\n right: {\n alignItems: 'flex-end',\n },\n },\n alt: {\n true: {},\n },\n expand: {\n false: {\n overflow: 'hidden',\n },\n true: {\n overflow: 'visible',\n w: 'full',\n },\n },\n gapType: {\n none: {\n gap: 0,\n },\n sm: {\n gap: 4,\n },\n md: {\n gap: 5,\n },\n lg: {\n gap: 6,\n },\n },\n heavyShadow: {\n false: {\n boxShadow: '0px 1px 2px rgba(189, 189, 189, 0.3)',\n },\n true: {\n boxShadow: '8px 8px 48px rgba(16, 15, 17, 0.14)',\n },\n },\n paddingType: {\n none: {\n p: 0,\n },\n sm: {\n px: 4,\n py: 3,\n },\n md: {\n px: 8,\n py: 6,\n },\n lg: {\n p: 12,\n },\n },\n widthMax: {\n true: {\n flex: 1,\n maxW: '29.125rem',\n mdDown: { maxW: 'full' },\n },\n },\n },\n compoundVariants: [\n {\n asButton: true,\n alt: true,\n css: {\n bgColor: 'surface.tertiary',\n color: 'text.secondary',\n _hover: {\n filter: 'brightness(0.9)',\n },\n },\n },\n ],\n defaultVariants: {\n alt: false,\n expand: false,\n gapType: 'md',\n heavyShadow: false,\n paddingType: 'md',\n widthMax: false,\n },\n});\n\nexport type CardVariants = RecipeVariantProps<typeof card>;\n"],"names":["card","cva"],"mappings":"kCAEO,MAAMA,EAAOC,EAAI,CACtB,KAAM,CACJ,QAAS,kBACT,aAAc,MACf,EACD,SAAU,CACR,SAAU,CACR,MAAO,CACL,OAAQ,SACT,EACD,KAAM,CACJ,WAAY,SACZ,OAAQ,UACR,EAAG,WACH,eAAgB,SAChB,EAAG,EACH,WAAY,gBACZ,EAAG,WACH,QAAS,CAAE,UAAW,aAAe,CACtC,CACF,EACD,UAAW,CACT,OAAQ,CACN,WAAY,QACb,EACD,KAAM,CACJ,WAAY,YACb,EACD,MAAO,CACL,WAAY,UACb,CACF,EACD,IAAK,CACH,KAAM,CACP,CAAA,EACD,OAAQ,CACN,MAAO,CACL,SAAU,QACX,EACD,KAAM,CACJ,SAAU,UACV,EAAG,MACJ,CACF,EACD,QAAS,CACP,KAAM,CACJ,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,CACF,EACD,YAAa,CACX,MAAO,CACL,UAAW,sCACZ,EACD,KAAM,CACJ,UAAW,qCACZ,CACF,EACD,YAAa,CACX,KAAM,CACJ,EAAG,CACJ,EACD,GAAI,CACF,GAAI,EACJ,GAAI,CACL,EACD,GAAI,CACF,GAAI,EACJ,GAAI,CACL,EACD,GAAI,CACF,EAAG,EACJ,CACF,EACD,SAAU,CACR,KAAM,CACJ,KAAM,EACN,KAAM,YACN,OAAQ,CAAE,KAAM,MAAQ,CACzB,CACF,CACF,EACD,iBAAkB,CAChB,CACE,SAAU,GACV,IAAK,GACL,IAAK,CACH,QAAS,mBACT,MAAO,iBACP,OAAQ,CACN,OAAQ,iBACT,CACF,CACF,CACF,EACD,gBAAiB,CACf,IAAK,GACL,OAAQ,GACR,QAAS,KACT,YAAa,GACb,YAAa,KACb,SAAU,EACX,CACF,CAAA"}
1
+ {"version":3,"file":"card.js","sources":["../../../src/recipes/card.ts"],"sourcesContent":["import { cva, type RecipeVariantProps } from '@styled/css';\n\nexport const card = cva({\n base: {\n bgColor: 'surface.primary',\n borderRadius: '1rem',\n },\n variants: {\n asButton: {\n false: {\n cursor: 'default',\n },\n true: {\n alignItems: 'center',\n cursor: 'pointer',\n h: '10.75rem',\n justifyContent: 'center',\n p: 4,\n transition: 'all 0.1s ease',\n w: '10.75rem',\n _active: { transform: 'scale(0.95)' },\n },\n },\n alignment: {\n center: {\n alignItems: 'center',\n },\n left: {\n alignItems: 'flex-start',\n },\n right: {\n alignItems: 'flex-end',\n },\n },\n alt: {\n true: {},\n },\n expand: {\n false: {\n overflow: 'hidden',\n },\n true: {\n overflow: 'visible',\n w: 'full',\n },\n },\n gapType: {\n none: {\n gap: 0,\n },\n sm: {\n gap: 4,\n },\n md: {\n gap: 5,\n },\n lg: {\n gap: 6,\n },\n },\n heavyShadow: {\n false: {\n boxShadow: '0px 1px 2px rgba(189, 189, 189, 0.3)',\n },\n true: {\n boxShadow: '8px 8px 48px rgba(16, 15, 17, 0.14)',\n },\n },\n paddingType: {\n none: {\n p: 0,\n },\n sm: {\n px: 4,\n py: 3,\n },\n md: {\n px: 8,\n py: 6,\n },\n lg: {\n p: 12,\n },\n },\n widthMax: {\n true: {\n flex: 1,\n maxW: '29.125rem',\n mdDown: { maxW: 'full' },\n },\n },\n disabled: {\n true: {\n opacity: 0.3,\n pointerEvents: 'none',\n },\n },\n validating: {\n true: {\n pointerEvents: 'none',\n },\n },\n },\n compoundVariants: [\n {\n asButton: true,\n alt: true,\n css: {\n bgColor: 'surface.tertiary',\n color: 'text.secondary',\n _hover: {\n filter: 'brightness(0.9)',\n },\n },\n },\n ],\n defaultVariants: {\n alt: false,\n expand: false,\n gapType: 'md',\n heavyShadow: false,\n paddingType: 'md',\n widthMax: false,\n },\n});\n\nexport type CardVariants = RecipeVariantProps<typeof card>;\n"],"names":["card","cva"],"mappings":"kCAEO,MAAMA,EAAOC,EAAI,CACtB,KAAM,CACJ,QAAS,kBACT,aAAc,MACf,EACD,SAAU,CACR,SAAU,CACR,MAAO,CACL,OAAQ,SACT,EACD,KAAM,CACJ,WAAY,SACZ,OAAQ,UACR,EAAG,WACH,eAAgB,SAChB,EAAG,EACH,WAAY,gBACZ,EAAG,WACH,QAAS,CAAE,UAAW,aAAe,CACtC,CACF,EACD,UAAW,CACT,OAAQ,CACN,WAAY,QACb,EACD,KAAM,CACJ,WAAY,YACb,EACD,MAAO,CACL,WAAY,UACb,CACF,EACD,IAAK,CACH,KAAM,CAAA,CACP,EACD,OAAQ,CACN,MAAO,CACL,SAAU,QACX,EACD,KAAM,CACJ,SAAU,UACV,EAAG,MACJ,CACF,EACD,QAAS,CACP,KAAM,CACJ,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,EACD,GAAI,CACF,IAAK,CACN,CACF,EACD,YAAa,CACX,MAAO,CACL,UAAW,sCACZ,EACD,KAAM,CACJ,UAAW,qCACZ,CACF,EACD,YAAa,CACX,KAAM,CACJ,EAAG,CACJ,EACD,GAAI,CACF,GAAI,EACJ,GAAI,CACL,EACD,GAAI,CACF,GAAI,EACJ,GAAI,CACL,EACD,GAAI,CACF,EAAG,EACJ,CACF,EACD,SAAU,CACR,KAAM,CACJ,KAAM,EACN,KAAM,YACN,OAAQ,CAAE,KAAM,MAAQ,CACzB,CACF,EACD,SAAU,CACR,KAAM,CACJ,QAAS,GACT,cAAe,MAChB,CACF,EACD,WAAY,CACV,KAAM,CACJ,cAAe,MAChB,CACF,CACF,EACD,iBAAkB,CAChB,CACE,SAAU,GACV,IAAK,GACL,IAAK,CACH,QAAS,mBACT,MAAO,iBACP,OAAQ,CACN,OAAQ,iBACT,CACF,CACF,CACF,EACD,gBAAiB,CACf,IAAK,GACL,OAAQ,GACR,QAAS,KACT,YAAa,GACb,YAAa,KACb,SAAU,EACX,CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- import{cva as e}from"@styled/css";const t=e({base:{textWrap:"pretty"},variants:{mono:{false:{},true:{}},scale:{false:{},true:{}},variant:{text:{color:"text.primary"},error:{color:"negative.darker",fontWeight:"medium"},info:{color:"brand.base",fontWeight:"medium"},success:{color:"positive.base",fontWeight:"medium"},warning:{color:"warning.base",fontWeight:"medium"}},size:{xs:{textStyle:"body-xs"},sm:{textStyle:"body-sm"},md:{textStyle:"body-md"},lg:{textStyle:"body-lg"}}},compoundVariants:[{scale:!0,size:"sm",css:{textStyle:"body-sm-scaled"}},{scale:!0,size:"md",css:{textStyle:"body-md-scaled"}},{scale:!0,size:"lg",css:{textStyle:"body-lg-scaled"}},{mono:!0,size:"sm",css:{textStyle:"mono-sm"}},{mono:!0,size:"md",css:{textStyle:"mono-md"}},{mono:!0,size:"lg",css:{textStyle:"mono-lg"}}],defaultVariants:{mono:!1,variant:"text",size:"md"}});export{t as text};
1
+ import{cva as e}from"@styled/css";const t=e({base:{textWrap:"wrap"},variants:{mono:{false:{},true:{}},scale:{false:{},true:{}},variant:{text:{color:"text.primary"},error:{color:"negative.darker"},info:{color:"brand.base"},success:{color:"positive.base"},warning:{color:"warning.base"}},size:{xs:{textStyle:"body-xs"},sm:{textStyle:"body-sm"},md:{textStyle:"body-md"},lg:{textStyle:"body-lg"}}},compoundVariants:[{scale:!0,size:"sm",css:{textStyle:"body-sm-scaled"}},{scale:!0,size:"md",css:{textStyle:"body-md-scaled"}},{scale:!0,size:"lg",css:{textStyle:"body-lg-scaled"}},{mono:!0,size:"sm",css:{textStyle:"mono-sm"}},{mono:!0,size:"md",css:{textStyle:"mono-md"}},{mono:!0,size:"lg",css:{textStyle:"mono-lg"}}],defaultVariants:{mono:!1,variant:"text",size:"md"}});export{t as text};
2
2
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sources":["../../../src/recipes/text.ts"],"sourcesContent":["import { cva, type RecipeVariantProps } from '@styled/css';\n\nexport const text = cva({\n base: {\n textWrap: 'pretty',\n },\n variants: {\n mono: {\n false: {},\n true: {},\n },\n scale: {\n false: {},\n true: {},\n },\n variant: {\n text: {\n color: 'text.primary',\n },\n error: {\n color: 'negative.darker',\n fontWeight: 'medium',\n },\n info: {\n color: 'brand.base',\n fontWeight: 'medium',\n },\n success: {\n color: 'positive.base',\n fontWeight: 'medium',\n },\n warning: {\n color: 'warning.base',\n fontWeight: 'medium',\n },\n },\n size: {\n xs: {\n textStyle: 'body-xs',\n },\n sm: {\n textStyle: 'body-sm',\n },\n md: {\n textStyle: 'body-md',\n },\n lg: {\n textStyle: 'body-lg',\n },\n },\n },\n compoundVariants: [\n {\n scale: true,\n size: 'sm',\n css: {\n textStyle: 'body-sm-scaled',\n },\n },\n {\n scale: true,\n size: 'md',\n css: {\n textStyle: 'body-md-scaled',\n },\n },\n {\n scale: true,\n size: 'lg',\n css: {\n textStyle: 'body-lg-scaled',\n },\n },\n {\n mono: true,\n size: 'sm',\n css: {\n textStyle: 'mono-sm',\n },\n },\n {\n mono: true,\n size: 'md',\n css: {\n textStyle: 'mono-md',\n },\n },\n {\n mono: true,\n size: 'lg',\n css: {\n textStyle: 'mono-lg',\n },\n },\n ],\n defaultVariants: {\n mono: false,\n variant: 'text',\n size: 'md',\n },\n});\n\nexport type TextVariants = RecipeVariantProps<typeof text>;\n"],"names":["text","cva"],"mappings":"kCAEa,MAAAA,EAAOC,EAAI,CACtB,KAAM,CACJ,SAAU,QACX,EACD,SAAU,CACR,KAAM,CACJ,MAAO,CAAE,EACT,KAAM,CACP,CAAA,EACD,MAAO,CACL,MAAO,CAAA,EACP,KAAM,CAAA,CACP,EACD,QAAS,CACP,KAAM,CACJ,MAAO,cACR,EACD,MAAO,CACL,MAAO,kBACP,WAAY,QACb,EACD,KAAM,CACJ,MAAO,aACP,WAAY,QACb,EACD,QAAS,CACP,MAAO,gBACP,WAAY,QACb,EACD,QAAS,CACP,MAAO,eACP,WAAY,QACb,CACF,EACD,KAAM,CACJ,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,CACF,CACF,EACD,iBAAkB,CAChB,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,CACF,EACD,gBAAiB,CACf,KAAM,GACN,QAAS,OACT,KAAM,IACP,CACF,CAAA"}
1
+ {"version":3,"file":"text.js","sources":["../../../src/recipes/text.ts"],"sourcesContent":["import { cva, type RecipeVariantProps } from '@styled/css';\n\nexport const text = cva({\n base: {\n textWrap: 'wrap',\n },\n variants: {\n mono: {\n false: {},\n true: {},\n },\n scale: {\n false: {},\n true: {},\n },\n variant: {\n text: {\n color: 'text.primary',\n },\n error: {\n color: 'negative.darker',\n },\n info: {\n color: 'brand.base',\n },\n success: {\n color: 'positive.base',\n },\n warning: {\n color: 'warning.base',\n },\n },\n size: {\n xs: {\n textStyle: 'body-xs',\n },\n sm: {\n textStyle: 'body-sm',\n },\n md: {\n textStyle: 'body-md',\n },\n lg: {\n textStyle: 'body-lg',\n },\n },\n },\n compoundVariants: [\n {\n scale: true,\n size: 'sm',\n css: {\n textStyle: 'body-sm-scaled',\n },\n },\n {\n scale: true,\n size: 'md',\n css: {\n textStyle: 'body-md-scaled',\n },\n },\n {\n scale: true,\n size: 'lg',\n css: {\n textStyle: 'body-lg-scaled',\n },\n },\n {\n mono: true,\n size: 'sm',\n css: {\n textStyle: 'mono-sm',\n },\n },\n {\n mono: true,\n size: 'md',\n css: {\n textStyle: 'mono-md',\n },\n },\n {\n mono: true,\n size: 'lg',\n css: {\n textStyle: 'mono-lg',\n },\n },\n ],\n defaultVariants: {\n mono: false,\n variant: 'text',\n size: 'md',\n },\n});\n\nexport type TextVariants = RecipeVariantProps<typeof text>;\n"],"names":["text","cva"],"mappings":"kCAEa,MAAAA,EAAOC,EAAI,CACtB,KAAM,CACJ,SAAU,MACX,EACD,SAAU,CACR,KAAM,CACJ,MAAO,CAAA,EACP,KAAM,CAAA,CACP,EACD,MAAO,CACL,MAAO,CAAA,EACP,KAAM,CAAA,CACP,EACD,QAAS,CACP,KAAM,CACJ,MAAO,cACR,EACD,MAAO,CACL,MAAO,iBACR,EACD,KAAM,CACJ,MAAO,YACR,EACD,QAAS,CACP,MAAO,eACR,EACD,QAAS,CACP,MAAO,cACR,CACF,EACD,KAAM,CACJ,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,EACD,GAAI,CACF,UAAW,SACZ,CACF,CACF,EACD,iBAAkB,CAChB,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,MAAO,GACP,KAAM,KACN,IAAK,CACH,UAAW,gBACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,EACD,CACE,KAAM,GACN,KAAM,KACN,IAAK,CACH,UAAW,SACZ,CACF,CACF,EACD,gBAAiB,CACf,KAAM,GACN,QAAS,OACT,KAAM,IACP,CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- import{defineSemanticTokens as r}from"@pandacss/dev";const a=r.colors({surface:{primary:{value:{base:"var(--surface-primary, {colors.paper})",_dark:"var(--surface-primary-dark, {colors.slate.0})"}},secondary:{value:{base:"var(--surface-secondary, {colors.ink.10})",_dark:"var(--surface-secondary-dark, {colors.slate.1})"}},tertiary:{value:{base:"var(--surface-tertiary, {colors.ink.20})",_dark:"var(--surface-tertiary-dark, {colors.slate.2})"}}},text:{primary:{value:{base:"var(--text-primary, {colors.ink.90})",_dark:"var(--text-primary-dark, {colors.chalk})"}},secondary:{value:{base:"var(--text-secondary, {colors.ink.80})",_dark:"var(--text-secondary-dark, {colors.chalk/72})"}},tertiary:{value:{base:"var(--text-tertiary, {colors.ink.70})",_dark:"var(--text-tertiary-dark, {colors.chalk/44})"}}},neutral:{primary:{value:{base:"var(--neutral-primary, {colors.ink.50})",_dark:"var(--neutral-primary-dark, {colors.chalk/16})"}},secondary:{value:{base:"var(--neutral-secondary, {colors.ink.30})",_dark:"var(--neutral-secondary-dark, {colors.chalk/12})"}},tertiary:{value:{base:"var(--neutral-tertiary, {colors.ink.20})",_dark:"var(--neutral-tertiary-dark, {colors.chalk/8})"}},quaternary:{value:{base:"var(--neutral-quaternary, {colors.ink.10})",_dark:"var(--neutral-quaternary-dark, {colors.chalk/5})"}}},brand:{lightest:{value:{base:"var(--brand-lightest, {colors.magic.10})",_dark:"var(--brand-lightest-dark, {colors.magic.30/25})"}},lighter:{value:{base:"var(--brand-lighter, {colors.magic.30})",_dark:"var(--brand-lighter-dark, {colors.magic.30/66})"}},base:{value:{base:"var(--brand-base, {colors.magic.50})",_dark:"var(--brand-base-dark, {colors.magic.30})"}},darker:{value:{base:"var(--brand-darker, {colors.magic.70})",_dark:"var(--brand-darker-dark, {colors.magic.10})"}},darkest:{value:{base:"var(--brand-darkest, {colors.magic.90})",_dark:"var(--brand-darkest-dark, {colors.magic.10})"}}},positive:{lightest:{value:{base:"{colors.leaf.10}",_dark:"{colors.leaf.30/8}"}},lighter:{value:{base:"{colors.leaf.30}",_dark:"{colors.leaf.50}"}},base:{value:{base:"{colors.leaf.50}",_dark:"{colors.leaf.50}"}},darker:{value:{base:"{colors.leaf.70}",_dark:"{colors.leaf.50}"}},darkest:{value:{base:"{colors.leaf.90}",_dark:"{colors.leaf.50}"}}},negative:{lightest:{value:{base:"{colors.ruby.10}",_dark:"{colors.ruby.30/8}"}},lighter:{value:{base:"{colors.ruby.30}",_dark:"{colors.ruby.50}"}},base:{value:{base:"{colors.ruby.50}",_dark:"{colors.ruby.50}"}},darker:{value:{base:"{colors.ruby.70}",_dark:"{colors.ruby.50}"}},darkest:{value:{base:"{colors.ruby.90}",_dark:"{colors.ruby.50}"}}},warning:{lightest:{value:{base:"{colors.gold.10}",_dark:"{colors.gold.30/8}"}},lighter:{value:{base:"{colors.gold.30}",_dark:"{colors.gold.50}"}},base:{value:{base:"{colors.gold.50}",_dark:"{colors.gold.50}"}},darker:{value:{base:"{colors.gold.70}",_dark:"{colors.gold.50}"}},darkest:{value:{base:"{colors.gold.90}",_dark:"{colors.gold.50}"}}},dedicated:{lightest:{value:{base:"{colors.sky.10}",_dark:"{colors.sky.30/8}"}},lighter:{value:{base:"{colors.sky.30}",_dark:"{colors.sky.30}"}},base:{value:{base:"{colors.sky.50}",_dark:"{colors.sky.30}"}},darker:{value:{base:"{colors.sky.70}",_dark:"{colors.sky.30}"}},darkest:{value:{base:"{colors.sky.90}",_dark:"{colors.sky.30}"}}}});export{a as semanticColors};
1
+ import{defineSemanticTokens as r}from"@pandacss/dev";const a=r.colors({surface:{primary:{value:{base:"var(--surface-primary, {colors.paper})",_dark:"var(--surface-primary-dark, {colors.slate.0})"}},secondary:{value:{base:"var(--surface-secondary, {colors.ink.10})",_dark:"var(--surface-secondary-dark, {colors.slate.1})"}},tertiary:{value:{base:"var(--surface-tertiary, {colors.ink.20})",_dark:"var(--surface-tertiary-dark, {colors.slate.2})"}}},text:{primary:{value:{base:"var(--text-primary, {colors.ink.90})",_dark:"var(--text-primary-dark, {colors.chalk})"}},secondary:{value:{base:"var(--text-secondary, {colors.ink.80})",_dark:"var(--text-secondary-dark, {colors.chalk/72})"}},tertiary:{value:{base:"var(--text-tertiary, {colors.ink.70})",_dark:"var(--text-tertiary-dark, {colors.chalk/44})"}},quaternary:{value:{base:"var(--text-quaternary, {colors.chalk})",_dark:"var(--text-quaternary-dark, {colors.ink.90})"}}},neutral:{primary:{value:{base:"var(--neutral-primary, {colors.ink.50})",_dark:"var(--neutral-primary-dark, {colors.chalk/16})"}},secondary:{value:{base:"var(--neutral-secondary, {colors.ink.30})",_dark:"var(--neutral-secondary-dark, {colors.chalk/12})"}},tertiary:{value:{base:"var(--neutral-tertiary, {colors.ink.20})",_dark:"var(--neutral-tertiary-dark, {colors.chalk/8})"}},quaternary:{value:{base:"var(--neutral-quaternary, {colors.ink.10})",_dark:"var(--neutral-quaternary-dark, {colors.chalk/5})"}}},brand:{lightest:{value:{base:"var(--brand-lightest, {colors.magic.10})",_dark:"var(--brand-lightest-dark, {colors.magic.30/25})"}},lighter:{value:{base:"var(--brand-lighter, {colors.magic.30})",_dark:"var(--brand-lighter-dark, {colors.magic.30/66})"}},base:{value:{base:"var(--brand-base, {colors.magic.50})",_dark:"var(--brand-base-dark, {colors.magic.30})"}},darker:{value:{base:"var(--brand-darker, {colors.magic.70})",_dark:"var(--brand-darker-dark, {colors.magic.10})"}},darkest:{value:{base:"var(--brand-darkest, {colors.magic.90})",_dark:"var(--brand-darkest-dark, {colors.magic.10})"}}},positive:{lightest:{value:{base:"{colors.leaf.10}",_dark:"{colors.leaf.30/8}"}},lighter:{value:{base:"{colors.leaf.30}",_dark:"{colors.leaf.50}"}},base:{value:{base:"{colors.leaf.50}",_dark:"{colors.leaf.50}"}},darker:{value:{base:"{colors.leaf.70}",_dark:"{colors.leaf.50}"}},darkest:{value:{base:"{colors.leaf.90}",_dark:"{colors.leaf.50}"}}},negative:{lightest:{value:{base:"{colors.ruby.10}",_dark:"{colors.ruby.30/8}"}},lighter:{value:{base:"{colors.ruby.30}",_dark:"{colors.ruby.50}"}},base:{value:{base:"{colors.ruby.50}",_dark:"{colors.ruby.50}"}},darker:{value:{base:"{colors.ruby.70}",_dark:"{colors.ruby.50}"}},darkest:{value:{base:"{colors.ruby.90}",_dark:"{colors.ruby.50}"}}},warning:{lightest:{value:{base:"{colors.gold.10}",_dark:"{colors.gold.30/8}"}},lighter:{value:{base:"{colors.gold.30}",_dark:"{colors.gold.50}"}},base:{value:{base:"{colors.gold.50}",_dark:"{colors.gold.50}"}},darker:{value:{base:"{colors.gold.70}",_dark:"{colors.gold.50}"}},darkest:{value:{base:"{colors.gold.90}",_dark:"{colors.gold.50}"}}},dedicated:{lightest:{value:{base:"{colors.sky.10}",_dark:"{colors.sky.30/8}"}},lighter:{value:{base:"{colors.sky.30}",_dark:"{colors.sky.30}"}},base:{value:{base:"{colors.sky.50}",_dark:"{colors.sky.30}"}},darker:{value:{base:"{colors.sky.70}",_dark:"{colors.sky.30}"}},darkest:{value:{base:"{colors.sky.90}",_dark:"{colors.sky.30}"}}}});export{a as semanticColors};
2
2
  //# sourceMappingURL=semantic-tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-tokens.js","sources":["../../../src/styles/semantic-tokens.ts"],"sourcesContent":["import { defineSemanticTokens } from '@pandacss/dev';\n\nexport const semanticColors = defineSemanticTokens.colors({\n surface: {\n primary: {\n value: {\n base: 'var(--surface-primary, {colors.paper})',\n _dark: 'var(--surface-primary-dark, {colors.slate.0})',\n },\n },\n secondary: {\n value: {\n base: 'var(--surface-secondary, {colors.ink.10})',\n _dark: 'var(--surface-secondary-dark, {colors.slate.1})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--surface-tertiary, {colors.ink.20})',\n _dark: 'var(--surface-tertiary-dark, {colors.slate.2})',\n },\n },\n },\n text: {\n primary: {\n value: {\n base: 'var(--text-primary, {colors.ink.90})',\n _dark: 'var(--text-primary-dark, {colors.chalk})',\n },\n },\n secondary: {\n value: {\n base: 'var(--text-secondary, {colors.ink.80})',\n _dark: 'var(--text-secondary-dark, {colors.chalk/72})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--text-tertiary, {colors.ink.70})',\n _dark: 'var(--text-tertiary-dark, {colors.chalk/44})',\n },\n },\n },\n neutral: {\n primary: {\n value: {\n base: 'var(--neutral-primary, {colors.ink.50})',\n _dark: 'var(--neutral-primary-dark, {colors.chalk/16})',\n },\n },\n secondary: {\n value: {\n base: 'var(--neutral-secondary, {colors.ink.30})',\n _dark: 'var(--neutral-secondary-dark, {colors.chalk/12})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--neutral-tertiary, {colors.ink.20})',\n _dark: 'var(--neutral-tertiary-dark, {colors.chalk/8})',\n },\n },\n quaternary: {\n value: {\n base: 'var(--neutral-quaternary, {colors.ink.10})',\n _dark: 'var(--neutral-quaternary-dark, {colors.chalk/5})',\n },\n },\n },\n brand: {\n lightest: {\n value: {\n base: 'var(--brand-lightest, {colors.magic.10})',\n _dark: 'var(--brand-lightest-dark, {colors.magic.30/25})',\n },\n },\n lighter: {\n value: {\n base: 'var(--brand-lighter, {colors.magic.30})',\n _dark: 'var(--brand-lighter-dark, {colors.magic.30/66})',\n },\n },\n base: {\n value: {\n base: 'var(--brand-base, {colors.magic.50})',\n _dark: 'var(--brand-base-dark, {colors.magic.30})',\n },\n },\n darker: {\n value: {\n base: 'var(--brand-darker, {colors.magic.70})',\n _dark: 'var(--brand-darker-dark, {colors.magic.10})',\n },\n },\n darkest: {\n value: {\n base: 'var(--brand-darkest, {colors.magic.90})',\n _dark: 'var(--brand-darkest-dark, {colors.magic.10})',\n },\n },\n },\n positive: {\n lightest: { value: { base: '{colors.leaf.10}', _dark: '{colors.leaf.30/8}' } },\n lighter: { value: { base: '{colors.leaf.30}', _dark: '{colors.leaf.50}' } },\n base: { value: { base: '{colors.leaf.50}', _dark: '{colors.leaf.50}' } },\n darker: { value: { base: '{colors.leaf.70}', _dark: '{colors.leaf.50}' } },\n darkest: { value: { base: '{colors.leaf.90}', _dark: '{colors.leaf.50}' } },\n },\n negative: {\n lightest: { value: { base: '{colors.ruby.10}', _dark: '{colors.ruby.30/8}' } },\n lighter: { value: { base: '{colors.ruby.30}', _dark: '{colors.ruby.50}' } },\n base: { value: { base: '{colors.ruby.50}', _dark: '{colors.ruby.50}' } },\n darker: { value: { base: '{colors.ruby.70}', _dark: '{colors.ruby.50}' } },\n darkest: { value: { base: '{colors.ruby.90}', _dark: '{colors.ruby.50}' } },\n },\n warning: {\n lightest: { value: { base: '{colors.gold.10}', _dark: '{colors.gold.30/8}' } },\n lighter: { value: { base: '{colors.gold.30}', _dark: '{colors.gold.50}' } },\n base: { value: { base: '{colors.gold.50}', _dark: '{colors.gold.50}' } },\n darker: { value: { base: '{colors.gold.70}', _dark: '{colors.gold.50}' } },\n darkest: { value: { base: '{colors.gold.90}', _dark: '{colors.gold.50}' } },\n },\n dedicated: {\n lightest: { value: { base: '{colors.sky.10}', _dark: '{colors.sky.30/8}' } },\n lighter: { value: { base: '{colors.sky.30}', _dark: '{colors.sky.30}' } },\n base: { value: { base: '{colors.sky.50}', _dark: '{colors.sky.30}' } },\n darker: { value: { base: '{colors.sky.70}', _dark: '{colors.sky.30}' } },\n darkest: { value: { base: '{colors.sky.90}', _dark: '{colors.sky.30}' } },\n },\n});\n"],"names":["semanticColors","defineSemanticTokens"],"mappings":"qDAEO,MAAMA,EAAiBC,EAAqB,OAAO,CACxD,QAAS,CACP,QAAS,CACP,MAAO,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B,MAAO,qBAAwB,EAC9E,QAAS,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EAC3E,KAAM,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EACxE,OAAQ,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EAC1E,QAAS,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,CAC5E,EACD,QAAS,CACP,SAAU,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,qBAAwB,EAC9E,QAAS,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EAC3E,KAAM,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EACxE,OAAQ,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,EAC1E,QAAS,CAAE,MAAO,CAAE,KAAM,mBAAoB,MAAO,mBAAsB,CAC5E,EACD,UAAW,CACT,SAAU,CAAE,MAAO,CAAE,KAAM,kBAAmB,MAAO,oBAAuB,EAC5E,QAAS,CAAE,MAAO,CAAE,KAAM,kBAAmB,MAAO,kBAAqB,EACzE,KAAM,CAAE,MAAO,CAAE,KAAM,kBAAmB,MAAO,kBAAqB,EACtE,OAAQ,CAAE,MAAO,CAAE,KAAM,kBAAmB,MAAO,kBAAqB,EACxE,QAAS,CAAE,MAAO,CAAE,KAAM,kBAAmB,MAAO,kBAAqB,CAC1E,CACF,CAAA"}
1
+ {"version":3,"file":"semantic-tokens.js","sources":["../../../src/styles/semantic-tokens.ts"],"sourcesContent":["import { defineSemanticTokens } from '@pandacss/dev';\n\nexport const semanticColors = defineSemanticTokens.colors({\n surface: {\n primary: {\n value: {\n base: 'var(--surface-primary, {colors.paper})',\n _dark: 'var(--surface-primary-dark, {colors.slate.0})',\n },\n },\n secondary: {\n value: {\n base: 'var(--surface-secondary, {colors.ink.10})',\n _dark: 'var(--surface-secondary-dark, {colors.slate.1})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--surface-tertiary, {colors.ink.20})',\n _dark: 'var(--surface-tertiary-dark, {colors.slate.2})',\n },\n },\n },\n text: {\n primary: {\n value: {\n base: 'var(--text-primary, {colors.ink.90})',\n _dark: 'var(--text-primary-dark, {colors.chalk})',\n },\n },\n secondary: {\n value: {\n base: 'var(--text-secondary, {colors.ink.80})',\n _dark: 'var(--text-secondary-dark, {colors.chalk/72})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--text-tertiary, {colors.ink.70})',\n _dark: 'var(--text-tertiary-dark, {colors.chalk/44})',\n },\n },\n quaternary: {\n value: {\n base: 'var(--text-quaternary, {colors.chalk})',\n _dark: 'var(--text-quaternary-dark, {colors.ink.90})',\n },\n },\n },\n neutral: {\n primary: {\n value: {\n base: 'var(--neutral-primary, {colors.ink.50})',\n _dark: 'var(--neutral-primary-dark, {colors.chalk/16})',\n },\n },\n secondary: {\n value: {\n base: 'var(--neutral-secondary, {colors.ink.30})',\n _dark: 'var(--neutral-secondary-dark, {colors.chalk/12})',\n },\n },\n tertiary: {\n value: {\n base: 'var(--neutral-tertiary, {colors.ink.20})',\n _dark: 'var(--neutral-tertiary-dark, {colors.chalk/8})',\n },\n },\n quaternary: {\n value: {\n base: 'var(--neutral-quaternary, {colors.ink.10})',\n _dark: 'var(--neutral-quaternary-dark, {colors.chalk/5})',\n },\n },\n },\n brand: {\n lightest: {\n value: {\n base: 'var(--brand-lightest, {colors.magic.10})',\n _dark: 'var(--brand-lightest-dark, {colors.magic.30/25})',\n },\n },\n lighter: {\n value: {\n base: 'var(--brand-lighter, {colors.magic.30})',\n _dark: 'var(--brand-lighter-dark, {colors.magic.30/66})',\n },\n },\n base: {\n value: {\n base: 'var(--brand-base, {colors.magic.50})',\n _dark: 'var(--brand-base-dark, {colors.magic.30})',\n },\n },\n darker: {\n value: {\n base: 'var(--brand-darker, {colors.magic.70})',\n _dark: 'var(--brand-darker-dark, {colors.magic.10})',\n },\n },\n darkest: {\n value: {\n base: 'var(--brand-darkest, {colors.magic.90})',\n _dark: 'var(--brand-darkest-dark, {colors.magic.10})',\n },\n },\n },\n positive: {\n lightest: { value: { base: '{colors.leaf.10}', _dark: '{colors.leaf.30/8}' } },\n lighter: { value: { base: '{colors.leaf.30}', _dark: '{colors.leaf.50}' } },\n base: { value: { base: '{colors.leaf.50}', _dark: '{colors.leaf.50}' } },\n darker: { value: { base: '{colors.leaf.70}', _dark: '{colors.leaf.50}' } },\n darkest: { value: { base: '{colors.leaf.90}', _dark: '{colors.leaf.50}' } },\n },\n negative: {\n lightest: { value: { base: '{colors.ruby.10}', _dark: '{colors.ruby.30/8}' } },\n lighter: { value: { base: '{colors.ruby.30}', _dark: '{colors.ruby.50}' } },\n base: { value: { base: '{colors.ruby.50}', _dark: '{colors.ruby.50}' } },\n darker: { value: { base: '{colors.ruby.70}', _dark: '{colors.ruby.50}' } },\n darkest: { value: { base: '{colors.ruby.90}', _dark: '{colors.ruby.50}' } },\n },\n warning: {\n lightest: { value: { base: '{colors.gold.10}', _dark: '{colors.gold.30/8}' } },\n lighter: { value: { base: '{colors.gold.30}', _dark: '{colors.gold.50}' } },\n base: { value: { base: '{colors.gold.50}', _dark: '{colors.gold.50}' } },\n darker: { value: { base: '{colors.gold.70}', _dark: '{colors.gold.50}' } },\n darkest: { value: { base: '{colors.gold.90}', _dark: '{colors.gold.50}' } },\n },\n dedicated: {\n lightest: { value: { base: '{colors.sky.10}', _dark: '{colors.sky.30/8}' } },\n lighter: { value: { base: '{colors.sky.30}', _dark: '{colors.sky.30}' } },\n base: { value: { base: '{colors.sky.50}', _dark: '{colors.sky.30}' } },\n darker: { value: { base: '{colors.sky.70}', _dark: '{colors.sky.30}' } },\n darkest: { value: { base: '{colors.sky.90}', _dark: '{colors.sky.30}' } },\n },\n});\n"],"names":["semanticColors","defineSemanticTokens"],"mappings":"qDAEO,MAAMA,EAAiBC,EAAqB,OAAO,CACxD,QAAS,CACP,QAAS,CACP,MAAO,CACL,KAAM,yCACN,MAAO,+CACR,CAC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