@ndla/primitives 1.0.127-alpha.0 → 1.0.129-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 (63) hide show
  1. package/dist/panda.buildinfo.json +1 -1
  2. package/dist/styles.css +20 -103
  3. package/es/Accordion.mjs.map +1 -1
  4. package/es/ArticleLists.mjs +7 -0
  5. package/es/ArticleLists.mjs.map +1 -1
  6. package/es/Card/Card.mjs.map +1 -1
  7. package/es/Checkbox.mjs.map +1 -1
  8. package/es/Combobox.mjs.map +1 -1
  9. package/es/DatePicker.mjs.map +1 -1
  10. package/es/Dialog.mjs.map +1 -1
  11. package/es/ErrorMessage/ErrorMessage.mjs.map +1 -1
  12. package/es/ExpandableBox.mjs.map +1 -1
  13. package/es/FileUpload.mjs.map +1 -1
  14. package/es/Hero.mjs.map +1 -1
  15. package/es/Layout/PageContent.mjs +5 -0
  16. package/es/Layout/PageContent.mjs.map +1 -1
  17. package/es/ListItem/ListItem.mjs.map +1 -1
  18. package/es/Menu.mjs.map +1 -1
  19. package/es/Pagination.mjs.map +1 -1
  20. package/es/Popover.mjs.map +1 -1
  21. package/es/RadioGroup.mjs.map +1 -1
  22. package/es/Select.mjs.map +1 -1
  23. package/es/Slider.mjs +1 -0
  24. package/es/Slider.mjs.map +1 -1
  25. package/es/Switch.mjs.map +1 -1
  26. package/es/Tabs.mjs.map +1 -1
  27. package/es/TagsInput.mjs.map +1 -1
  28. package/es/Toast.mjs.map +1 -1
  29. package/es/ToggleGroup.mjs.map +1 -1
  30. package/es/Tooltip.mjs.map +1 -1
  31. package/es/Tree/Tree.mjs.map +1 -1
  32. package/lib/Accordion.js.map +1 -1
  33. package/lib/ArticleLists.js +7 -0
  34. package/lib/ArticleLists.js.map +1 -1
  35. package/lib/Card/Card.js.map +1 -1
  36. package/lib/Checkbox.js.map +1 -1
  37. package/lib/Combobox.js.map +1 -1
  38. package/lib/DatePicker.js.map +1 -1
  39. package/lib/Dialog.js.map +1 -1
  40. package/lib/ErrorMessage/ErrorMessage.js.map +1 -1
  41. package/lib/ExpandableBox.js.map +1 -1
  42. package/lib/FileUpload.js.map +1 -1
  43. package/lib/Hero.js.map +1 -1
  44. package/lib/Layout/PageContent.js +5 -0
  45. package/lib/Layout/PageContent.js.map +1 -1
  46. package/lib/ListItem/ListItem.js.map +1 -1
  47. package/lib/Menu.js.map +1 -1
  48. package/lib/Pagination.js.map +1 -1
  49. package/lib/Popover.js.map +1 -1
  50. package/lib/RadioGroup.js.map +1 -1
  51. package/lib/Select.js.map +1 -1
  52. package/lib/Skeleton.js.map +1 -1
  53. package/lib/Slider.js +1 -0
  54. package/lib/Slider.js.map +1 -1
  55. package/lib/Switch.js.map +1 -1
  56. package/lib/Table.js.map +1 -1
  57. package/lib/Tabs.js.map +1 -1
  58. package/lib/TagsInput.js.map +1 -1
  59. package/lib/Toast.js.map +1 -1
  60. package/lib/ToggleGroup.js.map +1 -1
  61. package/lib/Tooltip.js.map +1 -1
  62. package/lib/Tree/Tree.js.map +1 -1
  63. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorMessage.mjs","names":[],"sources":["../../src/ErrorMessage/ErrorMessage.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 { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\nimport { Heading, Text, type TextProps } from \"../Text\";\n\nconst errorMessageRecipe = sva({\n slots: [\"root\", \"content\", \"actions\", \"title\", \"description\"],\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xxlarge\",\n alignItems: \"center\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"medium\",\n alignItems: \"center\",\n },\n actions: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n alignItems: \"center\",\n },\n title: {\n textAlign: \"center\",\n },\n description: {\n textAlign: \"center\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(errorMessageRecipe);\n\nexport const ErrorMessageRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\nexport const ErrorMessageContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const ErrorMessageActions = withContext(ark.div, \"actions\", { baseComponent: true });\n\ninterface ErrorMessageTitleProps extends Omit<HTMLArkProps<\"h1\">, \"color\">, StyledProps, TextProps {}\n\nconst InternalErrorMessageTitle = forwardRef<HTMLHeadingElement, ErrorMessageTitleProps>(\n ({ textStyle = \"heading.small\", ...props }, ref) => <Heading textStyle={textStyle} {...props} ref={ref} />,\n);\n\nexport const ErrorMessageTitle = withContext(InternalErrorMessageTitle, \"title\");\n\ninterface ErrorMessageDescriptionProps extends Omit<HTMLArkProps<\"p\">, \"color\">, StyledProps, TextProps {}\n\nconst InternalErrorMessageDescription = forwardRef<HTMLParagraphElement, ErrorMessageDescriptionProps>(\n ({ textStyle = \"body.xlarge\", ...props }, ref) => <Text textStyle={textStyle} {...props} ref={ref} />,\n);\n\nexport const ErrorMessageDescription = withContext(InternalErrorMessageDescription, \"description\");\n"],"mappings":";;;;;;;;;;;;;;AA6CA,MAAM,EAAE,cAAc,gBAAgB,mBA9BX,IAAI;CAC7B,OAAO;EAAC;EAAQ;EAAW;EAAW;EAAS;EAAc;CAC7D,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,OAAO,EACL,WAAW,UACZ;EACD,aAAa,EACX,WAAW,UACZ;EACF;CACF,CAAC,CAE0E;AAE5E,MAAa,mBAAmB,aAAa,IAAI,SAAS,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE1F,MAAa,sBAAsB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,sBAAsB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAQ3F,MAAa,oBAAoB,YAJC,YAC/B,EAAE,YAAY,iBAAiB,GAAG,SAAS,QAAQ,oBAAC,SAAD;CAAoB;CAAW,GAAI;CAAY;CAAO,CAAA,CAC3G,EAEuE,QAAQ;AAQhF,MAAa,0BAA0B,YAJC,YACrC,EAAE,YAAY,eAAe,GAAG,SAAS,QAAQ,oBAAC,MAAD;CAAiB;CAAW,GAAI;CAAY;CAAO,CAAA,CACtG,EAEmF,cAAc"}
