@ndla/primitives 1.0.107-alpha.0 → 1.0.109-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 (168) hide show
  1. package/dist/panda.buildinfo.json +4 -1
  2. package/dist/styles.css +17 -4
  3. package/es/ArticleLists.mjs +7 -0
  4. package/es/ArticleLists.mjs.map +1 -1
  5. package/es/Badge.mjs +8 -1
  6. package/es/Badge.mjs.map +1 -1
  7. package/es/BlockQuote.mjs +7 -0
  8. package/es/BlockQuote.mjs.map +1 -1
  9. package/es/Button.mjs +7 -0
  10. package/es/Button.mjs.map +1 -1
  11. package/es/Card/Card.mjs +28 -12
  12. package/es/Card/Card.mjs.map +1 -1
  13. package/es/Combobox.mjs +7 -0
  14. package/es/Combobox.mjs.map +1 -1
  15. package/es/DatePicker.mjs +7 -0
  16. package/es/DatePicker.mjs.map +1 -1
  17. package/es/Dialog.mjs +7 -0
  18. package/es/Dialog.mjs.map +1 -1
  19. package/es/ErrorMessage/ErrorMessage.mjs +7 -0
  20. package/es/ErrorMessage/ErrorMessage.mjs.map +1 -1
  21. package/es/ExpandableBox.mjs +7 -0
  22. package/es/ExpandableBox.mjs.map +1 -1
  23. package/es/Field.mjs +7 -0
  24. package/es/Field.mjs.map +1 -1
  25. package/es/FieldErrorMessage.mjs +7 -0
  26. package/es/FieldErrorMessage.mjs.map +1 -1
  27. package/es/FieldHelper.mjs +7 -0
  28. package/es/FieldHelper.mjs.map +1 -1
  29. package/es/Figure.mjs +7 -0
  30. package/es/Figure.mjs.map +1 -1
  31. package/es/FileUpload.mjs +7 -0
  32. package/es/FileUpload.mjs.map +1 -1
  33. package/es/FramedContent.mjs +7 -0
  34. package/es/FramedContent.mjs.map +1 -1
  35. package/es/Hero.mjs +7 -0
  36. package/es/Hero.mjs.map +1 -1
  37. package/es/Image.mjs +7 -0
  38. package/es/Image.mjs.map +1 -1
  39. package/es/Input.mjs +7 -0
  40. package/es/Input.mjs.map +1 -1
  41. package/es/Label.mjs +7 -0
  42. package/es/Label.mjs.map +1 -1
  43. package/es/Layout/PageContainer.mjs +7 -0
  44. package/es/Layout/PageContainer.mjs.map +1 -1
  45. package/es/Layout/PageContent.mjs +7 -0
  46. package/es/Layout/PageContent.mjs.map +1 -1
  47. package/es/ListItem/ListItem.mjs +7 -0
  48. package/es/ListItem/ListItem.mjs.map +1 -1
  49. package/es/Menu.mjs +7 -0
  50. package/es/Menu.mjs.map +1 -1
  51. package/es/MessageBox.mjs +7 -0
  52. package/es/MessageBox.mjs.map +1 -1
  53. package/es/Pagination.mjs +7 -0
  54. package/es/Pagination.mjs.map +1 -1
  55. package/es/Popover.mjs +7 -0
  56. package/es/Popover.mjs.map +1 -1
  57. package/es/RadioGroup.mjs +7 -0
  58. package/es/RadioGroup.mjs.map +1 -1
  59. package/es/Select.mjs +7 -0
  60. package/es/Select.mjs.map +1 -1
  61. package/es/Skeleton.mjs +7 -0
  62. package/es/Skeleton.mjs.map +1 -1
  63. package/es/Spinner.mjs +7 -0
  64. package/es/Spinner.mjs.map +1 -1
  65. package/es/Table.mjs +7 -0
  66. package/es/Table.mjs.map +1 -1
  67. package/es/TagsInput.mjs +7 -0
  68. package/es/TagsInput.mjs.map +1 -1
  69. package/es/Text.mjs +7 -0
  70. package/es/Text.mjs.map +1 -1
  71. package/es/ToggleGroup.mjs +7 -0
  72. package/es/ToggleGroup.mjs.map +1 -1
  73. package/es/Tooltip.mjs +7 -0
  74. package/es/Tooltip.mjs.map +1 -1
  75. package/es/Tree/Tree.mjs +7 -0
  76. package/es/Tree/Tree.mjs.map +1 -1
  77. package/lib/Accordion.js +0 -5
  78. package/lib/Accordion.js.map +1 -1
  79. package/lib/ArticleLists.js +7 -6
  80. package/lib/ArticleLists.js.map +1 -1
  81. package/lib/Badge.d.ts +1 -1
  82. package/lib/Badge.js +8 -7
  83. package/lib/Badge.js.map +1 -1
  84. package/lib/BlockQuote.js +7 -6
  85. package/lib/BlockQuote.js.map +1 -1
  86. package/lib/Button.js +7 -6
  87. package/lib/Button.js.map +1 -1
  88. package/lib/Card/Card.d.ts +16 -8
  89. package/lib/Card/Card.js +28 -18
  90. package/lib/Card/Card.js.map +1 -1
  91. package/lib/Checkbox.js +0 -5
  92. package/lib/Checkbox.js.map +1 -1
  93. package/lib/Combobox.js +7 -6
  94. package/lib/Combobox.js.map +1 -1
  95. package/lib/DatePicker.js +7 -6
  96. package/lib/DatePicker.js.map +1 -1
  97. package/lib/Dialog.js +7 -6
  98. package/lib/Dialog.js.map +1 -1
  99. package/lib/ErrorMessage/ErrorMessage.js +7 -6
  100. package/lib/ErrorMessage/ErrorMessage.js.map +1 -1
  101. package/lib/ExpandableBox.js +7 -5
  102. package/lib/ExpandableBox.js.map +1 -1
  103. package/lib/Field.js +7 -3
  104. package/lib/Field.js.map +1 -1
  105. package/lib/FieldErrorMessage.js +7 -6
  106. package/lib/FieldErrorMessage.js.map +1 -1
  107. package/lib/FieldHelper.js +7 -6
  108. package/lib/FieldHelper.js.map +1 -1
  109. package/lib/Figure.js +7 -6
  110. package/lib/Figure.js.map +1 -1
  111. package/lib/FileUpload.js +7 -6
  112. package/lib/FileUpload.js.map +1 -1
  113. package/lib/FramedContent.js +7 -6
  114. package/lib/FramedContent.js.map +1 -1
  115. package/lib/Hero.js +7 -4
  116. package/lib/Hero.js.map +1 -1
  117. package/lib/Image.js +7 -5
  118. package/lib/Image.js.map +1 -1
  119. package/lib/Input.js +7 -7
  120. package/lib/Label.js +7 -6
  121. package/lib/Label.js.map +1 -1
  122. package/lib/Layout/PageContainer.js +7 -5
  123. package/lib/Layout/PageContainer.js.map +1 -1
  124. package/lib/Layout/PageContent.js +7 -6
  125. package/lib/Layout/PageContent.js.map +1 -1
  126. package/lib/ListItem/ListItem.js +7 -6
  127. package/lib/ListItem/ListItem.js.map +1 -1
  128. package/lib/Menu.js +7 -6
  129. package/lib/Menu.js.map +1 -1
  130. package/lib/MessageBox.js +7 -6
  131. package/lib/MessageBox.js.map +1 -1
  132. package/lib/NdlaLogo.js +7 -5
  133. package/lib/NdlaLogo.js.map +1 -1
  134. package/lib/Pagination.js +7 -4
  135. package/lib/Pagination.js.map +1 -1
  136. package/lib/Popover.js +7 -6
  137. package/lib/Popover.js.map +1 -1
  138. package/lib/RadioGroup.js +7 -6
  139. package/lib/RadioGroup.js.map +1 -1
  140. package/lib/Select.js +7 -6
  141. package/lib/Select.js.map +1 -1
  142. package/lib/Skeleton.js +7 -3
  143. package/lib/Skeleton.js.map +1 -1
  144. package/lib/Slider.js +0 -5
  145. package/lib/Slider.js.map +1 -1
  146. package/lib/Spinner.js +7 -6
  147. package/lib/Spinner.js.map +1 -1
  148. package/lib/Switch.js +0 -5
  149. package/lib/Switch.js.map +1 -1
  150. package/lib/Table.js +7 -3
  151. package/lib/Table.js.map +1 -1
  152. package/lib/Tabs.js +0 -5
  153. package/lib/Tabs.js.map +1 -1
  154. package/lib/TagsInput.js +7 -6
  155. package/lib/TagsInput.js.map +1 -1
  156. package/lib/Text.js +7 -6
  157. package/lib/Text.js.map +1 -1
  158. package/lib/Toast.js +0 -5
  159. package/lib/Toast.js.map +1 -1
  160. package/lib/ToggleGroup.js +7 -4
  161. package/lib/ToggleGroup.js.map +1 -1
  162. package/lib/Tooltip.js +7 -6
  163. package/lib/Tooltip.js.map +1 -1
  164. package/lib/Tree/Tree.js +7 -6
  165. package/lib/Tree/Tree.js.map +1 -1
  166. package/lib/index.js +0 -2
  167. package/package.json +3 -3
  168. package/lib/_virtual/rolldown_runtime.js +0 -25
@@ -110,6 +110,7 @@
110
110
  "backgroundColor]___[value:surface.brand.3.subtle",
111
111
  "borderColor]___[value:surface.brand.3.strong",
112
112
  "backgroundColor]___[value:surface.infoSubtle",
113
+ "borderColor]___[value:stroke.info",
113
114
  "backgroundColor]___[value:surface.dangerSubtle",
114
115
  "borderColor]___[value:surface.danger",
115
116
  "backgroundColor]___[value:surface.successSubtle",
@@ -682,6 +683,9 @@
682
683
  "flexDirection]___[value:row",
683
684
  "--arrow-size]___[value:spacing.xxsmall",
684
685
  "--arrow-background]___[value:colors.surface.action",
686
+ "outlineOffset]___[value:-1px",
687
+ "boxShadow]___[value:xsmall",
688
+ "transitionProperty]___[value:background, color, outline-color",
685
689
  "height]___[value:200px",
686
690
  "gap]___[value:xxlarge",
687
691
  "gap]___[value:medium",
@@ -710,7 +714,6 @@
710
714
  "transitionProperty]___[value:background-color, border-color, color",
711
715
  "transitionDuration]___[value:superFast",
712
716
  "transitionTimingFunction]___[value:ease-in-out",
713
- "boxShadow]___[value:xsmall",
714
717
  "borderColor]___[value:stroke.hover]___[cond:_highlighted",
715
718
  "backgroundColor]___[value:surface.hover]___[cond:_highlighted",
716
719
  "backgroundColor]___[value:surface.hover]___[cond:_hover",
package/dist/styles.css CHANGED
@@ -433,6 +433,10 @@
433
433
  border-color: var(--colors-surface-brand-3-strong);
434
434
  }
435
435
 
436
+ .bd-c_stroke\.info {
437
+ border-color: var(--colors-stroke-info);
438
+ }
439
+
436
440
  .bd-c_surface\.danger {
437
441
  border-color: var(--colors-surface-danger);
438
442
  }
@@ -1188,6 +1192,19 @@
1188
1192
  flex-direction: row;
1189
1193
  }
1190
1194
 
1195
+ .ring-o_-1px {
1196
+ outline-offset: -1px;
1197
+ }
1198
+
1199
+ .bx-sh_xsmall {
1200
+ box-shadow: var(--shadows-xsmall);
1201
+ }
1202
+
1203
+ .trs-prop_background\,_color\,_outline-color {
1204
+ --transition-prop: background, color, outline-color;
1205
+ transition-property: background, color, outline-color;
1206
+ }
1207
+
1191
1208
  .pbe_5xlarge {
1192
1209
  padding-block-end: var(--spacing-5xlarge);
1193
1210
  }
@@ -1236,10 +1253,6 @@
1236
1253
  transition-timing-function: ease-in-out;
1237
1254
  }
1238
1255
 
1239
- .bx-sh_xsmall {
1240
- box-shadow: var(--shadows-xsmall);
1241
- }
1242
-
1243
1256
  .ps_calc\(\(var\(--depth\)_-_1\)_\*_token\(spacing\.medium\)\) {
1244
1257
  padding-inline-start: calc((var(--depth) - 1) * var(--spacing-medium));
1245
1258
  }
@@ -5,6 +5,13 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { forwardRef, useMemo } from "react";
6
6
 
7
7
  //#region src/ArticleLists.tsx
8
+ /**
9
+ * Copyright (c) 2024-present, NDLA.
10
+ *
11
+ * This source code is licensed under the GPLv3 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ *
14
+ */
8
15
  const LIST_ITEM = "& > li";
9
16
  const LETTER_LIST = "& > ol[data-variant='letters']";
10
17
  const NUMBER_LIST = "& > ol:not([data-variant='letters'])";
