@ndla/primitives 1.0.130-alpha.0 → 1.0.132-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/panda.buildinfo.json +25 -1
  2. package/dist/styles.css +100 -4
  3. package/es/Accordion.mjs +1 -1
  4. package/es/Accordion.mjs.map +1 -1
  5. package/es/ArticleLists.mjs +1 -1
  6. package/es/ArticleLists.mjs.map +1 -1
  7. package/es/Badge.mjs +1 -1
  8. package/es/Badge.mjs.map +1 -1
  9. package/es/BlockQuote.mjs +1 -1
  10. package/es/BlockQuote.mjs.map +1 -1
  11. package/es/Button.mjs +1 -1
  12. package/es/Button.mjs.map +1 -1
  13. package/es/Card/Card.mjs +1 -1
  14. package/es/Card/Card.mjs.map +1 -1
  15. package/es/Checkbox.mjs +2 -1
  16. package/es/Checkbox.mjs.map +1 -1
  17. package/es/Combobox.mjs +1 -1
  18. package/es/Combobox.mjs.map +1 -1
  19. package/es/DatePicker.mjs +1 -1
  20. package/es/DatePicker.mjs.map +1 -1
  21. package/es/Dialog.mjs +1 -1
  22. package/es/Dialog.mjs.map +1 -1
  23. package/es/ErrorMessage/ErrorMessage.mjs +1 -1
  24. package/es/ErrorMessage/ErrorMessage.mjs.map +1 -1
  25. package/es/ExpandableBox.mjs +1 -1
  26. package/es/ExpandableBox.mjs.map +1 -1
  27. package/es/Field.mjs +2 -1
  28. package/es/Field.mjs.map +1 -1
  29. package/es/FieldErrorMessage.mjs +2 -1
  30. package/es/FieldErrorMessage.mjs.map +1 -1
  31. package/es/FieldHelper.mjs +2 -1
  32. package/es/FieldHelper.mjs.map +1 -1
  33. package/es/Figure.mjs +1 -1
  34. package/es/Figure.mjs.map +1 -1
  35. package/es/FileUpload.mjs +1 -1
  36. package/es/FileUpload.mjs.map +1 -1
  37. package/es/FramedContent.mjs +1 -1
  38. package/es/FramedContent.mjs.map +1 -1
  39. package/es/Hero.mjs +1 -1
  40. package/es/Hero.mjs.map +1 -1
  41. package/es/Image.mjs +1 -1
  42. package/es/Image.mjs.map +1 -1
  43. package/es/Input.mjs +2 -1
  44. package/es/Input.mjs.map +1 -1
  45. package/es/Label.mjs +3 -1
  46. package/es/Label.mjs.map +1 -1
  47. package/es/Layout/PageContainer.mjs +1 -1
  48. package/es/Layout/PageContainer.mjs.map +1 -1
  49. package/es/Layout/PageContent.mjs +1 -1
  50. package/es/Layout/PageContent.mjs.map +1 -1
  51. package/es/ListItem/ListItem.mjs +1 -1
  52. package/es/ListItem/ListItem.mjs.map +1 -1
  53. package/es/Menu.mjs +1 -1
  54. package/es/Menu.mjs.map +1 -1
  55. package/es/MessageBox.mjs +1 -1
  56. package/es/MessageBox.mjs.map +1 -1
  57. package/es/Pagination.mjs +1 -1
  58. package/es/Pagination.mjs.map +1 -1
  59. package/es/Popover.mjs +1 -1
  60. package/es/Popover.mjs.map +1 -1
  61. package/es/RadioGroup.mjs +2 -1
  62. package/es/RadioGroup.mjs.map +1 -1
  63. package/es/RainbowSpinner.mjs +66 -0
  64. package/es/RainbowSpinner.mjs.map +1 -0
  65. package/es/Select.mjs +1 -1
  66. package/es/Select.mjs.map +1 -1
  67. package/es/Skeleton.mjs +1 -1
  68. package/es/Skeleton.mjs.map +1 -1
  69. package/es/Slider.mjs +1 -1
  70. package/es/Slider.mjs.map +1 -1
  71. package/es/Spinner.mjs +1 -1
  72. package/es/Spinner.mjs.map +1 -1
  73. package/es/Switch.mjs +1 -1
  74. package/es/Switch.mjs.map +1 -1
  75. package/es/Table.mjs +1 -1
  76. package/es/Table.mjs.map +1 -1
  77. package/es/Tabs.mjs +1 -1
  78. package/es/Tabs.mjs.map +1 -1
  79. package/es/TagsInput.mjs +1 -1
  80. package/es/TagsInput.mjs.map +1 -1
  81. package/es/Text.mjs +1 -1
  82. package/es/Text.mjs.map +1 -1
  83. package/es/Toast.mjs +1 -1
  84. package/es/Toast.mjs.map +1 -1
  85. package/es/ToggleGroup.mjs +1 -1
  86. package/es/ToggleGroup.mjs.map +1 -1
  87. package/es/Tooltip.mjs +1 -1
  88. package/es/Tooltip.mjs.map +1 -1
  89. package/es/Tree/Tree.mjs +1 -1
  90. package/es/Tree/Tree.mjs.map +1 -1
  91. package/es/index.mjs +3 -2
  92. package/lib/Accordion.d.ts +1 -1
  93. package/lib/Accordion.js +7 -7
  94. package/lib/Accordion.js.map +1 -1
  95. package/lib/ArticleLists.d.ts +1 -1
  96. package/lib/ArticleLists.js +2 -2
  97. package/lib/ArticleLists.js.map +1 -1
  98. package/lib/Badge.d.ts +1 -1
  99. package/lib/Badge.js +2 -2
  100. package/lib/Badge.js.map +1 -1
  101. package/lib/BlockQuote.d.ts +1 -1
  102. package/lib/BlockQuote.js +2 -2
  103. package/lib/BlockQuote.js.map +1 -1
  104. package/lib/Button.d.ts +1 -1
  105. package/lib/Button.js +2 -2
  106. package/lib/Button.js.map +1 -1
  107. package/lib/Card/Card.d.ts +3 -3
  108. package/lib/Card/Card.js +3 -3
  109. package/lib/Card/Card.js.map +1 -1
  110. package/lib/Checkbox.d.ts +2 -1
  111. package/lib/Checkbox.js +9 -8
  112. package/lib/Checkbox.js.map +1 -1
  113. package/lib/Combobox.d.ts +1 -1
  114. package/lib/Combobox.js +16 -16
  115. package/lib/Combobox.js.map +1 -1
  116. package/lib/DatePicker.d.ts +2 -2
  117. package/lib/DatePicker.js +26 -26
  118. package/lib/DatePicker.js.map +1 -1
  119. package/lib/Dialog.d.ts +2 -2
  120. package/lib/Dialog.js +12 -12
  121. package/lib/Dialog.js.map +1 -1
  122. package/lib/ErrorMessage/ErrorMessage.d.ts +4 -4
  123. package/lib/ErrorMessage/ErrorMessage.js +4 -4
  124. package/lib/ErrorMessage/ErrorMessage.js.map +1 -1
  125. package/lib/ExpandableBox.d.ts +1 -1
  126. package/lib/ExpandableBox.js +3 -3
  127. package/lib/ExpandableBox.js.map +1 -1
  128. package/lib/Field.d.ts +2 -1
  129. package/lib/Field.js +4 -3
  130. package/lib/Field.js.map +1 -1
  131. package/lib/FieldErrorMessage.d.ts +2 -1
  132. package/lib/FieldErrorMessage.js +4 -3
  133. package/lib/FieldErrorMessage.js.map +1 -1
  134. package/lib/FieldHelper.d.ts +2 -1
  135. package/lib/FieldHelper.js +4 -3
  136. package/lib/FieldHelper.js.map +1 -1
  137. package/lib/Figure.d.ts +1 -1
  138. package/lib/Figure.js +2 -2
  139. package/lib/Figure.js.map +1 -1
  140. package/lib/FileUpload.d.ts +1 -1
  141. package/lib/FileUpload.js +15 -15
  142. package/lib/FileUpload.js.map +1 -1
  143. package/lib/FramedContent.d.ts +1 -1
  144. package/lib/FramedContent.js +2 -2
  145. package/lib/FramedContent.js.map +1 -1
  146. package/lib/Hero.d.ts +4 -4
  147. package/lib/Hero.js +6 -5
  148. package/lib/Hero.js.map +1 -1
  149. package/lib/Image.js +2 -2
  150. package/lib/Image.js.map +1 -1
  151. package/lib/Input.d.ts +1 -1
  152. package/lib/Input.js +7 -6
  153. package/lib/Input.js.map +1 -1
  154. package/lib/Label.d.ts +2 -1
  155. package/lib/Label.js +7 -5
  156. package/lib/Label.js.map +1 -1
  157. package/lib/Layout/PageContainer.d.ts +1 -1
  158. package/lib/Layout/PageContainer.js +1 -1
  159. package/lib/Layout/PageContainer.js.map +1 -1
  160. package/lib/Layout/PageContent.d.ts +2 -2
  161. package/lib/Layout/PageContent.js +3 -3
  162. package/lib/Layout/PageContent.js.map +1 -1
  163. package/lib/ListItem/ListItem.d.ts +3 -3
  164. package/lib/ListItem/ListItem.js +3 -3
  165. package/lib/ListItem/ListItem.js.map +1 -1
  166. package/lib/Menu.d.ts +1 -1
  167. package/lib/Menu.js +12 -12
  168. package/lib/Menu.js.map +1 -1
  169. package/lib/MessageBox.d.ts +1 -1
  170. package/lib/MessageBox.js +2 -2
  171. package/lib/MessageBox.js.map +1 -1
  172. package/lib/Pagination.d.ts +1 -1
  173. package/lib/Pagination.js +10 -9
  174. package/lib/Pagination.js.map +1 -1
  175. package/lib/Popover.d.ts +2 -2
  176. package/lib/Popover.js +15 -15
  177. package/lib/Popover.js.map +1 -1
  178. package/lib/RadioGroup.d.ts +1 -1
  179. package/lib/RadioGroup.js +12 -11
  180. package/lib/RadioGroup.js.map +1 -1
  181. package/lib/RainbowSpinner.d.ts +26 -0
  182. package/lib/RainbowSpinner.js +66 -0
  183. package/lib/RainbowSpinner.js.map +1 -0
  184. package/lib/Select.d.ts +1 -1
  185. package/lib/Select.js +18 -18
  186. package/lib/Select.js.map +1 -1
  187. package/lib/Skeleton.d.ts +2 -2
  188. package/lib/Skeleton.js +3 -2
  189. package/lib/Skeleton.js.map +1 -1
  190. package/lib/Slider.d.ts +1 -1
  191. package/lib/Slider.js +9 -9
  192. package/lib/Slider.js.map +1 -1
  193. package/lib/Spinner.d.ts +1 -1
  194. package/lib/Spinner.js +2 -2
  195. package/lib/Spinner.js.map +1 -1
  196. package/lib/Switch.d.ts +1 -1
  197. package/lib/Switch.js +7 -7
  198. package/lib/Switch.js.map +1 -1
  199. package/lib/Table.d.ts +2 -2
  200. package/lib/Table.js +3 -2
  201. package/lib/Table.js.map +1 -1
  202. package/lib/Tabs.d.ts +1 -1
  203. package/lib/Tabs.js +6 -6
  204. package/lib/Tabs.js.map +1 -1
  205. package/lib/TagsInput.d.ts +1 -1
  206. package/lib/TagsInput.js +12 -12
  207. package/lib/TagsInput.js.map +1 -1
  208. package/lib/Text.d.ts +1 -1
  209. package/lib/Text.js +3 -3
  210. package/lib/Text.js.map +1 -1
  211. package/lib/Toast.d.ts +1 -1
  212. package/lib/Toast.js +7 -7
  213. package/lib/Toast.js.map +1 -1
  214. package/lib/ToggleGroup.d.ts +1 -1
  215. package/lib/ToggleGroup.js +6 -5
  216. package/lib/ToggleGroup.js.map +1 -1
  217. package/lib/Tooltip.d.ts +1 -1
  218. package/lib/Tooltip.js +8 -8
  219. package/lib/Tooltip.js.map +1 -1
  220. package/lib/Tree/Tree.d.ts +2 -2
  221. package/lib/Tree/Tree.js +19 -19
  222. package/lib/Tree/Tree.js.map +1 -1
  223. package/lib/index.d.ts +2 -1
  224. package/lib/index.js +6 -3
  225. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","names":["radioGroupAnatomy","RadioGroup","ark","Text"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { ark, RadioGroup, radioGroupAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef, type RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst radioGroupRecipe = sva({\n slots: radioGroupAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexWrap: \"wrap\",\n position: \"relative\",\n gap: \"small\",\n _vertical: {\n flexDirection: \"column\",\n },\n _horizontal: {\n flexDirection: \"row\",\n },\n },\n itemControl: {\n flexShrink: \"0\",\n background: \"surface.default\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"full\",\n borderWidth: \"2px\",\n width: \"medium\",\n height: \"medium\",\n outlineStyle: \"solid\",\n outlineWidth: \"4px\",\n outlineOffset: \"-6px\",\n outlineColor: \"surface.default\",\n transitionDuration: \"normal\",\n transitionProperty: \"background, border-color, box-shadow\",\n transitionTimingFunction: \"default\",\n _hover: {\n boxShadow: \"0 0 0 4px var(--shadow-color)\",\n boxShadowColor: \"surface.actionSubtle.hover.strong\",\n },\n _checked: {\n background: \"stroke.default\",\n borderColor: \"stroke.default\",\n },\n _disabled: {\n borderColor: \"stroke.disabled\",\n _hover: {\n borderColor: \"stroke.disabled\",\n boxShadow: \"none\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n item: {\n display: \"flex\",\n alignItems: \"center\",\n cursor: \"pointer\",\n gap: \"xsmall\",\n _disabled: {\n cursor: \"not-allowed\",\n },\n \"&:has(input:focus-visible)\": {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n itemText: {\n _hover: {\n color: \"text.action\",\n },\n _disabled: {\n color: \"text.disabled\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(radioGroupRecipe);\n\nexport interface RadioGroupRootProps extends RadioGroup.RootProps, StyledProps {}\n\nexport const RadioGroupRoot = withProvider(RadioGroup.Root, \"root\", {\n baseComponent: true,\n});\n\nexport const RadioGroupIndicator = withContext(RadioGroup.Indicator, \"indicator\", { baseComponent: true });\n\nexport const RadioGroupItemControl = withContext(RadioGroup.ItemControl, \"itemControl\", { baseComponent: true });\n\nexport const RadioGroupItem = withContext(RadioGroup.Item, \"item\", { baseComponent: true });\n\nconst InternalRadioGroupItemText = withContext(RadioGroup.ItemText, \"itemText\");\n\nconst InnerRadioGroupItemText = styled(ark.span, {}, { baseComponent: true });\n\ninterface RadioGroupItemTextProps\n extends Omit<RadioGroup.ItemTextProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const RadioGroupItemText = ({\n textStyle = \"label.medium\",\n children,\n asChild,\n consumeCss,\n ...props\n}: RadioGroupItemTextProps) => (\n <InternalRadioGroupItemText asChild>\n <Text asChild consumeCss textStyle={textStyle} {...props}>\n <InnerRadioGroupItemText asChild={asChild} consumeCss={consumeCss}>\n {children}\n </InnerRadioGroupItemText>\n </Text>\n </InternalRadioGroupItemText>\n);\n\nexport const InternalRadioGroupLabel = withContext(RadioGroup.Label, \"label\");\n\nconst InnerRadioGroupLabel = styled(ark.div, {}, { baseComponent: true });\n\ninterface RadioGroupLabelProps\n extends Omit<RadioGroup.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLLabelElement> {}\n\nexport const RadioGroupLabel = forwardRef<HTMLLabelElement, RadioGroupLabelProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", children, asChild, consumeCss, ...props }, ref) => (\n <InternalRadioGroupLabel {...props} asChild ref={ref}>\n <Text textStyle={textStyle} fontWeight={fontWeight} asChild>\n <InnerRadioGroupLabel asChild={asChild} consumeCss={consumeCss}>\n {children}\n </InnerRadioGroupLabel>\n </Text>\n </InternalRadioGroupLabel>\n ),\n);\n\nexport const RadioGroupItemHiddenInput = RadioGroup.ItemHiddenInput;\n"],"mappings":";;;;;;;;;;;;;;AA8FA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KA/EO;CAC3B,OAAOA,cAAAA,kBAAkB,KAAK;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,UAAU;GACV,UAAU;GACV,KAAK;GACL,WAAW,EACT,eAAe,SACjB;GACA,aAAa,EACX,eAAe,MACjB;EACF;EACA,aAAa;GACX,YAAY;GACZ,YAAY;GACZ,aAAa;GACb,cAAc;GACd,aAAa;GACb,OAAO;GACP,QAAQ;GACR,cAAc;GACd,cAAc;GACd,eAAe;GACf,cAAc;GACd,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ;IACN,WAAW;IACX,gBAAgB;GAClB;GACA,UAAU;IACR,YAAY;IACZ,aAAa;GACf;GACA,WAAW;IACT,aAAa;IACb,QAAQ;KACN,aAAa;KACb,WAAW;IACb;GACF;GACA,eAAe;IACb,YAAY;IACZ,oBAAoB;GACtB;EACF;EACA,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,QAAQ;GACR,KAAK;GACL,WAAW,EACT,QAAQ,cACV;GACA,8BAA8B;IAC5B,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;GAChB;EACF;EACA,UAAU;GACR,QAAQ,EACN,OAAO,cACT;GACA,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,gBACT;GACF;EACF;CACF;AACF,CAEwE,CAAC;AAIzE,MAAa,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;AACiB,CAAA,CAE7B;AAEA,MAAa,4BAA4BF,cAAAA,WAAW"}