1
+ {"version":3,"file":"ErrorMessage.mjs","names":[],"sources":["../../src/ErrorMessage/ErrorMessage.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 { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\nimport { Heading, Text, type TextProps } from \"../Text\";\n\nconst errorMessageRecipe = sva({\n slots: [\"root\", \"content\", \"actions\", \"title\", \"description\"],\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xxlarge\",\n alignItems: \"center\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"medium\",\n alignItems: \"center\",\n },\n actions: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n alignItems: \"center\",\n },\n title: {\n textAlign: \"center\",\n },\n description: {\n textAlign: \"center\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(errorMessageRecipe);\n\nexport const ErrorMessageRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\nexport const ErrorMessageContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const ErrorMessageActions = withContext(ark.div, \"actions\", { baseComponent: true });\n\ninterface ErrorMessageTitleProps extends Omit<HTMLArkProps<\"h1\">, \"color\">, StyledProps, TextProps {}\n\nconst InternalErrorMessageTitle = forwardRef<HTMLHeadingElement, ErrorMessageTitleProps>(\n ({ textStyle = \"heading.small\", ...props }, ref) => <Heading textStyle={textStyle} {...props} ref={ref} />,\n);\n\nexport const ErrorMessageTitle = withContext(InternalErrorMessageTitle, \"title\");\n\ninterface ErrorMessageDescriptionProps extends Omit<HTMLArkProps<\"p\">, \"color\">, StyledProps, TextProps {}\n\nconst InternalErrorMessageDescription = forwardRef<HTMLParagraphElement, ErrorMessageDescriptionProps>(\n ({ textStyle = \"body.xlarge\", ...props }, ref) => <Text textStyle={textStyle} {...props} ref={ref} />,\n);\n\nexport const ErrorMessageDescription = withContext(InternalErrorMessageDescription, \"description\");\n"],"mappings":";;;;;;;;;;;;;;AA6CA,MAAM,EAAE,cAAc,gBAAgB,mBA9BX,IAAI;CAC7B,OAAO;EAAC;EAAQ;EAAW;EAAW;EAAS;EAAc;CAC7D,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,YAAY;GACb;EACD,OAAO,EACL,WAAW,UACZ;EACD,aAAa,EACX,WAAW,UACZ;EACF;CACF,CAE0E,CAAC;AAE5E,MAAa,mBAAmB,aAAa,IAAI,SAAS,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE1F,MAAa,sBAAsB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,sBAAsB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAQ3F,MAAa,oBAAoB,YAJC,YAC/B,EAAE,YAAY,iBAAiB,GAAG,SAAS,QAAQ,oBAAC,SAAD;CAAoB;CAAW,GAAI;CAAY;CAAO,CAAA,CAG/D,EAA2B,QAAQ;AAQhF,MAAa,0BAA0B,YAJC,YACrC,EAAE,YAAY,eAAe,GAAG,SAAS,QAAQ,oBAAC,MAAD;CAAiB;CAAW,GAAI;CAAY;CAAO,CAAA,CAGpD,EAAiC,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableBox.mjs","names":[],"sources":["../src/ExpandableBox.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\";\nimport { forwardRef, useEffect } from \"react\";\n\nexport interface ExpandableBoxProps extends HTMLArkProps<\"details\">, StyledProps {}\n\nconst StyledExpandableBox = styled(\n ark.details,\n {\n base: {\n transitionDuration: \"fast\",\n width: \"100%\",\n position: \"relative\",\n border: \"1px solid\",\n borderRadius: \"xsmall\",\n borderColor: \"stroke.subtle\",\n padding: \"medium\",\n clear: \"both\",\n overflow: \"hidden\",\n _open: {\n padding: \"medium\",\n \"& summary, [data-embed-type='expandable-box-summary']\": {\n marginBlockEnd: \"-xxsmall\",\n },\n },\n },\n },\n { baseComponent: true },\n);\n\nconst onBeforePrint = (_: Event) => {\n const detailsElements = document.querySelectorAll(\"details\");\n detailsElements.forEach((details) => {\n if (!details.hasAttribute(\"open\")) {\n details.setAttribute(\"data-print-open\", \"true\");\n details.setAttribute(\"open\", \"true\");\n }\n });\n};\n\nconst onAfterPrint = (_: Event) => {\n const detailsElements = document.querySelectorAll(\"details[data-print-open]\");\n detailsElements.forEach((details) => {\n details.removeAttribute(\"data-print-open\");\n details.removeAttribute(\"open\");\n });\n};\n\nexport const ExpandableBox = forwardRef<HTMLDetailsElement, ExpandableBoxProps>((props, ref) => {\n useEffect(() => {\n window.addEventListener(\"beforeprint\", onBeforePrint);\n window.addEventListener(\"afterprint\", onAfterPrint);\n return () => {\n window.removeEventListener(\"beforeprint\", onBeforePrint);\n window.removeEventListener(\"afterprint\", onAfterPrint);\n };\n }, []);\n return <StyledExpandableBox {...props} data-embed-type=\"expandable-box\" ref={ref} />;\n});\n\nexport interface ExpandableBoxSummaryProps extends HTMLArkProps<\"summary\">, StyledProps {}\n\nconst StyledExpandableBoxSummary = styled(\n ark.summary,\n {\n base: {\n cursor: \"pointer\",\n margin: \"-medium\",\n padding: \"medium\",\n textStyle: \"label.large!\",\n _hover: {\n color: \"text.action\",\n },\n \"& > *\": {\n display: \"inline!\",\n textStyle: \"label.large!\",\n },\n },\n },\n { baseComponent: true },\n);\n\nexport const ExpandableBoxSummary = forwardRef<HTMLElement, ExpandableBoxSummaryProps>((props, ref) => (\n <StyledExpandableBoxSummary {...props} data-embed-type=\"expandable-box-summary\" ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,sBAAsB,OAC1B,IAAI,SACJ,EACE,MAAM;CACJ,oBAAoB;CACpB,OAAO;CACP,UAAU;CACV,QAAQ;CACR,cAAc;CACd,aAAa;CACb,SAAS;CACT,OAAO;CACP,UAAU;CACV,OAAO;EACL,SAAS;EACT,yDAAyD,EACvD,gBAAgB,YACjB;EACF;CACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB;AAED,MAAM,iBAAiB,MAAa;AACV,UAAS,iBAAiB,UAAU,CAC5C,SAAS,YAAY;AACnC,MAAI,CAAC,QAAQ,aAAa,OAAO,EAAE;AACjC,WAAQ,aAAa,mBAAmB,OAAO;AAC/C,WAAQ,aAAa,QAAQ,OAAO;;GAEtC;;AAGJ,MAAM,gBAAgB,MAAa;AACT,UAAS,iBAAiB,2BAA2B,CAC7D,SAAS,YAAY;AACnC,UAAQ,gBAAgB,kBAAkB;AAC1C,UAAQ,gBAAgB,OAAO;GAC/B;;AAGJ,MAAa,gBAAgB,YAAoD,OAAO,QAAQ;AAC9F,iBAAgB;AACd,SAAO,iBAAiB,eAAe,cAAc;AACrD,SAAO,iBAAiB,cAAc,aAAa;AACnD,eAAa;AACX,UAAO,oBAAoB,eAAe,cAAc;AACxD,UAAO,oBAAoB,cAAc,aAAa;;IAEvD,EAAE,CAAC;AACN,QAAO,oBAAC,qBAAD;EAAqB,GAAI;EAAO,mBAAgB;EAAsB;EAAO,CAAA;EACpF;AAIF,MAAM,6BAA6B,OACjC,IAAI,SACJ,EACE,MAAM;CACJ,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,WAAW;CACX,QAAQ,EACN,OAAO,eACR;CACD,SAAS;EACP,SAAS;EACT,WAAW;EACZ;CACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB;AAED,MAAa,uBAAuB,YAAoD,OAAO,QAC7F,oBAAC,4BAAD;CAA4B,GAAI;CAAO,mBAAgB;CAA8B;CAAO,CAAA,CAC5F"}
1
+ {"version":3,"file":"ExpandableBox.mjs","names":[],"sources":["../src/ExpandableBox.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\";\nimport { forwardRef, useEffect } from \"react\";\n\nexport interface ExpandableBoxProps extends HTMLArkProps<\"details\">, StyledProps {}\n\nconst StyledExpandableBox = styled(\n ark.details,\n {\n base: {\n transitionDuration: \"fast\",\n width: \"100%\",\n position: \"relative\",\n border: \"1px solid\",\n borderRadius: \"xsmall\",\n borderColor: \"stroke.subtle\",\n padding: \"medium\",\n clear: \"both\",\n overflow: \"hidden\",\n _open: {\n padding: \"medium\",\n \"& summary, [data-embed-type='expandable-box-summary']\": {\n marginBlockEnd: \"-xxsmall\",\n },\n },\n },\n },\n { baseComponent: true },\n);\n\nconst onBeforePrint = (_: Event) => {\n const detailsElements = document.querySelectorAll(\"details\");\n detailsElements.forEach((details) => {\n if (!details.hasAttribute(\"open\")) {\n details.setAttribute(\"data-print-open\", \"true\");\n details.setAttribute(\"open\", \"true\");\n }\n });\n};\n\nconst onAfterPrint = (_: Event) => {\n const detailsElements = document.querySelectorAll(\"details[data-print-open]\");\n detailsElements.forEach((details) => {\n details.removeAttribute(\"data-print-open\");\n details.removeAttribute(\"open\");\n });\n};\n\nexport const ExpandableBox = forwardRef<HTMLDetailsElement, ExpandableBoxProps>((props, ref) => {\n useEffect(() => {\n window.addEventListener(\"beforeprint\", onBeforePrint);\n window.addEventListener(\"afterprint\", onAfterPrint);\n return () => {\n window.removeEventListener(\"beforeprint\", onBeforePrint);\n window.removeEventListener(\"afterprint\", onAfterPrint);\n };\n }, []);\n return <StyledExpandableBox {...props} data-embed-type=\"expandable-box\" ref={ref} />;\n});\n\nexport interface ExpandableBoxSummaryProps extends HTMLArkProps<\"summary\">, StyledProps {}\n\nconst StyledExpandableBoxSummary = styled(\n ark.summary,\n {\n base: {\n cursor: \"pointer\",\n margin: \"-medium\",\n padding: \"medium\",\n textStyle: \"label.large!\",\n _hover: {\n color: \"text.action\",\n },\n \"& > *\": {\n display: \"inline!\",\n textStyle: \"label.large!\",\n },\n },\n },\n { baseComponent: true },\n);\n\nexport const ExpandableBoxSummary = forwardRef<HTMLElement, ExpandableBoxSummaryProps>((props, ref) => (\n <StyledExpandableBoxSummary {...props} data-embed-type=\"expandable-box-summary\" ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,sBAAsB,OAC1B,IAAI,SACJ,EACE,MAAM;CACJ,oBAAoB;CACpB,OAAO;CACP,UAAU;CACV,QAAQ;CACR,cAAc;CACd,aAAa;CACb,SAAS;CACT,OAAO;CACP,UAAU;CACV,OAAO;EACL,SAAS;EACT,yDAAyD,EACvD,gBAAgB,YACjB;EACF;CACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB;AAED,MAAM,iBAAiB,MAAa;AACV,UAAS,iBAAiB,UACnC,CAAC,SAAS,YAAY;AACnC,MAAI,CAAC,QAAQ,aAAa,OAAO,EAAE;AACjC,WAAQ,aAAa,mBAAmB,OAAO;AAC/C,WAAQ,aAAa,QAAQ,OAAO;;GAEtC;;AAGJ,MAAM,gBAAgB,MAAa;AACT,UAAS,iBAAiB,2BACnC,CAAC,SAAS,YAAY;AACnC,UAAQ,gBAAgB,kBAAkB;AAC1C,UAAQ,gBAAgB,OAAO;GAC/B;;AAGJ,MAAa,gBAAgB,YAAoD,OAAO,QAAQ;AAC9F,iBAAgB;AACd,SAAO,iBAAiB,eAAe,cAAc;AACrD,SAAO,iBAAiB,cAAc,aAAa;AACnD,eAAa;AACX,UAAO,oBAAoB,eAAe,cAAc;AACxD,UAAO,oBAAoB,cAAc,aAAa;;IAEvD,EAAE,CAAC;AACN,QAAO,oBAAC,qBAAD;EAAqB,GAAI;EAAO,mBAAgB;EAAsB;EAAO,CAAA;EACpF;AAIF,MAAM,6BAA6B,OACjC,IAAI,SACJ,EACE,MAAM;CACJ,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,WAAW;CACX,QAAQ,EACN,OAAO,eACR;CACD,SAAS;EACP,SAAS;EACT,WAAW;EACZ;CACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB;AAED,MAAa,uBAAuB,YAAoD,OAAO,QAC7F,oBAAC,4BAAD;CAA4B,GAAI;CAAO,mBAAgB;CAA8B;CAAO,CAAA,CAC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.mjs","names":[],"sources":["../src/FileUpload.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 { FileUpload, fileUploadAnatomy } 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 { forwardRef, type RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps, Text } from \"./Text\";\n\nconst fileUploadRecipe = sva({\n slots: fileUploadAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: \"100%\",\n },\n dropzone: {\n display: \"flex\",\n gap: \"small\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"4xlarge\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n transitionProperty: \"border, border-color\",\n transitionTimingFunction: \"default\",\n transitionDuration: \"normal\",\n _hover: {\n borderStyle: \"dashed\",\n borderColor: \"stroke.hover\",\n _disabled: {\n borderStyle: \"solid\",\n borderColor: \"stroke.subtle\",\n },\n },\n },\n itemGroup: {\n paddingBlockStart: \"medium\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n item: {\n width: \"100%\",\n display: \"grid\",\n gridTemplateAreas: `\n \"preview name delete\" \n \"preview size delete\"`,\n gridTemplateColumns: \"auto 1fr auto\",\n gridColumnGap: \"small\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"xsmall\",\n padding: \"xsmall\",\n },\n itemPreview: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"xxlarge\",\n height: \"xxlarge\",\n gridArea: \"preview\",\n },\n itemName: {\n gridArea: \"name\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n itemSizeText: {\n gridArea: \"size\",\n },\n itemDeleteTrigger: {\n gridArea: \"delete\",\n alignSelf: \"center\",\n },\n itemPreviewImage: {\n borderRadius: \"xsmall\",\n objectFit: \"cover\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(fileUploadRecipe);\n\nexport type FileUploadVariantProps = NonNullable<RecipeVariantProps<typeof fileUploadRecipe>>;\n\nexport interface FileUploadRootProps extends FileUpload.RootProps, FileUploadVariantProps {}\n\nexport const FileUploadHiddenInput = FileUpload.HiddenInput;\nexport const FileUploadContext = FileUpload.Context;\n\nexport const FileUploadRoot = withProvider(FileUpload.Root, \"root\", { baseComponent: true });\n\nexport const FileUploadDropzone = withContext(FileUpload.Dropzone, \"dropzone\", { baseComponent: true });\n\nexport const FileUploadTrigger = withContext(FileUpload.Trigger, \"trigger\", { baseComponent: true });\n\nexport const FileUploadItemGroup = withContext(FileUpload.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport const FileUploadItemPreview = withContext(FileUpload.ItemPreview, \"itemPreview\", { baseComponent: true });\n\nexport const FileUploadItem = withContext(FileUpload.Item, \"item\", { baseComponent: true });\n\nexport const FileUploadItemDeleteTrigger = withContext(FileUpload.ItemDeleteTrigger, \"itemDeleteTrigger\", {\n baseComponent: true,\n});\n\nexport const FileUploadItemPreviewImage = withContext(FileUpload.ItemPreviewImage, \"itemPreviewImage\", {\n baseComponent: true,\n});\n\nconst InternalFileUploadItemName = withContext(FileUpload.ItemName, \"itemName\", { baseComponent: true });\n\ninterface FileUploadItemNameProps\n extends Omit<FileUpload.ItemNameProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const FileUploadItemName = forwardRef<HTMLDivElement, FileUploadItemNameProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }, ref) => (\n <Text textStyle={textStyle} fontWeight={fontWeight} asChild {...props} ref={ref}>\n {/* Do not use children here whatsoever. The component falls back to the file name only if no children are passed in. It should be up to the consumer if they want to pass in children. */}\n <InternalFileUploadItemName />\n </Text>\n ),\n);\n\nconst InternalFileUploadItemSizeText = withContext(FileUpload.ItemSizeText, \"itemSizeText\", { baseComponent: true });\n\ninterface FileUploadItemSizeTextProps\n extends Omit<FileUpload.ItemSizeTextProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const FileUploadItemSizeText = forwardRef<HTMLDivElement, FileUploadItemSizeTextProps>(\n ({ textStyle = \"label.small\", ...props }, ref) => (\n <Text textStyle={textStyle} ref={ref} asChild {...props}>\n <InternalFileUploadItemSizeText />\n </Text>\n ),\n);\n\nconst InternalFileUploadLabel = withContext(FileUpload.Label, \"label\");\n\ninterface FileUploadLabelProps\n extends Omit<FileUpload.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const FileUploadLabel = forwardRef<HTMLLabelElement, FileUploadLabelProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"light\", children, ...props }, ref) => (\n <InternalFileUploadLabel ref={ref} asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props}>\n {children}\n </Label>\n </InternalFileUploadLabel>\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;AA+FA,MAAM,EAAE,cAAc,gBAAgB,mBA/Eb,IAAI;CAC3B,OAAO,kBAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,WAAW;GACZ;EACD,UAAU;GACR,SAAS;GACT,KAAK;GACL,eAAe;GACf,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,cAAc;GACd,QAAQ;GACR,aAAa;GACb,oBAAoB;GACpB,0BAA0B;GAC1B,oBAAoB;GACpB,QAAQ;IACN,aAAa;IACb,aAAa;IACb,WAAW;KACT,aAAa;KACb,aAAa;KACd;IACF;GACF;EACD,WAAW;GACT,mBAAmB;GACnB,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,MAAM;GACJ,OAAO;GACP,SAAS;GACT,mBAAmB;;;GAGnB,qBAAqB;GACrB,eAAe;GACf,QAAQ;GACR,aAAa;GACb,cAAc;GACd,SAAS;GACV;EACD,aAAa;GACX,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,OAAO;GACP,QAA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AAe,GAAG,SAAS,QACxC,oBAAC,MAAD;CAAiB;CAAgB;CAAK,SAAA;CAAQ,GAAI;WAChD,oBAAC,gCAAD,EAAkC,CAAA;CAC7B,CAAA,CAEV;AAED,MAAM,0BAA0B,YAAY,WAAW,OAAO,QAAQ;AAKtE,MAAa,kBAAkB,YAC5B,EAAE,YAAY,gBAAgB,aAAa,SAAS,UAAU,GAAG,SAAS,QACzE,oBAAC,yBAAD;CAA8B;CAAK,SAAA;WACjC,oBAAC,OAAD;EAAkB;EAAuB;EAAY,GAAI;EACtD;EACK,CAAA;CACgB,CAAA,CAE7B"}
1
+ {"version":3,"file":"FileUpload.mjs","names":[],"sources":["../src/FileUpload.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 { FileUpload, fileUploadAnatomy } 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 { forwardRef, type RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps, Text } from \"./Text\";\n\nconst fileUploadRecipe = sva({\n slots: fileUploadAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: \"100%\",\n },\n dropzone: {\n display: \"flex\",\n gap: \"small\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"4xlarge\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n transitionProperty: \"border, border-color\",\n transitionTimingFunction: \"default\",\n transitionDuration: \"normal\",\n _hover: {\n borderStyle: \"dashed\",\n borderColor: \"stroke.hover\",\n _disabled: {\n borderStyle: \"solid\",\n borderColor: \"stroke.subtle\",\n },\n },\n },\n itemGroup: {\n paddingBlockStart: \"medium\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n item: {\n width: \"100%\",\n display: \"grid\",\n gridTemplateAreas: `\n \"preview name delete\" \n \"preview size delete\"`,\n gridTemplateColumns: \"auto 1fr auto\",\n gridColumnGap: \"small\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"xsmall\",\n padding: \"xsmall\",\n },\n itemPreview: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"xxlarge\",\n height: \"xxlarge\",\n gridArea: \"preview\",\n },\n itemName: {\n gridArea: \"name\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n itemSizeText: {\n gridArea: \"size\",\n },\n itemDeleteTrigger: {\n gridArea: \"delete\",\n alignSelf: \"center\",\n },\n itemPreviewImage: {\n borderRadius: \"xsmall\",\n objectFit: \"cover\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(fileUploadRecipe);\n\nexport type FileUploadVariantProps = NonNullable<RecipeVariantProps<typeof fileUploadRecipe>>;\n\nexport interface FileUploadRootProps extends FileUpload.RootProps, FileUploadVariantProps {}\n\nexport const FileUploadHiddenInput = FileUpload.HiddenInput;\nexport const FileUploadContext = FileUpload.Context;\n\nexport const FileUploadRoot = withProvider(FileUpload.Root, \"root\", { baseComponent: true });\n\nexport const FileUploadDropzone = withContext(FileUpload.Dropzone, \"dropzone\", { baseComponent: true });\n\nexport const FileUploadTrigger = withContext(FileUpload.Trigger, \"trigger\", { baseComponent: true });\n\nexport const FileUploadItemGroup = withContext(FileUpload.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport const FileUploadItemPreview = withContext(FileUpload.ItemPreview, \"itemPreview\", { baseComponent: true });\n\nexport const FileUploadItem = withContext(FileUpload.Item, \"item\", { baseComponent: true });\n\nexport const FileUploadItemDeleteTrigger = withContext(FileUpload.ItemDeleteTrigger, \"itemDeleteTrigger\", {\n baseComponent: true,\n});\n\nexport const FileUploadItemPreviewImage = withContext(FileUpload.ItemPreviewImage, \"itemPreviewImage\", {\n baseComponent: true,\n});\n\nconst InternalFileUploadItemName = withContext(FileUpload.ItemName, \"itemName\", { baseComponent: true });\n\ninterface FileUploadItemNameProps\n extends Omit<FileUpload.ItemNameProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const FileUploadItemName = forwardRef<HTMLDivElement, FileUploadItemNameProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }, ref) => (\n <Text textStyle={textStyle} fontWeight={fontWeight} asChild {...props} ref={ref}>\n {/* Do not use children here whatsoever. The component falls back to the file name only if no children are passed in. It should be up to the consumer if they want to pass in children. */}\n <InternalFileUploadItemName />\n </Text>\n ),\n);\n\nconst InternalFileUploadItemSizeText = withContext(FileUpload.ItemSizeText, \"itemSizeText\", { baseComponent: true });\n\ninterface FileUploadItemSizeTextProps\n extends Omit<FileUpload.ItemSizeTextProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLParagraphElement> {}\n\nexport const FileUploadItemSizeText = forwardRef<HTMLDivElement, FileUploadItemSizeTextProps>(\n ({ textStyle = \"label.small\", ...props }, ref) => (\n <Text textStyle={textStyle} ref={ref} asChild {...props}>\n <InternalFileUploadItemSizeText />\n </Text>\n ),\n);\n\nconst InternalFileUploadLabel = withContext(FileUpload.Label, \"label\");\n\ninterface FileUploadLabelProps\n extends Omit<FileUpload.LabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLLabelElement> {}\n\nexport const FileUploadLabel = forwardRef<HTMLLabelElement, FileUploadLabelProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"light\", children, ...props }, ref) => (\n <InternalFileUploadLabel ref={ref} asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props}>\n {children}\n </Label>\n </InternalFileUploadLabel>\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;AA+FA,MAAM,EAAE,cAAc,gBAAgB,mBA/Eb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AC;AAEhH,MAAa,iBAAiB,YAAY,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,8BAA8B,YAAY,WAAW,mBAAmB,qBAAqB,EACxG,eAAe,MAChB,CAAC;AAEF,MAAa,6BAA6B,YAAY,WAAW,kBAAkB,oBAAoB,EACrG,eAAe,MAChB,CAAC;AAEF,MAAM,6BAA6B,YAAY,WAAW,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAKxG,MAAa,qBAAqB,YAC/B,EAAE,YAAY,gBAAgB,aAAa,QAAQ,GAAG,SAAS,QAC9D,oBAAC,MAAD;CAAiB;CAAuB;CAAY,SAAA;CAAQ,GAAI;CAAY;WAE1E,oBAAC,4BAAD,EAA8B,CAAA;CACzB,CAAA,CAEV;AAED,MAAM,iCAAiC,YAAY,WAAW,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAKpH,MAAa,yBAAyB,YACnC,EAAE,YAAY,eAAe,GAAG,SAAS,QACxC,oBAAC,MAAD;CAAiB;CAAgB;CAAK,SAAA;CAAQ,GAAI;WAChD,oBAAC,gCAAD,EAAkC,CAAA;CAC7B,CAAA,CAEV;AAED,MAAM,0BAA0B,YAAY,WAAW,OAAO,QAAQ;AAKtE,MAAa,kBAAkB,YAC5B,EAAE,YAAY,gBAAgB,aAAa,SAAS,UAAU,GAAG,SAAS,QACzE,oBAAC,yBAAD;CAA8B;CAAK,SAAA;WACjC,oBAAC,OAAD;EAAkB;EAAuB;EAAY,GAAI;EACtD;EACK,CAAA;CACgB,CAAA,CAE7B"}
package/es/Hero.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.mjs","names":[],"sources":["../src/Hero.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, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst heroRecipe = sva({\n slots: [\"root\", \"background\", \"content\"],\n base: {\n root: {\n width: \"100%\",\n position: \"relative\",\n },\n background: {\n height: \"350px\",\n width: \"100%\",\n zIndex: \"hide\",\n overflow: \"hidden\",\n clipPath: \"polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 100%)\",\n _print: {\n background: \"none\",\n },\n },\n content: {\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"flex-end\",\n paddingBlock: \"xsmall\",\n tablet: {\n paddingBlockStart: \"xxlarge\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n absolute: true,\n },\n variants: {\n absolute: {\n true: {\n background: {\n position: \"absolute\",\n },\n },\n },\n variant: {\n primary: {\n background: {\n background: \"primary\",\n },\n content: {\n \"@media not print\": {\n color: \"text.onAction\",\n },\n },\n },\n brand2Bold: {\n background: {\n background: \"surface.brand.2.bold\",\n },\n content: {\n \"@media not print\": {\n color: \"text.onAction\",\n },\n },\n },\n brand2: {\n background: {\n background: \"surface.brand.2\",\n },\n },\n brand2Moderate: {\n background: {\n background: \"surface.brand.2.moderate\",\n },\n },\n brand1: {\n background: {\n background: \"surface.brand.1\",\n },\n },\n brand1Subtle: {\n background: {\n background: \"surface.brand.1.subtle\",\n },\n },\n brand1Moderate: {\n background: {\n background: \"surface.brand.1.moderate\",\n },\n },\n brand3Moderate: {\n background: {\n background: \"surface.brand.3.moderate\",\n },\n },\n brand4Moderate: {\n background: {\n background: \"surface.brand.4.moderate\",\n },\n },\n brand5Moderate: {\n background: {\n background: \"surface.brand.5.moderate\",\n },\n },\n neutral: {\n background: {\n background: \"surface.infoSubtle\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(heroRecipe);\n\nexport type HeroVariantProps = NonNullable<RecipeVariantProps<typeof heroRecipe>>;\n\nexport type HeroVariant = NonNullable<HeroVariantProps>[\"variant\"];\n\nexport interface HeroProps extends HTMLArkProps<\"div\">, StyledProps, HeroVariantProps {}\n\nexport const Hero = withProvider(ark.div, \"root\", { baseComponent: true });\n\nexport interface HeroBackgroundProps extends HTMLArkProps<\"div\">, StyledProps {}\n\nexport const HeroBackground = withContext(ark.div, \"background\", { baseComponent: true });\n\nexport interface HeroContentProps extends HTMLArkProps<\"div\">, StyledProps {}\n\nexport const HeroContent = withContext(ark.div, \"content\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AA0HA,MAAM,EAAE,cAAc,gBAAgB,mBA7GnB,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAc;EAAU;CACxC,MAAM;EACJ,MAAM;GACJ,OAAO;GACP,UAAU;GACX;EACD,YAAY;GACV,QAAQ;GACR,OAAO;GACP,QAAQ;GACR,UAAU;GACV,UAAU;GACV,QAAQ,EACN,YAAY,QACb;GACF;EACD,SAAS;GACP,SAAS;GACT,UAAU;GACV,YAAY;GACZ,cAAc;GACd,QAAQ,EACN,mBAAmB,WACpB;GACF;EACF;CACD,iBAAiB;EACf,SAAS;EACT,UAAU;EACX;CACD,UAAU;EACR,UAAU,EACR,MAAM,EACJ,YAAY,EACV,UAAU,YACX,EACF,EACF;EACD,SAAS;GACP,SAAS;IACP,YAAY,EACV,YAAY,WACb;IACD,SAAS,EACP,oBAAoB,EAClB,OAAO,iBACR,EACF;IACF;GACD,YAAY;IACV,YAAY,EACV,YAAY,wBACb;IACD,SAAS,EACP,oBAAoB,EAClB,OAAO,iBACR,EACF;IACF;GACD,QAAQ,EACN,YAAY,EACV,YAAY,mBACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,QAAQ,EACN,YAAY,EACV,YAAY,mBACb,EACF;GACD,cAAc,EACZ,YAAY,EACV,YAAY,0BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,SAAS,EACP,YAAY,EACV,YAAY,sBACb,EACF;GACF;EACF;CACF,CAAC,CAEkE;AAQpE,MAAa,OAAO,aAAa,IAAI,KAAK,QAAQ,EAAE,eAAe,MAAM,CAAC;AAI1E,MAAa,iBAAiB,YAAY,IAAI,KAAK,cAAc,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,cAAc,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Hero.mjs","names":[],"sources":["../src/Hero.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, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst heroRecipe = sva({\n slots: [\"root\", \"background\", \"content\"],\n base: {\n root: {\n width: \"100%\",\n position: \"relative\",\n },\n background: {\n height: \"350px\",\n width: \"100%\",\n zIndex: \"hide\",\n overflow: \"hidden\",\n clipPath: \"polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 100%)\",\n _print: {\n background: \"none\",\n },\n },\n content: {\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"flex-end\",\n paddingBlock: \"xsmall\",\n tablet: {\n paddingBlockStart: \"xxlarge\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n absolute: true,\n },\n variants: {\n absolute: {\n true: {\n background: {\n position: \"absolute\",\n },\n },\n },\n variant: {\n primary: {\n background: {\n background: \"primary\",\n },\n content: {\n \"@media not print\": {\n color: \"text.onAction\",\n },\n },\n },\n brand2Bold: {\n background: {\n background: \"surface.brand.2.bold\",\n },\n content: {\n \"@media not print\": {\n color: \"text.onAction\",\n },\n },\n },\n brand2: {\n background: {\n background: \"surface.brand.2\",\n },\n },\n brand2Moderate: {\n background: {\n background: \"surface.brand.2.moderate\",\n },\n },\n brand1: {\n background: {\n background: \"surface.brand.1\",\n },\n },\n brand1Subtle: {\n background: {\n background: \"surface.brand.1.subtle\",\n },\n },\n brand1Moderate: {\n background: {\n background: \"surface.brand.1.moderate\",\n },\n },\n brand3Moderate: {\n background: {\n background: \"surface.brand.3.moderate\",\n },\n },\n brand4Moderate: {\n background: {\n background: \"surface.brand.4.moderate\",\n },\n },\n brand5Moderate: {\n background: {\n background: \"surface.brand.5.moderate\",\n },\n },\n neutral: {\n background: {\n background: \"surface.infoSubtle\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(heroRecipe);\n\nexport type HeroVariantProps = NonNullable<RecipeVariantProps<typeof heroRecipe>>;\n\nexport type HeroVariant = NonNullable<HeroVariantProps>[\"variant\"];\n\nexport interface HeroProps extends HTMLArkProps<\"div\">, StyledProps, HeroVariantProps {}\n\nexport const Hero = withProvider(ark.div, \"root\", { baseComponent: true });\n\nexport interface HeroBackgroundProps extends HTMLArkProps<\"div\">, StyledProps {}\n\nexport const HeroBackground = withContext(ark.div, \"background\", { baseComponent: true });\n\nexport interface HeroContentProps extends HTMLArkProps<\"div\">, StyledProps {}\n\nexport const HeroContent = withContext(ark.div, \"content\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AA0HA,MAAM,EAAE,cAAc,gBAAgB,mBA7GnB,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAc;EAAU;CACxC,MAAM;EACJ,MAAM;GACJ,OAAO;GACP,UAAU;GACX;EACD,YAAY;GACV,QAAQ;GACR,OAAO;GACP,QAAQ;GACR,UAAU;GACV,UAAU;GACV,QAAQ,EACN,YAAY,QACb;GACF;EACD,SAAS;GACP,SAAS;GACT,UAAU;GACV,YAAY;GACZ,cAAc;GACd,QAAQ,EACN,mBAAmB,WACpB;GACF;EACF;CACD,iBAAiB;EACf,SAAS;EACT,UAAU;EACX;CACD,UAAU;EACR,UAAU,EACR,MAAM,EACJ,YAAY,EACV,UAAU,YACX,EACF,EACF;EACD,SAAS;GACP,SAAS;IACP,YAAY,EACV,YAAY,WACb;IACD,SAAS,EACP,oBAAoB,EAClB,OAAO,iBACR,EACF;IACF;GACD,YAAY;IACV,YAAY,EACV,YAAY,wBACb;IACD,SAAS,EACP,oBAAoB,EAClB,OAAO,iBACR,EACF;IACF;GACD,QAAQ,EACN,YAAY,EACV,YAAY,mBACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,QAAQ,EACN,YAAY,EACV,YAAY,mBACb,EACF;GACD,cAAc,EACZ,YAAY,EACV,YAAY,0BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,gBAAgB,EACd,YAAY,EACV,YAAY,4BACb,EACF;GACD,SAAS,EACP,YAAY,EACV,YAAY,sBACb,EACF;GACF;EACF;CACF,CAEkE,CAAC;AAQpE,MAAa,OAAO,aAAa,IAAI,KAAK,QAAQ,EAAE,eAAe,MAAM,CAAC;AAI1E,MAAa,iBAAiB,YAAY,IAAI,KAAK,cAAc,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,cAAc,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC"}
@@ -18,6 +18,11 @@ const pageRecipe = cva({
18
18
  transitionDuration: "default",
19
19
  transitionTimingFunction: "default",
20
20
  alignContent: "start",
21
+ /**
22
+ * var(--size) is the max width of the content
23
+ * calc(100% - (var(--gutter, 0) * 2)) is the max width of the page, minus the gutters (inline padding without being actual padding).
24
+ * In effect, this will center the content on the page, and constrain it to either the content width or the page width, whichever is smaller.
25
+ */
21
26
  gridColumnGap: "var(--gutter, 0)",
22
27
  gridTemplateColumns: "1fr min(var(--size), calc(100% - (var(--gutter, 0) * 2))) 1fr",
23
28
  "& > *": {
@@ -1 +1 @@
1
- {"version":3,"file":"PageContent.mjs","names":[],"sources":["../../src/Layout/PageContent.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, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nconst pageRecipe = cva({\n base: {\n display: \"grid\",\n transitionProperty: \"all\",\n transitionDuration: \"default\",\n transitionTimingFunction: \"default\",\n alignContent: \"start\",\n /**\n * var(--size) is the max width of the content\n * calc(100% - (var(--gutter, 0) * 2)) is the max width of the page, minus the gutters (inline padding without being actual padding).\n * In effect, this will center the content on the page, and constrain it to either the content width or the page width, whichever is smaller.\n */\n gridColumnGap: \"var(--gutter, 0)\",\n gridTemplateColumns: \"1fr min(var(--size), calc(100% - (var(--gutter, 0) * 2))) 1fr\",\n \"& > *\": {\n gridColumnStart: \"2\",\n gridColumnEnd: \"2\",\n },\n },\n defaultVariants: {\n variant: \"page\",\n gutters: \"always\",\n },\n variants: {\n variant: {\n content: {\n \"--size\": \"sizes.surface.contentMax\",\n },\n article: {\n \"--size\": \"sizes.surface.articleMax\",\n },\n page: {\n \"--size\": \"sizes.surface.pageMax\",\n },\n wide: {\n \"--size\": \"sizes.surface.wideMax\",\n },\n },\n gutters: {\n never: {\n \"--gutter\": \"0px\",\n },\n mobileUp: {\n \"--gutter\": \"0px\",\n mobileWide: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n tabletUp: {\n \"--gutter\": \"0px\",\n tablet: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n always: {\n \"--gutter\": \"spacing.small\",\n tablet: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n },\n },\n});\n\nconst StyledPageContent = styled(ark.div, {}, { baseComponent: true });\n\nexport type PageContentVariantProps = NonNullable<RecipeVariantProps<typeof pageRecipe>>;\n\nexport interface PageContentProps extends HTMLArkProps<\"div\">, StyledProps, PageContentVariantProps {}\n\nexport const PageContent = forwardRef<HTMLDivElement, PageContentProps>(\n ({ variant, gutters, css: cssProp, ...props }, ref) => (\n <StyledPageContent css={css.raw(pageRecipe.raw({ variant, gutters }), cssProp)} ref={ref} {...props} />\n ),\n);\n\nexport const BleedPageContent = styled(\n ark.div,\n {\n base: {\n \"& \": {\n width: \"100%\",\n gridColumnStart: \"1\",\n gridColumnEnd: \"-1\",\n },\n },\n },\n { baseComponent: true },\n);\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,aAAa,IAAI;CACrB,MAAM;EACJ,SAAS;EACT,oBAAoB;EACpB,oBAAoB;EACpB,0BAA0B;EAC1B,cAAc;EAMd,eAAe;EACf,qBAAqB;EACrB,SAAS;GACP,iBAAiB;GACjB,eAAe;GAChB;EACF;CACD,iBAAiB;EACf,SAAS;EACT,SAAS;EACV;CACD,UAAU;EACR,SAAS;GACP,SAAS,EACP,UAAU,4BACX;GACD,SAAS,EACP,UAAU,4BACX;GACD,MAAM,EACJ,UAAU,yBACX;GACD,MAAM,EACJ,UAAU,yBACX;GACF;EACD,SAAS;GACP,OAAO,EACL,YAAY,OACb;GACD,UAAU;IACR,YAAY;IACZ,YAAY,EACV,YAAY,kBACb;IACF;GACD,UAAU;IACR,YAAY;IACZ,QAAQ,EACN,YAAY,kBACb;IACF;GACD,QAAQ;IACN,YAAY;IACZ,QAAQ,EACN,YAAY,kBACb;IACF;GACF;EACF;CACF,CAAC;AAEF,MAAM,oBAAoB,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAMtE,MAAa,cAAc,YACxB,EAAE,SAAS,SAAS,KAAK,SAAS,GAAG,SAAS,QAC7C,oBAAC,mBAAD;CAAmB,KAAK,IAAI,IAAI,WAAW,IAAI;EAAE;EAAS;EAAS,CAAC,EAAE,QAAQ;CAAO;CAAK,GAAI;CAAS,CAAA,CAE1G;AAED,MAAa,mBAAmB,OAC9B,IAAI,KACJ,EACE,MAAM,EACJ,MAAM;CACJ,OAAO;CACP,iBAAiB;CACjB,eAAe;CAChB,EACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB"}
1
+ {"version":3,"file":"PageContent.mjs","names":[],"sources":["../../src/Layout/PageContent.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, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\n\nconst pageRecipe = cva({\n base: {\n display: \"grid\",\n transitionProperty: \"all\",\n transitionDuration: \"default\",\n transitionTimingFunction: \"default\",\n alignContent: \"start\",\n /**\n * var(--size) is the max width of the content\n * calc(100% - (var(--gutter, 0) * 2)) is the max width of the page, minus the gutters (inline padding without being actual padding).\n * In effect, this will center the content on the page, and constrain it to either the content width or the page width, whichever is smaller.\n */\n gridColumnGap: \"var(--gutter, 0)\",\n gridTemplateColumns: \"1fr min(var(--size), calc(100% - (var(--gutter, 0) * 2))) 1fr\",\n \"& > *\": {\n gridColumnStart: \"2\",\n gridColumnEnd: \"2\",\n },\n },\n defaultVariants: {\n variant: \"page\",\n gutters: \"always\",\n },\n variants: {\n variant: {\n content: {\n \"--size\": \"sizes.surface.contentMax\",\n },\n article: {\n \"--size\": \"sizes.surface.articleMax\",\n },\n page: {\n \"--size\": \"sizes.surface.pageMax\",\n },\n wide: {\n \"--size\": \"sizes.surface.wideMax\",\n },\n },\n gutters: {\n never: {\n \"--gutter\": \"0px\",\n },\n mobileUp: {\n \"--gutter\": \"0px\",\n mobileWide: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n tabletUp: {\n \"--gutter\": \"0px\",\n tablet: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n always: {\n \"--gutter\": \"spacing.small\",\n tablet: {\n \"--gutter\": \"spacing.medium\",\n },\n },\n },\n },\n});\n\nconst StyledPageContent = styled(ark.div, {}, { baseComponent: true });\n\nexport type PageContentVariantProps = NonNullable<RecipeVariantProps<typeof pageRecipe>>;\n\nexport interface PageContentProps extends HTMLArkProps<\"div\">, StyledProps, PageContentVariantProps {}\n\nexport const PageContent = forwardRef<HTMLDivElement, PageContentProps>(\n ({ variant, gutters, css: cssProp, ...props }, ref) => (\n <StyledPageContent css={css.raw(pageRecipe.raw({ variant, gutters }), cssProp)} ref={ref} {...props} />\n ),\n);\n\nexport const BleedPageContent = styled(\n ark.div,\n {\n base: {\n \"& \": {\n width: \"100%\",\n gridColumnStart: \"1\",\n gridColumnEnd: \"-1\",\n },\n },\n },\n { baseComponent: true },\n);\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,aAAa,IAAI;CACrB,MAAM;EACJ,SAAS;EACT,oBAAoB;EACpB,oBAAoB;EACpB,0BAA0B;EAC1B,cAAc;;;;;;EAMd,eAAe;EACf,qBAAqB;EACrB,SAAS;GACP,iBAAiB;GACjB,eAAe;GAChB;EACF;CACD,iBAAiB;EACf,SAAS;EACT,SAAS;EACV;CACD,UAAU;EACR,SAAS;GACP,SAAS,EACP,UAAU,4BACX;GACD,SAAS,EACP,UAAU,4BACX;GACD,MAAM,EACJ,UAAU,yBACX;GACD,MAAM,EACJ,UAAU,yBACX;GACF;EACD,SAAS;GACP,OAAO,EACL,YAAY,OACb;GACD,UAAU;IACR,YAAY;IACZ,YAAY,EACV,YAAY,kBACb;IACF;GACD,UAAU;IACR,YAAY;IACZ,QAAQ,EACN,YAAY,kBACb;IACF;GACD,QAAQ;IACN,YAAY;IACZ,QAAQ,EACN,YAAY,kBACb;IACF;GACF;EACF;CACF,CAAC;AAEF,MAAM,oBAAoB,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAMtE,MAAa,cAAc,YACxB,EAAE,SAAS,SAAS,KAAK,SAAS,GAAG,SAAS,QAC7C,oBAAC,mBAAD;CAAmB,KAAK,IAAI,IAAI,WAAW,IAAI;EAAE;EAAS;EAAS,CAAC,EAAE,QAAQ;CAAO;CAAK,GAAI;CAAS,CAAA,CAE1G;AAED,MAAa,mBAAmB,OAC9B,IAAI,KACJ,EACE,MAAM,EACJ,MAAM;CACJ,OAAO;CACP,iBAAiB;CACjB,eAAe;CAChB,EACF,EACF,EACD,EAAE,eAAe,MAAM,CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.mjs","names":[],"sources":["../../src/ListItem/ListItem.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 { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\nimport { Image, type ImageProps } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nexport const listItemRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n minHeight: \"3xlarge\",\n borderStyle: \"solid\",\n borderWidth: \"1px\",\n borderColor: \"stroke.subtle\",\n backgroundColor: \"background.default\",\n color: \"text.default\",\n position: \"relative\",\n display: \"flex\",\n gap: \"small\",\n alignItems: \"center\",\n paddingBlock: \"xsmall\",\n paddingInline: \"xxsmall\",\n transitionProperty: \"background-color, border-color, color\",\n transitionDuration: \"superFast\",\n transitionTimingFunction: \"ease-in-out\",\n boxShadow: \"xsmall\",\n },\n content: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: \"xsmall\",\n width: \"100%\",\n },\n image: {\n minHeight: \"50px\",\n maxHeight: \"50px\",\n minWidth: \"70px\",\n maxWidth: \"70px\",\n objectFit: \"cover\",\n },\n },\n defaultVariants: {\n nonInteractive: false,\n },\n variants: {\n nonInteractive: {\n false: {\n root: {\n _highlighted: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.hover\",\n },\n _hover: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.hover\",\n },\n _active: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.active\",\n },\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(listItemRecipe);\n\nexport type ListItemVariantProps = NonNullable<RecipeVariantProps<typeof listItemRecipe>>;\n\nexport interface ListItemProps extends HTMLArkProps<\"div\">, StyledProps, ListItemVariantProps {}\n\nexport const ListItemRoot = withProvider(ark.div, \"root\", { baseComponent: true });\n\ninterface ListItemHeadingProps extends Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalListItemHeading = forwardRef<HTMLHeadingElement, ListItemHeadingProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const ListItemHeading = withContext(InternalListItemHeading, \"title\");\n\nexport const ListItemContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nconst InternalListItemImage = withContext(Image, \"image\");\n\nexport const ListItemImage = forwardRef<HTMLImageElement, ImageProps>(({ variant = \"rounded\", ...props }, ref) => (\n <InternalListItemImage variant={variant} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAmFA,MAAM,EAAE,cAAc,gBAAgB,mBAnER,IAAI;CAChC,OAAO;EAAC;EAAQ;EAAS;EAAW;EAAQ;CAC5C,MAAM;EACJ,MAAM;GACJ,WAAW;GACX,aAAa;GACb,aAAa;GACb,aAAa;GACb,iBAAiB;GACjB,OAAO;GACP,UAAU;GACV,SAAS;GACT,KAAK;GACL,YAAY;GACZ,cAAc;GACd,eAAe;GACf,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,WAAW;GACZ;EACD,SAAS;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GACL,OAAO;GACR;EACD,OAAO;GACL,WAAW;GACX,WAAW;GACX,UAAU;GACV,UAAU;GACV,WAAW;GACZ;EACF;CACD,iBAAiB,EACf,gBAAgB,OACjB;CACD,UAAU,EACR,gBAAgB,EACd,OAAO;EACL,MAAM;GACJ,cAAc;IACZ,aAAa;IACb,iBAAiB;IAClB;GACD,QAAQ;IACN,aAAa;IACb,iBAAiB;IAClB;GACD,SAAS;IACP,aAAa;IACb,iBAAiB;IAClB;GACF;EACD,OAAO;GACL,gBAAgB;GAChB,QAAQ,EACN,gBAAgB,QACjB;GACF;EACF,EACF,EACF;CACF,CAAC,CAEsE;AAMxE,MAAa,eAAe,aAAa,IAAI,KAAK,QAAQ,EAAE,eAAe,MAAM,CAAC;AAUlF,MAAa,kBAAkB,YANC,YAC7B,EAAE,YAAY,gBAAgB,aAAa,QAAQ,GAAG,SAAS,QAC9D,oBAAC,SAAD;CAAoB;CAAuB;CAAY,GAAI;CAAY;CAAO,CAAA,CAEjF,EAEmE,QAAQ;AAE5E,MAAa,kBAAkB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAEvF,MAAM,wBAAwB,YAAY,OAAO,QAAQ;AAEzD,MAAa,gBAAgB,YAA0C,EAAE,UAAU,WAAW,GAAG,SAAS,QACxG,oBAAC,uBAAD;CAAgC;CAAS,GAAI;CAAY;CAAO,CAAA,CAChE"}
1
+ {"version":3,"file":"ListItem.mjs","names":[],"sources":["../../src/ListItem/ListItem.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 { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { forwardRef } from \"react\";\nimport { Image, type ImageProps } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nexport const listItemRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n minHeight: \"3xlarge\",\n borderStyle: \"solid\",\n borderWidth: \"1px\",\n borderColor: \"stroke.subtle\",\n backgroundColor: \"background.default\",\n color: \"text.default\",\n position: \"relative\",\n display: \"flex\",\n gap: \"small\",\n alignItems: \"center\",\n paddingBlock: \"xsmall\",\n paddingInline: \"xxsmall\",\n transitionProperty: \"background-color, border-color, color\",\n transitionDuration: \"superFast\",\n transitionTimingFunction: \"ease-in-out\",\n boxShadow: \"xsmall\",\n },\n content: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: \"xsmall\",\n width: \"100%\",\n },\n image: {\n minHeight: \"50px\",\n maxHeight: \"50px\",\n minWidth: \"70px\",\n maxWidth: \"70px\",\n objectFit: \"cover\",\n },\n },\n defaultVariants: {\n nonInteractive: false,\n },\n variants: {\n nonInteractive: {\n false: {\n root: {\n _highlighted: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.hover\",\n },\n _hover: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.hover\",\n },\n _active: {\n borderColor: \"stroke.hover\",\n backgroundColor: \"surface.active\",\n },\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(listItemRecipe);\n\nexport type ListItemVariantProps = NonNullable<RecipeVariantProps<typeof listItemRecipe>>;\n\nexport interface ListItemProps extends HTMLArkProps<\"div\">, StyledProps, ListItemVariantProps {}\n\nexport const ListItemRoot = withProvider(ark.div, \"root\", { baseComponent: true });\n\ninterface ListItemHeadingProps extends Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalListItemHeading = forwardRef<HTMLHeadingElement, ListItemHeadingProps>(\n ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const ListItemHeading = withContext(InternalListItemHeading, \"title\");\n\nexport const ListItemContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nconst InternalListItemImage = withContext(Image, \"image\");\n\nexport const ListItemImage = forwardRef<HTMLImageElement, ImageProps>(({ variant = \"rounded\", ...props }, ref) => (\n <InternalListItemImage variant={variant} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAmFA,MAAM,EAAE,cAAc,gBAAgB,mBAnER,IAAI;CAChC,OAAO;EAAC;EAAQ;EAAS;EAAW;EAAQ;CAC5C,MAAM;EACJ,MAAM;GACJ,WAAW;GACX,aAAa;GACb,aAAa;GACb,aAAa;GACb,iBAAiB;GACjB,OAAO;GACP,UAAU;GACV,SAAS;GACT,KAAK;GACL,YAAY;GACZ,cAAc;GACd,eAAe;GACf,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,WAAW;GACZ;EACD,SAAS;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GACL,OAAO;GACR;EACD,OAAO;GACL,WAAW;GACX,WAAW;GACX,UAAU;GACV,UAAU;GACV,WAAW;GACZ;EACF;CACD,iBAAiB,EACf,gBAAgB,OACjB;CACD,UAAU,EACR,gBAAgB,EACd,OAAO;EACL,MAAM;GACJ,cAAc;IACZ,aAAa;IACb,iBAAiB;IAClB;GACD,QAAQ;IACN,aAAa;IACb,iBAAiB;IAClB;GACD,SAAS;IACP,aAAa;IACb,iBAAiB;IAClB;GACF;EACD,OAAO;GACL,gBAAgB;GAChB,QAAQ,EACN,gBAAgB,QACjB;GACF;EACF,EACF,EACF;CACF,CAEwD,CAAe;AAMxE,MAAa,eAAe,aAAa,IAAI,KAAK,QAAQ,EAAE,eAAe,MAAM,CAAC;AAUlF,MAAa,kBAAkB,YANC,YAC7B,EAAE,YAAY,gBAAgB,aAAa,QAAQ,GAAG,SAAS,QAC9D,oBAAC,SAAD;CAAoB;CAAuB;CAAY,GAAI;CAAY;CAAO,CAAA,CAIvC,EAAyB,QAAQ;AAE5E,MAAa,kBAAkB,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAEvF,MAAM,wBAAwB,YAAY,OAAO,QAAQ;AAEzD,MAAa,gBAAgB,YAA0C,EAAE,UAAU,WAAW,GAAG,SAAS,QACxG,oBAAC,uBAAD;CAAgC;CAAS,GAAI;CAAY;CAAO,CAAA,CAChE"}
package/es/Menu.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.mjs","names":[],"sources":["../src/Menu.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 { Menu, menuAnatomy } from \"@ark-ui/react\";\nimport { css, cva, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps, SystemStyleObject } from \"@ndla/styled-system/types\";\nimport { forwardRef, type RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst itemStyle: SystemStyleObject = css.raw({\n display: \"flex\",\n alignItems: \"center\",\n borderRadius: \"xsmall\",\n cursor: \"pointer\",\n textStyle: \"label.medium\",\n paddingBlock: \"4xsmall\",\n paddingInline: \"xsmall\",\n gap: \"xsmall\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n outline: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n _highlighted: {\n textDecoration: \"underline\",\n },\n _disabled: {\n color: \"text.disabled\",\n cursor: \"not-allowed\",\n \"& svg\": {\n color: \"stroke.disabled\",\n },\n _hover: {\n color: \"text.disabled\",\n textDecoration: \"none\",\n background: \"surface.default\",\n \"& svg\": {\n color: \"stroke.disabled\",\n },\n },\n },\n});\n\nconst itemCva = cva({\n defaultVariants: {\n variant: \"action\",\n },\n variants: {\n variant: {\n action: {\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n _active: {\n background: \"surface.active\",\n },\n },\n destructive: {\n color: \"text.error\",\n \"& svg\": {\n color: \"icon.error\",\n },\n _hover: {\n color: \"text.default\",\n \"& svg\": {\n color: \"icon.default\",\n },\n background: \"surface.dangerSubtle.hover\",\n },\n _highlighted: {\n color: \"text.default\",\n \"& svg\": {\n color: \"icon.default\",\n },\n background: \"surface.dangerSubtle.hover\",\n },\n _active: {\n background: \"surface.dangerSubtle.active\",\n },\n },\n },\n },\n});\n\nconst menuRecipe = sva({\n slots: menuAnatomy.keys(),\n base: {\n item: itemStyle,\n triggerItem: itemStyle,\n content: {\n color: \"text.default\",\n display: \"flex\",\n flexDirection: \"column\",\n width: \"fit-content\",\n minWidth: \"surface.xxsmall\",\n padding: \"3xsmall\",\n gap: \"3xsmall\",\n background: \"surface.default\",\n boxShadow: \"small\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n zIndex: \"dropdown\",\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 itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n positioner: {\n zIndex: \"dropdown\",\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(menuRecipe);\n\nexport type MenuRootProps = Menu.RootProps;\n\nconst InternalMenuRoot = withRootProvider(Menu.Root);\n\nexport const MenuRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: MenuRootProps) => (\n <InternalMenuRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const MenuContentStandalone = withContext(Menu.Content, \"content\", { baseComponent: true });\n\ninterface MenuContentProps extends Menu.ContentProps, StyledProps {}\n\nexport const MenuContent = forwardRef<HTMLDivElement, MenuContentProps>((props, ref) => (\n <MenuPositioner>\n <MenuContentStandalone ref={ref} {...props} />\n </MenuPositioner>\n));\n\nconst InternalMenuItemGroupLabel = withContext(Menu.ItemGroupLabel, \"itemGroupLabel\");\n\ninterface MenuItemGroupLabelProps\n extends Omit<Menu.ItemGroupLabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLDivElement> {}\n\nexport const MenuItemGroupLabel = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n children,\n ...props\n}: MenuItemGroupLabelProps) => (\n <InternalMenuItemGroupLabel {...props} asChild>\n <Text textStyle={textStyle} fontWeight={fontWeight}>\n {children}\n </Text>\n </InternalMenuItemGroupLabel>\n);\n\nexport const MenuItemGroup = withContext(Menu.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nconst InternalMenuItem = withContext(Menu.Item, \"item\", { baseComponent: true });\n\nexport type MenuItemVariantProps = NonNullable<RecipeVariantProps<typeof itemCva>>;\nexport interface MenuItemProps\n extends Menu.ItemProps, StyledProps, MenuItemVariantProps, RefAttributes<HTMLDivElement> {}\n\nexport const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(({ css: cssProp = {}, variant, ...props }, ref) => (\n <InternalMenuItem\n css={[itemCva.raw({ variant }), ...(Array.isArray(cssProp) ? cssProp : [cssProp])]}\n {...props}\n ref={ref}\n />\n));\n\nexport const MenuPositioner = withContext(Menu.Positioner, \"positioner\", { baseComponent: true });\n\nconst InternalMenuTriggerItem = withContext(Menu.TriggerItem, \"triggerItem\", { baseComponent: true });\n\ninterface MenuTriggerItemProps\n extends Menu.TriggerItemProps, StyledProps, MenuItemVariantProps, RefAttributes<HTMLButtonElement> {}\n\nexport const MenuTriggerItem = forwardRef<HTMLDivElement, MenuTriggerItemProps>(\n ({ css: cssProp = {}, variant, ...props }, ref) => (\n <InternalMenuTriggerItem\n css={[itemCva.raw({ variant }), ...(Array.isArray(cssProp) ? cssProp : [cssProp])]}\n {...props}\n ref={ref}\n />\n ),\n);\n\nexport const MenuTrigger = withContext(Menu.Trigger, \"trigger\", { baseComponent: true });\n\nexport const MenuSeparator = withContext(Menu.Separator, \"separator\", { baseComponent: true });\n\nexport const MenuItemText = withContext(Menu.ItemText, \"itemText\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,YAA+B,IAAI,IAAI;CAC3C,SAAS;CACT,YAAY;CACZ,cAAc;CACd,QAAQ;CACR,WAAW;CACX,cAAc;CACd,eAAe;CACf,KAAK;CACL,oBAAoB;CACpB,oBAAoB;CACpB,0BAA0B;CAC1B,SAAS;CACT,QAAQ,EACN,gBAAgB,aACjB;CACD,cAAc,EACZ,gBAAgB,aACjB;CACD,WAAW;EACT,OAAO;EACP,QAAQ;EACR,SAAS,EACP,OAAO,mBACR;EACD,QAAQ;GACN,OAAO;GACP,gBAAgB;GAChB,YAAY;GACZ,SAAS,EACP,OAAO,mBACR;GACF;EACF;CACF,CAAC;AAEF,MAAM,UAAU,IAAI;CAClB,iBAAiB,EACf,SAAS,UACV;CACD,UAAU,EACR,SAAS;EACP,QAAQ;GACN,QAAQ,EACN,YAAY,iBACb;GACD,cAAc,EACZ,YAAY,iBACb;GACD,SAAS,EACP,YAAY,kBACb;GACF;EACD,aAAa;GACX,OAAO;GACP,SAAS,EACP,OAAO,cACR;GACD,QAAQ;IACN,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,YAAY;IACb;GACD,cAAc;IACZ,OAAO;IACP,SAAS,EACP,OAAO,gBACR;IACD,YAAY;IACb;GACD,SAAS,EACP,YAAY,+BACb;GACF;EACF,EACF;CACF,CAAC;AA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,EAAE,SAAS,GAAG,SAAS,QAC3G,oBAAC,kBAAD;CACE,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,CAAC,EAAE,GAAI,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAE;CAClF,GAAI;CACC;CACL,CAAA,CACF;AAEF,MAAa,iBAAiB,YAAY,KAAK,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAEjG,MAAM,0BAA0B,YAAY,KAAK,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAKrG,MAAa,kBAAkB,YAC5B,EAAE,KAAK,UAAU,EAAE,EAAE,SAAS,GAAG,SAAS,QACzC,oBAAC,yBAAD;CACE,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,CAAC,EAAE,GAAI,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAE;CAClF,GAAI;CACC;CACL,CAAA,CAEL;AAED,MAAa,cAAc,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAY,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,eAAe,YAAY,KAAK,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Menu.mjs","names":[],"sources":["../src/Menu.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 { Menu, menuAnatomy } from \"@ark-ui/react\";\nimport { css, cva, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps, SystemStyleObject } from \"@ndla/styled-system/types\";\nimport { forwardRef, type RefAttributes } from \"react\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst itemStyle: SystemStyleObject = css.raw({\n display: \"flex\",\n alignItems: \"center\",\n borderRadius: \"xsmall\",\n cursor: \"pointer\",\n textStyle: \"label.medium\",\n paddingBlock: \"4xsmall\",\n paddingInline: \"xsmall\",\n gap: \"xsmall\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n outline: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n _highlighted: {\n textDecoration: \"underline\",\n },\n _disabled: {\n color: \"text.disabled\",\n cursor: \"not-allowed\",\n \"& svg\": {\n color: \"stroke.disabled\",\n },\n _hover: {\n color: \"text.disabled\",\n textDecoration: \"none\",\n background: \"surface.default\",\n \"& svg\": {\n color: \"stroke.disabled\",\n },\n },\n },\n});\n\nconst itemCva = cva({\n defaultVariants: {\n variant: \"action\",\n },\n variants: {\n variant: {\n action: {\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n _active: {\n background: \"surface.active\",\n },\n },\n destructive: {\n color: \"text.error\",\n \"& svg\": {\n color: \"icon.error\",\n },\n _hover: {\n color: \"text.default\",\n \"& svg\": {\n color: \"icon.default\",\n },\n background: \"surface.dangerSubtle.hover\",\n },\n _highlighted: {\n color: \"text.default\",\n \"& svg\": {\n color: \"icon.default\",\n },\n background: \"surface.dangerSubtle.hover\",\n },\n _active: {\n background: \"surface.dangerSubtle.active\",\n },\n },\n },\n },\n});\n\nconst menuRecipe = sva({\n slots: menuAnatomy.keys(),\n base: {\n item: itemStyle,\n triggerItem: itemStyle,\n content: {\n color: \"text.default\",\n display: \"flex\",\n flexDirection: \"column\",\n width: \"fit-content\",\n minWidth: \"surface.xxsmall\",\n padding: \"3xsmall\",\n gap: \"3xsmall\",\n background: \"surface.default\",\n boxShadow: \"small\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n zIndex: \"dropdown\",\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 itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n positioner: {\n zIndex: \"dropdown\",\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(menuRecipe);\n\nexport type MenuRootProps = Menu.RootProps;\n\nconst InternalMenuRoot = withRootProvider(Menu.Root);\n\nexport const MenuRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: MenuRootProps) => (\n <InternalMenuRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const MenuContentStandalone = withContext(Menu.Content, \"content\", { baseComponent: true });\n\ninterface MenuContentProps extends Menu.ContentProps, StyledProps {}\n\nexport const MenuContent = forwardRef<HTMLDivElement, MenuContentProps>((props, ref) => (\n <MenuPositioner>\n <MenuContentStandalone ref={ref} {...props} />\n </MenuPositioner>\n));\n\nconst InternalMenuItemGroupLabel = withContext(Menu.ItemGroupLabel, \"itemGroupLabel\");\n\ninterface MenuItemGroupLabelProps\n extends Omit<Menu.ItemGroupLabelProps, \"color\">, StyledProps, TextProps, RefAttributes<HTMLDivElement> {}\n\nexport const MenuItemGroupLabel = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n children,\n ...props\n}: MenuItemGroupLabelProps) => (\n <InternalMenuItemGroupLabel {...props} asChild>\n <Text textStyle={textStyle} fontWeight={fontWeight}>\n {children}\n </Text>\n </InternalMenuItemGroupLabel>\n);\n\nexport const MenuItemGroup = withContext(Menu.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nconst InternalMenuItem = withContext(Menu.Item, \"item\", { baseComponent: true });\n\nexport type MenuItemVariantProps = NonNullable<RecipeVariantProps<typeof itemCva>>;\nexport interface MenuItemProps\n extends Menu.ItemProps, StyledProps, MenuItemVariantProps, RefAttributes<HTMLDivElement> {}\n\nexport const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(({ css: cssProp = {}, variant, ...props }, ref) => (\n <InternalMenuItem\n css={[itemCva.raw({ variant }), ...(Array.isArray(cssProp) ? cssProp : [cssProp])]}\n {...props}\n ref={ref}\n />\n));\n\nexport const MenuPositioner = withContext(Menu.Positioner, \"positioner\", { baseComponent: true });\n\nconst InternalMenuTriggerItem = withContext(Menu.TriggerItem, \"triggerItem\", { baseComponent: true });\n\ninterface MenuTriggerItemProps\n extends Menu.TriggerItemProps, StyledProps, MenuItemVariantProps, RefAttributes<HTMLButtonElement> {}\n\nexport const MenuTriggerItem = forwardRef<HTMLDivElement, MenuTriggerItemProps>(\n ({ css: cssProp = {}, variant, ...props }, ref) => (\n <InternalMenuTriggerItem\n css={[itemCva.raw({ variant }), ...(Array.isArray(cssProp) ? cssProp : [cssProp])]}\n {...props}\n ref={ref}\n />\n ),\n);\n\nexport const MenuTrigger = withContext(Menu.Trigger, \"trigger\", { baseComponent: true });\n\nexport const MenuSeparator = withContext(Menu.Separator, \"separator\", { baseComponent: true });\n\nexport const MenuItemText = withContext(Menu.ItemText, \"itemText\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,YAA+B,IAAI,IAAI;CAC3C,SAAS;CACT,YAAY;CACZ,cAAc;CACd,QAAQ;CACR,WAAW;CACX,cAAc;CACd,eAAe;CACf,KAAK;CACL,oBAAoB;CACpB,oBAAoB;CACpB,0BAA0B;CAC1B,SAAS;CACT,QAAQ,EACN,gBAAgB,aACjB;CACD,cAAc,EACZ,gBAAgB,aACjB;CACD,WAAW;EACT,OAAO;EACP,QAAQ;EACR,SAAS,EACP,OAAO,mBACR;EACD,QAAQ;GACN,OAAO;GACP,gBAAgB;GAChB,YAAY;GACZ,SAAS,EACP,OAAO,mBACR;GACF;EACF;CACF,CAAC;AAEF,MAAM,UAAU,IAAI;CAClB,iBAAiB,EACf,SAAS,UACV;CACD,UAAU,EACR,SAAS;EACP,QAAQ;GACN,QAAQ,EACN,YAAY,iBACb;GACD,cAAc,EACZ,YAAY,iBACb;GACD,SAAS,EACP,YAAY,kBACb;GACF;EACD,aAAa;GACX,OAAO;GACP,SAAS,EACP,OAAO,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A;AAG/B,MAAa,gBAAgB,YAAY,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAM,mBAAmB,YAAY,KAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAMhF,MAAa,WAAW,YAA2C,EAAE,KAAK,UAAU,EAAE,EAAE,SAAS,GAAG,SAAS,QAC3G,oBAAC,kBAAD;CACE,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,CAAC,EAAE,GAAI,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAE;CAClF,GAAI;CACC;CACL,CAAA,CACF;AAEF,MAAa,iBAAiB,YAAY,KAAK,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAEjG,MAAM,0BAA0B,YAAY,KAAK,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAKrG,MAAa,kBAAkB,YAC5B,EAAE,KAAK,UAAU,EAAE,EAAE,SAAS,GAAG,SAAS,QACzC,oBAAC,yBAAD;CACE,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,CAAC,EAAE,GAAI,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAE;CAClF,GAAI;CACC;CACL,CAAA,CAEL;AAED,MAAa,cAAc,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAY,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,eAAe,YAAY,KAAK,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.mjs","names":[],"sources":["../src/Pagination.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 { Pagination, paginationAnatomy } 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\";\n\nconst paginationRecipe = sva({\n slots: paginationAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n gap: \"xxsmall\",\n justifyContent: \"center\",\n },\n item: {\n fontVariantNumeric: \"tabular-nums\",\n },\n ellipsis: {\n display: \"inline-flex\",\n alignItems: \"center\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(paginationRecipe);\n\nexport interface PaginationRootProps extends Pagination.RootProps, StyledProps {\n translations: Pagination.RootProps[\"translations\"];\n}\n\nexport const PaginationRoot = withProvider(Pagination.Root, \"root\", { baseComponent: true });\n\nexport const PaginationItem = withContext(Pagination.Item, \"item\", { baseComponent: true });\n\nexport const PaginationEllipsis = withContext(Pagination.Ellipsis, \"ellipsis\", { baseComponent: true });\n\nexport const PaginationContext = Pagination.Context;\n\nexport const PaginationPrevTrigger = withContext(Pagination.PrevTrigger, \"prevTrigger\", { baseComponent: true });\n\nexport const PaginationNextTrigger = withContext(Pagination.NextTrigger, \"nextTrigger\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AA+BA,MAAM,EAAE,cAAc,gBAAgB,mBAlBb,IAAI;CAC3B,OAAO,kBAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,KAAK;GACL,gBAAgB;GACjB;EACD,MAAM,EACJ,oBAAoB,gBACrB;EACD,UAAU;GACR,SAAS;GACT,YAAY;GACb;EACF;CACF,CAAC,CAEwE;AAM1E,MAAa,iBAAiB,aAAa,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,iBAAiB,YAAY,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,qBAAqB,YAAY,WAAW,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAEvG,MAAa,oBAAoB,WAAW;AAE5C,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Pagination.mjs","names":[],"sources":["../src/Pagination.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 { Pagination, paginationAnatomy } 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\";\n\nconst paginationRecipe = sva({\n slots: paginationAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n gap: \"xxsmall\",\n justifyContent: \"center\",\n },\n item: {\n fontVariantNumeric: \"tabular-nums\",\n },\n ellipsis: {\n display: \"inline-flex\",\n alignItems: \"center\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(paginationRecipe);\n\nexport interface PaginationRootProps extends Pagination.RootProps, StyledProps {\n translations: Pagination.RootProps[\"translations\"];\n}\n\nexport const PaginationRoot = withProvider(Pagination.Root, \"root\", { baseComponent: true });\n\nexport const PaginationItem = withContext(Pagination.Item, \"item\", { baseComponent: true });\n\nexport const PaginationEllipsis = withContext(Pagination.Ellipsis, \"ellipsis\", { baseComponent: true });\n\nexport const PaginationContext = Pagination.Context;\n\nexport const PaginationPrevTrigger = withContext(Pagination.PrevTrigger, \"prevTrigger\", { baseComponent: true });\n\nexport const PaginationNextTrigger = withContext(Pagination.NextTrigger, \"nextTrigger\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AA+BA,MAAM,EAAE,cAAc,gBAAgB,mBAlBb,IAAI;CAC3B,OAAO,kBAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,KAAK;GACL,gBAAgB;GACjB;EACD,MAAM,EACJ,oBAAoB,gBACrB;EACD,UAAU;GACR,SAAS;GACT,YAAY;GACb;EACF;CACF,CAEwE,CAAC;AAM1E,MAAa,iBAAiB,aAAa,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,iBAAiB,YAAY,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,qBAAqB,YAAY,WAAW,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAEvG,MAAa,oBAAoB,WAAW;AAE5C,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.mjs","names":["usePopover","_usePopover"],"sources":["../src/Popover.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 { Popover, popoverAnatomy, usePopover as _usePopover } 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 { Heading, type TextProps } from \"./Text\";\n\nconst popoverRecipe = sva({\n slots: popoverAnatomy.keys(),\n base: {\n positioner: {\n maxHeight: \"inherit\",\n position: \"relative\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"medium\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"xlarge\",\n zIndex: \"popover\",\n maxWidth: \"var(--available-width)\",\n _open: {\n animation: \"fade-shift-in 0.2s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"fade-shift-out 0.2s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n arrow: {\n \"--arrow-size\": \"sizes.xxsmall\",\n \"--arrow-background\": \"colors.surface.default\",\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(popoverRecipe);\n\nexport type PopoverRootProps = Popover.RootProps;\nconst InternalPopoverRoot = withRootProvider(Popover.Root);\n\nexport const PopoverRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: PopoverRootProps) => (\n <InternalPopoverRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const PopoverAnchor = withContext(Popover.Anchor, \"anchor\", { baseComponent: true });\n\nexport const PopoverArrowStandalone = withContext(Popover.Arrow, \"arrow\", { baseComponent: true });\n\ninterface PopoverArrowProps extends Popover.ArrowTipProps, StyledProps {}\n\nexport const PopoverArrow = (props: PopoverArrowProps) => (\n <PopoverArrowStandalone>\n <PopoverArrowTip {...props} />\n </PopoverArrowStandalone>\n);\n\nexport const PopoverArrowTip = withContext(Popover.ArrowTip, \"arrowTip\", { baseComponent: true });\n\nexport const PopoverCloseTrigger = withContext(Popover.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nexport const PopoverContentStandalone = withContext(Popover.Content, \"content\", { baseComponent: true });\n\ninterface PopoverContentProps extends Popover.ContentProps, StyledProps {}\n\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>((props, ref) => (\n <PopoverPositioner>\n <PopoverContentStandalone {...props} ref={ref} />\n </PopoverPositioner>\n));\n\nexport const PopoverDescription = withContext(Popover.Description, \"description\", { baseComponent: true });\n\nexport const PopoverIndicator = withContext(Popover.Indicator, \"indicator\", { baseComponent: true });\n\nexport const PopoverPositioner = withContext(Popover.Positioner, \"positioner\", { baseComponent: true });\n\nconst InternalPopoverTitle = withContext(Popover.Title, \"title\", { baseComponent: true });\n\ninterface PopoverTitleProps\n extends Omit<Popover.TitleProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLHeadingElement> {}\n\nexport const PopoverTitle = ({ textStyle = \"title.medium\", children, ...rest }: PopoverTitleProps) => (\n <Heading textStyle={textStyle} {...rest} asChild consumeCss>\n <InternalPopoverTitle>{children}</InternalPopoverTitle>\n </Heading>\n);\n\nexport const PopoverTrigger = withContext(Popover.Trigger, \"trigger\", { baseComponent: true });\n\nexport const PopoverRootProvider = withRootProvider(Popover.RootProvider);\n\nexport const usePopover = _usePopover;\n"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAM,EAAE,kBAAkB,gBAAgB,mBApCpB,IAAI;CACxB,OAAO,eAAe,MAAM;CAC5B,MAAM;EACJ,YAAY;GACV,WAAW;GACX,UAAU;GACX;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,SAAS;GACT,YAAY;GACZ,cAAc;GACd,WAAW;GACX,QAAQ;GACR,UAAU;GACV,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,OAAO;GACL,gBAAgB;GAChB,sBAAsB;GACvB;EACF;CACF,CAAC,CAEyE;AAG3E,MAAM,sBAAsB,iBAAiB,QAAQ,KAAK;AAE1D,MAAa,eAAe,EAAE,YAAY,MAAM,gBAAgB,MAAM,GAAG,YACvE,oBAAC,qBAAD;CAAgC;CAA0B;CAAe,GAAI;CAAS,CAAA;AAGxF,MAAa,gBAAgB,YAAY,QAAQ,QAAQ,UAAU,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,yBAAyB,YAAY,QAAQ,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAIlG,MAAa,gBAAgB,UAC3B,oBAAC,wBAAD,EAAA,UACE,oBAAC,iBAAD,EAAiB,GAAI,OAAS,CAAA,EACP,CAAA;AAG3B,MAAa,kBAAkB,YAAY,QAAQ,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAEjG,MAAa,sBAAsB,YAAY,QAAQ,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAE7G,MAAa,2BAA2B,YAAY,QAAQ,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIxG,MAAa,iBAAiB,YAAiD,OAAO,QACpF,oBAAC,mBAAD,EAAA,UACE,oBAAC,0BAAD;CAA0B,GAAI;CAAY;CAAO,CAAA,EAC/B,CAAA,CACpB;AAEF,MAAa,qBAAqB,YAAY,QAAQ,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAE1G,MAAa,mBAAmB,YAAY,QAAQ,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAEpG,MAAa,oBAAoB,YAAY,QAAQ,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAEvG,MAAM,uBAAuB,YAAY,QAAQ,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAKzF,MAAa,gBAAgB,EAAE,YAAY,gBAAgB,UAAU,GAAG,WACtE,oBAAC,SAAD;CAAoB;CAAW,GAAI;CAAM,SAAA;CAAQ,YAAA;WAC/C,oBAAC,sBAAD,EAAuB,UAAgC,CAAA;CAC/C,CAAA;AAGZ,MAAa,iBAAiB,YAAY,QAAQ,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,sBAAsB,iBAAiB,QAAQ,aAAa;AAEzE,MAAaA,eAAaC"}
1
+ {"version":3,"file":"Popover.mjs","names":["usePopover","_usePopover"],"sources":["../src/Popover.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 { Popover, popoverAnatomy, usePopover as _usePopover } 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 { Heading, type TextProps } from \"./Text\";\n\nconst popoverRecipe = sva({\n slots: popoverAnatomy.keys(),\n base: {\n positioner: {\n maxHeight: \"inherit\",\n position: \"relative\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"medium\",\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"xlarge\",\n zIndex: \"popover\",\n maxWidth: \"var(--available-width)\",\n _open: {\n animation: \"fade-shift-in 0.2s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"fade-shift-out 0.2s ease-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n arrow: {\n \"--arrow-size\": \"sizes.xxsmall\",\n \"--arrow-background\": \"colors.surface.default\",\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(popoverRecipe);\n\nexport type PopoverRootProps = Popover.RootProps;\nconst InternalPopoverRoot = withRootProvider(Popover.Root);\n\nexport const PopoverRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: PopoverRootProps) => (\n <InternalPopoverRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const PopoverAnchor = withContext(Popover.Anchor, \"anchor\", { baseComponent: true });\n\nexport const PopoverArrowStandalone = withContext(Popover.Arrow, \"arrow\", { baseComponent: true });\n\ninterface PopoverArrowProps extends Popover.ArrowTipProps, StyledProps {}\n\nexport const PopoverArrow = (props: PopoverArrowProps) => (\n <PopoverArrowStandalone>\n <PopoverArrowTip {...props} />\n </PopoverArrowStandalone>\n);\n\nexport const PopoverArrowTip = withContext(Popover.ArrowTip, \"arrowTip\", { baseComponent: true });\n\nexport const PopoverCloseTrigger = withContext(Popover.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nexport const PopoverContentStandalone = withContext(Popover.Content, \"content\", { baseComponent: true });\n\ninterface PopoverContentProps extends Popover.ContentProps, StyledProps {}\n\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>((props, ref) => (\n <PopoverPositioner>\n <PopoverContentStandalone {...props} ref={ref} />\n </PopoverPositioner>\n));\n\nexport const PopoverDescription = withContext(Popover.Description, \"description\", { baseComponent: true });\n\nexport const PopoverIndicator = withContext(Popover.Indicator, \"indicator\", { baseComponent: true });\n\nexport const PopoverPositioner = withContext(Popover.Positioner, \"positioner\", { baseComponent: true });\n\nconst InternalPopoverTitle = withContext(Popover.Title, \"title\", { baseComponent: true });\n\ninterface PopoverTitleProps\n extends Omit<Popover.TitleProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLHeadingElement> {}\n\nexport const PopoverTitle = ({ textStyle = \"title.medium\", children, ...rest }: PopoverTitleProps) => (\n <Heading textStyle={textStyle} {...rest} asChild consumeCss>\n <InternalPopoverTitle>{children}</InternalPopoverTitle>\n </Heading>\n);\n\nexport const PopoverTrigger = withContext(Popover.Trigger, \"trigger\", { baseComponent: true });\n\nexport const PopoverRootProvider = withRootProvider(Popover.RootProvider);\n\nexport const usePopover = _usePopover;\n"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAM,EAAE,kBAAkB,gBAAgB,mBApCpB,IAAI;CACxB,OAAO,eAAe,MAAM;CAC5B,MAAM;EACJ,YAAY;GACV,WAAW;GACX,UAAU;GACX;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,SAAS;GACT,YAAY;GACZ,cAAc;GACd,WAAW;GACX,QAAQ;GACR,UAAU;GACV,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,OAAO;GACL,gBAAgB;GAChB,sBAAsB;GACvB;EACF;CACF,CAEyE,CAAC;AAG3E,MAAM,sBAAsB,iBAAiB,QAAQ,KAAK;AAE1D,MAAa,eAAe,EAAE,YAAY,MAAM,gBAAgB,MAAM,GAAG,YACvE,oBAAC,qBAAD;CAAgC;CAA0B;CAAe,GAAI;CAAS,CAAA;AAGxF,MAAa,gBAAgB,YAAY,QAAQ,QAAQ,UAAU,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,yBAAyB,YAAY,QAAQ,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAIlG,MAAa,gBAAgB,UAC3B,oBAAC,wBAAD,EAAA,UACE,oBAAC,iBAAD,EAAiB,GAAI,OAAS,CAAA,EACP,CAAA;AAG3B,MAAa,kBAAkB,YAAY,QAAQ,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAEjG,MAAa,sBAAsB,YAAY,QAAQ,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAE7G,MAAa,2BAA2B,YAAY,QAAQ,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIxG,MAAa,iBAAiB,YAAiD,OAAO,QACpF,oBAAC,mBAAD,EAAA,UACE,oBAAC,0BAAD;CAA0B,GAAI;CAAY;CAAO,CAAA,EAC/B,CAAA,CACpB;AAEF,MAAa,qBAAqB,YAAY,QAAQ,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAE1G,MAAa,mBAAmB,YAAY,QAAQ,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAEpG,MAAa,oBAAoB,YAAY,QAAQ,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAEvG,MAAM,uBAAuB,YAAY,QAAQ,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAKzF,MAAa,gBAAgB,EAAE,YAAY,gBAAgB,UAAU,GAAG,WACtE,oBAAC,SAAD;CAAoB;CAAW,GAAI;CAAM,SAAA;CAAQ,YAAA;WAC/C,oBAAC,sBAAD,EAAuB,UAAgC,CAAA;CAC/C,CAAA;AAGZ,MAAa,iBAAiB,YAAY,QAAQ,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,sBAAsB,iBAAiB,QAAQ,aAAa;AAEzE,MAAaA,eAAaC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.mjs","names":[],"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,gBAAgB,mBA/Eb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sB,EACjC,YAAY,gBACZ,UACA,SACA,YACA,GAAG,YAEH,oBAAC,4BAAD;CAA4B,SAAA;WAC1B,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;EAAW,GAAI;YACjD,oBAAC,yBAAD;GAAkC;GAAqB;GACpD;GACuB,CAAA;EACrB,CAAA;CACoB,CAAA;AAG/B,MAAa,0BAA0B,YAAY,WAAW,OAAO,QAAQ;AAE7E,MAAM,uBAAuB,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAKzE,MAAa,kBAAkB,YAC5B,EAAE,YAAY,eAAe,aAAa,QAAQ,UAAU,SAAS,YAAY,GAAG,SAAS,QAC5F,oBAAC,yBAAD;CAAyB,GAAI;CAAO,SAAA;CAAa;WAC/C,oBAAC,MAAD;EAAiB;EAAuB;EAAY,SAAA;YAClD,oBAAC,sBAAD;GAA+B;GAAqB;GACjD;GACoB,CAAA;EAClB,CAAA;CACiB,CAAA,CAE7B;AAED,MAAa,4BAA4B,WAAW"}
1
+ {"version":3,"file":"RadioGroup.mjs","names":[],"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,gBAAgB,mBA/Eb,IAAI;CAC3B,OAAO,kBAAkB,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;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Ae,MAAM,CAAC;AAKzE,MAAa,kBAAkB,YAC5B,EAAE,YAAY,eAAe,aAAa,QAAQ,UAAU,SAAS,YAAY,GAAG,SAAS,QAC5F,oBAAC,yBAAD;CAAyB,GAAI;CAAO,SAAA;CAAa;WAC/C,oBAAC,MAAD;EAAiB;EAAuB;EAAY,SAAA;YAClD,oBAAC,sBAAD;GAA+B;GAAqB;GACjD;GACoB,CAAA;EAClB,CAAA;CACiB,CAAA,CAE7B;AAED,MAAa,4BAA4B,WAAW"}
package/es/Select.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Select.mjs","names":[],"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,gBAAgB,mBAlIjB,IAAI;CACvB,OAAO,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,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,OAAO;KACP,YAAY;KACb;IACD,WAAW;KACT,OAAO;KACP,YAAY;KACb;IACD,QAAQ;KACN,OAAO;KACP,YAAY;K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f,CAAA;CACqB,CAAA,CAElC;AAED,MAAM,+BAA+B,YAAY,OAAO,gBAAgB,iBAAiB;AAEzF,MAAa,kBAAkB,YAAY,OAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,sBAAsB,YAAY,OAAO,eAAe,iBAAiB,EAAE,eAAe,MAAM,CAAC;AAE9G,MAAa,aAAa,YAAY,OAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,iBAAiB,YAAY,OAAO,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAE/F,MAAM,sBAAsB,YAAY,OAAO,OAAO,QAAQ;AAK9D,MAAa,cAAc,YAAgD,EAAE,UAAU,GAAG,SAAS,QACjG,oBAAC,qBAAD;CAAqB,SAAA;CAAa;CAAK,GAAI;WACzC,oBAAC,OAAD,EAAQ,UAAiB,CAAA;CACL,CAAA,CACtB;AAEF,MAAa,mBAAmB,YAAY,OAAO,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAErG,MAAa,gBAAgB,YAAY,OAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,kBAAkB,YAAY,OAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,aAAa,YAAY,OAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,qBAAqB,OAAO"}
1
+ {"version":3,"file":"Select.mjs","names":[],"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,gBAAgB,mBAlIjB,IAAI;CACvB,OAAO,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,QACZ;IACF;GACD,SAAS;IACP,WA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OAAO,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAElG,MAAa,aAAa,YAAY,OAAO,MAAM,QAAQ,EACzD,eAAe,MAChB,CAAC;AAEF,MAAa,qBAAqB,OAAO"}
package/es/Slider.mjs CHANGED
@@ -22,6 +22,7 @@ const { withProvider, withContext } = createStyleContext(sva({
22
22
  },
23
23
  control: {
24
24
  position: "relative",
25
+ cursor: "pointer",
25
26
  display: "flex",
26
27
  _vertical: { flexDirection: "column" },
27
28
  alignItems: "center",
package/es/Slider.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.mjs","names":[],"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,gBAAgB,mBArEjB,IAAI;CACvB,OAAO,cAAc,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,aAAa,OAAO,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEpF,MAAa,gBAAgB,YAAY,OAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAY,OAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,GAAG,YAC3D,oBAAC,qBAAD;CAAqB,SAAA;WACnB,oBAAC,OAAD;EAAkB;EAAW,GAAI;EAAS,CAAA;CACtB,CAAA;AAGxB,MAAa,oBAAoB,OAAO"}
1
+ {"version":3,"file":"Slider.mjs","names":[],"sources":["../src/Slider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Slider, sliderAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport type { RefAttributes } from \"react\";\nimport { Label } from \"./Label\";\nimport { type TextProps } from \"./Text\";\n\nconst sliderRecipe = sva({\n slots: sliderAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n width: \"100%\",\n },\n control: {\n position: \"relative\",\n cursor: \"pointer\",\n display: \"flex\",\n _vertical: {\n flexDirection: \"column\",\n },\n alignItems: \"center\",\n height: \"medium\",\n },\n track: {\n background: \"surface.disabled\",\n overflow: \"hidden\",\n flex: \"1\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n range: {\n background: \"surface.action\",\n _vertical: {\n width: \"4xsmall\",\n },\n _horizontal: {\n height: \"4xsmall\",\n },\n },\n thumb: {\n background: \"surface.action\",\n borderRadius: \"full\",\n outline: \"none\",\n zIndex: \"1\",\n height: \"medium\",\n width: \"medium\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n transitionProperty: \"background\",\n _hover: {\n background: \"surface.action.hover\",\n },\n _active: {\n background: \"surface.action.active\",\n },\n _focusVisible: {\n border: \"2px solid\",\n borderColor: \"background.default\",\n outline: \"3px solid\",\n outlineColor: \"surface.action\",\n outlineOffset: \"0px\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(sliderRecipe);\n\nexport interface SliderRootProps extends Slider.RootProps, StyledProps {}\n\nexport const SliderRoot = withProvider(Slider.Root, \"root\", { baseComponent: true });\n\nexport const SliderControl = withContext(Slider.Control, \"control\", { baseComponent: true });\n\nexport const SliderTrack = withContext(Slider.Track, \"track\", { baseComponent: true });\n\nexport const SliderRange = withContext(Slider.Range, \"range\", { baseComponent: true });\n\nexport const SliderThumb = withContext(Slider.Thumb, \"thumb\", { baseComponent: true });\n\nconst InternalSliderLabel = withContext(Slider.Label, \"label\");\n\ninterface SliderLabelProps\n extends Omit<Slider.LabelProps, \"color\">, TextProps, StyledProps, RefAttributes<HTMLLabelElement> {}\n\nexport const SliderLabel = ({ textStyle = \"label.medium\", ...props }: SliderLabelProps) => (\n <InternalSliderLabel asChild>\n <Label textStyle={textStyle} {...props} />\n </InternalSliderLabel>\n);\n\nexport const SliderHiddenInput = Slider.HiddenInput;\n"],"mappings":";;;;;;;;;;;;;AAsFA,MAAM,EAAE,cAAc,gBAAgB,mBAtEjB,IAAI;CACvB,OAAO,cAAc,MAAM;CAC3B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,OAAO;GACR;EACD,SAAS;GACP,UAAU;GACV,QAAQ;GACR,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,CAEoE,CAAC;AAItE,MAAa,aAAa,aAAa,OAAO,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEpF,MAAa,gBAAgB,YAAY,OAAO,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAY,OAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,GAAG,YAC3D,oBAAC,qBAAD;CAAqB,SAAA;WACnB,oBAAC,OAAD;EAAkB;EAAW,GAAI;EAAS,CAAA;CACtB,CAAA;AAGxB,MAAa,oBAAoB,OAAO"}
package/es/Switch.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.mjs","names":[],"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"],"m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a,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAY,OAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,UAAU,GAAG,YACrE,oBAAC,qBAAD;CAAqB,SAAA;CAAQ,GAAI;WAC/B,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;YAClC,oBAAC,QAAD,EAAO,UAAgB,CAAA;EAClB,CAAA;CACa,CAAA;AAGxB,MAAa,oBAAoB,OAAO"}
1
+ {"version":3,"file":"Switch.mjs","names":[],"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 SwitchH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AAe,MAAM,CAAC;AAE5F,MAAa,cAAc,YAAY,OAAO,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAEtF,MAAM,sBAAsB,YAAY,OAAO,OAAO,QAAQ;AAK9D,MAAa,eAAe,EAAE,YAAY,gBAAgB,UAAU,GAAG,YACrE,oBAAC,qBAAD;CAAqB,SAAA;CAAQ,GAAI;WAC/B,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;YAClC,oBAAC,QAAD,EAAO,UAAgB,CAAA;EAClB,CAAA;CACa,CAAA;AAGxB,MAAa,oBAAoB,OAAO"}
package/es/Tabs.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.mjs","names":[],"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,gBAAgB,mBA3MnB,IAAI;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,WA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AG,YACpE,oBAAC,kBAAD;CAA6B;CAA0B;CAAe,GAAI;CAAS,CAAA;AAGrF,MAAa,cAAc,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAY,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,WAAW,YAAY,KAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE/E,MAAM,sBAAsB,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,oBAAC,qBAAD;CAAqB,WAAW,GAAG,QAAQ,UAAU;CAAE,GAAI;CAAS,CAAA"}
1
+ {"version":3,"file":"Tabs.mjs","names":[],"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,gBAAgB,mBA3MnB,IAAI;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;KACb,SAAS;KACT,cAAc;KACf;IACF;GACD,WAAW;IACT,YAAY;IACZ,mBAAmB;KACjB,QAAQ;KACR,OAAO;KACP,SAAS;KACT,eAAe;KACf,cAAc;KACd,YAAY;KACZ,aAAa,EACX,iBAAiB,UAClB;KACD,WAAW,EACT,mBAAmB,UACpB;KACF;IACD,aAAa;KACX,KAAK;KACL,QAAQ;KACR,OAAO;KACP,mBAAmB,EAAE,KAAK,cAAc;KACzC;IACD,WAAW;KACT,QAAQ;KACR,MAAM;KACN,OAAO;KACR;IACF;GACD,SAAS;IACP,QAAQ;IACR,aAAa,EACX,mBAAmB,UACpB;IACD,WAAW,EACT,oBAAoB,UACrB;IACD,eAAe;KACb,SAAS;KACT,WAAW;KACX,gBAAgB;KACjB;IACF;GACF;EACD,SAAS;GACP,MAAM;IACJ,aAAa,EACX,gBAAgB,QACjB;IACD,WAAW,EACT,iBAAiB,QAClB;IACF;GACD,SAAS;IACP,aAAa;IACb,aAAa;IACb,aAAa,EACX,iBAAiB,UAClB;IACD,WAAW;KACT,qBAAqB;KACrB,wBAAwB;KACzB;IACD,WAAW;KACT,YAAY;KACZ,aAAa;KACb,aAAa,EACX,cAAc,QACf;KACD,WAAW,EACT,aAAa,QACd;KACF;IACD,eAAe;KACb,SAAS;KACT,eAAe;KACf,cAAc;KACf;IACF;GACD,SAAS;IACP,aAAa;IACb,aAAa;IACb,YAAY;IACZ,OAAO;IACP,SAAS;IACT,WAAW;KACT,oBAAoB;KACpB,mBAAmB;KACpB;IACD,aAAa;KACX,mBAAmB;KACnB,wBAAwB;KACzB;IACD,eAAe;KACb,SAAS;KACT,eAAe;KACf,cAAc;KACf;IACF;GACF;EACF,EACF;CACF,CAEkE,CAAC;AAQpE,MAAM,mBAAmB,aAAa,KAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEjF,MAAa,YAAY,EAAE,YAAY,MAAM,gBAAgB,MAAM,GAAG,YACpE,oBAAC,kBAAD;CAA6B;CAA0B;CAAe,GAAI;CAAS,CAAA;AAGrF,MAAa,cAAc,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAExF,MAAa,gBAAgB,YAAY,KAAK,WAAW,aAAa,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,WAAW,YAAY,KAAK,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE/E,MAAM,sBAAsB,YAAY,KAAK,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIzF,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,oBAAC,qBAAD;CAAqB,WAAW,GAAG,QAAQ,UAAU;CAAE,GAAI;CAAS,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInput.mjs","names":[],"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,gBAAgB,mBAtFd,IAAI;CAC1B,OAAO,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;GAC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AAY,EAAE,eAAe,MAAM,CAAC;AAErG,MAAM,yBAAyB,YAAY,UAAU,OAAO,QAAQ;AAKpE,MAAa,iBAAiB,YAAmD,EAAE,UAAU,GAAG,SAAS,QACvG,oBAAC,wBAAD;CAAwB,SAAA;CAAa;CAAK,GAAI;WAC5C,oBAAC,OAAD,EAAQ,UAAiB,CAAA;CACF,CAAA,CACzB"}
1
+ {"version":3,"file":"TagsInput.mjs","names":[],"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,gBAAgB,mBAtFd,IAAI;CAC1B,OAAO,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;I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 @@
1
- {"version":3,"file":"Toast.mjs","names":[],"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,gBAAgB,mBA1DlB,IAAI;CACtB,OAAO,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,WACnB;EACD,cAAc;GACZ,UAAU;GACV,KAAK;GACL,OAAO;GACR;EACD,aAAa,EACX,kBAAkB,WACnB;EACF;CACD,iBAAiB,EACf,SAAS,SACV;CACD,UAAU,EACR,SAAS;EACP,OAAO,EACL,MAAM;GACJ,YAAY;GACZ,OAAO;GACR,EACF;EACD,MAAM,EACJ,MAAM;GACJ,YAAY;GACZ,OAAO;GACR,EACF;EACF,EACF;CACF,CAAC,CAEmE;AAKrE,MAAa,YAAY,aAAa,MAAM,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAElF,MAAa,qBAAqB,YAAY,MAAM,eAAe,iBAAiB,EAAE,eAAe,MAAM,CAAC;AAE5G,MAAa,oBAAoB,YAAY,MAAM,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAEzG,MAAM,2BAA2B,YAAY,MAAM,aAAa,cAAc;AAK9E,MAAa,oBAAoB,EAAE,YAAY,gBAAgB,UAAU,GAAG,YAC1E,oBAAC,0BAAD;CAA0B,SAAA;WACxB,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;EAAW,GAAI;YACjD,oBAAC,OAAD,EAAM,UAAe,CAAA;EAChB,CAAA;CACkB,CAAA;AAG7B,MAAM,qBAAqB,YAAY,MAAM,OAAO,QAAQ;AAK5D,MAAa,cAAc,EACzB,YAAY,gBACZ,aAAa,YACb,UACA,GAAG,YAEH,oBAAC,oBAAD;CAAoB,SAAA;WAClB,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAuB;EAAuB;EAAW,GAAI;YACzE,oBAAC,OAAD,EAAM,UAAe,CAAA;EAChB,CAAA;CACY,CAAA"}
1
+ {"version":3,"file":"Toast.mjs","names":[],"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,gBAAgB,mBA1DlB,IAAI;CACtB,OAAO,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,WACnB;EACD,cAAc;GACZ,UAAU;GACV,KAAK;GACL,OAAO;GACR;EACD,aAAa,EACX,kBAAkB,WACnB;EACF;CACD,iBAAiB,EACf,SAAS,SACV;CACD,UAAU,EACR,SAAS;EACP,OAAO,EACL,MAAM;GACJ,YAAY;GACZ,OAAO;GACR,EACF;EACD,MAAM,EACJ,MAAM;GACJ,YAAY;GACZ,OAAO;GACR,EACF;EACF,EACF;CACF,CAEmE,CAAC;AAKrE,MAAa,YAAY,aAAa,MAAM,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAElF,MAAa,qBAAqB,YAAY,MAAM,eAAe,iBAAiB,EAAE,eAAe,MAAM,CAAC;AAE5G,MAAa,oBAAoB,YAAY,MAAM,cAAc,gBAAgB,EAAE,eAAe,MAAM,CAAC;AAEzG,MAAM,2BAA2B,YAAY,MAAM,aAAa,cAAc;AAK9E,MAAa,oBAAoB,EAAE,YAAY,gBAAgB,UAAU,GAAG,YAC1E,oBAAC,0BAAD;CAA0B,SAAA;WACxB,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAsB;EAAW,GAAI;YACjD,oBAAC,OAAD,EAAM,UAAe,CAAA;EAChB,CAAA;CACkB,CAAA;AAG7B,MAAM,qBAAqB,YAAY,MAAM,OAAO,QAAQ;AAK5D,MAAa,cAAc,EACzB,YAAY,gBACZ,aAAa,YACb,UACA,GAAG,YAEH,oBAAC,oBAAD;CAAoB,SAAA;WAClB,oBAAC,MAAD;EAAM,SAAA;EAAQ,YAAA;EAAuB;EAAuB;EAAW,GAAI;YACzE,oBAAC,OAAD,EAAM,UAAe,CAAA;EAChB,CAAA;CACY,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroup.mjs","names":[],"sources":["../src/ToggleGroup.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 { toggleGroupAnatomy, ToggleGroup } 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\";\n\nconst toggleGroupRecipe = sva({\n slots: toggleGroupAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"row\",\n gap: \"4xsmall\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(toggleGroupRecipe);\n\nexport type ToggleGroupVariantProps = NonNullable<RecipeVariantProps<typeof toggleGroupRecipe>>;\nexport interface ToggleGroupRootProps extends ToggleGroup.RootProps, StyledProps, ToggleGroupVariantProps {}\n\nexport const ToggleGroupRoot = withProvider(ToggleGroup.Root, \"root\", { baseComponent: true });\n\nexport interface ToggleGroupItemProps extends ToggleGroup.ItemProps, StyledProps {}\n\nexport const ToggleGroupItem = withContext(ToggleGroup.Item, \"item\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AAwBA,MAAM,EAAE,cAAc,gBAAgB,mBAXZ,IAAI;CAC5B,OAAO,mBAAmB,MAAM;CAChC,MAAM,EACJ,MAAM;EACJ,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACF;CACF,CAAC,CAEyE;AAK3E,MAAa,kBAAkB,aAAa,YAAY,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAI9F,MAAa,kBAAkB,YAAY,YAAY,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"ToggleGroup.mjs","names":[],"sources":["../src/ToggleGroup.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 { toggleGroupAnatomy, ToggleGroup } 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\";\n\nconst toggleGroupRecipe = sva({\n slots: toggleGroupAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"row\",\n gap: \"4xsmall\",\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(toggleGroupRecipe);\n\nexport type ToggleGroupVariantProps = NonNullable<RecipeVariantProps<typeof toggleGroupRecipe>>;\nexport interface ToggleGroupRootProps extends ToggleGroup.RootProps, StyledProps, ToggleGroupVariantProps {}\n\nexport const ToggleGroupRoot = withProvider(ToggleGroup.Root, \"root\", { baseComponent: true });\n\nexport interface ToggleGroupItemProps extends ToggleGroup.ItemProps, StyledProps {}\n\nexport const ToggleGroupItem = withContext(ToggleGroup.Item, \"item\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;AAwBA,MAAM,EAAE,cAAc,gBAAgB,mBAXZ,IAAI;CAC5B,OAAO,mBAAmB,MAAM;CAChC,MAAM,EACJ,MAAM;EACJ,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACF;CACF,CAEyE,CAAC;AAK3E,MAAa,kBAAkB,aAAa,YAAY,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAI9F,MAAa,kBAAkB,YAAY,YAAY,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC"}