@@ -1 +1 @@
1
- {"version":3,"file":"ArticleLists.mjs","names":[],"sources":["../src/ArticleLists.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 CSSProperties, forwardRef, useMemo } from \"react\";\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 { HTMLStyledProps, RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst LIST_ITEM = \"& > li\";\nconst LETTER_LIST = \"& > ol[data-variant='letters']\";\nconst NUMBER_LIST = \"& > ol:not([data-variant='letters'])\";\nconst LETTER_LIST_ITEM = `${LETTER_LIST} > li`;\n\nconst orderedListRecipe = cva({\n base: {\n marginInlineStart: \"small\",\n paddingInlineStart: \"small\",\n [LIST_ITEM]: {\n \"& > ul\": {\n marginInlineStart: \"0 !important\",\n },\n _before: {\n position: \"absolute\",\n transform: \"translateX(calc(-100% + (token(spacing.small) * -1)))\",\n fontVariantNumeric: \"tabular-nums\",\n },\n },\n \"& li\": {\n marginBlock: \"small\",\n },\n },\n defaultVariants: {\n variant: \"numbers\",\n },\n variants: {\n variant: {\n numbers: {\n [NUMBER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level2\",\n \"&[data-count='true']\": {\n counterReset: \"level2 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"small\",\n counterIncrement: \"level2\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level3\",\n \"&[data-count='true']\": {\n counterReset: \"level3 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(1.5ch + token(spacing.small))\",\n counterIncrement: \"level3\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level4\",\n \"&[data-count='true']\": {\n counterReset: \"level4 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(3ch + token(spacing.small))\",\n counterIncrement: \"level4\",\n _before: {\n content:\n \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n letters: {\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LETTER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, upper-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-roman) '. '\",\n },\n },\n },\n },\n },\n },\n },\n});\n\nexport type OrderedListVariantProps = NonNullable<RecipeVariantProps<typeof orderedListRecipe>>;\n\nexport interface OrderedListProps extends StyledProps, HTMLArkProps<\"ol\">, OrderedListVariantProps {}\n\nconst StyledOrderedList = styled(ark.ol, {}, { baseComponent: true });\n\nexport const OrderedList = forwardRef<HTMLOListElement, OrderedListProps>(\n ({ variant, css: cssProp, start, ...props }, ref) => {\n const style = useMemo(() => ({ \"--start\": start ? start - 1 : undefined }) as CSSProperties, [start]);\n return (\n <StyledOrderedList\n data-embed-type=\"ordered-list\"\n data-variant={variant}\n data-count={start !== undefined}\n css={css.raw(orderedListRecipe.raw({ variant }), cssProp)}\n style={style}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport interface UnOrderedListProps extends StyledProps, HTMLArkProps<\"ul\"> {}\n\nexport const UnOrderedList = styled(\"ul\", {\n base: {\n listStyle: \"revert\",\n marginInlineStart: \"medium\",\n paddingInlineStart: \"small\",\n \"& ul\": {\n marginInlineStart: \"0\",\n },\n \"& li\": {\n marginBlock: \"small\",\n paddingInlineStart: \"small\",\n _marker: {\n color: \"icon.strong\",\n },\n\n \"& > ol\": {\n marginInlineStart: \"0 !important\",\n },\n },\n\n listStyleType: \"disc\",\n \"& > li > ul\": {\n listStyleType: \"circle\",\n \"& > li > ul\": {\n listStyleType: \"square\",\n },\n },\n },\n});\n\nexport const DefinitionList = styled(\"dl\", {\n base: {\n \"& dt\": {\n fontWeight: \"bold\",\n },\n \"& dd\": {\n marginInlineStart: \"medium\",\n },\n },\n});\n\nexport type DefinitionListProps = HTMLStyledProps<\"dl\">;\n"],"mappings":";;;;;;;AAcA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,mBAAmB,GAAG,YAAY;AAExC,MAAM,oBAAoB,IAAI;CAC5B,MAAM;EACJ,mBAAmB;EACnB,oBAAoB;GACnB,YAAY;GACX,UAAU,EACR,mBAAmB,gBACpB;GACD,SAAS;IACP,UAAU;IACV,WAAW;IACX,oBAAoB;IACrB;GACF;EACD,QAAQ,EACN,aAAa,SACd;EACF;CACD,iBAAiB,EACf,SAA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ACL,GAAI;GACJ;EAGP;AAID,MAAa,gBAAgB,OAAO,MAAM,EACxC,MAAM;CACJ,WAAW;CACX,mBAAmB;CACnB,oBAAoB;CACpB,QAAQ,EACN,mBAAmB,KACpB;CACD,QAAQ;EACN,aAAa;EACb,oBAAoB;EACpB,SAAS,EACP,OAAO,eACR;EAED,UAAU,EACR,mBAAmB,gBACpB;EACF;CAED,eAAe;CACf,eAAe;EACb,eAAe;EACf,eAAe,EACb,eAAe,UAChB;EACF;CACF,EACF,CAAC;AAEF,MAAa,iBAAiB,OAAO,MAAM,EACzC,MAAM;CACJ,QAAQ,EACN,YAAY,QACb;CACD,QAAQ,EACN,mBAAmB,UACpB;CACF,EACF,CAAC"}
1
+ {"version":3,"file":"ArticleLists.mjs","names":[],"sources":["../src/ArticleLists.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 CSSProperties, forwardRef, useMemo } from \"react\";\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 { HTMLStyledProps, RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst LIST_ITEM = \"& > li\";\nconst LETTER_LIST = \"& > ol[data-variant='letters']\";\nconst NUMBER_LIST = \"& > ol:not([data-variant='letters'])\";\nconst LETTER_LIST_ITEM = `${LETTER_LIST} > li`;\n\nconst orderedListRecipe = cva({\n base: {\n marginInlineStart: \"small\",\n paddingInlineStart: \"small\",\n [LIST_ITEM]: {\n \"& > ul\": {\n marginInlineStart: \"0 !important\",\n },\n _before: {\n position: \"absolute\",\n transform: \"translateX(calc(-100% + (token(spacing.small) * -1)))\",\n fontVariantNumeric: \"tabular-nums\",\n },\n },\n \"& li\": {\n marginBlock: \"small\",\n },\n },\n defaultVariants: {\n variant: \"numbers\",\n },\n variants: {\n variant: {\n numbers: {\n [NUMBER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level2\",\n \"&[data-count='true']\": {\n counterReset: \"level2 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"small\",\n counterIncrement: \"level2\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level3\",\n \"&[data-count='true']\": {\n counterReset: \"level3 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(1.5ch + token(spacing.small))\",\n counterIncrement: \"level3\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level4\",\n \"&[data-count='true']\": {\n counterReset: \"level4 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(3ch + token(spacing.small))\",\n counterIncrement: \"level4\",\n _before: {\n content:\n \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n letters: {\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LETTER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, upper-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-roman) '. '\",\n },\n },\n },\n },\n },\n },\n },\n});\n\nexport type OrderedListVariantProps = NonNullable<RecipeVariantProps<typeof orderedListRecipe>>;\n\nexport interface OrderedListProps extends StyledProps, HTMLArkProps<\"ol\">, OrderedListVariantProps {}\n\nconst StyledOrderedList = styled(ark.ol, {}, { baseComponent: true });\n\nexport const OrderedList = forwardRef<HTMLOListElement, OrderedListProps>(\n ({ variant, css: cssProp, start, ...props }, ref) => {\n const style = useMemo(() => ({ \"--start\": start ? start - 1 : undefined }) as CSSProperties, [start]);\n return (\n <StyledOrderedList\n data-embed-type=\"ordered-list\"\n data-variant={variant}\n data-count={start !== undefined}\n css={css.raw(orderedListRecipe.raw({ variant }), cssProp)}\n style={style}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport interface UnOrderedListProps extends StyledProps, HTMLArkProps<\"ul\"> {}\n\nexport const UnOrderedList = styled(\"ul\", {\n base: {\n listStyle: \"revert\",\n marginInlineStart: \"medium\",\n paddingInlineStart: \"small\",\n \"& ul\": {\n marginInlineStart: \"0\",\n },\n \"& li\": {\n marginBlock: \"small\",\n paddingInlineStart: \"small\",\n _marker: {\n color: \"icon.strong\",\n },\n\n \"& > ol\": {\n marginInlineStart: \"0 !important\",\n },\n },\n\n listStyleType: \"disc\",\n \"& > li > ul\": {\n listStyleType: \"circle\",\n \"& > li > ul\": {\n listStyleType: \"square\",\n },\n },\n },\n});\n\nexport const DefinitionList = styled(\"dl\", {\n base: {\n \"& dt\": {\n fontWeight: \"bold\",\n },\n \"& dd\": {\n marginInlineStart: \"medium\",\n },\n },\n});\n\nexport type DefinitionListProps = HTMLStyledProps<\"dl\">;\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,mBAAmB,GAAG,YAAY;AAExC,MAAM,oBAAoB,IAAI;CAC5B,MAAM;EACJ,mBAAmB;EACnB,oBAAoB;GACnB,YAAY;GACX,UAAU,EACR,mBAAmB,gBACpB;GACD,SAAS;IACP,UAAU;IACV,WA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EACtB,KAAK,IAAI,IAAI,kBAAkB,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ;EAClD;EACF;EACL,GAAI;GACJ;EAGP;AAID,MAAa,gBAAgB,OAAO,MAAM,EACxC,MAAM;CACJ,WAAW;CACX,mBAAmB;CACnB,oBAAoB;CACpB,QAAQ,EACN,mBAAmB,KACpB;CACD,QAAQ;EACN,aAAa;EACb,oBAAoB;EACpB,SAAS,EACP,OAAO,eACR;EAED,UAAU,EACR,mBAAmB,gBACpB;EACF;CAED,eAAe;CACf,eAAe;EACb,eAAe;EACf,eAAe,EACb,eAAe,UAChB;EACF;CACF,EACF,CAAC;AAEF,MAAa,iBAAiB,OAAO,MAAM,EACzC,MAAM;CACJ,QAAQ,EACN,YAAY,QACb;CACD,QAAQ,EACN,mBAAmB,UACpB;CACF,EACF,CAAC"}
package/es/Badge.mjs CHANGED
@@ -5,6 +5,13 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { forwardRef } from "react";
6
6
 
7
7
  //#region src/Badge.tsx
8
+ /**
9
+ * Copyright (c) 2024-present, NDLA.
10
+ *
11
+ * This source code is licensed under the GPLv3 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ *
14
+ */
8
15
  const badgeRecipe = cva({
9
16
  base: {
10
17
  paddingInline: "xsmall",
@@ -37,7 +44,7 @@ const badgeRecipe = cva({
37
44
  },
38
45
  neutral: {
39
46
  backgroundColor: "surface.infoSubtle",
40
- borderColor: "stroke.default"
47
+ borderColor: "stroke.info"
41
48
  },
42
49
  danger: {
43
50
  backgroundColor: "surface.dangerSubtle",
package/es/Badge.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.mjs","names":[],"sources":["../src/Badge.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 { forwardRef } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst badgeRecipe = cva({\n base: {\n paddingInline: \"xsmall\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n width: \"fit-content\",\n color: \"text.default\",\n },\n defaultVariants: {\n colorTheme: \"neutral\",\n size: \"medium\",\n },\n variants: {\n size: {\n small: {\n textStyle: \"label.small\",\n },\n medium: {\n textStyle: \"label.medium\",\n },\n },\n colorTheme: {\n brand1: {\n backgroundColor: \"surface.brand.1.moderate\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n backgroundColor: \"surface.brand.2.moderate\",\n borderColor: \"surface.brand.2.strong\",\n },\n brand3: {\n backgroundColor: \"surface.brand.3.subtle\",\n borderColor: \"surface.brand.3.strong\",\n },\n neutral: {\n backgroundColor: \"surface.infoSubtle\",\n borderColor: \"stroke.default\",\n },\n danger: {\n backgroundColor: \"surface.dangerSubtle\",\n borderColor: \"surface.danger\",\n },\n success: {\n backgroundColor: \"surface.successSubtle\",\n borderColor: \"surface.success\",\n },\n warning: {\n backgroundColor: \"surface.warningSubtle\",\n borderColor: \"surface.warning\",\n },\n },\n },\n});\n\nexport type BadgeVariantProps = NonNullable<RecipeVariantProps<typeof badgeRecipe>>;\n\nexport type BadgeVariant = NonNullable<BadgeVariantProps>[\"colorTheme\"];\n\nexport interface BadgeProps extends StyledProps, HTMLArkProps<\"div\">, BadgeVariantProps {}\n\nconst StyledBadge = styled(ark.div, {}, { baseComponent: true });\n\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(({ colorTheme, size, css: cssProp, ...props }, ref) => (\n <StyledBadge css={css.raw(badgeRecipe.raw({ colorTheme, size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,cAAc,IAAI;CACtB,MAAM;EACJ,eAAe;EACf,cAAc;EACd,QAAQ;EACR,OAAO;EACP,OAAO;EACR;CACD,iBAAiB;EACf,YAAY;EACZ,MAAM;EACP;CACD,UAAU;EACR,MAAM;GACJ,OAAO,EACL,WAAW,eACZ;GACD,QAAQ,EACN,WAAW,gBACZ;GACF;EACD,YAAY;GACV,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACF;EACF;CACF,CAAC;AAQF,MAAM,cAAc,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAEhE,MAAa,QAAQ,YAAwC,EAAE,YAAY,MAAM,KAAK,QAAS,GAAG,SAAS,QACzG,oBAAC;CAAY,KAAK,IAAI,IAAI,YAAY,IAAI;EAAE;EAAY;EAAM,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CAClG"}
1
+ {"version":3,"file":"Badge.mjs","names":[],"sources":["../src/Badge.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 { forwardRef } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst badgeRecipe = cva({\n base: {\n paddingInline: \"xsmall\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n width: \"fit-content\",\n color: \"text.default\",\n },\n defaultVariants: {\n colorTheme: \"neutral\",\n size: \"medium\",\n },\n variants: {\n size: {\n small: {\n textStyle: \"label.small\",\n },\n medium: {\n textStyle: \"label.medium\",\n },\n },\n colorTheme: {\n brand1: {\n backgroundColor: \"surface.brand.1.moderate\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n backgroundColor: \"surface.brand.2.moderate\",\n borderColor: \"surface.brand.2.strong\",\n },\n brand3: {\n backgroundColor: \"surface.brand.3.subtle\",\n borderColor: \"surface.brand.3.strong\",\n },\n neutral: {\n backgroundColor: \"surface.infoSubtle\",\n borderColor: \"stroke.info\",\n },\n danger: {\n backgroundColor: \"surface.dangerSubtle\",\n borderColor: \"surface.danger\",\n },\n success: {\n backgroundColor: \"surface.successSubtle\",\n borderColor: \"surface.success\",\n },\n warning: {\n backgroundColor: \"surface.warningSubtle\",\n borderColor: \"surface.warning\",\n },\n },\n },\n});\n\nexport type BadgeVariantProps = NonNullable<RecipeVariantProps<typeof badgeRecipe>>;\n\nexport type BadgeVariant = NonNullable<BadgeVariantProps>[\"colorTheme\"];\n\nexport interface BadgeProps extends StyledProps, HTMLArkProps<\"div\">, BadgeVariantProps {}\n\nconst StyledBadge = styled(ark.div, {}, { baseComponent: true });\n\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(({ colorTheme, size, css: cssProp, ...props }, ref) => (\n <StyledBadge css={css.raw(badgeRecipe.raw({ colorTheme, size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,cAAc,IAAI;CACtB,MAAM;EACJ,eAAe;EACf,cAAc;EACd,QAAQ;EACR,OAAO;EACP,OAAO;EACR;CACD,iBAAiB;EACf,YAAY;EACZ,MAAM;EACP;CACD,UAAU;EACR,MAAM;GACJ,OAAO,EACL,WAAW,eACZ;GACD,QAAQ,EACN,WAAW,gBACZ;GACF;EACD,YAAY;GACV,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACF;EACF;CACF,CAAC;AAQF,MAAM,cAAc,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAEhE,MAAa,QAAQ,YAAwC,EAAE,YAAY,MAAM,KAAK,QAAS,GAAG,SAAS,QACzG,oBAAC;CAAY,KAAK,IAAI,IAAI,YAAY,IAAI;EAAE;EAAY;EAAM,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CAClG"}
package/es/BlockQuote.mjs CHANGED
@@ -5,6 +5,13 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { forwardRef } from "react";
6
6
 
7
7
  //#region src/BlockQuote.tsx
8
+ /**
9
+ * Copyright (c) 2024-present, NDLA.
10
+ *
11
+ * This source code is licensed under the GPLv3 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ *
14
+ */
8
15
  const blockQuoteRecipe = cva({
9
16
  base: {
10
17
  borderInlineStart: "4px solid",
@@ -1 +1 @@
1
- {"version":3,"file":"BlockQuote.mjs","names":[],"sources":["../src/BlockQuote.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 { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst blockQuoteRecipe = cva({\n base: {\n borderInlineStart: \"4px solid\",\n paddingInline: \"medium\",\n },\n variants: {\n variant: {\n neutral: {\n borderColor: \"stroke.subtle\",\n background: \"surface.default\",\n },\n brand1: {\n background: \"surface.brand.1.subtle\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n background: \"surface.brand.2.subtle\",\n borderColor: \"surface.brand.2.strong\",\n },\n },\n },\n defaultVariants: {\n variant: \"neutral\",\n },\n});\n\nexport type BlockQuoteVariantProps = NonNullable<RecipeVariantProps<typeof blockQuoteRecipe>>;\n\nexport interface BlockQuoteProps extends HTMLArkProps<\"blockquote\">, StyledProps, BlockQuoteVariantProps {}\n\nconst StyledBlockQuote = styled(ark.blockquote, {}, { baseComponent: true });\n\nexport const BlockQuote = forwardRef<HTMLQuoteElement, BlockQuoteProps>(({ variant, css: cssProp, ...props }, ref) => (\n <StyledBlockQuote css={css.raw(blockQuoteRecipe.raw({ variant }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,mBAAmB,IAAI;CAC3B,MAAM;EACJ,mBAAmB;EACnB,eAAe;EAChB;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,aAAa;GACb,YAAY;GACb;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACF,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CAAC;AAMF,MAAM,mBAAmB,OAAO,IAAI,YAAY,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAE5E,MAAa,aAAa,YAA+C,EAAE,SAAS,KAAK,QAAS,GAAG,SAAS,QAC5G,oBAAC;CAAiB,KAAK,IAAI,IAAI,iBAAiB,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CACnG"}
1
+ {"version":3,"file":"BlockQuote.mjs","names":[],"sources":["../src/BlockQuote.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 { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst blockQuoteRecipe = cva({\n base: {\n borderInlineStart: \"4px solid\",\n paddingInline: \"medium\",\n },\n variants: {\n variant: {\n neutral: {\n borderColor: \"stroke.subtle\",\n background: \"surface.default\",\n },\n brand1: {\n background: \"surface.brand.1.subtle\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n background: \"surface.brand.2.subtle\",\n borderColor: \"surface.brand.2.strong\",\n },\n },\n },\n defaultVariants: {\n variant: \"neutral\",\n },\n});\n\nexport type BlockQuoteVariantProps = NonNullable<RecipeVariantProps<typeof blockQuoteRecipe>>;\n\nexport interface BlockQuoteProps extends HTMLArkProps<\"blockquote\">, StyledProps, BlockQuoteVariantProps {}\n\nconst StyledBlockQuote = styled(ark.blockquote, {}, { baseComponent: true });\n\nexport const BlockQuote = forwardRef<HTMLQuoteElement, BlockQuoteProps>(({ variant, css: cssProp, ...props }, ref) => (\n <StyledBlockQuote css={css.raw(blockQuoteRecipe.raw({ variant }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,mBAAmB,IAAI;CAC3B,MAAM;EACJ,mBAAmB;EACnB,eAAe;EAChB;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,aAAa;GACb,YAAY;GACb;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACF,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CAAC;AAMF,MAAM,mBAAmB,OAAO,IAAI,YAAY,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAE5E,MAAa,aAAa,YAA+C,EAAE,SAAS,KAAK,QAAS,GAAG,SAAS,QAC5G,oBAAC;CAAiB,KAAK,IAAI,IAAI,iBAAiB,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CACnG"}
package/es/Button.mjs CHANGED
@@ -6,6 +6,13 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { forwardRef, useMemo } from "react";
7
7
 
8
8
  //#region src/Button.tsx
9
+ /**
10
+ * Copyright (c) 2024-present, NDLA.
11
+ *
12
+ * This source code is licensed under the GPLv3 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ *
15
+ */
9
16
  const buttonBaseRecipe = cva({
10
17
  base: {
11
18
  display: "inline-flex",
package/es/Button.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","names":[],"sources":["../src/Button.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 ReactNode, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariant, StyledProps } from \"@ndla/styled-system/types\";\nimport { Spinner } from \"./Spinner\";\n\nexport const buttonBaseRecipe = cva({\n base: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"xxsmall\",\n cursor: \"pointer\",\n textDecoration: \"none\",\n fontWeight: \"bold\",\n transitionProperty: \"all\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n textAlign: \"center\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.onAction\",\n background: \"surface.disabled\",\n boxShadowColor: \"surface.disabled\",\n \"& svg\": {\n color: \"text.onAction\",\n },\n _hover: {\n color: \"text.onAction\",\n background: \"surface.disabled\",\n },\n },\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n variants: {\n variant: {\n primary: {\n color: \"text.onAction\",\n background: \"surface.action\",\n _hover: {\n color: \"text.onAction\",\n background: \"surface.action.hover\",\n },\n _active: {\n color: \"text.onAction\",\n background: \"surface.action.active\",\n },\n _focusVisible: {\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n _on: {\n background: \"surface.action.selected\",\n },\n },\n secondary: {\n color: \"text.strong\",\n background: \"surface.default\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n _active: {\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n },\n },\n tertiary: {\n color: \"text.strong\",\n background: \"transparent\",\n _hover: {\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n background: \"surface.actionSubtle.hover\",\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n },\n _active: {\n borderColor: \"stroke.default\",\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n },\n },\n clear: {\n background: \"transparent\",\n color: \"text.strong\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n clearSubtle: {\n background: \"transparent\",\n color: \"text.onAction\",\n _hover: {\n color: \"surface.actionSubtle.hover.strong\",\n },\n },\n danger: {\n background: \"surface.danger\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.danger.hover\",\n },\n _active: {\n background: \"surface.danger.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.danger\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n success: {\n background: \"surface.success\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.success.hover\",\n },\n _active: {\n background: \"surface.success.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.success\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n link: {\n background: \"transparent\",\n color: \"text.link\",\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n transitionProperty: \"unset\",\n transitionTimingFunction: \"unset\",\n transitionDuration: \"unset\",\n _hover: {\n textDecoration: \"none\",\n },\n _focusVisible: {\n boxShadow: \"none\",\n outline: \"3px\",\n borderRadius: \"xsmall\",\n outlineColor: \"stroke.default\",\n outlineOffset: \"3px\",\n outlineStyle: \"solid\",\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = cva({\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n textStyle: \"label.medium\",\n paddingInline: \"small\",\n paddingBlock: \"xxsmall\",\n minHeight: \"24\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n small: {\n textStyle: \"label.small\",\n minHeight: \"large\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n },\n },\n },\n});\n\nexport const iconButtonRecipe = cva({\n base: {\n lineHeight: \"1\",\n minHeight: \"unset\",\n },\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n \"--shadow-width\": \"3px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n paddingInline: \"xsmall\",\n paddingBlock: \"xsmall\",\n },\n small: {\n \"--shadow-width\": \"2px\",\n height: \"large\",\n width: \"large\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n paddingInline: \"xxsmall\",\n paddingBlock: \"xxsmall\",\n },\n },\n },\n});\n\ntype Variant = RecipeVariant<typeof buttonBaseRecipe>[\"variant\"];\n\ntype ButtonVariant = Exclude<Variant, \"clear\" | \"clearSubtle\">;\n\nexport interface ButtonVariantProps extends NonNullable<RecipeVariantProps<typeof buttonRecipe>> {\n variant?: ButtonVariant;\n}\n\nexport interface BaseButtonProps extends HTMLArkProps<\"button\">, StyledProps {\n loading?: boolean;\n loadingContent?: ReactNode;\n replaceContent?: boolean;\n}\n\nexport interface ButtonProps extends BaseButtonProps, ButtonVariantProps {}\n\nconst StyledButton = styled(ark.button, {}, { baseComponent: true, defaultProps: { type: \"button\" } });\n\nexport const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(\n ({ loading, loadingContent: loadingContentProp, replaceContent, onClick: _onClick, children, ...props }, ref) => {\n const ariaDisabled = loading ? { \"aria-disabled\": true } : {};\n\n const onClick = useMemo(() => (loading ? undefined : _onClick), [_onClick, loading]);\n\n const loadingContent = useMemo(() => {\n return replaceContent ? (\n loadingContentProp\n ) : (\n <>\n {loadingContentProp}\n {children}\n </>\n );\n }, [children, loadingContentProp, replaceContent]);\n\n return (\n <StyledButton onClick={onClick} {...ariaDisabled} {...props} ref={ref}>\n {loading ? loadingContent : children}\n </StyledButton>\n );\n },\n);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, loadingContent, size, css: cssProp, ...props }, ref) => (\n <BaseButton\n {...props}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n css={css.raw(\n buttonBaseRecipe.raw({ variant }),\n variant !== \"link\" ? buttonRecipe.raw({ size }) : undefined,\n cssProp,\n )}\n ref={ref}\n />\n ),\n);\n\ntype IconButtonVariant = Exclude<Variant, \"link\">;\n\nexport interface IconButtonVariantProps extends NonNullable<RecipeVariantProps<typeof iconButtonRecipe>> {\n variant?: IconButtonVariant;\n}\n\nexport interface IconButtonProps extends BaseButtonProps, IconButtonVariantProps {}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ variant, css: cssProp, loadingContent, size, replaceContent = true, ...props }, ref) => (\n <BaseButton\n {...props}\n css={css.raw(buttonBaseRecipe.raw({ variant }), iconButtonRecipe.raw({ size }), cssProp)}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n replaceContent={replaceContent}\n ref={ref}\n />\n ),\n);\n"],"mappings":";;;;;;;;AAeA,MAAa,mBAAmB,IAAI;CAClC,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,YAAY;EACZ,oBAAoB;EACpB,oBAAoB;EACpB,0BAA0B;EAC1B,WAAW;EACX,cAAc;EACd,SAAS;EACT,gBAAgB;EAChB,WAAW;GACT,QAAQ;GACR,OAAO;GACP,YAAY;GACZ,gBAAgB;GAChB,SAAS,EACP,OAAO,iBACR;GACD,QAAQ;IACN,OAAO;IACP,YAAY;IACb;GACF;EACD,eAAe,EACb,WAAW,4DACZ;EACD,eAAe;GACb,YAAY;GACZ,oBAAoB;GACrB;EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,OAAO;IACP,YAAY;IACb;GACD,SAAS;IACP,OAAO;IACP,YAAY;IACb;GACD,eAAe,EACb,WACE,+HACH;GACD,KAAK,EACH,YAAY,2BACb;GACF;EACD,WAAW;GACT,OAAO;GACP,YAAY;GACZ,WAAW;GACX,QAAQ,EACN,YAAY,8BACb;GACD,SAAS,EACP,YAAY,qCACb;GACD,KAAK,EACH,YAAY,+BACb;GACF;EACD,UAAU;GACR,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,WAAW;IACX,YAAY;IACZ,eAAe,EACb,WAAW,4DACZ;IACF;GACD,SAAS;IACP,a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I,EAAE,MAAM,CAAC,EAAE,QAAQ;CACxF,gBAAgB,kBAAkB,oBAAC,WAAQ,MAAK,UAAU;CAC1C;CACX;EACL,CAEL"}
1
+ {"version":3,"file":"Button.mjs","names":[],"sources":["../src/Button.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 ReactNode, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariant, StyledProps } from \"@ndla/styled-system/types\";\nimport { Spinner } from \"./Spinner\";\n\nexport const buttonBaseRecipe = cva({\n base: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"xxsmall\",\n cursor: \"pointer\",\n textDecoration: \"none\",\n fontWeight: \"bold\",\n transitionProperty: \"all\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n textAlign: \"center\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.onAction\",\n background: \"surface.disabled\",\n boxShadowColor: \"surface.disabled\",\n \"& svg\": {\n color: \"text.onAction\",\n },\n _hover: {\n color: \"text.onAction\",\n background: \"surface.disabled\",\n },\n },\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n variants: {\n variant: {\n primary: {\n color: \"text.onAction\",\n background: \"surface.action\",\n _hover: {\n color: \"text.onAction\",\n background: \"surface.action.hover\",\n },\n _active: {\n color: \"text.onAction\",\n background: \"surface.action.active\",\n },\n _focusVisible: {\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n _on: {\n background: \"surface.action.selected\",\n },\n },\n secondary: {\n color: \"text.strong\",\n background: \"surface.default\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n _active: {\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n },\n },\n tertiary: {\n color: \"text.strong\",\n background: \"transparent\",\n _hover: {\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n background: \"surface.actionSubtle.hover\",\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n },\n _active: {\n borderColor: \"stroke.default\",\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n },\n },\n clear: {\n background: \"transparent\",\n color: \"text.strong\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n clearSubtle: {\n background: \"transparent\",\n color: \"text.onAction\",\n _hover: {\n color: \"surface.actionSubtle.hover.strong\",\n },\n },\n danger: {\n background: \"surface.danger\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.danger.hover\",\n },\n _active: {\n background: \"surface.danger.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.danger\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n success: {\n background: \"surface.success\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.success.hover\",\n },\n _active: {\n background: \"surface.success.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.success\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n link: {\n background: \"transparent\",\n color: \"text.link\",\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n transitionProperty: \"unset\",\n transitionTimingFunction: \"unset\",\n transitionDuration: \"unset\",\n _hover: {\n textDecoration: \"none\",\n },\n _focusVisible: {\n boxShadow: \"none\",\n outline: \"3px\",\n borderRadius: \"xsmall\",\n outlineColor: \"stroke.default\",\n outlineOffset: \"3px\",\n outlineStyle: \"solid\",\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = cva({\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n textStyle: \"label.medium\",\n paddingInline: \"small\",\n paddingBlock: \"xxsmall\",\n minHeight: \"24\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n small: {\n textStyle: \"label.small\",\n minHeight: \"large\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n },\n },\n },\n});\n\nexport const iconButtonRecipe = cva({\n base: {\n lineHeight: \"1\",\n minHeight: \"unset\",\n },\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n \"--shadow-width\": \"3px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n paddingInline: \"xsmall\",\n paddingBlock: \"xsmall\",\n },\n small: {\n \"--shadow-width\": \"2px\",\n height: \"large\",\n width: \"large\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n paddingInline: \"xxsmall\",\n paddingBlock: \"xxsmall\",\n },\n },\n },\n});\n\ntype Variant = RecipeVariant<typeof buttonBaseRecipe>[\"variant\"];\n\ntype ButtonVariant = Exclude<Variant, \"clear\" | \"clearSubtle\">;\n\nexport interface ButtonVariantProps extends NonNullable<RecipeVariantProps<typeof buttonRecipe>> {\n variant?: ButtonVariant;\n}\n\nexport interface BaseButtonProps extends HTMLArkProps<\"button\">, StyledProps {\n loading?: boolean;\n loadingContent?: ReactNode;\n replaceContent?: boolean;\n}\n\nexport interface ButtonProps extends BaseButtonProps, ButtonVariantProps {}\n\nconst StyledButton = styled(ark.button, {}, { baseComponent: true, defaultProps: { type: \"button\" } });\n\nexport const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(\n ({ loading, loadingContent: loadingContentProp, replaceContent, onClick: _onClick, children, ...props }, ref) => {\n const ariaDisabled = loading ? { \"aria-disabled\": true } : {};\n\n const onClick = useMemo(() => (loading ? undefined : _onClick), [_onClick, loading]);\n\n const loadingContent = useMemo(() => {\n return replaceContent ? (\n loadingContentProp\n ) : (\n <>\n {loadingContentProp}\n {children}\n </>\n );\n }, [children, loadingContentProp, replaceContent]);\n\n return (\n <StyledButton onClick={onClick} {...ariaDisabled} {...props} ref={ref}>\n {loading ? loadingContent : children}\n </StyledButton>\n );\n },\n);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, loadingContent, size, css: cssProp, ...props }, ref) => (\n <BaseButton\n {...props}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n css={css.raw(\n buttonBaseRecipe.raw({ variant }),\n variant !== \"link\" ? buttonRecipe.raw({ size }) : undefined,\n cssProp,\n )}\n ref={ref}\n />\n ),\n);\n\ntype IconButtonVariant = Exclude<Variant, \"link\">;\n\nexport interface IconButtonVariantProps extends NonNullable<RecipeVariantProps<typeof iconButtonRecipe>> {\n variant?: IconButtonVariant;\n}\n\nexport interface IconButtonProps extends BaseButtonProps, IconButtonVariantProps {}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ variant, css: cssProp, loadingContent, size, replaceContent = true, ...props }, ref) => (\n <BaseButton\n {...props}\n css={css.raw(buttonBaseRecipe.raw({ variant }), iconButtonRecipe.raw({ size }), cssProp)}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n replaceContent={replaceContent}\n ref={ref}\n />\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,mBAAmB,IAAI;CAClC,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,YAAY;EACZ,oBAAoB;EACpB,oBAAoB;EACpB,0BAA0B;EAC1B,WAAW;EACX,cAAc;EACd,SAAS;EACT,gBAAgB;EAChB,WAAW;GACT,QAAQ;GACR,OAAO;GACP,YAAY;GACZ,gBAAgB;GAChB,SAAS,EACP,OAAO,iBACR;GACD,QAAQ;IACN,OAAO;IACP,YAAY;IACb;GACF;EACD,eAAe,EACb,WAAW,4DACZ;EACD,eAAe;GACb,YAAY;GACZ,oBAAoB;GACrB;EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,OAAO;IACP,YAAY;IACb;GACD,SAAS;IACP,OAAO;IACP,YAAY;IACb;GACD,eAAe,EACb,WACE,+HACH;GACD,KAAK,EACH,YAAY,2BACb;GACF;EACD,WAAW;GACT,OAAO;GACP,YAAY;GACZ,WAAW;GACX,QAAQ,EACN,YAAY,8BACb;GACD,SAAS,EACP,YAAY,qCACb;GACD,KAAK,EACH,YAAY,+BACb;GACF;EACD,UAAU;GACR,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,WAAW;IACX,YAAY;IACZ,eAAe,EACb,WAAW,4DACZ;IACF;GACD,SAAS;IACP,aAAa;IACb,YAAY;IACb;GACD,KAAK;IACH,YAAY;IACZ,WAAW;IACZ;GACF;EACD,OAAO;GACL,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,OAAO,gBACR;GACF;EACD,aAAa;GACX,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,OAAO,qCACR;GACF;EACD,QAAQ;GACN,YAAY;GACZ,OAAO;GACP,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* Copyright (c) 2024-present, NDLA.
12
+ *
13
+ * This source code is licensed under the GPLv3 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ */
10
17
  const { withProvider, withContext } = createStyleContext(sva({
11
18
  slots: [
12
19
  "root",
@@ -17,22 +24,25 @@ const { withProvider, withContext } = createStyleContext(sva({
17
24
  base: {
18
25
  root: {
19
26
  position: "relative",
20
- border: "1px solid",
27
+ outline: "1px solid",
21
28
  borderRadius: "xsmall",
22
- borderColor: "stroke.subtle",
29
+ outlineColor: "transparent",
30
+ outlineOffset: "-1px",
31
+ height: "100%",
32
+ boxShadow: "xsmall",
23
33
  transitionDuration: "fast",
24
- transitionProperty: "background, color",
34
+ transitionProperty: "background, color, outline-color",
25
35
  transitionTimingFunction: "default",
26
36
  background: "surface.default",
27
- overflow: "hidden",
28
- _hover: { borderColor: "stroke.hover" }
37
+ overflow: "hidden"
29
38
  },
30
39
  content: {
31
40
  display: "flex",
32
41
  flexDirection: "column",
33
- gap: "xsmall",
34
- paddingBlock: "xsmall",
35
- paddingInline: "medium"
42
+ gap: "small",
43
+ paddingBlockStart: "small",
44
+ paddingBlockEnd: "medium",
45
+ paddingInline: "small"
36
46
  },
37
47
  title: {
38
48
  textDecoration: "underline",
@@ -44,10 +54,16 @@ const { withProvider, withContext } = createStyleContext(sva({
44
54
  width: "100%"
45
55
  }
46
56
  },
47
- defaultVariants: { variant: "intense" },
48
- variants: { variant: {
49
- subtle: {},
50
- intense: { root: { _hover: { background: "surface.actionSubtle.hover" } } }
57
+ defaultVariants: { nonInteractive: false },
58
+ variants: { nonInteractive: {
59
+ true: {},
60
+ false: { root: {
61
+ _hover: {
62
+ background: "surface.hover",
63
+ outlineColor: "stroke.hover"
64
+ },
65
+ _active: { background: "surface.active" }
66
+ } }
51
67
  } }
52
68
  }));
53
69
  const CardRoot = withProvider(ark.article, "root", { baseComponent: true });
@@ -1 +1 @@
1
- {"version":3,"file":"Card.mjs","names":[],"sources":["../../src/Card/Card.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 { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } 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 { Image } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nconst cardRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n position: \"relative\",\n border: \"1px solid\",\n borderRadius: \"xsmall\",\n borderColor: \"stroke.subtle\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n overflow: \"hidden\",\n _hover: {\n borderColor: \"stroke.hover\",\n },\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n paddingBlock: \"xsmall\",\n paddingInline: \"medium\",\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n image: {\n height: \"200px\",\n objectFit: \"cover\",\n width: \"100%\",\n },\n },\n defaultVariants: {\n variant: \"intense\",\n },\n variants: {\n variant: {\n subtle: {},\n intense: {\n root: {\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(cardRecipe);\n\nexport type CardVariantProps = NonNullable<RecipeVariantProps<typeof cardRecipe>>;\n\nexport interface CardRootProps extends HTMLArkProps<\"article\">, StyledProps, CardVariantProps {}\n\nexport const CardRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\ninterface CardHeadingProps extends StyledProps, Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalCardHeading = forwardRef<HTMLHeadingElement, CardHeadingProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const CardHeading = withContext(InternalCardHeading, \"title\");\n\nexport const CardContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const CardImage = withContext(Image, \"image\");\n"],"mappings":";;;;;;;;;AAqEA,MAAM,EAAE,cAAc,gBAAgB,mBArDnB,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAS;EAAW;EAAQ;CAC5C,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,QAAQ;GACR,cAAc;GACd,aAAa;GACb,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,YAAY;GACZ,UAAU;GACV,QAAQ,EACN,aAAa,gBACd;GACF;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;GACd,eAAe;GAChB;EACD,OAAO;GACL,gBAAgB;GAChB,QAAQ,EACN,gBAAgB,QACjB;GACF;EACD,OAAO;GACL,QAAQ;GACR,WAAW;GACX,OAAO;GACR;EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACD,UAAU,EACR,SAAS;EACP,QAAQ,EAAE;EACV,SAAS,EACP,MAAM,EACJ,QAAQ,EACN,YAAY,8BACb,EACF,EACF;EACF,EACF;CACF,CAAC,CAEkE;AAMpE,MAAa,WAAW,aAAa,IAAI,SAAS,QAAQ,EAAE,eAAe,MAAM,CAAC;AAIlF,MAAM,sBAAsB,YACzB,EAAE,YAAY,eAAe,aAAa,OAAQ,GAAG,SAAS,QAC7D,oBAAC;CAAmB;CAAuB;CAAY,GAAI;CAAY;EAAO,CAEjF;AAED,MAAa,cAAc,YAAY,qBAAqB,QAAQ;AAEpE,MAAa,cAAc,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAEnF,MAAa,YAAY,YAAY,OAAO,QAAQ"}
1
+ {"version":3,"file":"Card.mjs","names":[],"sources":["../../src/Card/Card.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 { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } 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 { Image } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nconst cardRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n position: \"relative\",\n outline: \"1px solid\",\n borderRadius: \"xsmall\",\n outlineColor: \"transparent\",\n outlineOffset: \"-1px\",\n height: \"100%\",\n boxShadow: \"xsmall\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color, outline-color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n overflow: \"hidden\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"small\",\n paddingBlockStart: \"small\",\n paddingBlockEnd: \"medium\",\n paddingInline: \"small\",\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n image: {\n height: \"200px\",\n objectFit: \"cover\",\n width: \"100%\",\n },\n },\n defaultVariants: {\n nonInteractive: false,\n },\n variants: {\n nonInteractive: {\n true: {},\n false: {\n root: {\n _hover: {\n background: \"surface.hover\",\n outlineColor: \"stroke.hover\",\n },\n _active: {\n background: \"surface.active\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(cardRecipe);\n\nexport type CardVariantProps = NonNullable<RecipeVariantProps<typeof cardRecipe>>;\n\nexport interface CardRootProps extends HTMLArkProps<\"article\">, StyledProps, CardVariantProps {}\n\nexport const CardRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\ninterface CardHeadingProps extends StyledProps, Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalCardHeading = forwardRef<HTMLHeadingElement, CardHeadingProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const CardHeading = withContext(InternalCardHeading, \"title\");\n\nexport const CardContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const CardImage = withContext(Image, \"image\");\n"],"mappings":";;;;;;;;;;;;;;;;AA0EA,MAAM,EAAE,cAAc,gBAAgB,mBA1DnB,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAS;EAAW;EAAQ;CAC5C,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,SAAS;GACT,cAAc;GACd,cAAc;GACd,eAAe;GACf,QAAQ;GACR,WAAW;GACX,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,YAAY;GACZ,UAAU;GACX;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,mBAAmB;GACnB,iBAAiB;GACjB,eAAe;GAChB;EACD,OAAO;GACL,gBAAgB;GAChB,QAAQ,EACN,gBAAgB,QACjB;GACF;EACD,OAAO;GACL,QAAQ;GACR,WAAW;GACX,OAAO;GACR;EACF;CACD,iBAAiB,EACf,gBAAgB,OACjB;CACD,UAAU,EACR,gBAAgB;EACd,MAAM,EAAE;EACR,OAAO,EACL,MAAM;GACJ,QAAQ;IACN,YAAY;IACZ,cAAc;IACf;GACD,SAAS,EACP,YAAY,kBACb;GACF,EACF;EACF,EACF;CACF,CAAC,CAEkE;AAMpE,MAAa,WAAW,aAAa,IAAI,SAAS,QAAQ,EAAE,eAAe,MAAM,CAAC;AAIlF,MAAM,sBAAsB,YACzB,EAAE,YAAY,eAAe,aAAa,OAAQ,GAAG,SAAS,QAC7D,oBAAC;CAAmB;CAAuB;CAAY,GAAI;CAAY;EAAO,CAEjF;AAED,MAAa,cAAc,YAAY,qBAAqB,QAAQ;AAEpE,MAAa,cAAc,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAEnF,MAAa,YAAY,YAAY,OAAO,QAAQ"}
package/es/Combobox.mjs CHANGED
@@ -7,6 +7,13 @@ import { jsx } from "react/jsx-runtime";
7
7
  import { forwardRef } from "react";
8
8
 
9
9
  //#region src/Combobox.tsx
10
+ /**
11
+ * Copyright (c) 2024-present, NDLA.
12
+ *
13
+ * This source code is licensed under the GPLv3 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ */
10
17
  const { withProvider, withContext } = createStyleContext(sva({
11
18
  slots: comboboxAnatomy.keys(),
12
19
  base: {
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.mjs","names":[],"sources":["../src/Combobox.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 { forwardRef, type ElementType, type RefAttributes } from \"react\";\nimport { Combobox, comboboxAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\nimport { Label } from \"./Label\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst comboboxRecipe = sva({\n slots: comboboxAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n control: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"4xsmall\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n zIndex: \"dropdown\",\n background: \"surface.default\",\n overflowY: \"auto\",\n maxHeight: \"min(token(spacing.surface.xsmall), 45vh)\",\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 justifyContent: \"space-between\",\n alignItems: \"center\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color, border-color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n _disabled: {\n cursor: \"not-allowed\",\n background: \"surface.disabled\",\n color: \"text.disabled\",\n _hover: {\n background: \"surface.disabled\",\n color: \"text.disabled\",\n },\n },\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n _checked: {\n background: \"surface.selected\",\n _highlighted: {\n background: \"surface.hover\",\n },\n },\n },\n trigger: {\n \"& svg\": {\n color: \"icon.default\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n _open: {\n \"& svg\": {\n transform: \"rotate(180deg)\",\n },\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 itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n },\n },\n defaultVariants: {\n context: \"standalone\",\n variant: \"simple\",\n },\n variants: {\n context: {\n standalone: {\n content: {\n boxShadow: \"large\",\n borderRadius: \"xsmall\",\n padding: \"xsmall\",\n },\n },\n composite: {},\n },\n variant: {\n simple: {\n item: {\n padding: \"xsmall\",\n borderRadius: \"xsmall\",\n },\n content: {\n gap: \"4xsmall\",\n },\n },\n complex: {},\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(comboboxRecipe);\n\nexport type ComboboxVariantProps = NonNullable<RecipeVariantProps<typeof comboboxRecipe>>;\n\nexport interface ComboboxRootProps<T extends Combobox.CollectionItem>\n extends StyledProps,\n Combobox.RootProps<T>,\n ComboboxVariantProps,\n RefAttributes<HTMLDivElement> {\n translations: Combobox.RootProps<T>[\"translations\"];\n}\n\nconst InternalComboboxRoot = withProvider<ElementType<ComboboxRootProps<Combobox.CollectionItem>>>(\n Combobox.Root,\n \"root\",\n { baseComponent: true },\n);\n\nexport const ComboboxRoot = <T extends Combobox.CollectionItem>({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: ComboboxRootProps<T>) => {\n return <InternalComboboxRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />;\n};\n\nexport interface ComboboxClearTriggerProps extends Combobox.ClearTriggerProps, StyledProps {}\n\nexport const ComboboxClearTrigger = withContext(Combobox.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport interface ComboboxContentProps extends Combobox.ContentProps, StyledProps {}\n\nexport const ComboboxContentStandalone = withContext(Combobox.Content, \"content\", { baseComponent: true });\n\nexport const ComboboxContent = forwardRef<HTMLDivElement, ComboboxContentProps>((props, ref) => (\n <ComboboxPositioner>\n <ComboboxContentStandalone ref={ref} {...props} />\n </ComboboxPositioner>\n));\n\nexport interface ComboboxControlProps extends Combobox.ControlProps, StyledProps {}\n\nexport const ComboboxControl = withContext(Combobox.Control, \"control\", { baseComponent: true });\n\nexport interface ComboboxInputProps extends Combobox.InputProps, StyledProps {}\n\nexport const ComboboxInput = withContext(Combobox.Input, \"input\", { baseComponent: true });\n\nconst InternalComboboxItemGroupLabel = withContext(Combobox.ItemGroupLabel, \"itemGroupLabel\");\n\nexport interface ComboboxItemGroupLabelProps\n extends Omit<Combobox.ItemGroupLabelProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLDivElement> {}\n\nexport const ComboboxItemGroupLabel = ({\n children,\n textStyle = \"label.small\",\n fontWeight = \"bold\",\n ...props\n}: ComboboxItemGroupLabelProps) => (\n <InternalComboboxItemGroupLabel asChild>\n <Text asChild consumeCss textStyle={textStyle} fontWeight={fontWeight} {...props}>\n <div>{children}</div>\n </Text>\n </InternalComboboxItemGroupLabel>\n);\n\nexport interface ComboboxItemGroupProps extends Combobox.ItemGroupProps, StyledProps {}\n\nexport const ComboboxItemGroup = withContext(Combobox.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport interface ComboboxItemIndicatorProps extends Combobox.ItemIndicatorProps, StyledProps {}\n\nexport const ComboboxItemIndicator = withContext(Combobox.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport interface ComboboxItemProps extends Combobox.ItemProps, StyledProps {}\n\nexport const ComboboxItem = withContext(Combobox.Item, \"item\", { baseComponent: true });\n\nconst InternalComboboxItemText = withContext(Combobox.ItemText, \"itemText\");\n\nexport interface ComboboxItemTextProps\n extends Omit<Combobox.ItemTextProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLDivElement> {}\n\nexport const ComboboxItemText = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n children,\n ...props\n}: ComboboxItemTextProps) => (\n <InternalComboboxItemText asChild>\n <Text {...props} textStyle={textStyle} fontWeight={fontWeight} asChild consumeCss>\n <div>{children}</div>\n </Text>\n </InternalComboboxItemText>\n);\n\nconst InternalComboboxLabel = withContext(Combobox.Label, \"label\");\n\nexport interface ComboboxLabelProps\n extends Omit<Combobox.LabelProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLLabelElement> {}\n\nexport const ComboboxLabel = ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }: ComboboxLabelProps) => (\n <InternalComboboxLabel asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props} />\n </InternalComboboxLabel>\n);\n\nexport interface ComboboxPositionerProps extends Combobox.PositionerProps, StyledProps {}\n\nexport const ComboboxPositioner = withContext(Combobox.Positioner, \"positioner\", { baseComponent: true });\n\nexport interface ComboboxTriggerProps extends Combobox.TriggerProps, StyledProps {}\n\nexport const ComboboxTrigger = withContext(Combobox.Trigger, \"trigger\", { baseComponent: true });\n\nexport interface ComboboxListProps extends Combobox.ListProps, StyledProps {}\n\nexport const ComboboxList = withContext(Combobox.List, \"list\", { baseComponent: true });\n"],"mappings":";;;;;;;;;AAiJA,MAAM,EAAE,cAAc,gBAAgB,mBAjIf,IAAI;CACzB,OAAO,gBAAg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BAAC,SAAK,WAAe;GAChB;EACkB;AAG7B,MAAM,wBAAwB,YAAY,SAAS,OAAO,QAAQ;AAQlE,MAAa,iBAAiB,EAAE,YAAY,gBAAgB,aAAa,OAAQ,GAAG,YAClF,oBAAC;CAAsB;WACrB,oBAAC;EAAiB;EAAuB;EAAY,GAAI;GAAS;EAC5C;AAK1B,MAAa,qBAAqB,YAAY,SAAS,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAIzG,MAAa,kBAAkB,YAAY,SAAS,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIhG,MAAa,eAAe,YAAY,SAAS,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Combobox.mjs","names":[],"sources":["../src/Combobox.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 { forwardRef, type ElementType, type RefAttributes } from \"react\";\nimport { Combobox, comboboxAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\nimport { Label } from \"./Label\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst comboboxRecipe = sva({\n slots: comboboxAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n control: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"4xsmall\",\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n zIndex: \"dropdown\",\n background: \"surface.default\",\n overflowY: \"auto\",\n maxHeight: \"min(token(spacing.surface.xsmall), 45vh)\",\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 justifyContent: \"space-between\",\n alignItems: \"center\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color, border-color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n _disabled: {\n cursor: \"not-allowed\",\n background: \"surface.disabled\",\n color: \"text.disabled\",\n _hover: {\n background: \"surface.disabled\",\n color: \"text.disabled\",\n },\n },\n _hover: {\n background: \"surface.hover\",\n },\n _highlighted: {\n background: \"surface.hover\",\n },\n _checked: {\n background: \"surface.selected\",\n _highlighted: {\n background: \"surface.hover\",\n },\n },\n },\n trigger: {\n \"& svg\": {\n color: \"icon.default\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n _open: {\n \"& svg\": {\n transform: \"rotate(180deg)\",\n },\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 itemGroup: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4xsmall\",\n },\n },\n defaultVariants: {\n context: \"standalone\",\n variant: \"simple\",\n },\n variants: {\n context: {\n standalone: {\n content: {\n boxShadow: \"large\",\n borderRadius: \"xsmall\",\n padding: \"xsmall\",\n },\n },\n composite: {},\n },\n variant: {\n simple: {\n item: {\n padding: \"xsmall\",\n borderRadius: \"xsmall\",\n },\n content: {\n gap: \"4xsmall\",\n },\n },\n complex: {},\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(comboboxRecipe);\n\nexport type ComboboxVariantProps = NonNullable<RecipeVariantProps<typeof comboboxRecipe>>;\n\nexport interface ComboboxRootProps<T extends Combobox.CollectionItem>\n extends StyledProps,\n Combobox.RootProps<T>,\n ComboboxVariantProps,\n RefAttributes<HTMLDivElement> {\n translations: Combobox.RootProps<T>[\"translations\"];\n}\n\nconst InternalComboboxRoot = withProvider<ElementType<ComboboxRootProps<Combobox.CollectionItem>>>(\n Combobox.Root,\n \"root\",\n { baseComponent: true },\n);\n\nexport const ComboboxRoot = <T extends Combobox.CollectionItem>({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: ComboboxRootProps<T>) => {\n return <InternalComboboxRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />;\n};\n\nexport interface ComboboxClearTriggerProps extends Combobox.ClearTriggerProps, StyledProps {}\n\nexport const ComboboxClearTrigger = withContext(Combobox.ClearTrigger, \"clearTrigger\", { baseComponent: true });\n\nexport interface ComboboxContentProps extends Combobox.ContentProps, StyledProps {}\n\nexport const ComboboxContentStandalone = withContext(Combobox.Content, \"content\", { baseComponent: true });\n\nexport const ComboboxContent = forwardRef<HTMLDivElement, ComboboxContentProps>((props, ref) => (\n <ComboboxPositioner>\n <ComboboxContentStandalone ref={ref} {...props} />\n </ComboboxPositioner>\n));\n\nexport interface ComboboxControlProps extends Combobox.ControlProps, StyledProps {}\n\nexport const ComboboxControl = withContext(Combobox.Control, \"control\", { baseComponent: true });\n\nexport interface ComboboxInputProps extends Combobox.InputProps, StyledProps {}\n\nexport const ComboboxInput = withContext(Combobox.Input, \"input\", { baseComponent: true });\n\nconst InternalComboboxItemGroupLabel = withContext(Combobox.ItemGroupLabel, \"itemGroupLabel\");\n\nexport interface ComboboxItemGroupLabelProps\n extends Omit<Combobox.ItemGroupLabelProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLDivElement> {}\n\nexport const ComboboxItemGroupLabel = ({\n children,\n textStyle = \"label.small\",\n fontWeight = \"bold\",\n ...props\n}: ComboboxItemGroupLabelProps) => (\n <InternalComboboxItemGroupLabel asChild>\n <Text asChild consumeCss textStyle={textStyle} fontWeight={fontWeight} {...props}>\n <div>{children}</div>\n </Text>\n </InternalComboboxItemGroupLabel>\n);\n\nexport interface ComboboxItemGroupProps extends Combobox.ItemGroupProps, StyledProps {}\n\nexport const ComboboxItemGroup = withContext(Combobox.ItemGroup, \"itemGroup\", { baseComponent: true });\n\nexport interface ComboboxItemIndicatorProps extends Combobox.ItemIndicatorProps, StyledProps {}\n\nexport const ComboboxItemIndicator = withContext(Combobox.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport interface ComboboxItemProps extends Combobox.ItemProps, StyledProps {}\n\nexport const ComboboxItem = withContext(Combobox.Item, \"item\", { baseComponent: true });\n\nconst InternalComboboxItemText = withContext(Combobox.ItemText, \"itemText\");\n\nexport interface ComboboxItemTextProps\n extends Omit<Combobox.ItemTextProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLDivElement> {}\n\nexport const ComboboxItemText = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n children,\n ...props\n}: ComboboxItemTextProps) => (\n <InternalComboboxItemText asChild>\n <Text {...props} textStyle={textStyle} fontWeight={fontWeight} asChild consumeCss>\n <div>{children}</div>\n </Text>\n </InternalComboboxItemText>\n);\n\nconst InternalComboboxLabel = withContext(Combobox.Label, \"label\");\n\nexport interface ComboboxLabelProps\n extends Omit<Combobox.LabelProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLLabelElement> {}\n\nexport const ComboboxLabel = ({ textStyle = \"label.medium\", fontWeight = \"bold\", ...props }: ComboboxLabelProps) => (\n <InternalComboboxLabel asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props} />\n </InternalComboboxLabel>\n);\n\nexport interface ComboboxPositionerProps extends Combobox.PositionerProps, StyledProps {}\n\nexport const ComboboxPositioner = withContext(Combobox.Positioner, \"positioner\", { baseComponent: true });\n\nexport interface ComboboxTriggerProps extends Combobox.TriggerProps, StyledProps {}\n\nexport const ComboboxTrigger = withContext(Combobox.Trigger, \"trigger\", { baseComponent: true });\n\nexport interface ComboboxListProps extends Combobox.ListProps, StyledProps {}\n\nexport const ComboboxList = withContext(Combobox.List, \"list\", { baseComponent: true });\n"],"mappings":";;;;;;;;;;;;;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C;CAAyB;WACxB,oBAAC;EAAK,GAAI;EAAkB;EAAuB;EAAY;EAAQ;YACrE,oBAAC,SAAK,WAAe;GAChB;EACkB;AAG7B,MAAM,wBAAwB,YAAY,SAAS,OAAO,QAAQ;AAQlE,MAAa,iBAAiB,EAAE,YAAY,gBAAgB,aAAa,OAAQ,GAAG,YAClF,oBAAC;CAAsB;WACrB,oBAAC;EAAiB;EAAuB;EAAY,GAAI;GAAS;EAC5C;AAK1B,MAAa,qBAAqB,YAAY,SAAS,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC;AAIzG,MAAa,kBAAkB,YAAY,SAAS,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAIhG,MAAa,eAAe,YAAY,SAAS,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC"}
package/es/DatePicker.mjs CHANGED
@@ -6,6 +6,13 @@ import { jsx } from "react/jsx-runtime";
6
6
  import { forwardRef } from "react";
7
7
 
8
8
  //#region src/DatePicker.tsx
9
+ /**
10
+ * Copyright (c) 2024-present, NDLA.
11
+ *
12
+ * This source code is licensed under the GPLv3 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ *
15
+ */
9
16
  const { withProvider, withContext } = createStyleContext(sva({
10
17
  slots: datePickerAnatomy.keys(),
11
18
  base: {
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.mjs","names":[],"sources":["../src/DatePicker.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 { forwardRef, type RefAttributes } from \"react\";\nimport { DatePicker, datePickerAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, type StyledProps } from \"@ndla/styled-system/jsx\";\nimport { Label } from \"./Label\";\nimport type { TextProps } from \"./Text\";\n\nconst datePickerRecipe = sva({\n slots: datePickerAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n content: {\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"large\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n padding: \"xsmall\",\n zIndex: \"dropdown\",\n _open: {\n animation: \"fade-shift-in 0.25s ease-in-out\",\n },\n _closed: {\n animation: \"fade-shift-out 0.25s ease-in-out\",\n },\n },\n control: {\n display: \"flex\",\n width: \"fit-content\",\n gap: \"xsmall\",\n },\n label: {},\n tableHeader: {},\n viewControl: {\n display: \"flex\",\n gap: \"5xsmall\",\n justifyContent: \"space-between\",\n },\n table: {\n width: \"100%\",\n borderCollapse: \"separate\",\n borderSpacing: \"5xsmall\",\n margin: \"-5xsmall\",\n },\n tableCell: {\n textAlign: \"center\",\n },\n tableCellTrigger: {\n width: \"100%\",\n \"&[data-today]\": {\n _before: {\n content: \"'-'\",\n color: \"stroke.default\",\n position: \"absolute\",\n marginBlockStart: \"medium\",\n },\n },\n \"&[data-outside-range]\": {\n color: \"text.subtle\",\n fontWeight: \"normal\",\n },\n },\n view: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n },\n});\nconst { withProvider, withContext } = createStyleContext(datePickerRecipe);\n\nexport interface DatePickerRootProps extends DatePicker.RootProps, StyledProps {\n translations: DatePicker.RootProps[\"translations\"];\n locale: DatePicker.RootProps[\"locale\"];\n}\n\nexport const DatePickerRoot = withProvider(DatePicker.Root, \"root\", { baseComponent: true });\n\nexport const DatePickerClearTrigger = withContext(DatePicker.ClearTrigger, \"clearTrigger\", {\n baseComponent: true,\n});\n\ninterface DatePickerContentProps extends DatePicker.ContentProps, StyledProps {}\n\nexport const DatePickerContent = forwardRef<HTMLDivElement, DatePickerContentProps>((props, ref) => (\n <DatePickerPositioner>\n <DatePickerStandaloneContent {...props} ref={ref} />\n </DatePickerPositioner>\n));\n\nexport const DatePickerStandaloneContent = withContext(DatePicker.Content, \"content\", { baseComponent: true });\n\nexport const DatePickerControl = withContext(DatePicker.Control, \"control\", { baseComponent: true });\n\nexport const DatePickerInput = withContext(DatePicker.Input, \"input\", { baseComponent: true });\n\ninterface DatePickerLabelProps\n extends Omit<DatePicker.LabelProps, \"color\">,\n StyledProps,\n TextProps,\n RefAttributes<HTMLLabelElement> {}\n\nconst InternalDatePickerLabel = withContext(DatePicker.Label, \"label\");\n\nexport const DatePickerLabel = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n ...props\n}: DatePickerLabelProps) => (\n <InternalDatePickerLabel asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props} />\n </InternalDatePickerLabel>\n);\n\nexport const DatePickerMonthSelect = withContext(DatePicker.MonthSelect, \"monthSelect\", { baseComponent: true });\n\ninterface DatePickerNextTrigger extends DatePicker.NextTriggerProps, StyledProps {}\n\nexport const DatePickerNextTrigger = withContext(DatePicker.NextTrigger, \"nextTrigger\", { baseComponent: true });\n\nexport const DatePickerPositioner = withContext(DatePicker.Positioner, \"positioner\", { baseComponent: true });\n\nexport const DatePickerPresetTrigger = withContext(DatePicker.PresetTrigger, \"presetTrigger\", { baseComponent: true });\n\nexport const DatePickerPrevTrigger = withContext(DatePicker.PrevTrigger, \"prevTrigger\", { baseComponent: true });\n\nexport const DatePickerRangeText = withContext(DatePicker.RangeText, \"rangeText\", { baseComponent: true });\n\nexport const DatePickerTableBody = withContext(DatePicker.TableBody, \"tableBody\", { baseComponent: true });\n\nexport const DatePickerTableCell = withContext(DatePicker.TableCell, \"tableCell\", { baseComponent: true });\n\nexport const DatePickerTableCellTrigger = withContext(DatePicker.TableCellTrigger, \"tableCellTrigger\", {\n baseComponent: true,\n});\n\nexport const DatePickerTableHead = withContext(DatePicker.TableHead, \"tableHead\", { baseComponent: true });\n\nexport const DatePickerTableHeader = withContext(DatePicker.TableHeader, \"tableHeader\", { baseComponent: true });\n\nexport const DatePickerTable = withContext(DatePicker.Table, \"table\", { baseComponent: true });\n\nexport const DatePickerTableRow = withContext(DatePicker.TableRow, \"tableRow\", { baseComponent: true });\n\nexport const DatePickerTrigger = withContext(DatePicker.Trigger, \"trigger\", { baseComponent: true });\n\nexport const DatePickerViewControl = withContext(DatePicker.ViewControl, \"viewControl\", { baseComponent: true });\n\nexport const DatePickerView = withContext(DatePicker.View, \"view\", { baseComponent: true });\n\nexport const DatePickerViewTrigger = withContext(DatePicker.ViewTrigger, \"viewTrigger\", { baseComponent: true });\n\nexport const DatePickerYearSelect = withContext(DatePicker.YearSelect, \"yearSelect\", { baseComponent: true });\n\nexport { DatePickerContext } from \"@ark-ui/react\";\n"],"mappings":";;;;;;;;AAkFA,MAAM,EAAE,cAAc,gBAAgB,mBAnEb,IAAI;CAC3B,OAAO,kBAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,SAAS;GACP,YAAY;GACZ,cAAc;GACd,WAAW;GACX,SAAS;GACT,eAAe;GACf,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,EACL,WAAW,mCACZ;GACD,SAAS,EACP,WAAW,oCACZ;GACF;EACD,SAAS;GACP,SAAS;GACT,OAAO;GACP,KAAK;GACN;EACD,OAAO,EAAE;EACT,aAAa,EAAE;EACf,aAAa;GACX,SAAS;GACT,KAAK;GACL,gBAAgB;GACjB;EACD,OAAO;GACL,OAAO;GACP,gBAAgB;GAChB,eAAe;GACf,QAAQ;GACT;EACD,WAAW,EACT,WAAW,UACZ;EACD,kBAAkB;GAChB,OAAO;GACP,iBAAiB,EACf,SAAS;IACP,SAAS;IACT,OAAO;IACP,UAAU;IACV,kBAAkB;IACnB,EACF;GACD,yBAAyB;IACvB,OAAO;IACP,YAAY;IACb;GACF;EACD,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACF;CACF,CAAC,CACwE;AAO1E,MAAa,iBAAiB,aAAa,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,yBAAyB,YAAY,WAAW,cAAc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,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,kBAAkB,YAAY,WAAW,OAAO,SAAS,EAAE,eAAe,MAAM,CAAC;AAE9F,MAAa,qBAAqB,YAAY,WAAW,UAAU,YAAY,EAAE,eAAe,MAAM,CAAC;AAEvG,MAAa,oBAAoB,YAAY,WAAW,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAEpG,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,iBAAiB,YAAY,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,uBAAuB,YAAY,WAAW,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"DatePicker.mjs","names":[],"sources":["../src/DatePicker.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 { forwardRef, type RefAttributes } from \"react\";\nimport { DatePicker, datePickerAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, type StyledProps } from \"@ndla/styled-system/jsx\";\nimport { Label } from \"./Label\";\nimport type { TextProps } from \"./Text\";\n\nconst datePickerRecipe = sva({\n slots: datePickerAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n content: {\n background: \"surface.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"large\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n padding: \"xsmall\",\n zIndex: \"dropdown\",\n _open: {\n animation: \"fade-shift-in 0.25s ease-in-out\",\n },\n _closed: {\n animation: \"fade-shift-out 0.25s ease-in-out\",\n },\n },\n control: {\n display: \"flex\",\n width: \"fit-content\",\n gap: \"xsmall\",\n },\n label: {},\n tableHeader: {},\n viewControl: {\n display: \"flex\",\n gap: \"5xsmall\",\n justifyContent: \"space-between\",\n },\n table: {\n width: \"100%\",\n borderCollapse: \"separate\",\n borderSpacing: \"5xsmall\",\n margin: \"-5xsmall\",\n },\n tableCell: {\n textAlign: \"center\",\n },\n tableCellTrigger: {\n width: \"100%\",\n \"&[data-today]\": {\n _before: {\n content: \"'-'\",\n color: \"stroke.default\",\n position: \"absolute\",\n marginBlockStart: \"medium\",\n },\n },\n \"&[data-outside-range]\": {\n color: \"text.subtle\",\n fontWeight: \"normal\",\n },\n },\n view: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n },\n});\nconst { withProvider, withContext } = createStyleContext(datePickerRecipe);\n\nexport interface DatePickerRootProps extends DatePicker.RootProps, StyledProps {\n translations: DatePicker.RootProps[\"translations\"];\n locale: DatePicker.RootProps[\"locale\"];\n}\n\nexport const DatePickerRoot = withProvider(DatePicker.Root, \"root\", { baseComponent: true });\n\nexport const DatePickerClearTrigger = withContext(DatePicker.ClearTrigger, \"clearTrigger\", {\n baseComponent: true,\n});\n\ninterface DatePickerContentProps extends DatePicker.ContentProps, StyledProps {}\n\nexport const DatePickerContent = forwardRef<HTMLDivElement, DatePickerContentProps>((props, ref) => (\n <DatePickerPositioner>\n <DatePickerStandaloneContent {...props} ref={ref} />\n </DatePickerPositioner>\n));\n\nexport const DatePickerStandaloneContent = withContext(DatePicker.Content, \"content\", { baseComponent: true });\n\nexport const DatePickerControl = withContext(DatePicker.Control, \"control\", { baseComponent: true });\n\nexport const DatePickerInput = withContext(DatePicker.Input, \"input\", { baseComponent: true });\n\ninterface DatePickerLabelProps\n extends Omit<DatePicker.LabelProps, \"color\">,\n StyledProps,\n TextProps,\n RefAttributes<HTMLLabelElement> {}\n\nconst InternalDatePickerLabel = withContext(DatePicker.Label, \"label\");\n\nexport const DatePickerLabel = ({\n textStyle = \"label.medium\",\n fontWeight = \"bold\",\n ...props\n}: DatePickerLabelProps) => (\n <InternalDatePickerLabel asChild>\n <Label textStyle={textStyle} fontWeight={fontWeight} {...props} />\n </InternalDatePickerLabel>\n);\n\nexport const DatePickerMonthSelect = withContext(DatePicker.MonthSelect, \"monthSelect\", { baseComponent: true });\n\ninterface DatePickerNextTrigger extends DatePicker.NextTriggerProps, StyledProps {}\n\nexport const DatePickerNextTrigger = withContext(DatePicker.NextTrigger, \"nextTrigger\", { baseComponent: true });\n\nexport const DatePickerPositioner = withContext(DatePicker.Positioner, \"positioner\", { baseComponent: true });\n\nexport const DatePickerPresetTrigger = withContext(DatePicker.PresetTrigger, \"presetTrigger\", { baseComponent: true });\n\nexport const DatePickerPrevTrigger = withContext(DatePicker.PrevTrigger, \"prevTrigger\", { baseComponent: true });\n\nexport const DatePickerRangeText = withContext(DatePicker.RangeText, \"rangeText\", { baseComponent: true });\n\nexport const DatePickerTableBody = withContext(DatePicker.TableBody, \"tableBody\", { baseComponent: true });\n\nexport const DatePickerTableCell = withContext(DatePicker.TableCell, \"tableCell\", { baseComponent: true });\n\nexport const DatePickerTableCellTrigger = withContext(DatePicker.TableCellTrigger, \"tableCellTrigger\", {\n baseComponent: true,\n});\n\nexport const DatePickerTableHead = withContext(DatePicker.TableHead, \"tableHead\", { baseComponent: true });\n\nexport const DatePickerTableHeader = withContext(DatePicker.TableHeader, \"tableHeader\", { baseComponent: true });\n\nexport const DatePickerTable = withContext(DatePicker.Table, \"table\", { baseComponent: true });\n\nexport const DatePickerTableRow = withContext(DatePicker.TableRow, \"tableRow\", { baseComponent: true });\n\nexport const DatePickerTrigger = withContext(DatePicker.Trigger, \"trigger\", { baseComponent: true });\n\nexport const DatePickerViewControl = withContext(DatePicker.ViewControl, \"viewControl\", { baseComponent: true });\n\nexport const DatePickerView = withContext(DatePicker.View, \"view\", { baseComponent: true });\n\nexport const DatePickerViewTrigger = withContext(DatePicker.ViewTrigger, \"viewTrigger\", { baseComponent: true });\n\nexport const DatePickerYearSelect = withContext(DatePicker.YearSelect, \"yearSelect\", { baseComponent: true });\n\nexport { DatePickerContext } from \"@ark-ui/react\";\n"],"mappings":";;;;;;;;;;;;;;;AAkFA,MAAM,EAAE,cAAc,gBAAgB,mBAnEb,IAAI;CAC3B,OAAO,kBAAkB,MAAM;CAC/B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,SAAS;GACP,YAAY;GACZ,cAAc;GACd,WAAW;GACX,SAAS;GACT,eAAe;GACf,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,EACL,WAAW,mCACZ;GACD,SAAS,EACP,WAAW,oCACZ;GACF;EACD,SAAS;GACP,SAAS;GACT,OAAO;GACP,KAAK;GACN;EACD,OAAO,EAAE;EACT,aAAa,EAAE;EACf,aAAa;GACX,SAAS;GACT,KAAK;GACL,gBAAgB;GACjB;EACD,OAAO;GACL,OAAO;GACP,gBAAgB;GAChB,eAAe;GACf,QAAQ;GACT;EACD,WAAW,EACT,WAAW,UACZ;EACD,kBAAkB;GAChB,OAAO;GACP,iBAAiB,EACf,SAAS;IACP,SAAS;IACT,OAAO;IACP,UAAU;IACV,kBAAkB;IACnB,EACF;GACD,yBAAyB;IACvB,OAAO;IACP,YAAY;IACb;GACF;EACD,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACF;CACF,CAAC,CACwE;AAO1E,MAAa,iBAAiB,aAAa,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE5F,MAAa,yBAAyB,YAAY,WAAW,cAAc,gBAAgB,EACzF,eAAe,MAChB,CAAC;AAIF,MAAa,oBAAoB,YAAoD,OAAO,QAC1F,oBAAC,kCACC,oBAAC;CAA4B,GAAI;CAAY;EAAO,GAC/B,CACvB;AAEF,MAAa,8BAA8B,YAAY,WAAW,SAAS,WAAW,EAAE,eAAe,MAAM,CAAC;AAE9G,MAAa,oBAAoB,YAAY,WAAW,SAAS,WAAW,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,EAAE,eAAe,MAAM,CAAC;AAEpG,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,iBAAiB,YAAY,WAAW,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE3F,MAAa,wBAAwB,YAAY,WAAW,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAEhH,MAAa,uBAAuB,YAAY,WAAW,YAAY,cAAc,EAAE,eAAe,MAAM,CAAC"}
package/es/Dialog.mjs CHANGED
@@ -6,6 +6,13 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { forwardRef } from "react";
7
7
 
8
8
  //#region src/Dialog.tsx
9
+ /**
10
+ * Copyright (c) 2024-present, NDLA.
11
+ *
12
+ * This source code is licensed under the GPLv3 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ *
15
+ */
9
16
  const { withRootProvider, withContext } = createStyleContext(sva({
10
17
  slots: dialogAnatomy.keys(),
11
18
  base: {
package/es/Dialog.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.mjs","names":["useDialog","_useDialog"],"sources":["../src/Dialog.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 { forwardRef, type RefAttributes } from \"react\";\nimport { Dialog, dialogAnatomy, useDialog as _useDialog } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { Heading, Text, type TextProps } from \"./Text\";\n\nconst dialogRecipe = sva({\n slots: dialogAnatomy.keys(),\n base: {\n backdrop: {\n position: \"fixed\",\n height: \"100vh\",\n width: \"100vw\",\n left: \"0\",\n top: \"0\",\n // TODO: Consider if this should be a token. It's probably consistent enough between dark and light mode to be a token.\n background: \"rgba(1, 1, 1, 0.3)\",\n _open: {\n animation: \"backdrop-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"backdrop-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n positioner: {\n position: \"fixed\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n left: \"0\",\n top: \"0\",\n width: \"100vw\",\n height: \"100dvh\",\n },\n content: {\n \"--margin\": \"token(sizes.medium)\",\n position: \"relative\",\n background: \"surface.default\",\n boxShadow: \"xlarge\",\n height: \"min-content\",\n maxWidth: \"95%\",\n maxHeight: \"95%\",\n margin: \"auto\",\n overflowY: \"auto\",\n borderRadius: { base: \"sharp\", tablet: \"small\" },\n paddingBlockStart: \"env(safe-area-inset-top)\",\n paddingBlockEnd: \"env(safe-area-inset-bottom)\",\n paddingInlineStart: \"env(safe-area-inset-left)\",\n paddingInlineEnd: \"env(safe-area-inset-right)\",\n tabletDown: {\n \"--margin\": \"0px\",\n minWidth: \"100%\",\n minHeight: \"100%\",\n },\n },\n },\n defaultVariants: {\n size: \"medium\",\n position: \"center\",\n variant: \"dialog\",\n context: \"dialog\",\n },\n compoundVariants: [\n {\n variant: \"drawer\",\n position: \"left\",\n css: {\n content: {\n minHeight: \"100%\",\n maxHeight: \"100%\",\n width: \"var(--size)\",\n _open: {\n animation: \"drawer-in-left\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-left\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"right\",\n css: {\n content: {\n minHeight: \"100%\",\n maxHeight: \"100%\",\n width: \"var(--size)\",\n _open: {\n animation: \"drawer-in-right\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-right\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"top\",\n css: {\n content: {\n minWidth: \"100%\",\n maxWidth: \"100%\",\n height: \"var(--size)\",\n _open: {\n animation: \"drawer-in-top\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-top\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"bottom\",\n css: {\n content: {\n minWidth: \"100%\",\n maxWidth: \"100%\",\n height: \"var(--size)\",\n _open: {\n animation: \"drawer-in-bottom\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-bottom\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"xsmall\",\n css: {\n content: {\n \"--size\": \"sizes.surface.3xsmall\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"small\",\n css: {\n content: {\n \"--size\": \"sizes.surface.xsmall\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"medium\",\n css: {\n content: {\n \"--size\": \"sizes.surface.medium\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"large\",\n css: {\n content: {\n \"--size\": \"sizes.surface.xlarge\",\n },\n },\n },\n ],\n variants: {\n context: {\n dialog: {\n positioner: {\n zIndex: \"modal\",\n },\n backdrop: {\n zIndex: \"overlay\",\n },\n },\n alert: {\n positioner: {\n zIndex: \"alertModal\",\n },\n backdrop: {\n zIndex: \"alertModalOverlay\",\n },\n },\n },\n variant: {\n drawer: {\n content: {\n \"--margin\": \"0px\",\n borderRadius: { base: \"sharp\", tablet: \"sharp\" },\n },\n },\n dialog: {\n content: {\n width: \"var(--size)\",\n _open: {\n animation: \"dialog-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"dialog-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n position: {\n left: {\n content: {\n marginInlineStart: \"var(--margin)\",\n },\n },\n center: {},\n right: {\n content: {\n marginInlineEnd: \"var(--margin)\",\n },\n },\n bottom: {\n content: {\n marginBlockEnd: \"var(--margin)\",\n },\n },\n top: {\n content: {\n marginBlockStart: \"var(--margin)\",\n },\n },\n },\n size: {\n full: {\n content: {\n \"--margin\": \"0px\",\n minHeight: \"100%\",\n minWidth: \"100%\",\n borderRadius: \"sharp\",\n },\n },\n xsmall: {\n content: {\n \"--size\": \"sizes.surface.xsmall\",\n },\n },\n small: {\n content: {\n \"--size\": \"sizes.surface.medium\",\n },\n },\n medium: {\n content: {\n \"--size\": \"sizes.surface.xlarge\",\n },\n },\n large: {\n content: {\n \"--size\": \"sizes.surface.4xlarge\",\n },\n },\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(dialogRecipe);\n\nexport type DialogVariantProps = NonNullable<RecipeVariantProps<typeof dialogRecipe>>;\n\nexport interface DialogRootProps extends Dialog.RootProps, DialogVariantProps {}\n\nexport const InternalDialogRoot = withRootProvider(Dialog.Root);\n\nexport const DialogRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: DialogRootProps) => (\n <InternalDialogRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const DialogBackdrop = withContext(Dialog.Backdrop, \"backdrop\", { baseComponent: true });\n\nexport const DialogStandaloneContent = withContext(Dialog.Content, \"content\", { baseComponent: true });\n\nexport const DialogPositioner = withContext(Dialog.Positioner, \"positioner\", { baseComponent: true });\n\ninterface DialogContentProps extends Dialog.ContentProps, StyledProps {}\n\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>((props, ref) => (\n <>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogStandaloneContent ref={ref} {...props} />\n </DialogPositioner>\n </>\n));\n\nconst InternalDialogDescription = withContext(Dialog.Description, \"description\");\n\ninterface DialogDescriptionProps\n extends Omit<Dialog.DescriptionProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLParagraphElement> {}\n\nexport const DialogDescription = ({ textStyle = \"body.large\", children, ...rest }: DialogDescriptionProps) => {\n return (\n <InternalDialogDescription asChild>\n <Text textStyle={textStyle} {...rest}>\n {children}\n </Text>\n </InternalDialogDescription>\n );\n};\n\nconst InternalDialogTitle = withContext(Dialog.Title, \"title\");\n\ninterface DialogTitleProps\n extends Omit<Dialog.TitleProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLHeadingElement> {}\n\nexport const DialogTitle = ({ textStyle = \"title.medium\", children, ...rest }: DialogTitleProps) => (\n <InternalDialogTitle asChild>\n <Heading textStyle={textStyle} {...rest}>\n {children}\n </Heading>\n </InternalDialogTitle>\n);\n\nexport const DialogTrigger = withContext(Dialog.Trigger, \"trigger\", { baseComponent: true });\n\nexport const DialogCloseTrigger = withContext(Dialog.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nexport const DialogHeader = styled(\"div\", {\n base: {\n display: \"flex\",\n paddingInline: \"medium\",\n paddingBlockStart: \"medium\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n gap: \"xsmall\",\n },\n});\n\nexport const DialogBody = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n paddingInline: \"medium\",\n paddingBlockStart: \"small\",\n paddingBlockEnd: \"medium\",\n },\n});\n\nexport const DialogFooter = styled(\"div\", {\n base: {\n display: \"flex\",\n gap: \"3xsmall\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n paddingInline: \"medium\",\n paddingBlockStart: \"small\",\n paddingBlockEnd: \"medium\",\n },\n});\n\nexport const DialogRootProvider = withRootProvider(Dialog.RootProvider);\n\nexport const useDialog = _useDialog;\n"],"mappings":";;;;;;;;AAoTA,MAAM,EAAE,kBAAkB,gBAAgB,mBArSrB,IAAI;CACvB,OAAO,cAAc,MAAM;CAC3B,MAAM;EACJ,UAAU;GACR,UAAU;GACV,QAAQ;GACR,OAAO;GACP,MAAM;GACN,KAAK;GAEL,YAAY;GACZ,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,YAAY;GACV,UAAU;GACV,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,UAAU;GACV,MAAM;GACN,KAAK;GACL,OAAO;GACP,QAAQ;GACT;EACD,SAAS;GACP,YAAY;GACZ,UAAU;GACV,YAAY;GACZ,WAAW;GACX,QAAQ;GACR,UAAU;GACV,WAAW;GACX,QAAQ;GACR,WAAW;GACX,cAAc;IAAE,MAAM;IAAS,QAAQ;IAAS;GAChD,mBAAmB;GACnB,iBAAiB;GACjB,oBAAoB;GACpB,kBAAkB;GAClB,YAAY;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACZ;GACF;EACF;CACD,iBAAiB;EACf,MAAM;EACN,UAAU;EACV,SAAS;EACT,SAAS;EACV;CACD,kBAAkB;EAChB;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,yBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,wBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,wBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,wBACX,EACF;GACF;EACF;CACD,UAAU;EACR,SAAS;GACP,QAAQ;IACN,YAAY,EACV,QAAQ,SACT;IACD,UAAU,EACR,QAAQ,WACT;IACF;GACD,OAAO;IACL,YAAY,EACV,QAAQ,cACT;IACD,UAAU,EACR,QAAQ,qBACT;IACF;GACF;EACD,SAAS;GACP,QAAQ,EACN,SAAS;IACP,YAAY;IACZ,cAAc;KAAE,MAAM;KAAS,QAAQ;KAAS;IACjD,EACF;GACD,QAAQ,EACN,SAAS;IACP,OAAO;IACP,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD,UAAU;GACR,MAAM,EACJ,SAAS,EACP,mBAAmB,iBACpB,EACF;GACD,QAAQ,EAAE;GACV,OAAO,EACL,SAAS,EACP,iBAAiB,iBAClB,EACF;GACD,QAAQ,EACN,SAAS,EACP,gBAAgB,iBACjB,EACF;GACD,KAAK,EACH,SAAS,EACP,kBAAkB,iBACnB,EACF;GACF;EACD,MAAM;GACJ,MAAM,EACJ,SAAS;IACP,YAAY;IACZ,WAAW;IACX,UAAU;IACV,cAAc;IACf,EACF;GACD,QAAQ,EACN,SAAS,EACP,UAAU,wBACX,EACF;GACD,OAAO,EACL,SAAS,EACP,UAAU,wBACX,EACF;GACD,QAAQ,EACN,SAAS,EACP,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ACtC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,eAAe;CACf,mBAAmB;CACnB,iBAAiB;CAClB,EACF,CAAC;AAEF,MAAa,eAAe,OAAO,OAAO,EACxC,MAAM;CACJ,SAAS;CACT,KAAK;CACL,YAAY;CACZ,gBAAgB;CAChB,eAAe;CACf,mBAAmB;CACnB,iBAAiB;CAClB,EACF,CAAC;AAEF,MAAa,qBAAqB,iBAAiB,OAAO,aAAa;AAEvE,MAAaA,cAAYC"}
1
+ {"version":3,"file":"Dialog.mjs","names":["useDialog","_useDialog"],"sources":["../src/Dialog.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 { forwardRef, type RefAttributes } from \"react\";\nimport { Dialog, dialogAnatomy, useDialog as _useDialog } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext, styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\nimport { Heading, Text, type TextProps } from \"./Text\";\n\nconst dialogRecipe = sva({\n slots: dialogAnatomy.keys(),\n base: {\n backdrop: {\n position: \"fixed\",\n height: \"100vh\",\n width: \"100vw\",\n left: \"0\",\n top: \"0\",\n // TODO: Consider if this should be a token. It's probably consistent enough between dark and light mode to be a token.\n background: \"rgba(1, 1, 1, 0.3)\",\n _open: {\n animation: \"backdrop-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"backdrop-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n positioner: {\n position: \"fixed\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n left: \"0\",\n top: \"0\",\n width: \"100vw\",\n height: \"100dvh\",\n },\n content: {\n \"--margin\": \"token(sizes.medium)\",\n position: \"relative\",\n background: \"surface.default\",\n boxShadow: \"xlarge\",\n height: \"min-content\",\n maxWidth: \"95%\",\n maxHeight: \"95%\",\n margin: \"auto\",\n overflowY: \"auto\",\n borderRadius: { base: \"sharp\", tablet: \"small\" },\n paddingBlockStart: \"env(safe-area-inset-top)\",\n paddingBlockEnd: \"env(safe-area-inset-bottom)\",\n paddingInlineStart: \"env(safe-area-inset-left)\",\n paddingInlineEnd: \"env(safe-area-inset-right)\",\n tabletDown: {\n \"--margin\": \"0px\",\n minWidth: \"100%\",\n minHeight: \"100%\",\n },\n },\n },\n defaultVariants: {\n size: \"medium\",\n position: \"center\",\n variant: \"dialog\",\n context: \"dialog\",\n },\n compoundVariants: [\n {\n variant: \"drawer\",\n position: \"left\",\n css: {\n content: {\n minHeight: \"100%\",\n maxHeight: \"100%\",\n width: \"var(--size)\",\n _open: {\n animation: \"drawer-in-left\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-left\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"right\",\n css: {\n content: {\n minHeight: \"100%\",\n maxHeight: \"100%\",\n width: \"var(--size)\",\n _open: {\n animation: \"drawer-in-right\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-right\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"top\",\n css: {\n content: {\n minWidth: \"100%\",\n maxWidth: \"100%\",\n height: \"var(--size)\",\n _open: {\n animation: \"drawer-in-top\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-top\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n position: \"bottom\",\n css: {\n content: {\n minWidth: \"100%\",\n maxWidth: \"100%\",\n height: \"var(--size)\",\n _open: {\n animation: \"drawer-in-bottom\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"drawer-out-bottom\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"xsmall\",\n css: {\n content: {\n \"--size\": \"sizes.surface.3xsmall\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"small\",\n css: {\n content: {\n \"--size\": \"sizes.surface.xsmall\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"medium\",\n css: {\n content: {\n \"--size\": \"sizes.surface.medium\",\n },\n },\n },\n {\n variant: \"drawer\",\n size: \"large\",\n css: {\n content: {\n \"--size\": \"sizes.surface.xlarge\",\n },\n },\n },\n ],\n variants: {\n context: {\n dialog: {\n positioner: {\n zIndex: \"modal\",\n },\n backdrop: {\n zIndex: \"overlay\",\n },\n },\n alert: {\n positioner: {\n zIndex: \"alertModal\",\n },\n backdrop: {\n zIndex: \"alertModalOverlay\",\n },\n },\n },\n variant: {\n drawer: {\n content: {\n \"--margin\": \"0px\",\n borderRadius: { base: \"sharp\", tablet: \"sharp\" },\n },\n },\n dialog: {\n content: {\n width: \"var(--size)\",\n _open: {\n animation: \"dialog-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"dialog-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n },\n },\n position: {\n left: {\n content: {\n marginInlineStart: \"var(--margin)\",\n },\n },\n center: {},\n right: {\n content: {\n marginInlineEnd: \"var(--margin)\",\n },\n },\n bottom: {\n content: {\n marginBlockEnd: \"var(--margin)\",\n },\n },\n top: {\n content: {\n marginBlockStart: \"var(--margin)\",\n },\n },\n },\n size: {\n full: {\n content: {\n \"--margin\": \"0px\",\n minHeight: \"100%\",\n minWidth: \"100%\",\n borderRadius: \"sharp\",\n },\n },\n xsmall: {\n content: {\n \"--size\": \"sizes.surface.xsmall\",\n },\n },\n small: {\n content: {\n \"--size\": \"sizes.surface.medium\",\n },\n },\n medium: {\n content: {\n \"--size\": \"sizes.surface.xlarge\",\n },\n },\n large: {\n content: {\n \"--size\": \"sizes.surface.4xlarge\",\n },\n },\n },\n },\n});\n\nconst { withRootProvider, withContext } = createStyleContext(dialogRecipe);\n\nexport type DialogVariantProps = NonNullable<RecipeVariantProps<typeof dialogRecipe>>;\n\nexport interface DialogRootProps extends Dialog.RootProps, DialogVariantProps {}\n\nexport const InternalDialogRoot = withRootProvider(Dialog.Root);\n\nexport const DialogRoot = ({ lazyMount = true, unmountOnExit = true, ...props }: DialogRootProps) => (\n <InternalDialogRoot lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n);\n\nexport const DialogBackdrop = withContext(Dialog.Backdrop, \"backdrop\", { baseComponent: true });\n\nexport const DialogStandaloneContent = withContext(Dialog.Content, \"content\", { baseComponent: true });\n\nexport const DialogPositioner = withContext(Dialog.Positioner, \"positioner\", { baseComponent: true });\n\ninterface DialogContentProps extends Dialog.ContentProps, StyledProps {}\n\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>((props, ref) => (\n <>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogStandaloneContent ref={ref} {...props} />\n </DialogPositioner>\n </>\n));\n\nconst InternalDialogDescription = withContext(Dialog.Description, \"description\");\n\ninterface DialogDescriptionProps\n extends Omit<Dialog.DescriptionProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLParagraphElement> {}\n\nexport const DialogDescription = ({ textStyle = \"body.large\", children, ...rest }: DialogDescriptionProps) => {\n return (\n <InternalDialogDescription asChild>\n <Text textStyle={textStyle} {...rest}>\n {children}\n </Text>\n </InternalDialogDescription>\n );\n};\n\nconst InternalDialogTitle = withContext(Dialog.Title, \"title\");\n\ninterface DialogTitleProps\n extends Omit<Dialog.TitleProps, \"color\">,\n TextProps,\n StyledProps,\n RefAttributes<HTMLHeadingElement> {}\n\nexport const DialogTitle = ({ textStyle = \"title.medium\", children, ...rest }: DialogTitleProps) => (\n <InternalDialogTitle asChild>\n <Heading textStyle={textStyle} {...rest}>\n {children}\n </Heading>\n </InternalDialogTitle>\n);\n\nexport const DialogTrigger = withContext(Dialog.Trigger, \"trigger\", { baseComponent: true });\n\nexport const DialogCloseTrigger = withContext(Dialog.CloseTrigger, \"closeTrigger\", { baseComponent: true });\n\nexport const DialogHeader = styled(\"div\", {\n base: {\n display: \"flex\",\n paddingInline: \"medium\",\n paddingBlockStart: \"medium\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n gap: \"xsmall\",\n },\n});\n\nexport const DialogBody = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n paddingInline: \"medium\",\n paddingBlockStart: \"small\",\n paddingBlockEnd: \"medium\",\n },\n});\n\nexport const DialogFooter = styled(\"div\", {\n base: {\n display: \"flex\",\n gap: \"3xsmall\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n paddingInline: \"medium\",\n paddingBlockStart: \"small\",\n paddingBlockEnd: \"medium\",\n },\n});\n\nexport const DialogRootProvider = withRootProvider(Dialog.RootProvider);\n\nexport const useDialog = _useDialog;\n"],"mappings":";;;;;;;;;;;;;;;AAoTA,MAAM,EAAE,kBAAkB,gBAAgB,mBArSrB,IAAI;CACvB,OAAO,cAAc,MAAM;CAC3B,MAAM;EACJ,UAAU;GACR,UAAU;GACV,QAAQ;GACR,OAAO;GACP,MAAM;GACN,KAAK;GAEL,YAAY;GACZ,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,YAAY;GACV,UAAU;GACV,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,UAAU;GACV,MAAM;GACN,KAAK;GACL,OAAO;GACP,QAAQ;GACT;EACD,SAAS;GACP,YAAY;GACZ,UAAU;GACV,YAAY;GACZ,WAAW;GACX,QAAQ;GACR,UAAU;GACV,WAAW;GACX,QAAQ;GACR,WAAW;GACX,cAAc;IAAE,MAAM;IAAS,QAAQ;IAAS;GAChD,mBAAmB;GACnB,iBAAiB;GACjB,oBAAoB;GACpB,kBAAkB;GAClB,YAAY;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACZ;GACF;EACF;CACD,iBAAiB;EACf,MAAM;EACN,UAAU;EACV,SAAS;EACT,SAAS;EACV;CACD,kBAAkB;EAChB;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,UAAU;GACV,KAAK,EACH,SAAS;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;KACL,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACD,SAAS;KACP,WAAW;KACX,eAAe,EACb,WAAW,QACZ;KACF;IACF,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,yBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,wBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SAAS,EACP,UAAU,wBACX,EACF;GACF;EACD;GACE,SAAS;GACT,MAAM;GACN,KAAK,EACH,SA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