1
+ {"version":3,"file":"RadioGroup.js","names":["radioGroupAnatomy","RadioGroup","ark","Text"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { ark } from \"@ark-ui/react/factory\";\nimport { RadioGroup, radioGroupAnatomy } from \"@ark-ui/react/radio-group\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef, type RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst radioGroupRecipe = sva({\n slots: radioGroupAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexWrap: \"wrap\",\n position: \"relative\",\n gap: \"small\",\n _vertical: {\n flexDirection: \"column\",\n },\n _horizontal: {\n flexDirection: \"row\",\n },\n },\n itemControl: {\n flexShrink: \"0\",\n background: \"surface.default\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"full\",\n borderWidth: \"2px\",\n width: \"medium\",\n height: \"medium\",\n outlineStyle: \"solid\",\n outlineWidth: \"4px\",\n outlineOffset: \"-6px\",\n outlineColor: \"surface.default\",\n transitionDuration: \"normal\",\n transitionProperty: \"background, border-color, box-shadow\",\n transitionTimingFunction: \"default\",\n _hover: {\n boxShadow: \"0 0 0 4px var(--shadow-color)\",\n boxShadowColor: \"surface.actionSubtle.hover.strong\",\n },\n _checked: {\n background: \"stroke.default\",\n borderColor: \"stroke.default\",\n },\n _disabled: {\n borderColor: \"stroke.disabled\",\n _hover: {\n borderColor: \"stroke.disabled\",\n boxShadow: \"none\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n item: {\n display: \"flex\",\n alignItems: \"center\",\n cursor: \"pointer\",\n gap: \"xsmall\",\n _disabled: {\n cursor: \"not-allowed\",\n },\n \"&:has(input:focus-visible)\": {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n itemText: {\n _hover: {\n color: \"text.action\",\n },\n _disabled: {\n color: \"text.disabled\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(radioGroupRecipe);\n\nexport interface RadioGroupRootProps extends RadioGroup.RootProps, StyledProps {}\n\nexport const RadioGroupRoot = withProvider(RadioGroup.Root, \"root\", {\n baseComponent: true,\n});\n\nexport const RadioGroupIndicator = withContext(RadioGroup.Indicator, \"indicator\", { baseComponent: true });\n\nexport const RadioGroupItemControl = withContext(RadioGroup.ItemControl, \"itemControl\", { baseComponent: true });\n\nexport const RadioGroupItem = withContext(RadioGroup.Item, \"item\", { baseComponent: true });\n\nconst InternalRadioGroupItemText = withContext(RadioGroup.ItemText, \"itemText\");\n\nconst InnerRadioGroupItemText = styled(ark.span, {}, { baseComponent: true });\n\ninterface RadioGroupItemTextProps\n extends Omit<RadioGroup.ItemTextProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const RadioGroupItemText = ({\n textStyle = \"label.medium\",\n children,\n asChild,\n consumeCss,\n ...props\n}: RadioGroupItemTextProps) => (\n <InternalRadioGroupItemText asChild>\n <Text asChild consumeCss textStyle={textStyle} {...props}>\n <InnerRadioGroupItemText asChild={asChild} consumeCss={consumeCss}>\n {children}\n </InnerRadioGroupItemText>\n </Text>\n </InternalRadioGroupItemText>\n);\n\nexport const InternalRadioGroupLabel = withContext(RadioGroup.Label, \"label\");\n\nconst InnerRadioGroupLabel = styled(ark.div, {}, { baseComponent: true });\n\ninterface RadioGroupLabelProps\n extends Omit<RadioGroup.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLLabelElement> {}\n\nexport const RadioGroupLabel = forwardRef<HTMLLabelElement, RadioGroupLabelProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", children, asChild, consumeCss, ...props }, ref) => (\n <InternalRadioGroupLabel {...props} asChild ref={ref}>\n <Text textStyle={textStyle} fontWeight={fontWeight} asChild>\n <InnerRadioGroupLabel asChild={asChild} consumeCss={consumeCss}>\n {children}\n </InnerRadioGroupLabel>\n </Text>\n </InternalRadioGroupLabel>\n ),\n);\n\nexport const RadioGroupItemHiddenInput = RadioGroup.ItemHiddenInput;\n"],"mappings":";;;;;;;;;;;;;;;AA+FA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KA/EO;CAC3B,OAAOA,0BAAAA,kBAAkB,KAAK;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,UAAU;GACV,UAAU;GACV,KAAK;GACL,WAAW,EACT,eAAe,SACjB;GACA,aAAa,EACX,eAAe,MACjB;EACF;EACA,aAAa;GACX,YAAY;GACZ,YAAY;GACZ,aAAa;GACb,cAAc;GACd,aAAa;GACb,OAAO;GACP,QAAQ;GACR,cAAc;GACd,cAAc;GACd,eAAe;GACf,cAAc;GACd,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ;IACN,WAAW;IACX,gBAAgB;GAClB;GACA,UAAU;IACR,YAAY;IACZ,aAAa;GACf;GACA,WAAW;IACT,aAAa;IACb,QAAQ;KACN,aAAa;KACb,WAAW;IACb;GACF;GACA,eAAe;IACb,YAAY;IACZ,oBAAoB;GACtB;EACF;EACA,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,QAAQ;GACR,KAAK;GACL,WAAW,EACT,QAAQ,cACV;GACA,8BAA8B;IAC5B,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;GAChB;EACF;EACA,UAAU;GACR,QAAQ,EACN,OAAO,cACT;GACA,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,gBACT;GACF;EACF;CACF;AACF,CAEwE,CAAC;AAIzE,M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AA;CAClB,CAAA;AACiB,CAAA,CAE7B;AAEA,MAAa,4BAA4BF,0BAAAA,WAAW"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { HTMLProps } from "@ark-ui/react/factory";
9
+ import { type RecipeVariantProps } from "@ndla/styled-system/css";
10
+ import { type StyledProps } from "@ndla/styled-system/jsx";
11
+ declare const rainbowRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
12
+ variant: {
13
+ page: {
14
+ paddingBlockStart: "4xlarge";
15
+ display: "flex";
16
+ justifyContent: "center";
17
+ alignItems: "center";
18
+ };
19
+ default: {};
20
+ };
21
+ }>;
22
+ export type RainbowSpinnerVariantProps = NonNullable<RecipeVariantProps<typeof rainbowRecipe>>;
23
+ interface Props extends HTMLProps<"div">, StyledProps, RainbowSpinnerVariantProps {
24
+ }
25
+ export declare const RainbowSpinner: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
26
+ export {};
@@ -0,0 +1,66 @@
1
+ let _ndla_styled_system_css = require("@ndla/styled-system/css");
2
+ let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
3
+ let react_jsx_runtime = require("react/jsx-runtime");
4
+ let react = require("react");
5
+ //#region src/RainbowSpinner.tsx
6
+ const rainbowRecipe = (0, _ndla_styled_system_css.cva)({
7
+ base: {
8
+ "--line-width": "token(sizes.4xsmall)",
9
+ "--line-spacing": "token(sizes.xxsmall)",
10
+ position: "relative",
11
+ width: "3xlarge",
12
+ height: "3xlarge",
13
+ "& > :nth-child(1)": { "--i": "0" },
14
+ "& > :nth-child(2)": { "--i": "1" },
15
+ "& > :nth-child(3)": { "--i": "2" },
16
+ "& > :nth-child(4)": { "--i": "3" },
17
+ "& > :nth-child(5)": { "--i": "4" }
18
+ },
19
+ variants: { variant: {
20
+ page: {
21
+ paddingBlockStart: "4xlarge",
22
+ display: "flex",
23
+ justifyContent: "center",
24
+ alignItems: "center"
25
+ },
26
+ default: {}
27
+ } },
28
+ defaultVariants: { variant: "default" }
29
+ });
30
+ const BaseLine = (0, _ndla_styled_system_jsx.styled)("div", { base: {
31
+ position: "absolute",
32
+ animation: "rainbow-spin",
33
+ transformOrigin: "50% 100%",
34
+ width: "calc(100% - (var(--i) * (var(--line-spacing) + var(--line-width))))",
35
+ height: "calc(50% - (var(--i) * (var(--line-spacing) + var(--line-width)) / 2))",
36
+ top: "calc(var(--i) * (var(--line-spacing) + var(--line-width)) / 2)",
37
+ insetInline: "calc(var(--i) * (var(--line-spacing) + var(--line-width)) / 2)",
38
+ animationDelay: "calc(var(--i) * -50ms)",
39
+ borderRadius: "50% 50% 0 0 / 100% 100% 0 0",
40
+ borderWidth: "var(--line-width)",
41
+ borderBottom: "0"
42
+ } });
43
+ const Line1 = (0, _ndla_styled_system_jsx.styled)(BaseLine, { base: { borderColor: "surface.brand.5" } });
44
+ const Line2 = (0, _ndla_styled_system_jsx.styled)(BaseLine, { base: { borderColor: "surface.brand.4" } });
45
+ const Line3 = (0, _ndla_styled_system_jsx.styled)(BaseLine, { base: { borderColor: "surface.brand.3" } });
46
+ const Line4 = (0, _ndla_styled_system_jsx.styled)(BaseLine, { base: { borderColor: "surface.brand.2" } });
47
+ const Line5 = (0, _ndla_styled_system_jsx.styled)(BaseLine, { base: { borderColor: "surface.brand.1" } });
48
+ const RainbowRoot = (0, _ndla_styled_system_jsx.styled)("div", {}, { baseComponent: true });
49
+ const RainbowSpinner = (0, react.forwardRef)(({ css: cssProp, variant, ...props }, ref) => {
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RainbowRoot, {
51
+ css: _ndla_styled_system_css.css.raw(rainbowRecipe.raw({ variant }), cssProp),
52
+ ...props,
53
+ ref,
54
+ children: [
55
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line1, {}),
56
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line2, {}),
57
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line3, {}),
58
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line4, {}),
59
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line5, {})
60
+ ]
61
+ });
62
+ });
63
+ //#endregion
64
+ exports.RainbowSpinner = RainbowSpinner;
65
+
66
+ //# sourceMappingURL=RainbowSpinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RainbowSpinner.js","names":["css"],"sources":["../src/RainbowSpinner.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport type { HTMLProps } from \"@ark-ui/react/factory\";\nimport { css, cva, type RecipeVariantProps } from \"@ndla/styled-system/css\";\nimport { styled, type StyledProps } from \"@ndla/styled-system/jsx\";\nimport { forwardRef } from \"react\";\n\nconst rainbowRecipe = cva({\n base: {\n \"--line-width\": \"token(sizes.4xsmall)\",\n \"--line-spacing\": \"token(sizes.xxsmall)\",\n position: \"relative\",\n width: \"3xlarge\",\n height: \"3xlarge\",\n \"& > :nth-child(1)\": { \"--i\": \"0\" },\n \"& > :nth-child(2)\": { \"--i\": \"1\" },\n \"& > :nth-child(3)\": { \"--i\": \"2\" },\n \"& > :nth-child(4)\": { \"--i\": \"3\" },\n \"& > :nth-child(5)\": { \"--i\": \"4\" },\n },\n variants: {\n variant: {\n page: {\n paddingBlockStart: \"4xlarge\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n default: {},\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\nconst BaseLine = styled(\"div\", {\n base: {\n position: \"absolute\",\n animation: \"rainbow-spin\",\n transformOrigin: \"50% 100%\",\n width: \"calc(100% - (var(--i) * (var(--line-spacing) + var(--line-width))))\",\n height: \"calc(50% - (var(--i) * (var(--line-spacing) + var(--line-width)) / 2))\",\n top: \"calc(var(--i) * (var(--line-spacing) + var(--line-width)) / 2)\",\n insetInline: \"calc(var(--i) * (var(--line-spacing) + var(--line-width)) / 2)\",\n animationDelay: \"calc(var(--i) * -50ms)\",\n borderRadius: \"50% 50% 0 0 / 100% 100% 0 0\",\n borderWidth: \"var(--line-width)\",\n borderBottom: \"0\",\n },\n});\n\nconst Line1 = styled(BaseLine, {\n base: {\n borderColor: \"surface.brand.5\",\n },\n});\n\nconst Line2 = styled(BaseLine, {\n base: {\n borderColor: \"surface.brand.4\",\n },\n});\n\nconst Line3 = styled(BaseLine, {\n base: {\n borderColor: \"surface.brand.3\",\n },\n});\n\nconst Line4 = styled(BaseLine, {\n base: {\n borderColor: \"surface.brand.2\",\n },\n});\n\nconst Line5 = styled(BaseLine, {\n base: {\n borderColor: \"surface.brand.1\",\n },\n});\n\nconst RainbowRoot = styled(\"div\", {}, { baseComponent: true });\n\nexport type RainbowSpinnerVariantProps = NonNullable<RecipeVariantProps<typeof rainbowRecipe>>;\n\ninterface Props extends HTMLProps<\"div\">, StyledProps, RainbowSpinnerVariantProps {}\n\nexport const RainbowSpinner = forwardRef<HTMLDivElement, Props>(({ css: cssProp, variant, ...props }, ref) => {\n return (\n <RainbowRoot css={css.raw(rainbowRecipe.raw({ variant }), cssProp)} {...props} ref={ref}>\n <Line1 />\n <Line2 />\n <Line3 />\n <Line4 />\n <Line5 />\n </RainbowRoot>\n );\n});\n"],"mappings":";;;;;AAaA,MAAM,iBAAA,GAAA,wBAAA,KAAoB;CACxB,MAAM;EACJ,gBAAgB;EAChB,kBAAkB;EAClB,UAAU;EACV,OAAO;EACP,QAAQ;EACR,qBAAqB,EAAE,OAAO,IAAI;EAClC,qBAAqB,EAAE,OAAO,IAAI;EAClC,qBAAqB,EAAE,OAAO,IAAI;EAClC,qBAAqB,EAAE,OAAO,IAAI;EAClC,qBAAqB,EAAE,OAAO,IAAI;CACpC;CACA,UAAU,EACR,SAAS;EACP,MAAM;GACJ,mBAAmB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AAQ,CAAA;GACR,iBAAA,GAAA,kBAAA,KAAC,OAAD,CAAQ,CAAA;EACG;;AAEjB,CAAC"}
package/lib/Select.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { Select } from "@ark-ui/react";
8
+ import { Select } from "@ark-ui/react/select";
9
9
  import type { StyledProps } from "@ndla/styled-system/types";
