@ndla/primitives 1.0.124-alpha.0 → 1.0.126-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 (182) hide show
  1. package/dist/panda.buildinfo.json +8 -0
  2. package/dist/styles.css +119 -7
  3. package/es/Accordion.mjs +1 -2
  4. package/es/Accordion.mjs.map +1 -1
  5. package/es/ArticleLists.mjs +1 -2
  6. package/es/ArticleLists.mjs.map +1 -1
  7. package/es/Badge.mjs +1 -2
  8. package/es/Badge.mjs.map +1 -1
  9. package/es/BlockQuote.mjs +1 -2
  10. package/es/BlockQuote.mjs.map +1 -1
  11. package/es/Button.mjs +1 -2
  12. package/es/Button.mjs.map +1 -1
  13. package/es/Card/Card.mjs +3 -5
  14. package/es/Card/Card.mjs.map +1 -1
  15. package/es/Checkbox.mjs +1 -2
  16. package/es/Checkbox.mjs.map +1 -1
  17. package/es/Combobox.mjs +1 -2
  18. package/es/Combobox.mjs.map +1 -1
  19. package/es/DatePicker.mjs +1 -2
  20. package/es/DatePicker.mjs.map +1 -1
  21. package/es/Dialog.mjs +1 -2
  22. package/es/Dialog.mjs.map +1 -1
  23. package/es/ErrorMessage/ErrorMessage.mjs +5 -8
  24. package/es/ErrorMessage/ErrorMessage.mjs.map +1 -1
  25. package/es/ExpandableBox.mjs +1 -2
  26. package/es/ExpandableBox.mjs.map +1 -1
  27. package/es/Field.mjs +1 -2
  28. package/es/Field.mjs.map +1 -1
  29. package/es/FieldErrorMessage.mjs +1 -2
  30. package/es/FieldErrorMessage.mjs.map +1 -1
  31. package/es/FieldHelper.mjs +1 -2
  32. package/es/FieldHelper.mjs.map +1 -1
  33. package/es/Figure.mjs +31 -14
  34. package/es/Figure.mjs.map +1 -1
  35. package/es/FileUpload.mjs +1 -2
  36. package/es/FileUpload.mjs.map +1 -1
  37. package/es/FramedContent.mjs +1 -2
  38. package/es/FramedContent.mjs.map +1 -1
  39. package/es/Hero.mjs +1 -2
  40. package/es/Hero.mjs.map +1 -1
  41. package/es/Image.mjs +1 -2
  42. package/es/Image.mjs.map +1 -1
  43. package/es/Input.mjs +1 -2
  44. package/es/Input.mjs.map +1 -1
  45. package/es/Label.mjs +1 -2
  46. package/es/Label.mjs.map +1 -1
  47. package/es/Layout/PageContainer.mjs +1 -2
  48. package/es/Layout/PageContainer.mjs.map +1 -1
  49. package/es/Layout/PageContent.mjs +1 -2
  50. package/es/Layout/PageContent.mjs.map +1 -1
  51. package/es/ListItem/ListItem.mjs +5 -16
  52. package/es/ListItem/ListItem.mjs.map +1 -1
  53. package/es/Menu.mjs +1 -2
  54. package/es/Menu.mjs.map +1 -1
  55. package/es/MessageBox.mjs +1 -2
  56. package/es/MessageBox.mjs.map +1 -1
  57. package/es/NdlaLogo.mjs +1 -2
  58. package/es/NdlaLogo.mjs.map +1 -1
  59. package/es/Pagination.mjs +1 -2
  60. package/es/Pagination.mjs.map +1 -1
  61. package/es/Popover.mjs +1 -2
  62. package/es/Popover.mjs.map +1 -1
  63. package/es/RadioGroup.mjs +1 -2
  64. package/es/RadioGroup.mjs.map +1 -1
  65. package/es/Select.mjs +1 -2
  66. package/es/Select.mjs.map +1 -1
  67. package/es/Skeleton.mjs +1 -2
  68. package/es/Skeleton.mjs.map +1 -1
  69. package/es/Slider.mjs +1 -2
  70. package/es/Slider.mjs.map +1 -1
  71. package/es/Spinner.mjs +1 -2
  72. package/es/Spinner.mjs.map +1 -1
  73. package/es/Switch.mjs +1 -2
  74. package/es/Switch.mjs.map +1 -1
  75. package/es/Table.mjs +1 -2
  76. package/es/Table.mjs.map +1 -1
  77. package/es/Tabs.mjs +1 -2
  78. package/es/Tabs.mjs.map +1 -1
  79. package/es/TagsInput.mjs +1 -2
  80. package/es/TagsInput.mjs.map +1 -1
  81. package/es/Text.mjs +1 -2
  82. package/es/Text.mjs.map +1 -1
  83. package/es/Toast.mjs +1 -2
  84. package/es/Toast.mjs.map +1 -1
  85. package/es/ToggleGroup.mjs +1 -2
  86. package/es/ToggleGroup.mjs.map +1 -1
  87. package/es/Tooltip.mjs +1 -2
  88. package/es/Tooltip.mjs.map +1 -1
  89. package/es/Tree/Tree.mjs +1 -2
  90. package/es/Tree/Tree.mjs.map +1 -1
  91. package/es/index.mjs +1 -2
  92. package/lib/Accordion.js +1 -2
  93. package/lib/Accordion.js.map +1 -1
  94. package/lib/ArticleLists.js +1 -2
  95. package/lib/ArticleLists.js.map +1 -1
  96. package/lib/Badge.js +1 -2
  97. package/lib/Badge.js.map +1 -1
  98. package/lib/BlockQuote.js +1 -2
  99. package/lib/BlockQuote.js.map +1 -1
  100. package/lib/Button.js +2 -3
  101. package/lib/Button.js.map +1 -1
  102. package/lib/Card/Card.js +5 -7
  103. package/lib/Card/Card.js.map +1 -1
  104. package/lib/Checkbox.js +2 -3
  105. package/lib/Checkbox.js.map +1 -1
  106. package/lib/Combobox.js +3 -4
  107. package/lib/Combobox.js.map +1 -1
  108. package/lib/DatePicker.js +2 -3
  109. package/lib/DatePicker.js.map +1 -1
  110. package/lib/Dialog.js +2 -3
  111. package/lib/Dialog.js.map +1 -1
  112. package/lib/ErrorMessage/ErrorMessage.js +6 -9
  113. package/lib/ErrorMessage/ErrorMessage.js.map +1 -1
  114. package/lib/ExpandableBox.js +1 -2
  115. package/lib/ExpandableBox.js.map +1 -1
  116. package/lib/Field.js +1 -2
  117. package/lib/Field.js.map +1 -1
  118. package/lib/FieldErrorMessage.js +1 -2
  119. package/lib/FieldErrorMessage.js.map +1 -1
  120. package/lib/FieldHelper.js +1 -2
  121. package/lib/FieldHelper.js.map +1 -1
  122. package/lib/Figure.d.ts +20 -0
  123. package/lib/Figure.js +31 -14
  124. package/lib/Figure.js.map +1 -1
  125. package/lib/FileUpload.js +3 -4
  126. package/lib/FileUpload.js.map +1 -1
  127. package/lib/FramedContent.js +1 -2
  128. package/lib/FramedContent.js.map +1 -1
  129. package/lib/Hero.js +2 -4
  130. package/lib/Hero.js.map +1 -1
  131. package/lib/Image.js +1 -2
  132. package/lib/Image.js.map +1 -1
  133. package/lib/Input.js +1 -2
  134. package/lib/Input.js.map +1 -1
  135. package/lib/Label.js +1 -2
  136. package/lib/Label.js.map +1 -1
  137. package/lib/Layout/PageContainer.js +3 -4
  138. package/lib/Layout/PageContainer.js.map +1 -1
  139. package/lib/Layout/PageContent.js +1 -2
  140. package/lib/Layout/PageContent.js.map +1 -1
  141. package/lib/ListItem/ListItem.js +5 -7
  142. package/lib/ListItem/ListItem.js.map +1 -1
  143. package/lib/Menu.js +2 -3
  144. package/lib/Menu.js.map +1 -1
  145. package/lib/MessageBox.js +1 -2
  146. package/lib/MessageBox.js.map +1 -1
  147. package/lib/NdlaLogo.js +2 -3
  148. package/lib/NdlaLogo.js.map +1 -1
  149. package/lib/Pagination.js +2 -4
  150. package/lib/Pagination.js.map +1 -1
  151. package/lib/Popover.js +2 -3
  152. package/lib/Popover.js.map +1 -1
  153. package/lib/RadioGroup.js +2 -3
  154. package/lib/RadioGroup.js.map +1 -1
  155. package/lib/Select.js +2 -3
  156. package/lib/Select.js.map +1 -1
  157. package/lib/Skeleton.js +2 -4
  158. package/lib/Skeleton.js.map +1 -1
  159. package/lib/Slider.js +2 -3
  160. package/lib/Slider.js.map +1 -1
  161. package/lib/Spinner.js +1 -2
  162. package/lib/Spinner.js.map +1 -1
  163. package/lib/Switch.js +2 -3
  164. package/lib/Switch.js.map +1 -1
  165. package/lib/Table.js +2 -4
  166. package/lib/Table.js.map +1 -1
  167. package/lib/Tabs.js +1 -2
  168. package/lib/Tabs.js.map +1 -1
  169. package/lib/TagsInput.js +2 -3
  170. package/lib/TagsInput.js.map +1 -1
  171. package/lib/Text.js +1 -2
  172. package/lib/Text.js.map +1 -1
  173. package/lib/Toast.js +2 -3
  174. package/lib/Toast.js.map +1 -1
  175. package/lib/ToggleGroup.js +2 -4
  176. package/lib/ToggleGroup.js.map +1 -1
  177. package/lib/Tooltip.js +1 -2
  178. package/lib/Tooltip.js.map +1 -1
  179. package/lib/Tree/Tree.js +2 -3
  180. package/lib/Tree/Tree.js.map +1 -1
  181. package/lib/index.js +56 -57
  182. 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: \"xxsmall\",\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,iGA/EO;CAC3B,OAAOA,gCAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,UAAU;GACV,UAAU;GACV,KAAK;GACL,WAAW,EACT,eAAe,UAChB;GACD,aAAa,EACX,eAAe,OAChB;GACF;EACD,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;IACjB;GACD,UAAU;IACR,YAAY;IACZ,aAAa;IACd;GACD,WAAW;IACT,aAAa;IACb,QAAQ;KACN,aAAa;KACb,WAAW;KACZ;IACF;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,QAAQ;GACR,KAAK;GACL,WAAW,EACT,QAAQ,eACT;GACD,8BAA8B;IAC5B,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;IACf;GACF;EACD,UAAU;GACR,QAAQ,EACN,OAAO,eACR;GACD,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,iBACR;IACF;GACF;EACF;CACF,CAAC,CAEwE;AAI1E,MAAa,iBAAiB,aAAaC,yBAAW,MAAM,QAAQ,EAClE,eAAe,MAChB,CAAC;AAEF,MAAa,sBAAsB,YAAYA,yBAAW,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE1G,MAAa,wBAAwB,YAAYA,yBAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,iBAAiB,YAAYA,yBAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAM,6BAA6B,YAAYA,yBAAW,UAAU,WAAW;AAE/E,MAAM,8DAAiCC,kBAAI,MAAM,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAK7E,MAAa,sBAAsB,EACjC,YAAY,gBACZ,UACA,SACA,YACA,GAAG,YAEH,2CAAC;CAA2B;WAC1B,2CAACC;EAAK;EAAQ;EAAsB;EAAW,GAAI;YACjD,2CAAC;GAAiC;GAAqB;GACpD;IACuB;GACrB;EACoB;AAG/B,MAAa,0BAA0B,YAAYF,yBAAW,OAAO,QAAQ;AAE7E,MAAM,2DAA8BC,kBAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAKzE,MAAa,yCACV,EAAE,YAAY,eAAe,aAAa,QAAQ,UAAU,SAAS,YAAY,GAAG,SAAS,QAC5F,2CAAC;CAAwB,GAAI;CAAO;CAAa;WAC/C,2CAACC;EAAgB;EAAuB;EAAY;YAClD,2CAAC;GAA8B;GAAqB;GACjD;IACoB;GAClB;EACiB,CAE7B;AAED,MAAa,4BAA4BF,yBAAW"}
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: \"xxsmall\",\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,cAAA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AE,EAAE,eAAe,MAAM,CAAC;AAK7E,MAAa,sBAAsB,EACjC,YAAY,gBACZ,UACA,SACA,YACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,4BAAD;CAA4B,SAAA;WAC1B,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;EAAW,GAAI;YACjD,iBAAA,GAAA,kBAAA,KAAC,yBAAD;GAAkC;GAAqB;GACpD;GACuB,CAAA;EACrB,CAAA;CACoB,CAAA;AAG/B,MAAa,0BAA0B,YAAYF,cAAAA,WAAW,OAAO,QAAQ;AAE7E,MAAM,wBAAA,GAAA,wBAAA,QAA8BC,cAAAA,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAKzE,MAAa,mBAAA,GAAA,MAAA,aACV,EAAE,YAAY,eAAe,aAAa,QAAQ,UAAU,SAAS,YAAY,GAAG,SAAS,QAC5F,iBAAA,GAAA,kBAAA,KAAC,yBAAD;CAAyB,GAAI;CAAO,SAAA;CAAa;WAC/C,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;EAAiB;EAAuB;EAAY,SAAA;YAClD,iBAAA,GAAA,kBAAA,KAAC,sBAAD;GAA+B;GAAqB;GACjD;GACoB,CAAA;EAClB,CAAA;CACiB,CAAA,CAE7B;AAED,MAAa,4BAA4BF,cAAAA,WAAW"}
package/lib/Select.js CHANGED
@@ -1,10 +1,9 @@
1
- const require_Label = require('./Label.js');
1
+ const require_Label = require("./Label.js");
2
2
  let _ark_ui_react = require("@ark-ui/react");