10
10
  import { type RefAttributes } from "react";
11
11
  import { type TextProps } from "./Text";
package/lib/Select.js CHANGED
@@ -1,9 +1,9 @@
1
1
  const require_Label = require("./Label.js");
2
- let _ark_ui_react = require("@ark-ui/react");
3
2
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
4
  let react_jsx_runtime = require("react/jsx-runtime");
6
5
  let react = require("react");
6
+ let _ark_ui_react_select = require("@ark-ui/react/select");
7
7
  //#region src/Select.tsx
8
8
  /**
9
9
  * Copyright (c) 2024-present, NDLA.
@@ -13,7 +13,7 @@ let react = require("react");
13
13
  *
14
14
  */
15
15
  const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleContext)((0, _ndla_styled_system_css.sva)({
16
- slots: _ark_ui_react.selectAnatomy.keys(),
16
+ slots: _ark_ui_react_select.selectAnatomy.keys(),
17
17
  base: {
18
18
  root: {
19
19
  display: "flex",
@@ -115,20 +115,20 @@ const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleCon
115
115
  valueText: { textAlign: "start" }
116
116
  }
117
117
  }));
118
- const InternalSelectRoot = withProvider(_ark_ui_react.Select.Root, "root", { baseComponent: true });
118
+ const InternalSelectRoot = withProvider(_ark_ui_react_select.Select.Root, "root", { baseComponent: true });
119
119
  const SelectRoot = ({ lazyMount = true, unmountOnExit = true, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalSelectRoot, {
120
120
  lazyMount,
121
121
  unmountOnExit,
122
122
  ...props
123
123
  });
124
- const SelectClearTrigger = withContext(_ark_ui_react.Select.ClearTrigger, "clearTrigger", { baseComponent: true });
125
- const SelectContentStandalone = withContext(_ark_ui_react.Select.Content, "content", { baseComponent: true });
124
+ const SelectClearTrigger = withContext(_ark_ui_react_select.Select.ClearTrigger, "clearTrigger", { baseComponent: true });
125
+ const SelectContentStandalone = withContext(_ark_ui_react_select.Select.Content, "content", { baseComponent: true });
126
126
  const SelectContent = (0, react.forwardRef)((props, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectPositioner, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectContentStandalone, {
127
127
  ref,
128
128
  ...props
129
129
  }) }));