3
3
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
4
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  let react = require("react");
7
-
8
7
  //#region src/Select.tsx
9
8
  /**
10
9
  * Copyright (c) 2024-present, NDLA.
@@ -157,7 +156,6 @@ const SelectTrigger = withContext(_ark_ui_react.Select.Trigger, "trigger", { bas
157
156
  const SelectValueText = withContext(_ark_ui_react.Select.ValueText, "valueText", { baseComponent: true });
158
157
  const SelectList = withContext(_ark_ui_react.Select.List, "list", { baseComponent: true });
159
158
  const SelectHiddenSelect = _ark_ui_react.Select.HiddenSelect;
160
-
161
159
  //#endregion
162
160
  exports.SelectClearTrigger = SelectClearTrigger;
163
161
  exports.SelectContent = SelectContent;
@@ -176,4 +174,5 @@ exports.SelectPositioner = SelectPositioner;
176
174
  exports.SelectRoot = SelectRoot;
177
175
  exports.SelectTrigger = SelectTrigger;
178
176
  exports.SelectValueText = SelectValueText;
177
+
179
178
  //# sourceMappingURL=Select.js.map
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,MAAM,EAAE,cAAc,iGAlIG;CACvB,OAAOA,4BAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,eAAe;GACf,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,WAAW;GACX,SAAS;GACT,WAAW;GACX,WAAW;GACX,eAAe,EACb,eAAe,MAChB;GACD,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,YAAY;GACZ,cAAc;GACd,QAAQ;GACR,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ,EACN,YAAY,iBACb;GACD,WAAW;IACT,YAAY;IACZ,QAAQ,EACN,YAAY,iBACb;IACD,cAAc,EACZ,YAAY,iBACb;IACF;GACD,cAAc;IACZ,YAAY;IACZ,QAAQ,EACN,YAAY,iBACb;IACF;GACD,WAAW;IACT,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,cAAc;KACZ,O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ACf;EACqB,CAElC;AAED,MAAM,+BAA+B,YAAYD,qBAAO,gBAAgB,iBAAiB;AAEzF,MAAa,kBAAkB,YAAYA,qBAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,sBAAsB,YAAYA,qBAAO,eAAe,iBAAiB,EAAE,eAAe,MAAM,CAAC;AAE9G,MAAa,aAAa,YAAYA,qBAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,iBAAiB,YAAYA,qBAAO,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAE/F,MAAM,sBAAsB,YAAYA,qBAAO,OAAO,QAAQ;AAK9D,MAAa,qCAA8D,EAAE,UAAU,GAAG,SAAS,QACjG,2CAAC;CAAoB;CAAa;CAAK,GAAI;WACzC,2CAACC,uBAAO,WAAiB;EACL,CACtB;AAEF,MAAa,mBAAmB,YAAYD,qBAAO,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAErG,MAAa,gBAAgB,YAAYA,qBAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,kBAAkB,YAAYA,qBAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,aAAa,YAAYA,qBAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,qBAAqBA,qBAAO"}
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,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAlIG;CACvB,OAAOA,cAAAA,cAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,eAAe;GACf,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,WAAW;GACX,SAAS;GACT,WAAW;GACX,WAAW;GACX,eAAe,EACb,eAAe,MAChB;GACD,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QAC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,QACjG,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,SAAA;CAAa;CAAK,GAAI;WACzC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD,EAAQ,UAAiB,CAAA;CACL,CAAA,CACtB;AAEF,MAAa,mBAAmB,YAAYD,cAAAA,OAAO,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAErG,MAAa,gBAAgB,YAAYA,cAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,kBAAkB,YAAYA,cAAAA,OAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,aAAa,YAAYA,cAAAA,OAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,qBAAqBA,cAAAA,OAAO"}
package/lib/Skeleton.js CHANGED
@@ -1,6 +1,4 @@
1
1
  let _ark_ui_react = require("@ark-ui/react");
2
- let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
3
-
4
2
  //#region src/Skeleton.tsx
5
3
  /**
6
4
  * Copyright (c) 2024-present, NDLA.
@@ -9,7 +7,7 @@ let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
9
7
  * LICENSE file in the root directory of this source tree.
10
8
  *
11
9
  */
12
- const Skeleton = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react.ark.div, { base: {
10
+ const Skeleton = (0, require("@ndla/styled-system/jsx").styled)(_ark_ui_react.ark.div, { base: {
13
11
  animation: "skeleton-pulse",
14
12
  backgroundColor: "surface.disabled",
15
13
  backgroundClip: "padding-box",
@@ -21,7 +19,7 @@ const Skeleton = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react.ark.div, { ba
21
19
  "&::before, &::after, *": { visibility: "hidden" },
22
20
  _motionReduce: { animation: "none" }
23
21
  } }, { baseComponent: true });
24
-
25
22
  //#endregion
26
23
  exports.Skeleton = Skeleton;
24
+
27
25
  //# sourceMappingURL=Skeleton.js.map
@@ -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,+CACXA,kBAAI,KACJ,EACE,MAAM;CACJ,WAAW;CACX,iBAAiB;CACjB,gBAAgB;CAChB,cAAc;CACd,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,0BAA0B,EACxB,YAAY,UACb;CACD,eAAe,EACb,WAAW,QACZ;CACF,EACF,EACD,EAAE,eAAe,MAAM,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\";\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,sCAAA,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,UACb;CACD,eAAe,EACb,WAAW,QACZ;CACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB"}
package/lib/Slider.js CHANGED
@@ -1,9 +1,8 @@
1
- const require_Label = require('./Label.js');
1
+ const require_Label = require("./Label.js");
2
2
  let _ark_ui_react = require("@ark-ui/react");
3
3
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
4
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
-
7
6
  //#region src/Slider.tsx
8
7
  /**
9
8
  * Copyright (c) 2024-present, NDLA.
@@ -80,7 +79,6 @@ const SliderLabel = ({ textStyle = "label.medium", ...props }) => /* @__PURE__ *
80
79
  })
81
80
  });
82
81
  const SliderHiddenInput = _ark_ui_react.Slider.HiddenInput;
83
-
84
82
  //#endregion
85
83
  exports.SliderControl = SliderControl;
86
84
  exports.SliderHiddenInput = SliderHiddenInput;
@@ -89,4 +87,5 @@ exports.SliderRange = SliderRange;
89
87
  exports.SliderRoot = SliderRoot;
90
88
  exports.SliderThumb = SliderThumb;
91
89
  exports.SliderTrack = SliderTrack;
90
+
92
91
  //# sourceMappingURL=Slider.js.map
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 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":";;;;;;;;;;;;;;AAqFA,MAAM,EAAE,cAAc,iGArEG;CACvB,OAAOA,4BAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;GACR;EACD,SAAS;GACP,UAAU;GACV,SAAS;GACT,WAAW,EACT,eAAe,UAChB;GACD,YAAY;GACZ,QAAQ;GACT;EACD,OAAO;GACL,YAAY;GACZ,UAAU;GACV,MAAM;GACN,WAAW,EACT,OAAO,WACR;GACD,aAAa,EACX,QAAQ,WACT;GACF;EACD,OAAO;GACL,YAAY;GACZ,WAAW,EACT,OAAO,WACR;GACD,aAAa,EACX,QAAQ,WACT;GACF;EACD,OAAO;GACL,YAAY;GACZ,cAAc;GACd,SAAS;GACT,QAAQ;GACR,QAAQ;GACR,OAAO;GACP,oBAAoB;GACpB,0BAA0B;GAC1B,oBAAoB;GACpB,QAAQ,EACN,YAAY,wBACb;GACD,SAAS,EACP,YAAY,yBACb;GACD,eAAe;IACb,QAAQ;IACR,aAAa;IACb,SAAS;IACT,cAAc;IACd,eAAe;IAChB;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACF;CACF,CAAC,CAEoE;AAItE,MAAa,aAAa,aAAaC,qBAAO,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEpF,MAAa,gBAAgB,YAAYA,qBAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAYA,qBAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAYA,qBAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAYA,qBAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAYA,qBAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,GAAG,YAC3D,2CAAC;CAAoB;WACnB,2CAACC;EAAiB;EAAW,GAAI;GAAS;EACtB;AAGxB,MAAa,oBAAoBD,qBAAO"}
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 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":";;;;;;;;;;;;;AAqFA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KArEG;CACvB,OAAOA,cAAAA,cAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;GACR;EACD,SAAS;GACP,UAAU;GACV,SAAS;GACT,WAAW,EACT,eAA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 -3,7 +3,6 @@ let _ndla_styled_system_css = require("@ndla/styled-system/css");
3
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  let react = require("react");
6
-
7
6
  //#region src/Spinner.tsx
8
7
  /**
9
8
  * Copyright (c) 2024-present, NDLA.
@@ -49,7 +48,7 @@ const Spinner = (0, react.forwardRef)(({ size, css: cssProp, ...props }, ref) =>
49
48
  ...props,
50
49
  ref
51
50
  }));
52
-
53
51
  //#endregion
54
52
  exports.Spinner = Spinner;
53
+
55
54
  //# sourceMappingURL=Spinner.js.map
@@ -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,iDAAoB;CAC/B,MAAM;EACJ,cAAc;EACd,WAAW;EACX,SAAS;EACT,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,wBAAwB;EACxB,sBAAsB;EACtB,eAAe,EACb,mBAAmB,MACpB;EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACD,UAAU,EACR,MAAM;EACJ,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACD,QAAQ;GACN,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACD,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACF,EACF;CACF,CAAC;AAMF,MAAM,oDAAuBA,kBAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAElE,MAAa,iCAAoD,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,QACjG,2CAAC;CAAc,KAAKC,4BAAI,IAAI,cAAc,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,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\";\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,MACpB;EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACD,UAAU,EACR,MAAM;EACJ,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACD,QAAQ;GACN,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACD,OAAO;GACL,aAAa;GACb,QAAQ;GACR,OAAO;GACR;EACF,EACF;CACF,CAAC;AAMF,MAAM,iBAAA,GAAA,wBAAA,QAAuBA,cAAAA,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAElE,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,MAAM,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;CAAO,CAAA,CAC1F"}
package/lib/Switch.js CHANGED
@@ -1,9 +1,8 @@
1
- const require_Text = require('./Text.js');
1
+ const require_Text = require("./Text.js");
2
2
  let _ark_ui_react = require("@ark-ui/react");
3
3
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
4
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
-
7
6
  //#region src/Switch.tsx
8
7
  /**
9
8
  * Copyright (c) 2024-present, NDLA.
@@ -109,11 +108,11 @@ const SwitchLabel = ({ textStyle = "label.medium", children, ...props }) => /* @
109
108
  })
110
109
  });
111
110
  const SwitchHiddenInput = _ark_ui_react.Switch.HiddenInput;
112
-
113
111
  //#endregion
114
112
  exports.SwitchControl = SwitchControl;
115
113
  exports.SwitchHiddenInput = SwitchHiddenInput;
116
114
  exports.SwitchLabel = SwitchLabel;
117
115
  exports.SwitchRoot = SwitchRoot;
118
116
  exports.SwitchThumb = SwitchThumb;
117
+
119
118
  //# sourceMappingURL=Switch.js.map
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,iGAjGG;CACvB,OAAOA,4BAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,UAAU;GACV,KAAK;GACL,QAAQ;IACN,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;IACf;GACF;EACD,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,yBACb;GACD,WAAW;IACT,YAAY;IACZ,QAAQ;IACT;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,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,iBACZ;IACD,eAAe,EACb,WAAW,iBACZ;IACF;GACD,UAAU;IACR,WAAW;IACX,QAAQ;KACN,WAAW;KACX,WAAW,EACT,WAAW,oBACZ;KACD,eAAe,EACb,WAAW,oBACZ;KACF;IACF;GACF;EACD,OAAO;GACL,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ,EACN,OAAO,eACR;GACD,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,iBACR;IACF;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACF;CACF,CAAC,CAEoE;AAMtE,MAAa,aAAa,aAAaC,qBAAO,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEpF,MAAa,gBAAgB,YAAYA,qBAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAYA,qBAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAYA,qBAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,UAAU,GAAG,YACrE,2CAAC;CAAoB;CAAQ,GAAI;WAC/B,2CAACC;EAAK;EAAQ;EAAsB;YAClC,2CAAC,UAAM,WAAgB;GAClB;EACa;AAGxB,MAAa,oBAAoBD,qBAAO"}
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,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,UAAU;GACV,KAAK;GACL,QAAQ;IACN,SAAS;IACT,eAAe;IACf,cAAc;IACd,cAAc;IACf;GACF;EACD,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,yBACb;GACD,WAAW;IACT,YAAY;IACZ,QAAQ;IACT;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,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,iBACZ;IACD,eAAe,EACb,WAAW,iBACZ;IACF;GACD,UAAU;IACR,WAAW;IACX,QAAQ;KACN,WAAW;KACX,WAAW,EACT,WAAW,oBACZ;KACD,eAAe,EACb,WAAW,oBACZ;KACF;IACF;GACF;EACD,OAAO;GACL,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,QAAQ,EACN,OAAO,eACR;GACD,WAAW;IACT,OAAO;IACP,QAAQ,EACN,OAAO,iBACR;IACF;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACF;CACF,CAAC,CAEoE;AAMtE,MAAa,aAAa,aAAaC,cAAAA,OAAO,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEpF,MAAa,gBAAgB,YAAYA,cAAAA,OAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAYA,cAAAA,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAYA,cAAAA,OAAO,OAAO,QAAQ;AAK9D,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,UAAgB,CAAA;EAClB,CAAA;CACa,CAAA;AAGxB,MAAa,oBAAoBD,cAAAA,OAAO"}
package/lib/Table.js CHANGED
@@ -1,6 +1,4 @@
1
1
  let _ark_ui_react = require("@ark-ui/react");
2
- let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
3
-
4
2
  //#region src/Table.tsx
5
3
  /**
6
4
  * Copyright (c) 2024-present, NDLA.
@@ -9,7 +7,7 @@ let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
9
7
  * LICENSE file in the root directory of this source tree.
10
8
  *
11
9
  */
12
- const Table = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react.ark.table, { base: {
10
+ const Table = (0, require("@ndla/styled-system/jsx").styled)(_ark_ui_react.ark.table, { base: {
13
11
  display: "block",
14
12
  overflowX: "auto",
15
13
  maxWidth: "100%",
@@ -64,7 +62,7 @@ const Table = (0, _ndla_styled_system_jsx.styled)(_ark_ui_react.ark.table, { bas
64
62
  baseComponent: true,
65
63
  defaultProps: { tabIndex: 0 }
66
64
  });
67
-
68
65
  //#endregion
69
66
  exports.Table = Table;
67
+
70
68
  //# sourceMappingURL=Table.js.map
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,4CACXA,kBAAI,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;EACjB;CACD,WAAW,EACT,UAAU,UACX;CACD,iBAAiB;EACf,YAAY;EACZ,cAAc;EACd,aAAa;EACb,eAAe;EAChB;CACD,cAAc;EACZ,aAAa;EACb,aAAa;EACb,SAAS;EACV;CACD,8BAA8B;EAC5B,QAAQ;EACR,aAAa;EACb,eAAe;EACf,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,QAAQ,EACN,iBAAiB,eAClB;EACF;CACD,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,eAAe;EAChB;CACD,cAAc;EACZ,SAAS;EACT,eAAe;EACf,cAAc;EACd,UAAU;EACV,0BAA0B,EACxB,WAAW,UACZ;EACD,wBAAwB,EACtB,WAAW,QACZ;EACD,yBAAyB,EACvB,WAAW,SACZ;EACF;CACF,EACF,EAED;CAAE,eAAe;CAAM,cAAc,EAAE,UAAU,GAAG;CAAE,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\";\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,sCAAA,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;EACjB;CACD,WAAW,EACT,UAAU,UACX;CACD,iBAAiB;EACf,YAAY;EACZ,cAAc;EACd,aAAa;EACb,eAAe;EAChB;CACD,cAAc;EACZ,aAAa;EACb,aAAa;EACb,SAAS;EACV;CACD,8BAA8B;EAC5B,QAAQ;EACR,aAAa;EACb,eAAe;EACf,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,QAAQ,EACN,iBAAiB,eAClB;EACF;CACD,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,eAAe;EAChB;CACD,cAAc;EACZ,SAAS;EACT,eAAe;EACf,cAAc;EACd,UAAU;EACV,0BAA0B,EACxB,WAAW,UACZ;EACD,wBAAwB,EACtB,WAAW,QACZ;EACD,yBAAyB,EACvB,WAAW,SACZ;EACF;CACF,EACF,EAED;CAAE,eAAe;CAAM,cAAc,EAAE,UAAU,GAAG;CAAE,CACvD"}
package/lib/Tabs.js CHANGED
@@ -2,7 +2,6 @@ let _ark_ui_react = require("@ark-ui/react");
2
2
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
3
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
-
6
5
  //#region src/Tabs.tsx
7
6
  /**
8
7
  * Copyright (c) 2024-present, NDLA.
@@ -189,11 +188,11 @@ const TabsTrigger = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_r
189
188
  className: (0, _ndla_styled_system_css.cx)("peer", className),
190
189
  ...props
191
190
  });
192
-
193
191
  //#endregion
194
192
  exports.TabsContent = TabsContent;
195
193
  exports.TabsIndicator = TabsIndicator;
196
194
  exports.TabsList = TabsList;
197
195
  exports.TabsRoot = TabsRoot;
198
196
  exports.TabsTrigger = TabsTrigger;
197
+
199
198
  //# sourceMappingURL=Tabs.js.map
package/lib/Tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["Tabs"],"sources":["../src/Tabs.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 { Tabs } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, cx, 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\";\n\nconst tabsRecipe = sva({\n // TODO: This still doesn't work. Need to figure out why we need to pass keys manually.\n // slots: tabsAnatomy.keys(),\n slots: [\"root\", \"list\", \"trigger\", \"content\", \"indicator\"],\n base: {\n root: {\n position: \"relative\",\n display: \"flex\",\n width: \"100%\",\n _horizontal: {\n flexDirection: \"column\",\n },\n _vertical: {\n flexDirection: \"row\",\n },\n },\n list: {\n position: \"relative\",\n display: \"flex\",\n flexShrink: \"0\",\n flexWrap: \"wrap\",\n _horizontal: {\n flexDirection: \"row\",\n },\n _vertical: {\n flexDirection: \"column\",\n },\n },\n trigger: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: \"0\",\n cursor: \"pointer\",\n textStyle: \"label.small\",\n fontWeight: \"bold\",\n transitionDuration: \"normal\",\n transitionProperty: \"color, background, border-color\",\n transitionTimingFunction: \"default\",\n whiteSpace: \"nowrap\",\n paddingInline: \"small\",\n paddingBlock: \"3xsmall\",\n zIndex: \"1\",\n _hover: {\n color: \"text.action\",\n },\n _selected: {\n color: \"text.strong\",\n },\n _disabled: {\n color: \"text.subtle\",\n cursor: \"not-allowed\",\n _hover: {\n color: \"text.subtle\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n },\n },\n defaultVariants: {\n variant: \"line\",\n },\n variants: {\n variant: {\n line: {\n trigger: {\n borderColor: \"stroke.default\",\n _hover: {\n borderColor: \"stroke.hover\",\n _focusVisible: {\n borderColor: \"stroke.default\",\n },\n },\n _horizontal: {\n borderBottom: \"1px solid\",\n },\n _disabled: {\n borderColor: \"stroke.default\",\n _hover: {\n borderColor: \"stroke.default\",\n },\n },\n _vertical: {\n borderLeft: \"1px solid\",\n justifyContent: \"flex-start\",\n },\n _focusVisible: {\n outline: \"none\",\n borderRadius: \"unset\",\n },\n },\n indicator: {\n background: \"stroke.default\",\n _peerFocusVisible: {\n height: \"var(--height)\",\n width: \"var(--width)\",\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n background: \"transparent\",\n _horizontal: {\n borderTopRadius: \"xsmall\",\n },\n _vertical: {\n borderRightRadius: \"xsmall\",\n },\n },\n _horizontal: {\n top: \"calc(var(--top) + var(--height) - 6px)\",\n height: \"3\",\n width: \"var(--width)\",\n _peerFocusVisible: { top: \"var(--top)\" },\n },\n _vertical: {\n height: \"var(--height)\",\n left: \"0\",\n width: \"3\",\n },\n },\n content: {\n zIndex: \"1\",\n _horizontal: {\n paddingBlockStart: \"xsmall\",\n },\n _vertical: {\n paddingInlineStart: \"xsmall\",\n },\n _focusVisible: {\n outline: \"none\",\n boxShadow: \"0 0 0 3px var(--shadow-color)\",\n boxShadowColor: \"stroke.default\",\n },\n },\n },\n outline: {\n list: {\n _horizontal: {\n marginBlockEnd: \"-1px\",\n },\n _vertical: {\n marginInlineEnd: \"-1px\",\n },\n },\n trigger: {\n borderColor: \"transparent\",\n borderWidth: \"1px\",\n _horizontal: {\n borderTopRadius: \"xsmall\",\n },\n _vertical: {\n borderTopLeftRadius: \"xsmall\",\n borderBottomLeftRadius: \"xsmall\",\n },\n _selected: {\n background: \"surface.default\",\n borderColor: \"stroke.default\",\n _horizontal: {\n borderBottom: \"none\",\n },\n _vertical: {\n borderRight: \"none\",\n },\n },\n _focusVisible: {\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n },\n },\n content: {\n borderWidth: \"1px\",\n borderColor: \"stroke.default\",\n background: \"surface.default\",\n width: \"100%\",\n padding: \"xsmall\",\n _vertical: {\n borderBottomRadius: \"xsmall\",\n borderRightRadius: \"xsmall\",\n },\n _horizontal: {\n borderRightRadius: \"xsmall\",\n borderBottomLeftRadius: \"xsmall\",\n },\n _focusVisible: {\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(tabsRecipe);\n\nexport type TabsVariantProps = NonNullable<RecipeVariantProps<typeof tabsRecipe>>;\n\nexport interface TabsRootProps extends Tabs.RootProps, TabsVariantProps, StyledProps, RefAttributes<HTMLDivElement> {\n translations: Tabs.RootProps[\"translations\"];\n}\n\nconst InternalTabsRoot = withProvider(Tabs.Root, \"root\", { baseComponent: true });\n\nexport const TabsRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: TabsRootProps) => (\n <InternalTabsRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const TabsContent = withContext(Tabs.Content, \"content\", { baseComponent: true });\n\nexport const TabsIndicator = withContext(Tabs.Indicator, \"indicator\", { baseComponent: true });\n\nexport const TabsList = withContext(Tabs.List, \"list\", { baseComponent: true });\n\nconst InternalTabsTrigger = withContext(Tabs.Trigger, \"trigger\", { baseComponent: true });\n\ninterface TabsTriggerProps extends Tabs.TriggerProps, StyledProps, RefAttributes<HTMLButtonElement> {}\n\nexport const TabsTrigger = ({ className, ...props }: TabsTriggerProps) => (\n <InternalTabsTrigger className={cx(\"peer\", className)} {...props} />\n);\n"],"mappings":";;;;;;;;;;;;;AAyNA,MAAM,EAAE,cAAc,iGA3MC;CAGrB,OAAO;EAAC;EAAQ;EAAQ;EAAW;EAAW;EAAY;CAC1D,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,SAAS;GACT,OAAO;GACP,aAAa,EACX,eAAe,UAChB;GACD,WAAW,EACT,eAAe,OAChB;GACF;EACD,MAAM;GACJ,UAAU;GACV,SAAS;GACT,YAAY;GACZ,UAAU;GACV,aAAa,EACX,eAAe,OAChB;GACD,WAAW,EACT,eAAe,UAChB;GACF;EACD,SAAS;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,YAAY;GACZ,QAAQ;GACR,WAAW;GACX,YAAY;GACZ,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,YAAY;GACZ,eAAe;GACf,cAAc;GACd,QAAQ;GACR,QAAQ,EACN,OAAO,eACR;GACD,WAAW,EACT,OAAO,eACR;GACD,WAAW;IACT,OAAO;IACP,QAAQ;IACR,QAAQ,EACN,OAAO,eACR;IACF;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,YAAY;GACZ,KAAK;GACN;EACF;CACD,iBAAiB,EACf,SAAS,QACV;CACD,UAAU,EACR,SAAS;EACP,MAAM;GACJ,SAAS;IACP,aAAa;IACb,QAAQ;KACN,aAAa;KACb,eAAe,EACb,aAAa,kBACd;KACF;IACD,aAAa,EACX,cAAc,aACf;IACD,WAAW;KACT,aAAa;KACb,QAAQ,EACN,aAAa,kBACd;KACF;IACD,WAAW;KACT,YAAY;KACZ,gBAAgB;KACjB;IACD,eAAe;KAC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AS;AAGrF,MAAa,cAAc,YAAYA,mBAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAYA,mBAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,WAAW,YAAYA,mBAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE/E,MAAM,sBAAsB,YAAYA,mBAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,2CAAC;CAAoB,2CAAc,QAAQ,UAAU;CAAE,GAAI;EAAS"}
1
+ {"version":3,"file":"Tabs.js","names":["Tabs"],"sources":["../src/Tabs.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 { Tabs } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, cx, 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\";\n\nconst tabsRecipe = sva({\n // TODO: This still doesn't work. Need to figure out why we need to pass keys manually.\n // slots: tabsAnatomy.keys(),\n slots: [\"root\", \"list\", \"trigger\", \"content\", \"indicator\"],\n base: {\n root: {\n position: \"relative\",\n display: \"flex\",\n width: \"100%\",\n _horizontal: {\n flexDirection: \"column\",\n },\n _vertical: {\n flexDirection: \"row\",\n },\n },\n list: {\n position: \"relative\",\n display: \"flex\",\n flexShrink: \"0\",\n flexWrap: \"wrap\",\n _horizontal: {\n flexDirection: \"row\",\n },\n _vertical: {\n flexDirection: \"column\",\n },\n },\n trigger: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: \"0\",\n cursor: \"pointer\",\n textStyle: \"label.small\",\n fontWeight: \"bold\",\n transitionDuration: \"normal\",\n transitionProperty: \"color, background, border-color\",\n transitionTimingFunction: \"default\",\n whiteSpace: \"nowrap\",\n paddingInline: \"small\",\n paddingBlock: \"3xsmall\",\n zIndex: \"1\",\n _hover: {\n color: \"text.action\",\n },\n _selected: {\n color: \"text.strong\",\n },\n _disabled: {\n color: \"text.subtle\",\n cursor: \"not-allowed\",\n _hover: {\n color: \"text.subtle\",\n },\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n },\n },\n defaultVariants: {\n variant: \"line\",\n },\n variants: {\n variant: {\n line: {\n trigger: {\n borderColor: \"stroke.default\",\n _hover: {\n borderColor: \"stroke.hover\",\n _focusVisible: {\n borderColor: \"stroke.default\",\n },\n },\n _horizontal: {\n borderBottom: \"1px solid\",\n },\n _disabled: {\n borderColor: \"stroke.default\",\n _hover: {\n borderColor: \"stroke.default\",\n },\n },\n _vertical: {\n borderLeft: \"1px solid\",\n justifyContent: \"flex-start\",\n },\n _focusVisible: {\n outline: \"none\",\n borderRadius: \"unset\",\n },\n },\n indicator: {\n background: \"stroke.default\",\n _peerFocusVisible: {\n height: \"var(--height)\",\n width: \"var(--width)\",\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n background: \"transparent\",\n _horizontal: {\n borderTopRadius: \"xsmall\",\n },\n _vertical: {\n borderRightRadius: \"xsmall\",\n },\n },\n _horizontal: {\n top: \"calc(var(--top) + var(--height) - 6px)\",\n height: \"3\",\n width: \"var(--width)\",\n _peerFocusVisible: { top: \"var(--top)\" },\n },\n _vertical: {\n height: \"var(--height)\",\n left: \"0\",\n width: \"3\",\n },\n },\n content: {\n zIndex: \"1\",\n _horizontal: {\n paddingBlockStart: \"xsmall\",\n },\n _vertical: {\n paddingInlineStart: \"xsmall\",\n },\n _focusVisible: {\n outline: \"none\",\n boxShadow: \"0 0 0 3px var(--shadow-color)\",\n boxShadowColor: \"stroke.default\",\n },\n },\n },\n outline: {\n list: {\n _horizontal: {\n marginBlockEnd: \"-1px\",\n },\n _vertical: {\n marginInlineEnd: \"-1px\",\n },\n },\n trigger: {\n borderColor: \"transparent\",\n borderWidth: \"1px\",\n _horizontal: {\n borderTopRadius: \"xsmall\",\n },\n _vertical: {\n borderTopLeftRadius: \"xsmall\",\n borderBottomLeftRadius: \"xsmall\",\n },\n _selected: {\n background: \"surface.default\",\n borderColor: \"stroke.default\",\n _horizontal: {\n borderBottom: \"none\",\n },\n _vertical: {\n borderRight: \"none\",\n },\n },\n _focusVisible: {\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n },\n },\n content: {\n borderWidth: \"1px\",\n borderColor: \"stroke.default\",\n background: \"surface.default\",\n width: \"100%\",\n padding: \"xsmall\",\n _vertical: {\n borderBottomRadius: \"xsmall\",\n borderRightRadius: \"xsmall\",\n },\n _horizontal: {\n borderRightRadius: \"xsmall\",\n borderBottomLeftRadius: \"xsmall\",\n },\n _focusVisible: {\n outline: \"3px solid\",\n outlineOffset: \"-3px\",\n outlineColor: \"stroke.default\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(tabsRecipe);\n\nexport type TabsVariantProps = NonNullable<RecipeVariantProps<typeof tabsRecipe>>;\n\nexport interface TabsRootProps extends Tabs.RootProps, TabsVariantProps, StyledProps, RefAttributes<HTMLDivElement> {\n translations: Tabs.RootProps[\"translations\"];\n}\n\nconst InternalTabsRoot = withProvider(Tabs.Root, \"root\", { baseComponent: true });\n\nexport const TabsRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: TabsRootProps) => (\n <InternalTabsRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const TabsContent = withContext(Tabs.Content, \"content\", { baseComponent: true });\n\nexport const TabsIndicator = withContext(Tabs.Indicator, \"indicator\", { baseComponent: true });\n\nexport const TabsList = withContext(Tabs.List, \"list\", { baseComponent: true });\n\nconst InternalTabsTrigger = withContext(Tabs.Trigger, \"trigger\", { baseComponent: true });\n\ninterface TabsTriggerProps extends Tabs.TriggerProps, StyledProps, RefAttributes<HTMLButtonElement> {}\n\nexport const TabsTrigger = ({ className, ...props }: TabsTriggerProps) => (\n <InternalTabsTrigger className={cx(\"peer\", className)} {...props} />\n);\n"],"mappings":";;;;;;;;;;;;AAyNA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KA3MC;CAGrB,OAAO;EAAC;EAAQ;EAAQ;EAAW;EAAW;EAAY;CAC1D,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,SAAS;GACT,OAAO;GACP,aAAa,EACX,eAAe,UAChB;GACD,WAAW,EACT,eAAe,OAChB;GACF;EACD,MAAM;GACJ,UAAU;GACV,SAAS;GACT,YAAY;GACZ,UAAU;GACV,aAAa,EACX,eAAe,OAChB;GACD,WAAW,EACT,eAAe,UAChB;GACF;EACD,SAAS;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,YAAY;GACZ,QAAQ;GACR,WAAW;GACX,YAAY;GACZ,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,YAAY;GACZ,eAAe;GACf,cAAc;GACd,QAAQ;GACR,QAAQ,EACN,OAAO,eACR;GACD,WAAW,EACT,OAAO,eACR;GACD,WAAW;IACT,OAAO;IACP,QAAQ;IACR,QAAQ,EACN,OAAO,eACR;IACF;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,YAAY;GACZ,KAAK;GACN;EACF;CACD,iBAAiB,EACf,SAAS,QACV;CACD,UAAU,EACR,SAAS;EACP,MAAM;GACJ,SAAS;IACP,aAAa;IACb,QAAQ;KACN,aAAa;KACb,eAAe,EACb,aAAa,kBACd;KACF;IACD,aAAa,EACX,cAAc,aACf;IACD,WAAW;KACT,aAAa;KACb,QAAQ,EACN,aAAa,kBACd;KACF;IACD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gB,MAAM,GAAG,YACpE,iBAAA,GAAA,kBAAA,KAAC,kBAAD;CAA6B;CAA0B;CAAe,GAAI;CAAS,CAAA;AAGrF,MAAa,cAAc,YAAYA,cAAAA,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAYA,cAAAA,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,WAAW,YAAYA,cAAAA,KAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE/E,MAAM,sBAAsB,YAAYA,cAAAA,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,iBAAA,GAAA,kBAAA,KAAC,qBAAD;CAAqB,YAAA,GAAA,wBAAA,IAAc,QAAQ,UAAU;CAAE,GAAI;CAAS,CAAA"}
package/lib/TagsInput.js CHANGED
@@ -1,10 +1,9 @@
1
- const require_Label = require('./Label.js');
1
+ const require_Label = require("./Label.js");
2
2
  let _ark_ui_react = require("@ark-ui/react");
3
3
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
4
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  let react = require("react");
7
-
8
7
  //#region src/TagsInput.tsx
9
8
  /**
10
9
  * Copyright (c) 2024-present, NDLA.
@@ -103,7 +102,6 @@ const TagsInputLabel = (0, react.forwardRef)(({ children, ...props }, ref) => /*
103
102
  ...props,
104
103
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Label.Label, { children })
105
104
  }));
106
-
107
105
  //#endregion
108
106
  exports.TagsInputClearTrigger = TagsInputClearTrigger;
109
107
  exports.TagsInputControl = TagsInputControl;
@@ -115,4 +113,5 @@ exports.TagsInputItemPreview = TagsInputItemPreview;
115
113
  exports.TagsInputItemText = TagsInputItemText;
116
114
  exports.TagsInputLabel = TagsInputLabel;
117
115
  exports.TagsInputRoot = TagsInputRoot;
116
+
118
117
  //# sourceMappingURL=TagsInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInput.js","names":["tagsInputAnatomy","TagsInput","Label"],"sources":["../src/TagsInput.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 { TagsInput, tagsInputAnatomy } 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 RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst tagsInputRecipe = sva({\n slots: tagsInputAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xxsmall\",\n width: \"full\",\n },\n control: {\n display: \"inline-flex\",\n gap: \"xxsmall\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n item: {\n paddingBlock: \"3xsmall\",\n },\n itemPreview: {\n display: \"flex\",\n gap: \"1\",\n paddingBlock: \"4xsmall\",\n paddingInlineEnd: \"3xsmall\",\n paddingInlineStart: \"xsmall\",\n cursor: \"initial\",\n borderRadius: \"large\",\n outline: \"1px solid\",\n outlineColor: \"transparent\",\n backgroundColor: \"surface.action.selected\",\n color: \"text.onAction\",\n transitionDuration: \"normal\",\n transitionProperty: \"background, outline-color, color\",\n transitionTimingFunction: \"default\",\n textStyle: \"label.medium\",\n _hover: {\n backgroundColor: \"surface.actionSubtle.hover\",\n outlineColor: \"stroke.hover\",\n color: \"text.default\",\n \"& svg\": {\n color: \"stroke.hover\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n _highlighted: {\n backgroundColor: \"surface.actionSubtle.hover\",\n outlineWidth: \"3px\",\n outlineOffset: \"-1px\",\n outlineColor: \"stroke.hover\",\n color: \"text.default\",\n \"& svg\": {\n color: \"stroke.hover\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n input: {\n flex: \"1\",\n },\n itemDeleteTrigger: {\n paddingBottom: \"1\",\n cursor: \"pointer\",\n \"& span\": {\n display: \"inline-block\",\n },\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n itemText: {\n paddingBottom: \"1\",\n },\n itemInput: {\n outline: \"none\",\n background: \"transparent\",\n },\n },\n});\nconst { withProvider, withContext } = createStyleContext(tagsInputRecipe);\n\nexport interface TagsInputRootProps extends TagsInput.RootProps, StyledProps {\n translations: TagsInput.RootProps[\"translations\"];\n}\n\nexport const TagsInputRoot = withProvider(TagsInput.Root, \"root\", {\n baseComponent: true,\n});\n\nexport interface TagsInputClearTriggerProps extends TagsInput.ClearTriggerProps, StyledProps {}\n\nexport const TagsInputClearTrigger = withContext(TagsInput.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport interface TagsInputControlProps extends TagsInput.ControlProps, StyledProps {}\n\nexport const TagsInputControl = withContext(TagsInput.Control, \"control\", { baseComponent: true });\n\nexport interface TagsInputInputProps extends TagsInput.InputProps, StyledProps {}\n\nexport const TagsInputInput = withContext(TagsInput.Input, \"input\", { baseComponent: true });\n\nexport interface TagsInputItemDeleteTriggerProps extends TagsInput.ItemDeleteTriggerProps, StyledProps {}\n\nexport const TagsInputItemDeleteTrigger = withContext(TagsInput.ItemDeleteTrigger, \"itemDeleteTrigger\", {\n baseComponent: true,\n});\n\nexport interface TagsInputItemInputProps extends TagsInput.ItemInputProps, StyledProps {}\n\nexport const TagsInputItemInput = withContext(TagsInput.ItemInput, \"itemInput\", { baseComponent: true });\n\nexport interface TagsInputItemPreviewProps extends TagsInput.ItemPreviewProps, StyledProps {}\n\nexport const TagsInputItemPreview = withContext(TagsInput.ItemPreview, \"itemPreview\", { baseComponent: true });\n\nexport interface TagsInputItemProps extends TagsInput.ItemProps, StyledProps {}\n\nexport const TagsInputItem = withContext(TagsInput.Item, \"item\", { baseComponent: true });\n\nexport interface TagsInputItemTextProps extends TagsInput.ItemTextProps, StyledProps {}\n\nexport const TagsInputItemText = withContext(TagsInput.ItemText, \"itemText\", { baseComponent: true });\n\nconst InternalTagsInputLabel = withContext(TagsInput.Label, \"label\");\n\nexport interface TagsInputLabelProps\n extends Omit<TagsInput.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const TagsInputLabel = forwardRef<HTMLLabelElement, TagsInputLabelProps>(({ children, ...props }, ref) => (\n <InternalTagsInputLabel asChild ref={ref} {...props}>\n <Label>{children}</Label>\n </InternalTagsInputLabel>\n));\n"],"mappings":";;;;;;;;;;;;;;;AAsGA,MAAM,EAAE,cAAc,iGAtFM;CAC1B,OAAOA,+BAAiB,MAAM;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;GACR;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,YAAY;GACZ,UAAU;GACX;EACD,MAAM,EACJ,cAAc,WACf;EACD,aAAa;GACX,SAAS;GACT,KAAK;GACL,cAAc;GACd,kBAAkB;GAClB,oBAAoB;GACpB,QAAQ;GACR,cAAc;GACd,SAAS;GACT,cAAc;GACd,iBAAiB;GACjB,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,WAAW;GACX,QAAQ;IACN,iBAAiB;IACjB,cAAc;IACd,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,eAAe;KACb,YAAY;KACZ,oBAAoB;KACrB;IACF;GACD,cAAc;IACZ,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,cAAc;IACd,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,eAAe;KACb,YAAY;KACZ,oBAAoB;KACrB;IACF;GACF;EACD,OAAO,EACL,MAAM,KACP;EACD,mBAAmB;GACjB,eAAe;GACf,QAAQ;GACR,UAAU,EACR,SAAS,gBACV;GACD,SAAS;IACP,cAAc;IACd,aAAa;IACb,OAAO;IACP,QAAQ;IACT;GACF;EACD,UAAU,EACR,eAAe,KAChB;EACD,WAAW;GACT,SAAS;GACT,YAAY;GACb;EACF;CACF,CAAC,CACuE;AAMzE,MAAa,gBAAgB,aAAaC,wBAAU,MAAM,QAAQ,EAChE,eAAe,MAChB,CAAC;AAIF,MAAa,wBAAwB,YAAYA,wBAAU,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAIjH,MAAa,mBAAmB,YAAYA,wBAAU,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIlG,MAAa,iBAAiB,YAAYA,wBAAU,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAI5F,MAAa,6BAA6B,YAAYA,wBAAU,mBAAmB,qBAAqB,EACtG,eAAe,MAChB,CAAC;AAIF,MAAa,qBAAqB,YAAYA,wBAAU,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAIxG,MAAa,uBAAuB,YAAYA,wBAAU,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAI9G,MAAa,gBAAgB,YAAYA,wBAAU,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,oBAAoB,YAAYA,wBAAU,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAErG,MAAM,yBAAyB,YAAYA,wBAAU,OAAO,QAAQ;AAKpE,MAAa,wCAAoE,EAAE,UAAU,GAAG,SAAS,QACvG,2CAAC;CAAuB;CAAa;CAAK,GAAI;WAC5C,2CAACC,uBAAO,WAAiB;EACF,CACzB"}
1
+ {"version":3,"file":"TagsInput.js","names":["tagsInputAnatomy","TagsInput","Label"],"sources":["../src/TagsInput.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 { TagsInput, tagsInputAnatomy } 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 RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst tagsInputRecipe = sva({\n slots: tagsInputAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xxsmall\",\n width: \"full\",\n },\n control: {\n display: \"inline-flex\",\n gap: \"xxsmall\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n item: {\n paddingBlock: \"3xsmall\",\n },\n itemPreview: {\n display: \"flex\",\n gap: \"1\",\n paddingBlock: \"4xsmall\",\n paddingInlineEnd: \"3xsmall\",\n paddingInlineStart: \"xsmall\",\n cursor: \"initial\",\n borderRadius: \"large\",\n outline: \"1px solid\",\n outlineColor: \"transparent\",\n backgroundColor: \"surface.action.selected\",\n color: \"text.onAction\",\n transitionDuration: \"normal\",\n transitionProperty: \"background, outline-color, color\",\n transitionTimingFunction: \"default\",\n textStyle: \"label.medium\",\n _hover: {\n backgroundColor: \"surface.actionSubtle.hover\",\n outlineColor: \"stroke.hover\",\n color: \"text.default\",\n \"& svg\": {\n color: \"stroke.hover\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n _highlighted: {\n backgroundColor: \"surface.actionSubtle.hover\",\n outlineWidth: \"3px\",\n outlineOffset: \"-1px\",\n outlineColor: \"stroke.hover\",\n color: \"text.default\",\n \"& svg\": {\n color: \"stroke.hover\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n input: {\n flex: \"1\",\n },\n itemDeleteTrigger: {\n paddingBottom: \"1\",\n cursor: \"pointer\",\n \"& span\": {\n display: \"inline-block\",\n },\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n itemText: {\n paddingBottom: \"1\",\n },\n itemInput: {\n outline: \"none\",\n background: \"transparent\",\n },\n },\n});\nconst { withProvider, withContext } = createStyleContext(tagsInputRecipe);\n\nexport interface TagsInputRootProps extends TagsInput.RootProps, StyledProps {\n translations: TagsInput.RootProps[\"translations\"];\n}\n\nexport const TagsInputRoot = withProvider(TagsInput.Root, \"root\", {\n baseComponent: true,\n});\n\nexport interface TagsInputClearTriggerProps extends TagsInput.ClearTriggerProps, StyledProps {}\n\nexport const TagsInputClearTrigger = withContext(TagsInput.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport interface TagsInputControlProps extends TagsInput.ControlProps, StyledProps {}\n\nexport const TagsInputControl = withContext(TagsInput.Control, \"control\", { baseComponent: true });\n\nexport interface TagsInputInputProps extends TagsInput.InputProps, StyledProps {}\n\nexport const TagsInputInput = withContext(TagsInput.Input, \"input\", { baseComponent: true });\n\nexport interface TagsInputItemDeleteTriggerProps extends TagsInput.ItemDeleteTriggerProps, StyledProps {}\n\nexport const TagsInputItemDeleteTrigger = withContext(TagsInput.ItemDeleteTrigger, \"itemDeleteTrigger\", {\n baseComponent: true,\n});\n\nexport interface TagsInputItemInputProps extends TagsInput.ItemInputProps, StyledProps {}\n\nexport const TagsInputItemInput = withContext(TagsInput.ItemInput, \"itemInput\", { baseComponent: true });\n\nexport interface TagsInputItemPreviewProps extends TagsInput.ItemPreviewProps, StyledProps {}\n\nexport const TagsInputItemPreview = withContext(TagsInput.ItemPreview, \"itemPreview\", { baseComponent: true });\n\nexport interface TagsInputItemProps extends TagsInput.ItemProps, StyledProps {}\n\nexport const TagsInputItem = withContext(TagsInput.Item, \"item\", { baseComponent: true });\n\nexport interface TagsInputItemTextProps extends TagsInput.ItemTextProps, StyledProps {}\n\nexport const TagsInputItemText = withContext(TagsInput.ItemText, \"itemText\", { baseComponent: true });\n\nconst InternalTagsInputLabel = withContext(TagsInput.Label, \"label\");\n\nexport interface TagsInputLabelProps\n extends Omit<TagsInput.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const TagsInputLabel = forwardRef<HTMLLabelElement, TagsInputLabelProps>(({ children, ...props }, ref) => (\n <InternalTagsInputLabel asChild ref={ref} {...props}>\n <Label>{children}</Label>\n </InternalTagsInputLabel>\n));\n"],"mappings":";;;;;;;;;;;;;;AAsGA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KAtFM;CAC1B,OAAOA,cAAAA,iBAAiB,MAAM;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;GACR;EACD,SAAS;GACP,SAAS;GACT,KAAK;GACL,YAAY;GACZ,UAAU;GACX;EACD,MAAM,EACJ,cAAc,WACf;EACD,aAAa;GACX,SAAS;GACT,KAAK;GACL,cAAc;GACd,kBAAkB;GAClB,oBAAoB;GACpB,QAAQ;GACR,cAAc;GACd,SAAS;GACT,cAAc;GACd,iBAAiB;GACjB,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,WAAW;GACX,QAAQ;IACN,iBAAiB;IACjB,cAAc;IACd,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,eAAe;KACb,YAAY;KACZ,oBAAoB;KACrB;IACF;GACD,cAAc;IACZ,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,cAAc;IACd,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,eAAe;KACb,YAAY;KACZ,oBAAoB;KACrB;IACF;GACF;EACD,OAAO,EACL,MAAM,KACP;EACD,mBAAmB;GACjB,eAAe;GACf,QAAQ;GACR,UAAU,EACR,SAAS,gBACV;GACD,SAAS;IACP,cAAc;IACd,aAAa;IACb,OAAO;IACP,QAAQ;IACT;GACF;EACD,UAAU,EACR,eAAe,KAChB;EACD,WAAW;GACT,SAAS;GACT,YAAY;GACb;EACF;CACF,CAAC,CACuE;AAMzE,MAAa,gBAAgB,aAAaC,cAAAA,UAAU,MAAM,QAAQ,EAChE,eAAe,MAChB,CAAC;AAIF,MAAa,wBAAwB,YAAYA,cAAAA,UAAU,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAIjH,MAAa,mBAAmB,YAAYA,cAAAA,UAAU,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIlG,MAAa,iBAAiB,YAAYA,cAAAA,UAAU,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAI5F,MAAa,6BAA6B,YAAYA,cAAAA,UAAU,mBAAmB,qBAAqB,EACtG,eAAe,MAChB,CAAC;AAIF,MAAa,qBAAqB,YAAYA,cAAAA,UAAU,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAIxG,MAAa,uBAAuB,YAAYA,cAAAA,UAAU,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAI9G,MAAa,gBAAgB,YAAYA,cAAAA,UAAU,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,oBAAoB,YAAYA,cAAAA,UAAU,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAErG,MAAM,yBAAyB,YAAYA,cAAAA,UAAU,OAAO,QAAQ;AAKpE,MAAa,kBAAA,GAAA,MAAA,aAAoE,EAAE,UAAU,GAAG,SAAS,QACvG,iBAAA,GAAA,kBAAA,KAAC,wBAAD;CAAwB,SAAA;CAAa;CAAK,GAAI;WAC5C,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD,EAAQ,UAAiB,CAAA;CACF,CAAA,CACzB"}
package/lib/Text.js CHANGED
@@ -3,7 +3,6 @@ let _ndla_styled_system_css = require("@ndla/styled-system/css");
3
3
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  let react = require("react");
6
-
7
6
  //#region src/Text.tsx
8
7
  /**
9
8
  * Copyright (c) 2024-present, NDLA.
@@ -34,8 +33,8 @@ const Heading = (0, react.forwardRef)(({ textStyle = "heading.medium", fontWeigh
34
33
  ref,
35
34
  ...rest
36
35
  }));
37
-
38
36
  //#endregion
39
37
  exports.Heading = Heading;
40
38
  exports.Text = Text;
39
+
41
40
  //# sourceMappingURL=Text.js.map
package/lib/Text.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","names":["ark","css"],"sources":["../src/Text.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 { css } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { ColorToken, FontWeightToken } from \"@ndla/styled-system/tokens\";\nimport type { StyledProps, UtilityValues } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nexport interface TextProps {\n textStyle?: UtilityValues[\"textStyle\"];\n fontWeight?: FontWeightToken;\n color?: ColorToken;\n srOnly?: boolean;\n}\n\nconst StyledP = styled(ark.p, {}, { baseComponent: true });\n\nexport interface TextComponentProps extends Omit<HTMLArkProps<\"p\">, \"color\">, StyledProps, TextProps {}\n\nexport const Text = forwardRef<HTMLParagraphElement, TextComponentProps>(\n ({ textStyle = \"body.medium\", fontWeight, color, srOnly, css: cssProp, ...rest }, ref) => (\n <StyledP css={css.raw({ textStyle, fontWeight, color, srOnly }, cssProp)} ref={ref} {...rest} />\n ),\n);\n\nconst StyledH1 = styled(ark.h1, {}, { baseComponent: true });\n\nexport interface HeadingComponentProps extends Omit<HTMLArkProps<\"h1\">, \"color\">, StyledProps, TextProps {}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingComponentProps>(\n ({ textStyle = \"heading.medium\", fontWeight, color, srOnly, css: cssProp, ...rest }, ref) => (\n <StyledH1 css={css.raw({ textStyle, fontWeight, color, srOnly }, cssProp)} ref={ref} {...rest} />\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,8CAAiBA,kBAAI,GAAG,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAI1D,MAAa,8BACV,EAAE,YAAY,eAAe,YAAY,OAAO,QAAQ,KAAK,SAAS,GAAG,QAAQ,QAChF,2CAAC;CAAQ,KAAKC,4BAAI,IAAI;EAAE;EAAW;EAAY;EAAO;EAAQ,EAAE,QAAQ;CAAO;CAAK,GAAI;EAAQ,CAEnG;AAED,MAAM,+CAAkBD,kBAAI,IAAI,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAI5D,MAAa,iCACV,EAAE,YAAY,kBAAkB,YAAY,OAAO,QAAQ,KAAK,SAAS,GAAG,QAAQ,QACnF,2CAAC;CAAS,KAAKC,4BAAI,IAAI;EAAE;EAAW;EAAY;EAAO;EAAQ,EAAE,QAAQ;CAAO;CAAK,GAAI;EAAQ,CAEpG"}
1
+ {"version":3,"file":"Text.js","names":["ark","css"],"sources":["../src/Text.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 { css } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { ColorToken, FontWeightToken } from \"@ndla/styled-system/tokens\";\nimport type { StyledProps, UtilityValues } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nexport interface TextProps {\n textStyle?: UtilityValues[\"textStyle\"];\n fontWeight?: FontWeightToken;\n color?: ColorToken;\n srOnly?: boolean;\n}\n\nconst StyledP = styled(ark.p, {}, { baseComponent: true });\n\nexport interface TextComponentProps extends Omit<HTMLArkProps<\"p\">, \"color\">, StyledProps, TextProps {}\n\nexport const Text = forwardRef<HTMLParagraphElement, TextComponentProps>(\n ({ textStyle = \"body.medium\", fontWeight, color, srOnly, css: cssProp, ...rest }, ref) => (\n <StyledP css={css.raw({ textStyle, fontWeight, color, srOnly }, cssProp)} ref={ref} {...rest} />\n ),\n);\n\nconst StyledH1 = styled(ark.h1, {}, { baseComponent: true });\n\nexport interface HeadingComponentProps extends Omit<HTMLArkProps<\"h1\">, \"color\">, StyledProps, TextProps {}\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingComponentProps>(\n ({ textStyle = \"heading.medium\", fontWeight, color, srOnly, css: cssProp, ...rest }, ref) => (\n <StyledH1 css={css.raw({ textStyle, fontWeight, color, srOnly }, cssProp)} ref={ref} {...rest} />\n ),\n);\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,WAAA,GAAA,wBAAA,QAAiBA,cAAAA,IAAI,GAAG,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAI1D,MAAa,QAAA,GAAA,MAAA,aACV,EAAE,YAAY,eAAe,YAAY,OAAO,QAAQ,KAAK,SAAS,GAAG,QAAQ,QAChF,iBAAA,GAAA,kBAAA,KAAC,SAAD;CAAS,KAAKC,wBAAAA,IAAI,IAAI;EAAE;EAAW;EAAY;EAAO;EAAQ,EAAE,QAAQ;CAAO;CAAK,GAAI;CAAQ,CAAA,CAEnG;AAED,MAAM,YAAA,GAAA,wBAAA,QAAkBD,cAAAA,IAAI,IAAI,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAI5D,MAAa,WAAA,GAAA,MAAA,aACV,EAAE,YAAY,kBAAkB,YAAY,OAAO,QAAQ,KAAK,SAAS,GAAG,QAAQ,QACnF,iBAAA,GAAA,kBAAA,KAAC,UAAD;CAAU,KAAKC,wBAAAA,IAAI,IAAI;EAAE;EAAW;EAAY;EAAO;EAAQ,EAAE,QAAQ;CAAO;CAAK,GAAI;CAAQ,CAAA,CAEpG"}
package/lib/Toast.js CHANGED
@@ -1,9 +1,8 @@
1
- const require_Text = require('./Text.js');
1
+ const require_Text = require("./Text.js");
2
2
  let _ark_ui_react = require("@ark-ui/react");
3
3
  let _ndla_styled_system_css = require("@ndla/styled-system/css");
4
4
  let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
-
7
6
  //#region src/Toast.tsx
8
7
  /**
9
8
  * Copyright (c) 2024-present, NDLA.
@@ -83,11 +82,11 @@ const ToastTitle = ({ textStyle = "label.medium", fontWeight = "semibold", child
83
82
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children })
84
83
  })
85
84
  });
86
-
87
85
  //#endregion
88
86
  exports.ToastActionTrigger = ToastActionTrigger;
89
87
  exports.ToastCloseTrigger = ToastCloseTrigger;
90
88
  exports.ToastDescription = ToastDescription;
91
89
  exports.ToastRoot = ToastRoot;
92
90
  exports.ToastTitle = ToastTitle;
91
+
93
92
  //# sourceMappingURL=Toast.js.map
package/lib/Toast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["toastAnatomy","Toast","Text"],"sources":["../src/Toast.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 { Toast, toastAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst toastRecipe = sva({\n slots: toastAnatomy.keys(),\n base: {\n root: {\n position: \"relative\",\n borderRadius: \"xsmall\",\n boxShadow: \"medium\",\n minWidth: \"20rem\",\n maxWidth: \"30rem\",\n height: \"var(--height)\",\n opacity: \"var(--opacity)\",\n overflowWrap: \"anywhere\",\n padding: \"small\",\n scale: \"var(--scale)\",\n translate: \"var(--x) var(--y) 0\",\n willChange: \"translate, scale, opacity, height\",\n zIndex: \"var(--z-index)\",\n transitionDuration: \"slow\",\n transitionProperty: \"translate, scale, opacity, height\",\n transitionTimingFunction: \"default\",\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n title: {\n paddingInlineEnd: \"xxlarge\",\n },\n closeTrigger: {\n position: \"absolute\",\n top: \"xxsmall\",\n right: \"xxsmall\",\n },\n description: {\n paddingInlineEnd: \"xxlarge\",\n },\n },\n defaultVariants: {\n variant: \"light\",\n },\n variants: {\n variant: {\n light: {\n root: {\n background: \"surface.brand.1.moderate\",\n color: \"text.default\",\n },\n },\n dark: {\n root: {\n background: \"surface.brand.1.strong\",\n color: \"text.onAction\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(toastRecipe);\n\nexport type ToastRootVariantProps = NonNullable<RecipeVariantProps<typeof toastRecipe>>;\n\nexport interface ToastRootProps extends Toast.RootProps, StyledProps, ToastRootVariantProps {}\nexport const ToastRoot = withProvider(Toast.Root, \"root\", { baseComponent: true });\n\nexport const ToastActionTrigger = withContext(Toast.ActionTrigger, \"actionTrigger\", { baseComponent: true });\n\nexport const ToastCloseTrigger = withContext(Toast.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nconst InternalToastDescription = withContext(Toast.Description, \"description\");\n\ninterface ToastDescriptionProps\n extends Omit<Toast.DescriptionProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLDivElement> {}\n\nexport const ToastDescription = ({ textStyle = \"label.medium\", children, ...props }: ToastDescriptionProps) => (\n <InternalToastDescription asChild>\n <Text asChild consumeCss textStyle={textStyle} {...props}>\n <div>{children}</div>\n </Text>\n </InternalToastDescription>\n);\n\nconst InternalToastTitle = withContext(Toast.Title, \"title\");\n\ninterface ToastTitleProps\n extends Omit<Toast.TitleProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLDivElement> {}\n\nexport const ToastTitle = ({\n textStyle = \"label.medium\",\n fontWeight = \"semibold\",\n children,\n ...props\n}: ToastTitleProps) => (\n <InternalToastTitle asChild>\n <Text asChild consumeCss fontWeight={fontWeight} textStyle={textStyle} {...props}>\n <div>{children}</div>\n </Text>\n </InternalToastTitle>\n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AAQ;EAAuB;EAAuB;EAAW,GAAI;YACzE,2CAAC,SAAK,WAAe;GAChB;EACY"}
1
+ {"version":3,"file":"Toast.js","names":["toastAnatomy","Toast","Text"],"sources":["../src/Toast.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 { Toast, toastAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst toastRecipe = sva({\n slots: toastAnatomy.keys(),\n base: {\n root: {\n position: \"relative\",\n borderRadius: \"xsmall\",\n boxShadow: \"medium\",\n minWidth: \"20rem\",\n maxWidth: \"30rem\",\n height: \"var(--height)\",\n opacity: \"var(--opacity)\",\n overflowWrap: \"anywhere\",\n padding: \"small\",\n scale: \"var(--scale)\",\n translate: \"var(--x) var(--y) 0\",\n willChange: \"translate, scale, opacity, height\",\n zIndex: \"var(--z-index)\",\n transitionDuration: \"slow\",\n transitionProperty: \"translate, scale, opacity, height\",\n transitionTimingFunction: \"default\",\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n title: {\n paddingInlineEnd: \"xxlarge\",\n },\n closeTrigger: {\n position: \"absolute\",\n top: \"xxsmall\",\n right: \"xxsmall\",\n },\n description: {\n paddingInlineEnd: \"xxlarge\",\n },\n },\n defaultVariants: {\n variant: \"light\",\n },\n variants: {\n variant: {\n light: {\n root: {\n background: \"surface.brand.1.moderate\",\n color: \"text.default\",\n },\n },\n dark: {\n root: {\n background: \"surface.brand.1.strong\",\n color: \"text.onAction\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(toastRecipe);\n\nexport type ToastRootVariantProps = NonNullable<RecipeVariantProps<typeof toastRecipe>>;\n\nexport interface ToastRootProps extends Toast.RootProps, StyledProps, ToastRootVariantProps {}\nexport const ToastRoot = withProvider(Toast.Root, \"root\", { baseComponent: true });\n\nexport const ToastActionTrigger = withContext(Toast.ActionTrigger, \"actionTrigger\", { baseComponent: true });\n\nexport const ToastCloseTrigger = withContext(Toast.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nconst InternalToastDescription = withContext(Toast.Description, \"description\");\n\ninterface ToastDescriptionProps\n extends Omit<Toast.DescriptionProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLDivElement> {}\n\nexport const ToastDescription = ({ textStyle = \"label.medium\", children, ...props }: ToastDescriptionProps) => (\n <InternalToastDescription asChild>\n <Text asChild consumeCss textStyle={textStyle} {...props}>\n <div>{children}</div>\n </Text>\n </InternalToastDescription>\n);\n\nconst InternalToastTitle = withContext(Toast.Title, \"title\");\n\ninterface ToastTitleProps\n extends Omit<Toast.TitleProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLDivElement> {}\n\nexport const ToastTitle = ({\n textStyle = \"label.medium\",\n fontWeight = \"semibold\",\n children,\n ...props\n}: ToastTitleProps) => (\n <InternalToastTitle asChild>\n <Text asChild consumeCss fontWeight={fontWeight} textStyle={textStyle} {...props}>\n <div>{children}</div>\n </Text>\n </InternalToastTitle>\n);\n"],"mappings":";;;;;;;;;;;;;AAyEA,MAAM,EAAE,cAAc,iBAAA,GAAA,wBAAA,qBAAA,GAAA,wBAAA,KA1DE;CACtB,OAAOA,cAAAA,aAAa,MAAM;CAC1B,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,cAAc;GACd,WAAW;GACX,UAAU;GACV,UAAU;GACV,QAAQ;GACR,SAAS;GACT,cAAc;GACd,SAAS;GACT,OAAO;GACP,WAAW;GACX,YAAY;GACZ,QAAQ;GACR,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,OAAO,EACL,kBAAkB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