130
- const SelectControl = withContext(_ark_ui_react.Select.Control, "control", { baseComponent: true });
131
- const SelectIndicator = withContext(_ark_ui_react.Select.Indicator, "indicator", { baseComponent: true });
130
+ const SelectControl = withContext(_ark_ui_react_select.Select.Control, "control", { baseComponent: true });
131
+ const SelectIndicator = withContext(_ark_ui_react_select.Select.Indicator, "indicator", { baseComponent: true });
132
132
  const SelectItemGroupLabel = (0, react.forwardRef)(({ children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalSelectItemGroupLabel, {
133
133
  asChild: true,
134
134
  ref,
@@ -139,23 +139,23 @@ const SelectItemGroupLabel = (0, react.forwardRef)(({ children, ...props }, ref)
139
139
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children })
140
140
  })
141
141
  }));
142
- const InternalSelectItemGroupLabel = withContext(_ark_ui_react.Select.ItemGroupLabel, "itemGroupLabel");
143
- const SelectItemGroup = withContext(_ark_ui_react.Select.ItemGroup, "itemGroup", { baseComponent: true });
144
- const SelectItemIndicator = withContext(_ark_ui_react.Select.ItemIndicator, "itemIndicator", { baseComponent: true });
145
- const SelectItem = withContext(_ark_ui_react.Select.Item, "item", { baseComponent: true });
146
- const SelectItemText = withContext(_ark_ui_react.Select.ItemText, "itemText", { baseComponent: true });
147
- const InternalSelectLabel = withContext(_ark_ui_react.Select.Label, "label");
142
+ const InternalSelectItemGroupLabel = withContext(_ark_ui_react_select.Select.ItemGroupLabel, "itemGroupLabel");
143
+ const SelectItemGroup = withContext(_ark_ui_react_select.Select.ItemGroup, "itemGroup", { baseComponent: true });
144
+ const SelectItemIndicator = withContext(_ark_ui_react_select.Select.ItemIndicator, "itemIndicator", { baseComponent: true });
145
+ const SelectItem = withContext(_ark_ui_react_select.Select.Item, "item", { baseComponent: true });
146
+ const SelectItemText = withContext(_ark_ui_react_select.Select.ItemText, "itemText", { baseComponent: true });
147
+ const InternalSelectLabel = withContext(_ark_ui_react_select.Select.Label, "label");
148
148
  const SelectLabel = (0, react.forwardRef)(({ children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalSelectLabel, {
149
149
  asChild: true,
150
150
  ref,
151
151
  ...props,
152
152
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Label.Label, { children })
153
153
  }));
154
- const SelectPositioner = withContext(_ark_ui_react.Select.Positioner, "positioner", { baseComponent: true });
155
- const SelectTrigger = withContext(_ark_ui_react.Select.Trigger, "trigger", { baseComponent: true });
156
- const SelectValueText = withContext(_ark_ui_react.Select.ValueText, "valueText", { baseComponent: true });
157
- const SelectList = withContext(_ark_ui_react.Select.List, "list", { baseComponent: true });
158
- const SelectHiddenSelect = _ark_ui_react.Select.HiddenSelect;
154
+ const SelectPositioner = withContext(_ark_ui_react_select.Select.Positioner, "positioner", { baseComponent: true });
155
+ const SelectTrigger = withContext(_ark_ui_react_select.Select.Trigger, "trigger", { baseComponent: true });
156
+ const SelectValueText = withContext(_ark_ui_react_select.Select.ValueText, "valueText", { baseComponent: true });
157
+ const SelectList = withContext(_ark_ui_react_select.Select.List, "list", { baseComponent: true });
158
+ const SelectHiddenSelect = _ark_ui_react_select.Select.HiddenSelect;
159
159
  //#endregion
160
160
  exports.SelectClearTrigger = SelectClearTrigger;
161
161
  exports.SelectContent = SelectContent;
package/lib/Select.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["selectAnatomy","Select","Label"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Select, selectAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef, type ElementType, type RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst selectRecipe = sva({\n slots: selectAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n control: {\n display: \"flex\",\n gap: \"4xsmall\",\n alignItems: \"center\",\n },\n content: {\n display: \"flex\",\n gap: \"4xsmall\",\n flexDirection: \"column\",\n zIndex: \"dropdown\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"large\",\n padding: \"xsmall\",\n overflowY: \"auto\",\n maxHeight: \"min(token(spacing.surface.xsmall), 45vh)\",\n _focusVisible: {\n outlineOffset: \"-1\",\n },\n _open: {\n animation: \"fade-shift-in 0.25s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"fade-shift-out 0.25s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n item: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"xsmall\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n _hover: {\n background: \"surface.hover\",\n },\n _selected: {\n background: \"surface.selected\",\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n },\n _highlighted: {\n background: \"surface.hover\",\n _hover: {\n background: \"surface.hover\",\n },\n },\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.disabled\",\n background: \"surface.disabled\",\n _highlighted: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n _selected: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n _hover: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n },\n },\n indicator: {\n color: \"icon.default\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _open: {\n transform: \"rotate(180deg)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n itemIndicator: {\n color: \"stroke.default\",\n },\n itemText: {\n _checked: {\n textDecoration: \"underline\",\n },\n _highlighted: {\n textDecoration: \"underline\",\n },\n },\n trigger: {\n justifyContent: \"space-between\",\n width: \"surface.small\",\n _ariaInvalid: {\n boxShadowColor: \"stroke.error\",\n },\n },\n itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n },\n valueText: {\n textAlign: \"start\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(selectRecipe);\n\nexport interface SelectRootProps<T extends Select.CollectionItem>\n extends Select.RootProps<T>, StyledProps, RefAttributes<HTMLDivElement> {}\nconst InternalSelectRoot = withProvider<ElementType<SelectRootProps<Select.CollectionItem>>>(Select.Root, \"root\", {\n baseComponent: true,\n});\n\nexport const SelectRoot = <T extends Select.CollectionItem>({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: SelectRootProps<T>) => <InternalSelectRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />;\n\nexport const SelectClearTrigger = withContext(Select.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport const SelectContentStandalone = withContext(Select.Content, \"content\", { baseComponent: true });\n\ninterface SelectContentProps extends Select.ContentProps, StyledProps {}\n\nexport const SelectContent = forwardRef<HTMLDivElement, SelectContentProps>((props, ref) => (\n <SelectPositioner>\n <SelectContentStandalone ref={ref} {...props} />\n </SelectPositioner>\n));\n\nexport const SelectControl = withContext(Select.Control, \"control\", { baseComponent: true });\n\nexport const SelectIndicator = withContext(Select.Indicator, \"indicator\", { baseComponent: true });\n\ninterface SelectItemGroupLabelProps\n extends Omit<Select.ItemGroupLabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLDivElement> {}\n\nexport const SelectItemGroupLabel = forwardRef<HTMLDivElement, SelectItemGroupLabelProps>(\n ({ children, ...props }, ref) => (\n <InternalSelectItemGroupLabel asChild ref={ref} {...props}>\n <Label asChild consumeCss>\n <div>{children}</div>\n </Label>\n </InternalSelectItemGroupLabel>\n ),\n);\n\nconst InternalSelectItemGroupLabel = withContext(Select.ItemGroupLabel, \"itemGroupLabel\");\n\nexport const SelectItemGroup = withContext(Select.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport const SelectItemIndicator = withContext(Select.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport const SelectItem = withContext(Select.Item, \"item\", {\n baseComponent: true,\n});\n\nexport const SelectItemText = withContext(Select.ItemText, \"itemText\", { baseComponent: true });\n\nconst InternalSelectLabel = withContext(Select.Label, \"label\");\n\ninterface SelectLabelProps\n extends Omit<Select.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const SelectLabel = forwardRef<HTMLLabelElement, SelectLabelProps>(({ children, ...props }, ref) => (\n <InternalSelectLabel asChild ref={ref} {...props}>\n <Label>{children}</Label>\n </InternalSelectLabel>\n));\n\nexport const SelectPositioner = withContext(Select.Positioner, \"positioner\", { baseComponent: true });\n\nexport const SelectTrigger = withContext(Select.Trigger, \"trigger\", { baseComponent: true });\n\nexport const SelectValueText = withContext(Select.ValueText, \"valueText\", { baseComponent: true });\n\nexport const SelectList = withContext(Select.List, \"list\", {\n baseComponent: true,\n});\n\nexport const SelectHiddenSelect = Select.HiddenSelect;\n"],"mappings":";;;;;;;;;;;;;;AAkJA,MAA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AAAA,OAAO,WAAW,aAAa,EAAE,eAAe,KAAK,CAAC;AAEjG,MAAa,sBAAsB,YAAYA,cAAAA,OAAO,eAAe,iBAAiB,EAAE,eAAe,KAAK,CAAC;AAE7G,MAAa,aAAa,YAAYA,cAAAA,OAAO,MAAM,QAAQ,EACzD,eAAe,KACjB,CAAC;AAED,MAAa,iBAAiB,YAAYA,cAAAA,OAAO,UAAU,YAAY,EAAE,eAAe,KAAK,CAAC;AAE9F,MAAM,sBAAsB,YAAYA,cAAAA,OAAO,OAAO,OAAO;AAK7D,MAAa,eAAA,GAAA,MAAA,aAA8D,EAAE,UAAU,GAAG,SAAS,QACjG,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,SAAA;CAAa;CAAK,GAAI;WACzC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD,EAAQ,SAAgB,CAAA;AACL,CAAA,CACtB;AAED,MAAa,mBAAmB,YAAYD,cAAAA,OAAO,YAAY,cAAc,EAAE,eAAe,KAAK,CAAC;AAEpG,MAAa,gBAAgB,YAAYA,cAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,KAAK,CAAC;AAE3F,MAAa,kBAAkB,YAAYA,cAAAA,OAAO,WAAW,aAAa,EAAE,eAAe,KAAK,CAAC;AAEjG,MAAa,aAAa,YAAYA,cAAAA,OAAO,MAAM,QAAQ,EACzD,eAAe,KACjB,CAAC;AAED,MAAa,qBAAqBA,cAAAA,OAAO"}
1
+ {"version":3,"file":"Select.js","names":["selectAnatomy","Select","Label"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Select, selectAnatomy } from \"@ark-ui/react/select\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef, type ElementType, type RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst selectRecipe = sva({\n slots: selectAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n control: {\n display: \"flex\",\n gap: \"4xsmall\",\n alignItems: \"center\",\n },\n content: {\n display: \"flex\",\n gap: \"4xsmall\",\n flexDirection: \"column\",\n zIndex: \"dropdown\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"large\",\n padding: \"xsmall\",\n overflowY: \"auto\",\n maxHeight: \"min(token(spacing.surface.xsmall), 45vh)\",\n _focusVisible: {\n outlineOffset: \"-1\",\n },\n _open: {\n animation: \"fade-shift-in 0.25s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"fade-shift-out 0.25s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n item: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"xsmall\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n _hover: {\n background: \"surface.hover\",\n },\n _selected: {\n background: \"surface.selected\",\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n },\n _highlighted: {\n background: \"surface.hover\",\n _hover: {\n background: \"surface.hover\",\n },\n },\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.disabled\",\n background: \"surface.disabled\",\n _highlighted: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n _selected: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n _hover: {\n color: \"text.disabled\",\n background: \"surface.disabled\",\n },\n },\n },\n indicator: {\n color: \"icon.default\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _open: {\n transform: \"rotate(180deg)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n itemIndicator: {\n color: \"stroke.default\",\n },\n itemText: {\n _checked: {\n textDecoration: \"underline\",\n },\n _highlighted: {\n textDecoration: \"underline\",\n },\n },\n trigger: {\n justifyContent: \"space-between\",\n width: \"surface.small\",\n _ariaInvalid: {\n boxShadowColor: \"stroke.error\",\n },\n },\n itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n },\n valueText: {\n textAlign: \"start\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(selectRecipe);\n\nexport interface SelectRootProps<T extends Select.CollectionItem>\n extends Select.RootProps<T>, StyledProps, RefAttributes<HTMLDivElement> {}\nconst InternalSelectRoot = withProvider<ElementType<SelectRootProps<Select.CollectionItem>>>(Select.Root, \"root\", {\n baseComponent: true,\n});\n\nexport const SelectRoot = <T extends Select.CollectionItem>({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: SelectRootProps<T>) => <InternalSelectRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />;\n\nexport const SelectClearTrigger = withContext(Select.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport const SelectContentStandalone = withContext(Select.Content, \"content\", { baseComponent: true });\n\ninterface SelectContentProps extends Select.ContentProps, StyledProps {}\n\nexport const SelectContent = forwardRef<HTMLDivElement, SelectContentProps>((props, ref) => (\n <SelectPositioner>\n <SelectContentStandalone ref={ref} {...props} />\n </SelectPositioner>\n));\n\nexport const SelectControl = withContext(Select.Control, \"control\", { baseComponent: true });\n\nexport const SelectIndicator = withContext(Select.Indicator, \"indicator\", { baseComponent: true });\n\ninterface SelectItemGroupLabelProps\n extends Omit<Select.ItemGroupLabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLDivElement> {}\n\nexport const SelectItemGroupLabel = forwardRef<HTMLDivElement, SelectItemGroupLabelProps>(\n ({ children, ...props }, ref) => (\n <InternalSelectItemGroupLabel asChild ref={ref} {...props}>\n <Label asChild consumeCss>\n <div>{children}</div>\n </Label>\n </InternalSelectItemGroupLabel>\n ),\n);\n\nconst InternalSelectItemGroupLabel = withContext(Select.ItemGroupLabel, \"itemGroupLabel\");\n\nexport const SelectItemGroup = withContext(Select.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport const SelectItemIndicator = withContext(Select.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport const SelectItem = withContext(Select.Item, \"item\", {\n baseComponent: true,\n});\n\nexport const SelectItemText = withContext(Select.ItemText, \"itemText\", { baseComponent: true });\n\nconst InternalSelectLabel = withContext(Select.Label, \"label\");\n\ninterface SelectLabelProps\n extends Omit<Select.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const SelectLabel = forwardRef<HTMLLabelElement, SelectLabelProps>(({ children, ...props }, ref) => (\n <InternalSelectLabel asChild ref={ref} {...props}>\n <Label>{children}</Label>\n </InternalSelectLabel>\n));\n\nexport const SelectPositioner = withContext(Select.Positioner, \"positioner\", { baseComponent: true });\n\nexport const SelectTrigger = withContext(Select.Trigger, \"trigger\", { baseComponent: true });\n\nexport const SelectValueText = withContext(Select.ValueText, \"valueText\", { baseComponent: true });\n\nexport const SelectList = withContext(Select.List, \"list\", {\n baseComponent: true,\n});\n\nexport const SelectHiddenSelect = Select.HiddenSelect;\n"],"mappings":";;;;;;;;;;;;;;AAkJA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAlIG;CACvB,OAAOA,qBAAAA,cAAc,KAAK;CAC1B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;EACP;EACA,SAAS;GACP,SAAS;GACT,KAAK;GACL,YAAY;EACd;EACA,SAAS;GACP,SAAS;GACT,KAAK;GACL,eAAe;GACf,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,WAAW;GACX,SAAS;GACT,WAAW;GACX,WAAW;GACX,eAAe,EAC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,OAAO;AAK7D,MAAa,eAAA,GAAA,MAAA,aAA8D,EAAE,UAAU,GAAG,SAAS,QACjG,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,SAAA;CAAa;CAAK,GAAI;WACzC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD,EAAQ,SAAgB,CAAA;AACL,CAAA,CACtB;AAED,MAAa,mBAAmB,YAAYD,qBAAAA,OAAO,YAAY,cAAc,EAAE,eAAe,KAAK,CAAC;AAEpG,MAAa,gBAAgB,YAAYA,qBAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,KAAK,CAAC;AAE3F,MAAa,kBAAkB,YAAYA,qBAAAA,OAAO,WAAW,aAAa,EAAE,eAAe,KAAK,CAAC;AAEjG,MAAa,aAAa,YAAYA,qBAAAA,OAAO,MAAM,QAAQ,EACzD,eAAe,KACjB,CAAC;AAED,MAAa,qBAAqBA,qBAAAA,OAAO"}
package/lib/Skeleton.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { type HTMLArkProps } from "@ark-ui/react";
8
+ import { type HTMLArkProps } from "@ark-ui/react/factory";
9
9
  import type { StyledProps } from "@ndla/styled-system/types";
10
- export declare const Skeleton: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
10
+ export declare const Skeleton: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("@ark-ui/react/factory").PolymorphicProps>, {}>;
11
11
  export interface SkeletonProps extends HTMLArkProps<"div">, StyledProps {
12
12
  }
package/lib/Skeleton.js CHANGED
@@ -1,4 +1,5 @@
1
- let _ark_ui_react = require("@ark-ui/react");
1
+ let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
2
+ let _ark_ui_react_factory = require("@ark-ui/react/factory");
2
3
  //#region src/Skeleton.tsx
3
4
  /**
4
5
  * Copyright (c) 2024-present, NDLA.
@@ -7,7 +8,7 @@ let _ark_ui_react = require("@ark-ui/react");
7
8
  * LICENSE file in the root directory of this source tree.
8
9
  *
9
10
  */
10
- const Skeleton = (0, require("@ndla/styled-system/jsx").styled)(_ark_ui_react.ark.div, { base: {
11
+ const Skeleton = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react_factory.ark.div, { base: {
11
12
  animation: "skeleton-pulse",
12
13
  backgroundColor: "surface.disabled",
13
14
  backgroundClip: "padding-box",
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.js","names":["ark"],"sources":["../src/Skeleton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nexport const Skeleton = styled(\n ark.div,\n {\n base: {\n animation: \"skeleton-pulse\",\n backgroundColor: \"surface.disabled\",\n backgroundClip: \"padding-box\",\n borderRadius: \"xsmall\",\n color: \"transparent\",\n cursor: \"default\",\n pointerEvents: \"none\",\n userSelect: \"none\",\n \"&::before, &::after, *\": {\n visibility: \"hidden\",\n },\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n { baseComponent: true },\n);\n\nexport interface SkeletonProps extends HTMLArkProps<\"div\">, StyledProps {}\n"],"mappings":";;;;;;;;;AAYA,MAAa,YAAA,oCAAA,EAAA,QACXA,cAAAA,IAAI,KACJ,EACE,MAAM;CACJ,WAAW;CACX,iBAAiB;CACjB,gBAAgB;CAChB,cAAc;CACd,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,0BAA0B,EACxB,YAAY,SACd;CACA,eAAe,EACb,WAAW,OACb;AACF,EACF,GACA,EAAE,eAAe,KAAK,CACxB"}
1
+ {"version":3,"file":"Skeleton.js","names":["ark"],"sources":["../src/Skeleton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react/factory\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nexport const Skeleton = styled(\n ark.div,\n {\n base: {\n animation: \"skeleton-pulse\",\n backgroundColor: \"surface.disabled\",\n backgroundClip: \"padding-box\",\n borderRadius: \"xsmall\",\n color: \"transparent\",\n cursor: \"default\",\n pointerEvents: \"none\",\n userSelect: \"none\",\n \"&::before, &::after, *\": {\n visibility: \"hidden\",\n },\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n { baseComponent: true },\n);\n\nexport interface SkeletonProps extends HTMLArkProps<\"div\">, StyledProps {}\n"],"mappings":";;;;;;;;;;AAYA,MAAa,YAAA,GAAA,wBAAA,QACXA,sBAAAA,IAAI,KACJ,EACE,MAAM;CACJ,WAAW;CACX,iBAAiB;CACjB,gBAAgB;CAChB,cAAc;CACd,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,0BAA0B,EACxB,YAAY,SACd;CACA,eAAe,EACb,WAAW,OACb;AACF,EACF,GACA,EAAE,eAAe,KAAK,CACxB"}
package/lib/Slider.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { Slider } from "@ark-ui/react";
8
+ import { Slider } from "@ark-ui/react/slider";
9
9
  import type { StyledProps } from "@ndla/styled-system/types";
10
10
  import type { RefAttributes } from "react";
11
11
  import { type TextProps } from "./Text";
package/lib/Slider.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const require_Label = require("./Label.js");
2
- let _ark_ui_react = require("@ark-ui/react");
3
2
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
+ let _ark_ui_react_slider = require("@ark-ui/react/slider");
6
6
  //#region src/Slider.tsx
7
7
  /**
8
8
  * Copyright (c) 2024-present, NDLA.
@@ -12,7 +12,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
12
12
  *
13
13
  */
14
14
  const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleContext)((0, _ndla_styled_system_css.sva)({
15
- slots: _ark_ui_react.sliderAnatomy.keys(),
15
+ slots: _ark_ui_react_slider.sliderAnatomy.keys(),
16
16
  base: {
17
17
  root: {
18
18
  display: "flex",
@@ -66,12 +66,12 @@ const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleCon
66
66
  }
67
67
  }
68
68
  }));
69
- const SliderRoot = withProvider(_ark_ui_react.Slider.Root, "root", { baseComponent: true });
70
- const SliderControl = withContext(_ark_ui_react.Slider.Control, "control", { baseComponent: true });
71
- const SliderTrack = withContext(_ark_ui_react.Slider.Track, "track", { baseComponent: true });
72
- const SliderRange = withContext(_ark_ui_react.Slider.Range, "range", { baseComponent: true });
73
- const SliderThumb = withContext(_ark_ui_react.Slider.Thumb, "thumb", { baseComponent: true });
74
- const InternalSliderLabel = withContext(_ark_ui_react.Slider.Label, "label");
69
+ const SliderRoot = withProvider(_ark_ui_react_slider.Slider.Root, "root", { baseComponent: true });
70
+ const SliderControl = withContext(_ark_ui_react_slider.Slider.Control, "control", { baseComponent: true });
71
+ const SliderTrack = withContext(_ark_ui_react_slider.Slider.Track, "track", { baseComponent: true });
72
+ const SliderRange = withContext(_ark_ui_react_slider.Slider.Range, "range", { baseComponent: true });
73
+ const SliderThumb = withContext(_ark_ui_react_slider.Slider.Thumb, "thumb", { baseComponent: true });
74
+ const InternalSliderLabel = withContext(_ark_ui_react_slider.Slider.Label, "label");
75
75
  const SliderLabel = ({ textStyle = "label.medium", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalSliderLabel, {
76
76
  asChild: true,
77
77
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Label.Label, {
@@ -79,7 +79,7 @@ const SliderLabel = ({ textStyle = "label.medium", ...props }) => /* @__PURE__ *
79
79
  ...props
80
80
  })
81
81
  });
82
- const SliderHiddenInput = _ark_ui_react.Slider.HiddenInput;
82
+ const SliderHiddenInput = _ark_ui_react_slider.Slider.HiddenInput;
83
83
  //#endregion
84
84
  exports.SliderControl = SliderControl;
85
85
  exports.SliderHiddenInput = SliderHiddenInput;
package/lib/Slider.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","names":["sliderAnatomy","Slider","Label"],"sources":["../src/Slider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Slider, sliderAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst sliderRecipe = sva({\n slots: sliderAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n width: \"100%\",\n },\n control: {\n position: \"relative\",\n cursor: \"pointer\",\n display: \"flex\",\n _vertical: {\n flexDirection: \"column\",\n },\n alignItems: \"center\",\n height: \"medium\",\n },\n track: {\n background: \"surface.disabled\",\n overflow: \"hidden\",\n flex: \"1\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n range: {\n background: \"surface.action\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n thumb: {\n background: \"surface.action\",\n borderRadius: \"full\",\n outline: \"none\",\n zIndex: \"1\",\n height: \"medium\",\n width: \"medium\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n transitionProperty: \"background\",\n _hover: {\n background: \"surface.action.hover\",\n },\n _active: {\n background: \"surface.action.active\",\n },\n _focusVisible: {\n border: \"2px solid\",\n borderColor: \"background.default\",\n outline: \"3px solid\",\n outlineColor: \"surface.action\",\n outlineOffset: \"0px\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(sliderRecipe);\n\nexport interface SliderRootProps extends Slider.RootProps, StyledProps {}\n\nexport const SliderRoot = withProvider(Slider.Root, \"root\", { baseComponent: true });\n\nexport const SliderControl = withContext(Slider.Control, \"control\", { baseComponent: true });\n\nexport const SliderTrack = withContext(Slider.Track, \"track\", { baseComponent: true });\n\nexport const SliderRange = withContext(Slider.Range, \"range\", { baseComponent: true });\n\nexport const SliderThumb = withContext(Slider.Thumb, \"thumb\", { baseComponent: true });\n\nconst InternalSliderLabel = withContext(Slider.Label, \"label\");\n\ninterface SliderLabelProps\n extends Omit<Slider.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLLabelElement> {}\n\nexport const SliderLabel = ({ textStyle = \"label.medium\", ...props }: SliderLabelProps) => (\n <InternalSliderLabel asChild>\n <Label textStyle={textStyle} {...props} />\n </InternalSliderLabel>\n);\n\nexport const SliderHiddenInput = Slider.HiddenInput;\n"],"mappings":";;;;;;;;;;;;;AAsFA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAtEG;CACvB,OAAOA,cAAAA,cAAc,KAAK;CAC1B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;EACT;EACA,SAAS;GACP,UAAU;GACV,QAAQ;GACR,SAAS;GACT,WAAW,EACT,eAAe,SACjB;GACA,YAAY;GACZ,QAAQ;E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slider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Slider, sliderAnatomy } from \"@ark-ui/react/slider\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst sliderRecipe = sva({\n slots: sliderAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n width: \"100%\",\n },\n control: {\n position: \"relative\",\n cursor: \"pointer\",\n display: \"flex\",\n _vertical: {\n flexDirection: \"column\",\n },\n alignItems: \"center\",\n height: \"medium\",\n },\n track: {\n background: \"surface.disabled\",\n overflow: \"hidden\",\n flex: \"1\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n range: {\n background: \"surface.action\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n thumb: {\n background: \"surface.action\",\n borderRadius: \"full\",\n outline: \"none\",\n zIndex: \"1\",\n height: \"medium\",\n width: \"medium\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n transitionProperty: \"background\",\n _hover: {\n background: \"surface.action.hover\",\n },\n _active: {\n background: \"surface.action.active\",\n },\n _focusVisible: {\n border: \"2px solid\",\n borderColor: \"background.default\",\n outline: \"3px solid\",\n outlineColor: \"surface.action\",\n outlineOffset: \"0px\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(sliderRecipe);\n\nexport interface SliderRootProps extends Slider.RootProps, StyledProps {}\n\nexport const SliderRoot = withProvider(Slider.Root, \"root\", { baseComponent: true });\n\nexport const SliderControl = withContext(Slider.Control, \"control\", { baseComponent: true });\n\nexport const SliderTrack = withContext(Slider.Track, \"track\", { baseComponent: true });\n\nexport const SliderRange = withContext(Slider.Range, \"range\", { baseComponent: true });\n\nexport const SliderThumb = withContext(Slider.Thumb, \"thumb\", { baseComponent: true });\n\nconst InternalSliderLabel = withContext(Slider.Label, \"label\");\n\ninterface SliderLabelProps\n extends Omit<Slider.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLLabelElement> {}\n\nexport const SliderLabel = ({ textStyle = \"label.medium\", ...props }: SliderLabelProps) => (\n <InternalSliderLabel asChild>\n <Label textStyle={textStyle} {...props} />\n </InternalSliderLabel>\n);\n\nexport const SliderHiddenInput = Slider.HiddenInput;\n"],"mappings":";;;;;;;;;;;;;AAsFA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAtEG;CACvB,OAAOA,qBAAAA,cAAc,KAAK;CAC1B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;EACT;EACA,SAAS;GACP,UAAU;GACV,QAAQ;GACR,SAAS;GACT,WAAW,EACT,eAAe,SACjB;GACA,YAAY;GACZ,QAAQ;EACV;EACA,OAAO;GACL,YAAY;GACZ,UAAU;GACV,MAAM;GACN,WAAW,EACT,OAAO,UACT;GACA,aAAa,EACX,QAAQ,UACV;EACF;EACA,OAAO;GACL,YAAY;GACZ,WAAW,EACT,OAAO,UACT;GACA,aAAa,EACX,QAAQ,UACV;EACF;EACA,OAAO;GACL,YAAY;GACZ,cAAc;GACd,SAAS;GACT,QAAQ;GACR,QAAQ;GACR,OAAO;GACP,oBAAoB;GACpB,0BAA0B;GAC1B,oBAAoB;GACpB,QAAQ,EACN,YAAY,uBACd;GACA,SAAS,EACP,YAAY,wBACd;GACA,eAAe;IACb,QAAQ;IACR,aAAa;IACb,SAAS;IACT,cAAc;IACd,eAAe;GACjB;GACA,eAAe;IACb,YAAY;IACZ,oBAAoB;GACtB;EACF;CACF;AACF,CAEoE,CAAC;AAIrE,MAAa,aAAa,aAAaC,qBAAAA,OAAO,MAAM,QAAQ,EAAE,eAAe,KAAK,CAAC;AAEnF,MAAa,gBAAgB,YAAYA,qBAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,KAAK,CAAC;AAE3F,MAAa,cAAc,YAAYA,qBAAAA,OAAO,OAAO,SAAS,EAAE,eAAe,KAAK,CAAC;AAErF,MAAa,cAAc,YAAYA,qBAAAA,OAAO,OAAO,SAAS,EAAE,eAAe,KAAK,CAAC;AAErF,MAAa,cAAc,YAAYA,qBAAAA,OAAO,OAAO,SAAS,EAAE,eAAe,KAAK,CAAC;AAErF,MAAM,sBAAsB,YAAYA,qBAAAA,OAAO,OAAO,OAAO;AAK7D,MAAa,eAAe,EAAE,YAAY,gBAAgB,GAAG,YAC3D,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,SAAA;WACnB,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD;EAAkB;EAAW,GAAI;CAAQ,CAAA;AACtB,CAAA;AAGvB,MAAa,oBAAoBD,qBAAAA,OAAO"}
package/lib/Spinner.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { type HTMLArkProps } from "@ark-ui/react";
8
+ import { type HTMLArkProps } from "@ark-ui/react/factory";
9
9
  import { type RecipeVariantProps } from "@ndla/styled-system/css";
10
10
  import type { StyledProps } from "@ndla/styled-system/types";
11
11
  export declare const spinnerRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
package/lib/Spinner.js CHANGED
@@ -1,7 +1,7 @@
1
- let _ark_ui_react = require("@ark-ui/react");
2
1
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
3
2
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
4
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
+ let _ark_ui_react_factory = require("@ark-ui/react/factory");
5
5
  let react = require("react");
6
6
  //#region src/Spinner.tsx
7
7
  /**
@@ -42,7 +42,7 @@ const spinnerRecipe = (0, _ndla_styled_system_css.cva)({
42
42
  }
43
43
  } }
44
44
  });
45
- const StyledSpinner = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react.ark.div, {}, { baseComponent: true });
45
+ const StyledSpinner = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react_factory.ark.div, {}, { baseComponent: true });
46
46
  const Spinner = (0, react.forwardRef)(({ size, css: cssProp, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSpinner, {
47
47
  css: _ndla_styled_system_css.css.raw(spinnerRecipe.raw({ size }), cssProp),
48
48
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","names":["ark","css"],"sources":["../src/Spinner.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nexport const spinnerRecipe = cva({\n base: {\n borderRadius: \"full\",\n animation: \"spin\",\n display: \"block\",\n marginInline: \"auto\",\n borderStyle: \"solid\",\n borderBlockColor: \"background.subtle\",\n borderInlineStartColor: \"background.subtle\",\n borderInlineEndColor: \"stroke.default\",\n _motionReduce: {\n animationDuration: \"2s\",\n },\n },\n defaultVariants: {\n size: \"large\",\n },\n variants: {\n size: {\n small: {\n borderWidth: \"4px\",\n height: \"small\",\n width: \"small\",\n },\n medium: {\n borderWidth: \"4px\",\n height: \"large\",\n width: \"large\",\n },\n large: {\n borderWidth: \"8px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n },\n },\n },\n});\n\nexport type SpinnerVariantProps = NonNullable<RecipeVariantProps<typeof spinnerRecipe>>;\n\nexport interface SpinnerProps extends HTMLArkProps<\"div\">, StyledProps, SpinnerVariantProps {}\n\nconst StyledSpinner = styled(ark.div, {}, { baseComponent: true });\n\nexport const Spinner = forwardRef<HTMLDivElement, SpinnerProps>(({ size, css: cssProp, ...props }, ref) => (\n <StyledSpinner css={css.raw(spinnerRecipe.raw({ size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,iBAAA,GAAA,wBAAA,KAAoB;CAC/B,MAAM;EACJ,cAAc;EACd,WAAW;EACX,SAAS;EACT,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,wBAAwB;EACxB,sBAAsB;EACtB,eAAe,EACb,mBAAmB,KACrB;CACF;CACA,iBAAiB,EACf,MAAM,QACR;CACA,UAAU,EACR,MAAM;EACJ,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;EACT;EACA,QAAQ;GACN,aAAa;GACb,QAAQ;GACR,OAAO;EACT;EACA,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;EACT;CACF,EACF;AACF,CAAC;AAMD,MAAM,iBAAA,GAAA,wBAAA,QAAuBA,cAAAA,IAAI,KAAK,CAAC,GAAG,EAAE,eAAe,KAAK,CAAC;AAEjE,MAAa,WAAA,GAAA,MAAA,aAAoD,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,QACjG,iBAAA,GAAA,kBAAA,KAAC,eAAD;CAAe,KAAKC,wBAAAA,IAAI,IAAI,cAAc,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO;CAAG,GAAI;CAAY;AAAM,CAAA,CAC1F"}
1
+ {"version":3,"file":"Spinner.js","names":["ark","css"],"sources":["../src/Spinner.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react/factory\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nexport const spinnerRecipe = cva({\n base: {\n borderRadius: \"full\",\n animation: \"spin\",\n display: \"block\",\n marginInline: \"auto\",\n borderStyle: \"solid\",\n borderBlockColor: \"background.subtle\",\n borderInlineStartColor: \"background.subtle\",\n borderInlineEndColor: \"stroke.default\",\n _motionReduce: {\n animationDuration: \"2s\",\n },\n },\n defaultVariants: {\n size: \"large\",\n },\n variants: {\n size: {\n small: {\n borderWidth: \"4px\",\n height: \"small\",\n width: \"small\",\n },\n medium: {\n borderWidth: \"4px\",\n height: \"large\",\n width: \"large\",\n },\n large: {\n borderWidth: \"8px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n },\n },\n },\n});\n\nexport type SpinnerVariantProps = NonNullable<RecipeVariantProps<typeof spinnerRecipe>>;\n\nexport interface SpinnerProps extends HTMLArkProps<\"div\">, StyledProps, SpinnerVariantProps {}\n\nconst StyledSpinner = styled(ark.div, {}, { baseComponent: true });\n\nexport const Spinner = forwardRef<HTMLDivElement, SpinnerProps>(({ size, css: cssProp, ...props }, ref) => (\n <StyledSpinner css={css.raw(spinnerRecipe.raw({ size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,iBAAA,GAAA,wBAAA,KAAoB;CAC/B,MAAM;EACJ,cAAc;EACd,WAAW;EACX,SAAS;EACT,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,wBAAwB;EACxB,sBAAsB;EACtB,eAAe,EACb,mBAAmB,KACrB;CACF;CACA,iBAAiB,EACf,MAAM,QACR;CACA,UAAU,EACR,MAAM;EACJ,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;EACT;EACA,QAAQ;GACN,aAAa;GACb,QAAQ;GACR,OAAO;EACT;EACA,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;EACT;CACF,EACF;AACF,CAAC;AAMD,MAAM,iBAAA,GAAA,wBAAA,QAAuBA,sBAAAA,IAAI,KAAK,CAAC,GAAG,EAAE,eAAe,KAAK,CAAC;AAEjE,MAAa,WAAA,GAAA,MAAA,aAAoD,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,QACjG,iBAAA,GAAA,kBAAA,KAAC,eAAD;CAAe,KAAKC,wBAAAA,IAAI,IAAI,cAAc,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO;CAAG,GAAI;CAAY;AAAM,CAAA,CAC1F"}
package/lib/Switch.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { Switch } from "@ark-ui/react";
8
+ import { Switch } from "@ark-ui/react/switch";
9
9
  import { type RecipeVariantProps } from "@ndla/styled-system/css";
10
10
  import type { StyledProps } from "@ndla/styled-system/types";
11
11
  import type { RefAttributes } from "react";
package/lib/Switch.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const require_Text = require("./Text.js");
2
- let _ark_ui_react = require("@ark-ui/react");
3
2
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
+ let _ark_ui_react_switch = require("@ark-ui/react/switch");
6
6
  //#region src/Switch.tsx
7
7
  /**
8
8
  * Copyright (c) 2024-present, NDLA.
@@ -12,7 +12,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
12
12
  *
13
13
  */
14
14
  const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleContext)((0, _ndla_styled_system_css.sva)({
15
- slots: _ark_ui_react.switchAnatomy.keys(),
15
+ slots: _ark_ui_react_switch.switchAnatomy.keys(),
16
16
  base: {
17
17
  root: {
18
18
  display: "inline-flex",
@@ -93,10 +93,10 @@ const { withProvider, withContext } = (0, _ndla_styled_system_jsx.createStyleCon
93
93
  }
94
94
  }
95
95
  }));
96
- const SwitchRoot = withProvider(_ark_ui_react.Switch.Root, "root", { baseComponent: true });
97
- const SwitchControl = withContext(_ark_ui_react.Switch.Control, "control", { baseComponent: true });
98
- const SwitchThumb = withContext(_ark_ui_react.Switch.Thumb, "thumb", { baseComponent: true });
99
- const InternalSwitchLabel = withContext(_ark_ui_react.Switch.Label, "label");
96
+ const SwitchRoot = withProvider(_ark_ui_react_switch.Switch.Root, "root", { baseComponent: true });
97
+ const SwitchControl = withContext(_ark_ui_react_switch.Switch.Control, "control", { baseComponent: true });
98
+ const SwitchThumb = withContext(_ark_ui_react_switch.Switch.Thumb, "thumb", { baseComponent: true });
99
+ const InternalSwitchLabel = withContext(_ark_ui_react_switch.Switch.Label, "label");
100
100
  const SwitchLabel = ({ textStyle = "label.medium", children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalSwitchLabel, {
101
101
  asChild: true,
102
102
  ...props,
@@ -107,7 +107,7 @@ const SwitchLabel = ({ textStyle = "label.medium", children, ...props }) => /* @
107
107
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children })
108
108
  })
109
109
  });
110
- const SwitchHiddenInput = _ark_ui_react.Switch.HiddenInput;
110
+ const SwitchHiddenInput = _ark_ui_react_switch.Switch.HiddenInput;
111
111
  //#endregion
112
112
  exports.SwitchControl = SwitchControl;
113
113
  exports.SwitchHiddenInput = SwitchHiddenInput;
package/lib/Switch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["switchAnatomy","Switch","Text"],"sources":["../src/Switch.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Switch, switchAnatomy } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst switchRecipe = sva({\n slots: switchAnatomy.keys(),\n base: {\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n position: \"relative\",\n gap: \"xxsmall\",\n _focus: {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n control: {\n display: \"inline-flex\",\n alignItems: \"center\",\n background: \"surface.disabled.strong\",\n width: \"xxlarge\",\n padding: \"1\",\n borderRadius: \"medium\",\n cursor: \"pointer\",\n flexShrink: \"0\",\n transitionDuration: \"fast\",\n transitionProperty: \"background\",\n transitionTimingFunction: \"default\",\n _checked: {\n background: \"surface.action.active\",\n },\n _disabled: {\n background: \"surface.disabled\",\n cursor: \"not-allowed\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n thumb: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"icon.onAction\",\n borderRadius: \"full\",\n boxShadow: \"small\",\n transitionDuration: \"fast\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n width: \"10\",\n height: \"10\",\n textStyle: \"label.xsmall\",\n fontWeight: \"bold\",\n _hover: {\n transform: \"translateX(20%)\",\n _disabled: {\n transform: \"translateX(0)\",\n },\n _motionReduce: {\n transform: \"translateX(0)\",\n },\n },\n _checked: {\n transform: \"translateX(120%)\",\n _hover: {\n transform: \"translateX(100%)\",\n _disabled: {\n transform: \"translateX(120%)\",\n },\n _motionReduce: {\n transform: \"translateX(120%)\",\n },\n },\n },\n },\n label: {\n color: \"text.strong\",\n transitionDuration: \"fast\",\n transitionProperty: \"color\",\n transitionTimingFunction: \"default\",\n _hover: {\n color: \"text.action\",\n },\n _disabled: {\n color: \"text.disabled\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(switchRecipe);\n\nexport type SwitchVariantProps = NonNullable<RecipeVariantProps<typeof switchRecipe>>;\n\nexport interface SwitchRootProps extends Switch.RootProps, StyledProps, SwitchVariantProps {}\n\nexport const SwitchRoot = withProvider(Switch.Root, \"root\", { baseComponent: true });\n\nexport const SwitchControl = withContext(Switch.Control, \"control\", { baseComponent: true });\n\nexport const SwitchThumb = withContext(Switch.Thumb, \"thumb\", { baseComponent: true });\n\nconst InternalSwitchLabel = withContext(Switch.Label, \"label\");\n\ninterface SwitchLabelProps\n extends Omit<Switch.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLSpanElement> {}\n\nexport const SwitchLabel = ({ textStyle = \"label.medium\", children, ...props }: SwitchLabelProps) => (\n <InternalSwitchLabel asChild {...props}>\n <Text asChild consumeCss textStyle={textStyle}>\n <span>{children}</span>\n </Text>\n </InternalSwitchLabel>\n);\n\nexport const SwitchHiddenInput = Switch.HiddenInput;\n"],"mappings":";;;;;;;;;;;;;AAgHA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAjGG;CACvB,OAAOA,cAAAA,cAAc,KAAK;CAC1B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,UAAU;GACV,KAAK;GACL,QAAQ;IACN,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;GAChB;EACF;EACA,SAAS;GACP,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,OAAO;GACP,SAAS;GACT,cAAc;GACd,QAAQ;GACR,YAAY;GACZ,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,UAAU,EACR,YAAY,wBACd;GACA,WAAW;IACT,YAAY;IACZ,QAAQ;GACV;GACA,eAAe;IACb,YAAY;IACZ,oBAAoB;GACtB;EACF;EACA,OAAO;GACL,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,YAAY;GACZ,cAAc;GACd,WAAW;GACX,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO;GACP,QAAQ;GACR,WAAW;GACX,YAAY;GACZ,QAAQ;IACN,WAAW;IACX,WAAW,EACT,WAAW,gBACb;IACA,eAAe,EACb,WAAW,gBACb;GACF;GACA,UAAU;IACR,WAAW;IACX,QAAQ;KACN,WAAW;KACX,WAAW,EACT,WAAW,mBACb;KACA,eAAe,EACb,WAAW,mBACb;IACF;GACF;EACF;EACA,OAAO;GACL,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ,EACN,OAAO,cACT;GACA,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,gBACT;GACF;GACA,eAAe;IACb,YAAY;IACZ,oBAAoB;GACtB;EACF;CACF;AACF,CAEoE,CAAC;AAMrE,MAAa,aAAa,aAAaC,cAAAA,OAAO,MAAM,QAAQ,EAAE,eAAe,KAAK,CAAC;AAEnF,MAAa,gBAAgB,YAAYA,cAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,KAAK,CAAC;AAE3F,MAAa,cAAc,YAAYA,cAAAA,OAAO,OAAO,SAAS,EAAE,eAAe,KAAK,CAAC;AAErF,MAAM,sBAAsB,YAAYA,cAAAA,OAAO,OAAO,OAAO;AAK7D,MAAa,eAAe,EAAE,YAAY,gBAAgB,UAAU,GAAG,YACrE,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,SAAA;CAAQ,GAAI;WAC/B,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;YAClC,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAO,SAAe,CAAA;CAClB,CAAA;AACa,CAAA;AAGvB,MAAa,oBAAoBD,cAAAA,OAAO"}
1
+ {"version":3,"file":"Switch.js","names":["switchAnatomy","Switch","Text"],"sources":["../src/Switch.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Switch, switchAnatomy } from \"@ark-ui/react/switch\";\nimport { type RecipeVariantProps, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst switchRecipe = sva({\n slots: switchAnatomy.keys(),\n base: {\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n position: \"relative\",\n gap: \"xxsmall\",\n _focus: {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n control: {\n display: \"inline-flex\",\n alignItems: \"center\",\n background: \"surface.disabled.strong\",\n width: \"xxlarge\",\n padding: \"1\",\n borderRadius: \"medium\",\n cursor: \"pointer\",\n flexShrink: \"0\",\n transitionDuration: \"fast\",\n transitionProperty: \"background\",\n transitionTimingFunction: \"default\",\n _checked: {\n background: \"surface.action.active\",\n },\n _disabled: {\n background: \"surface.disabled\",\n cursor: \"not-allowed\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n thumb: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"icon.onAction\",\n borderRadius: \"full\",\n boxShadow: \"small\",\n transitionDuration: \"fast\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n width: \"10\",\n height: \"10\",\n textStyle: \"label.xsmall\",\n fontWeight: \"bold\",\n _hover: {\n transform: \"translateX(20%)\",\n _disabled: {\n transform: \"translateX(0)\",\n },\n _motionReduce: {\n transform: \"translateX(0)\",\n },\n },\n _checked: {\n transform: \"translateX(120%)\",\n _hover: {\n transform: \"translateX(100%)\",\n _disabled: {\n transform: \"translateX(120%)\",\n },\n _motionReduce: {\n transform: \"translateX(120%)\",\n },\n },\n },\n },\n label: {\n color: \"text.strong\",\n transitionDuration: \"fast\",\n transitionProperty: \"color\",\n transitionTimingFunction: \"default\",\n _hover: {\n color: \"text.action\",\n },\n _disabled: {\n color: \"text.disabled\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(switchRecipe);\n\nexport type SwitchVariantProps = NonNullable<RecipeVariantProps<typeof switchRecipe>>;\n\nexport interface SwitchRootProps extends Switch.RootProps, StyledProps, SwitchVariantProps {}\n\nexport const SwitchRoot = withProvider(Switch.Root, \"root\", { baseComponent: true });\n\nexport const SwitchControl = withContext(Switch.Control, \"control\", { baseComponent: true });\n\nexport const SwitchThumb = withContext(Switch.Thumb, \"thumb\", { baseComponent: true });\n\nconst InternalSwitchLabel = withContext(Switch.Label, \"label\");\n\ninterface SwitchLabelProps\n extends Omit<Switch.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLSpanElement> {}\n\nexport const SwitchLabel = ({ textStyle = \"label.medium\", children, ...props }: SwitchLabelProps) => (\n <InternalSwitchLabel asChild {...props}>\n <Text asChild consumeCss textStyle={textStyle}>\n <span>{children}</span>\n </Text>\n </InternalSwitchLabel>\n);\n\nexport const SwitchHiddenInput = Switch.HiddenInput;\n"],"mappings":";;;;;;;;;;;;;AAgHA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAjGG;CACvB,OAAOA,qBAAAA,cAAc,KAAK;CAC1B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,UAAU;GACV,KAAK;GACL,QAAQ;IACN,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;GAChB;EACF;EACA,SAAS;GACP,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,OAAO;GACP,SAAS;GACT,cAAc;GACd,QAAQ;GACR,YAAY;GACZ,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,UAAU,EACR,YAAY,wBACd;GACA,WAAW;IACT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,MAAa,oBAAoBD,qBAAAA,OAAO"}
package/lib/Table.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { type HTMLArkProps } from "@ark-ui/react";
8
+ import { type HTMLArkProps } from "@ark-ui/react/factory";
9
9
  import type { StyledProps } from "@ndla/styled-system/types";
10
10
  export interface TableProps extends HTMLArkProps<"table">, StyledProps {
11
11
  }
12
- export declare const Table: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLTableElement> & import("react").TableHTMLAttributes<HTMLTableElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
12
+ export declare const Table: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLTableElement> & import("react").TableHTMLAttributes<HTMLTableElement> & import("@ark-ui/react/factory").PolymorphicProps>, {}>;
package/lib/Table.js CHANGED
@@ -1,4 +1,5 @@
1
- let _ark_ui_react = require("@ark-ui/react");
1
+ let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
2
+ let _ark_ui_react_factory = require("@ark-ui/react/factory");
2
3
  //#region src/Table.tsx
3
4
  /**
4
5
  * Copyright (c) 2024-present, NDLA.
@@ -7,7 +8,7 @@ let _ark_ui_react = require("@ark-ui/react");
7
8
  * LICENSE file in the root directory of this source tree.
8
9
  *
9
10
  */
10
- const Table = (0, require("@ndla/styled-system/jsx").styled)(_ark_ui_react.ark.table, { base: {
11
+ const Table = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react_factory.ark.table, { base: {
11
12
  display: "block",
12
13
  overflowX: "auto",
13
14
  maxWidth: "100%",
package/lib/Table.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","names":["ark"],"sources":["../src/Table.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nexport interface TableProps extends HTMLArkProps<\"table\">, StyledProps {}\n\nexport const Table = styled(\n ark.table,\n {\n base: {\n display: \"block\",\n overflowX: \"auto\",\n maxWidth: \"100%\",\n padding: \"4xsmall\",\n tableLayout: \"fixed\",\n clear: \"both\",\n \"& > caption\": {\n fontWeight: \"bold\",\n textAlign: \"left\",\n textTransform: \"uppercase\",\n marginBlockEnd: \"xsmall\",\n },\n \"& thead\": {\n overflow: \"hidden\",\n },\n \"& thead tr th\": {\n fontWeight: \"bold\",\n borderBottom: \"3px solid\",\n borderColor: \"surface.brand.1.strong\",\n verticalAlign: \"text-top\",\n },\n \"& tbody th\": {\n borderRight: \"3px solid\",\n borderColor: \"surface.brand.1.strong\",\n padding: \"3xsmall\",\n },\n \"& thead tr:nth-child(2) th\": {\n border: \"1px solid\",\n borderColor: \"surface.brand.1.subtle\",\n textTransform: \"none\",\n fontWeight: \"semibold\",\n height: \"large\",\n backgroundColor: \"surface.brand.1.subtle\",\n paddingBlock: \"4xsmall\",\n paddingInlineEnd: \"medium\",\n paddingInlineStart: \"3xsmall\",\n _empty: {\n backgroundColor: \"transparent\",\n },\n },\n \"& td\": {\n border: \"1px solid\",\n borderColor: \"surface.brand.1.subtle\",\n verticalAlign: \"top\",\n },\n \"& td, & th\": {\n display: \"table-cell\",\n paddingInline: \"xsmall\",\n paddingBlock: \"3xsmall\",\n minWidth: \"large\",\n \"&[data-align='center']\": {\n textAlign: \"center\",\n },\n \"&[data-align='left']\": {\n textAlign: \"left\",\n },\n \"&[data-align='right']\": {\n textAlign: \"right\",\n },\n },\n },\n },\n // TODO: Chrome doesn't support automatically making overflowed elements tabbable yet. Revisit this in a year or two\n { baseComponent: true, defaultProps: { tabIndex: 0 } },\n);\n"],"mappings":";;;;;;;;;AAcA,MAAa,SAAA,oCAAA,EAAA,QACXA,cAAAA,IAAI,OACJ,EACE,MAAM;CACJ,SAAS;CACT,WAAW;CACX,UAAU;CACV,SAAS;CACT,aAAa;CACb,OAAO;CACP,eAAe;EACb,YAAY;EACZ,WAAW;EACX,eAAe;EACf,gBAAgB;CAClB;CACA,WAAW,EACT,UAAU,SACZ;CACA,iBAAiB;EACf,YAAY;EACZ,cAAc;EACd,aAAa;EACb,eAAe;CACjB;CACA,cAAc;EACZ,aAAa;EACb,aAAa;EACb,SAAS;CACX;CACA,8BAA8B;EAC5B,QAAQ;EACR,aAAa;EACb,eAAe;EACf,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,QAAQ,EACN,iBAAiB,cACnB;CACF;CACA,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,eAAe;CACjB;CACA,cAAc;EACZ,SAAS;EACT,eAAe;EACf,cAAc;EACd,UAAU;EACV,0BAA0B,EACxB,WAAW,SACb;EACA,wBAAwB,EACtB,WAAW,OACb;EACA,yBAAyB,EACvB,WAAW,QACb;CACF;AACF,EACF,GAEA;CAAE,eAAe;CAAM,cAAc,EAAE,UAAU,EAAE;AAAE,CACvD"}
1
+ {"version":3,"file":"Table.js","names":["ark"],"sources":["../src/Table.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type HTMLArkProps, ark } from \"@ark-ui/react/factory\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nexport interface TableProps extends HTMLArkProps<\"table\">, StyledProps {}\n\nexport const Table = styled(\n ark.table,\n {\n base: {\n display: \"block\",\n overflowX: \"auto\",\n maxWidth: \"100%\",\n padding: \"4xsmall\",\n tableLayout: \"fixed\",\n clear: \"both\",\n \"& > caption\": {\n fontWeight: \"bold\",\n textAlign: \"left\",\n textTransform: \"uppercase\",\n marginBlockEnd: \"xsmall\",\n },\n \"& thead\": {\n overflow: \"hidden\",\n },\n \"& thead tr th\": {\n fontWeight: \"bold\",\n borderBottom: \"3px solid\",\n borderColor: \"surface.brand.1.strong\",\n verticalAlign: \"text-top\",\n },\n \"& tbody th\": {\n borderRight: \"3px solid\",\n borderColor: \"surface.brand.1.strong\",\n padding: \"3xsmall\",\n },\n \"& thead tr:nth-child(2) th\": {\n border: \"1px solid\",\n borderColor: \"surface.brand.1.subtle\",\n textTransform: \"none\",\n fontWeight: \"semibold\",\n height: \"large\",\n backgroundColor: \"surface.brand.1.subtle\",\n paddingBlock: \"4xsmall\",\n paddingInlineEnd: \"medium\",\n paddingInlineStart: \"3xsmall\",\n _empty: {\n backgroundColor: \"transparent\",\n },\n },\n \"& td\": {\n border: \"1px solid\",\n borderColor: \"surface.brand.1.subtle\",\n verticalAlign: \"top\",\n },\n \"& td, & th\": {\n display: \"table-cell\",\n paddingInline: \"xsmall\",\n paddingBlock: \"3xsmall\",\n minWidth: \"large\",\n \"&[data-align='center']\": {\n textAlign: \"center\",\n },\n \"&[data-align='left']\": {\n textAlign: \"left\",\n },\n \"&[data-align='right']\": {\n textAlign: \"right\",\n },\n },\n },\n },\n // TODO: Chrome doesn't support automatically making overflowed elements tabbable yet. Revisit this in a year or two\n { baseComponent: true, defaultProps: { tabIndex: 0 } },\n);\n"],"mappings":";;;;;;;;;;AAcA,MAAa,SAAA,GAAA,wBAAA,QACXA,sBAAAA,IAAI,OACJ,EACE,MAAM;CACJ,SAAS;CACT,WAAW;CACX,UAAU;CACV,SAAS;CACT,aAAa;CACb,OAAO;CACP,eAAe;EACb,YAAY;EACZ,WAAW;EACX,eAAe;EACf,gBAAgB;CAClB;CACA,WAAW,EACT,UAAU,SACZ;CACA,iBAAiB;EACf,YAAY;EACZ,cAAc;EACd,aAAa;EACb,eAAe;CACjB;CACA,cAAc;EACZ,aAAa;EACb,aAAa;EACb,SAAS;CACX;CACA,8BAA8B;EAC5B,QAAQ;EACR,aAAa;EACb,eAAe;EACf,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,QAAQ,EACN,iBAAiB,cACnB;CACF;CACA,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,eAAe;CACjB;CACA,cAAc;EACZ,SAAS;EACT,eAAe;EACf,cAAc;EACd,UAAU;EACV,0BAA0B,EACxB,WAAW,SACb;EACA,wBAAwB,EACtB,WAAW,OACb;EACA,yBAAyB,EACvB,WAAW,QACb;CACF;AACF,EACF,GAEA;CAAE,eAAe;CAAM,cAAc,EAAE,UAAU,EAAE;AAAE,CACvD"}