@strapi/design-system 1.6.2 → 1.6.4

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 (287) hide show
  1. package/dist/Accordion/Accordion.cjs +5 -5
  2. package/dist/Accordion/Accordion.js +45 -44
  3. package/dist/Accordion/AccordionContent.cjs +1 -1
  4. package/dist/Accordion/AccordionContent.js +4 -4
  5. package/dist/Accordion/AccordionGroup.cjs +4 -4
  6. package/dist/Accordion/AccordionGroup.js +18 -18
  7. package/dist/Accordion/AccordionToggle.cjs +2 -2
  8. package/dist/Accordion/AccordionToggle.js +11 -11
  9. package/dist/Alert/Alert.cjs +1 -1
  10. package/dist/Alert/Alert.js +8 -8
  11. package/dist/Avatar/Avatar.cjs +5 -5
  12. package/dist/Avatar/Avatar.js +11 -11
  13. package/dist/Avatar/AvatarGroup.cjs +2 -2
  14. package/dist/Avatar/AvatarGroup.js +4 -4
  15. package/dist/BaseButton/BaseButton.cjs +5 -11
  16. package/dist/BaseButton/BaseButton.js +31 -38
  17. package/dist/BaseCheckbox/BaseCheckbox.cjs +3 -3
  18. package/dist/BaseCheckbox/BaseCheckbox.js +22 -22
  19. package/dist/BaseRadio/BaseRadio.cjs +2 -2
  20. package/dist/BaseRadio/BaseRadio.js +4 -4
  21. package/dist/BaseRadio/RadioGroup.cjs +1 -1
  22. package/dist/BaseRadio/RadioGroup.js +28 -26
  23. package/dist/Box/Box.cjs +2 -2
  24. package/dist/Box/Box.js +36 -33
  25. package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
  26. package/dist/Breadcrumbs/Breadcrumbs.js +12 -12
  27. package/dist/Button/Button.cjs +10 -27
  28. package/dist/Button/Button.js +65 -85
  29. package/dist/Button/utils.cjs +22 -22
  30. package/dist/Button/utils.js +2 -2
  31. package/dist/Card/Card.cjs +1 -1
  32. package/dist/Card/Card.js +15 -14
  33. package/dist/Card/CardAsset.js +4 -4
  34. package/dist/Card/CardBody.cjs +1 -1
  35. package/dist/Card/CardBody.js +4 -4
  36. package/dist/Card/CardCheckbox.cjs +1 -1
  37. package/dist/Card/CardCheckbox.js +6 -6
  38. package/dist/Card/CardTitle.cjs +1 -1
  39. package/dist/Card/CardTitle.js +1 -1
  40. package/dist/CarouselInput/Carousel.cjs +2 -2
  41. package/dist/CarouselInput/Carousel.js +19 -64
  42. package/dist/CarouselInput/CarouselActions.js +1 -9
  43. package/dist/CarouselInput/CarouselImage.js +1 -10
  44. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  45. package/dist/CarouselInput/CarouselInput.js +19 -24
  46. package/dist/CarouselInput/CarouselSlide.js +13 -9
  47. package/dist/Checkbox/Checkbox.cjs +2 -2
  48. package/dist/Checkbox/Checkbox.js +7 -26
  49. package/dist/Combobox/Combobox.cjs +1 -1
  50. package/dist/Combobox/Combobox.js +106 -120
  51. package/dist/Combobox/ComboboxOption.cjs +1 -1
  52. package/dist/Combobox/ComboboxOption.js +18 -17
  53. package/dist/DatePicker/DatePicker.cjs +1 -1
  54. package/dist/DatePicker/DatePicker.js +47 -46
  55. package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
  56. package/dist/DatePicker/DatePickerCalendar.js +28 -61
  57. package/dist/DatePicker/DatePickerTd.js +1 -12
  58. package/dist/DatePicker/DatePickerTh.cjs +3 -3
  59. package/dist/DatePicker/DatePickerTh.js +7 -16
  60. package/dist/DatePicker/components.cjs +3 -3
  61. package/dist/DatePicker/components.js +6 -6
  62. package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
  63. package/dist/DateTimePicker/DateTimePicker.js +64 -61
  64. package/dist/DateTimePicker/DateTimePickerProps.js +1 -3
  65. package/dist/Dialog/Dialog.cjs +4 -4
  66. package/dist/Dialog/Dialog.js +26 -37
  67. package/dist/Dialog/DialogBody.cjs +1 -1
  68. package/dist/Dialog/DialogBody.js +2 -11
  69. package/dist/Dialog/DialogFooter.cjs +1 -1
  70. package/dist/Dialog/DialogFooter.js +2 -7
  71. package/dist/DismissibleLayer/DismissibleLayer.js +1 -4
  72. package/dist/Divider/Divider.js +1 -5
  73. package/dist/EmptyStateLayout/EmptyStateLayout.cjs +1 -1
  74. package/dist/EmptyStateLayout/EmptyStateLayout.js +2 -16
  75. package/dist/EmptyStateLayout/story-assets/Illo.js +60 -45
  76. package/dist/Field/Field.cjs +1 -1
  77. package/dist/Field/Field.js +12 -13
  78. package/dist/Field/FieldAction.cjs +1 -1
  79. package/dist/Field/FieldAction.js +2 -6
  80. package/dist/Field/FieldError.js +1 -7
  81. package/dist/Field/FieldHint.js +1 -6
  82. package/dist/Field/FieldInput.cjs +4 -4
  83. package/dist/Field/FieldInput.js +26 -34
  84. package/dist/Field/FieldLabel.cjs +1 -1
  85. package/dist/Field/FieldLabel.js +3 -16
  86. package/dist/FocusTrap/FocusTrap.js +1 -5
  87. package/dist/Grid/Grid.cjs +3 -3
  88. package/dist/Grid/Grid.js +12 -15
  89. package/dist/Grid/GridItem.cjs +2 -2
  90. package/dist/Grid/GridItem.js +5 -13
  91. package/dist/IconButton/IconButton.cjs +7 -12
  92. package/dist/IconButton/IconButton.js +88 -84
  93. package/dist/JSONInput/JSONInput.cjs +1 -1
  94. package/dist/JSONInput/JSONInput.js +85 -78
  95. package/dist/JSONInput/JSONInputContainer.cjs +10 -10
  96. package/dist/JSONInput/JSONInputContainer.js +22 -15
  97. package/dist/Layout/ActionLayout.js +1 -13
  98. package/dist/Layout/ContentLayout.js +1 -4
  99. package/dist/Layout/HeaderLayout.cjs +1 -1
  100. package/dist/Layout/HeaderLayout.js +35 -64
  101. package/dist/Layout/Layout.js +1 -5
  102. package/dist/Layout/TwoColsLayout.js +1 -17
  103. package/dist/Link/Link.cjs +5 -5
  104. package/dist/Link/Link.js +55 -57
  105. package/dist/LinkButton/LinkButton.cjs +7 -24
  106. package/dist/LinkButton/LinkButton.js +60 -87
  107. package/dist/LiveRegions/LiveRegions.cjs +1 -1
  108. package/dist/LiveRegions/LiveRegions.js +1 -1
  109. package/dist/Loader/Loader.cjs +4 -4
  110. package/dist/Loader/Loader.js +26 -24
  111. package/dist/Main/Main.js +1 -6
  112. package/dist/Main/SkipToContent.cjs +2 -2
  113. package/dist/Main/SkipToContent.js +17 -13
  114. package/dist/MainNav/MainNav.cjs +2 -2
  115. package/dist/MainNav/MainNav.js +21 -20
  116. package/dist/MainNav/NavBrand.cjs +2 -2
  117. package/dist/MainNav/NavBrand.js +4 -38
  118. package/dist/MainNav/NavCondense.cjs +2 -2
  119. package/dist/MainNav/NavCondense.js +10 -18
  120. package/dist/MainNav/NavFooter.js +1 -3
  121. package/dist/MainNav/NavLink.cjs +4 -4
  122. package/dist/MainNav/NavLink.js +8 -34
  123. package/dist/MainNav/NavSection.cjs +1 -1
  124. package/dist/MainNav/NavSection.js +5 -38
  125. package/dist/MainNav/NavSections.cjs +2 -2
  126. package/dist/MainNav/NavSections.js +4 -15
  127. package/dist/MainNav/NavUser.cjs +2 -2
  128. package/dist/MainNav/NavUser.js +6 -27
  129. package/dist/ModalLayout/ModalBody.js +1 -4
  130. package/dist/ModalLayout/ModalFooter.cjs +1 -1
  131. package/dist/ModalLayout/ModalFooter.js +2 -10
  132. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  133. package/dist/ModalLayout/ModalHeader.js +8 -20
  134. package/dist/ModalLayout/ModalLayout.cjs +3 -3
  135. package/dist/ModalLayout/ModalLayout.js +23 -31
  136. package/dist/NumberInput/NumberInput.cjs +2 -2
  137. package/dist/NumberInput/NumberInput.js +54 -59
  138. package/dist/Pagination/Pagination.cjs +2 -2
  139. package/dist/Pagination/Pagination.js +11 -16
  140. package/dist/Pagination/components.cjs +3 -3
  141. package/dist/Pagination/components.js +31 -38
  142. package/dist/Popover/Popover.cjs +3 -3
  143. package/dist/Popover/Popover.js +111 -102
  144. package/dist/Popover/index.cjs +1 -1
  145. package/dist/Popover/index.js +9 -3
  146. package/dist/Portal/Portal.cjs +1 -1
  147. package/dist/Portal/Portal.js +10 -12
  148. package/dist/ProgressBar/ProgressBar.js +17 -14
  149. package/dist/Radio/Radio.cjs +2 -2
  150. package/dist/Radio/Radio.js +4 -11
  151. package/dist/RawTable/RawCell.cjs +1 -1
  152. package/dist/RawTable/RawCell.js +5 -14
  153. package/dist/RawTable/RawTable.cjs +1 -1
  154. package/dist/RawTable/RawTable.js +36 -35
  155. package/dist/RawTable/RawTbody.js +1 -3
  156. package/dist/RawTable/RawThead.js +1 -3
  157. package/dist/RawTable/RawTr.js +1 -4
  158. package/dist/Searchbar/SearchForm.js +1 -4
  159. package/dist/Searchbar/Searchbar.cjs +3 -3
  160. package/dist/Searchbar/Searchbar.js +21 -25
  161. package/dist/Select/MultiSelectNested.js +2 -14
  162. package/dist/Select/OptGroup.cjs +1 -1
  163. package/dist/Select/OptGroup.js +14 -10
  164. package/dist/Select/Option.cjs +3 -3
  165. package/dist/Select/Option.js +31 -33
  166. package/dist/Select/Select.cjs +2 -2
  167. package/dist/Select/Select.js +87 -107
  168. package/dist/Select/SelectButton.cjs +1 -1
  169. package/dist/Select/SelectButton.js +14 -11
  170. package/dist/Select/SelectList.cjs +1 -1
  171. package/dist/Select/SelectList.js +20 -16
  172. package/dist/Select/SelectTags.cjs +3 -3
  173. package/dist/Select/SelectTags.js +17 -15
  174. package/dist/Select/SingleSelect.cjs +1 -1
  175. package/dist/Select/SingleSelect.js +1 -1
  176. package/dist/SimpleMenu/SimpleMenu.cjs +3 -3
  177. package/dist/SimpleMenu/SimpleMenu.js +43 -67
  178. package/dist/Status/Status.js +15 -13
  179. package/dist/SubNav/SubNav.cjs +2 -2
  180. package/dist/SubNav/SubNav.js +5 -9
  181. package/dist/SubNav/SubNavHeader.cjs +2 -2
  182. package/dist/SubNav/SubNavHeader.js +31 -53
  183. package/dist/SubNav/SubNavLink.cjs +3 -3
  184. package/dist/SubNav/SubNavLink.js +18 -22
  185. package/dist/SubNav/SubNavLinkSection.cjs +2 -2
  186. package/dist/SubNav/SubNavLinkSection.js +5 -30
  187. package/dist/SubNav/SubNavSection.cjs +2 -2
  188. package/dist/SubNav/SubNavSection.js +23 -30
  189. package/dist/SubNav/SubNavSectionLabel.cjs +2 -2
  190. package/dist/SubNav/SubNavSectionLabel.js +15 -24
  191. package/dist/SubNav/SubNavSections.cjs +1 -1
  192. package/dist/SubNav/SubNavSections.js +3 -12
  193. package/dist/Switch/Switch.cjs +2 -2
  194. package/dist/Switch/Switch.js +16 -17
  195. package/dist/Table/Cell.cjs +1 -1
  196. package/dist/Table/Cell.js +3 -8
  197. package/dist/Table/TFooter.cjs +2 -2
  198. package/dist/Table/TFooter.js +3 -17
  199. package/dist/Table/Table.cjs +1 -1
  200. package/dist/Table/Table.js +2 -18
  201. package/dist/Table/Tbody.js +1 -3
  202. package/dist/Table/Thead.js +1 -3
  203. package/dist/Table/Tr.js +1 -3
  204. package/dist/Tabs/TabGroup.cjs +1 -1
  205. package/dist/Tabs/TabGroup.js +30 -27
  206. package/dist/Tabs/TabPanels.js +2 -10
  207. package/dist/Tabs/Tabs.cjs +1 -1
  208. package/dist/Tabs/Tabs.js +43 -51
  209. package/dist/Tag/Tag.cjs +1 -1
  210. package/dist/Tag/Tag.js +20 -23
  211. package/dist/TextButton/TextButton.cjs +6 -6
  212. package/dist/TextButton/TextButton.js +15 -15
  213. package/dist/TextInput/TextInput.cjs +1 -1
  214. package/dist/TextInput/TextInput.js +14 -32
  215. package/dist/Textarea/Textarea.cjs +2 -2
  216. package/dist/Textarea/Textarea.js +10 -25
  217. package/dist/Textarea/TextareaInput.cjs +1 -1
  218. package/dist/Textarea/TextareaInput.js +15 -15
  219. package/dist/TimePicker/TimePicker.cjs +2 -2
  220. package/dist/TimePicker/TimePicker.js +27 -26
  221. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +5 -5
  222. package/dist/ToggleCheckbox/ToggleCheckbox.js +85 -60
  223. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  224. package/dist/ToggleInput/ToggleInput.js +14 -32
  225. package/dist/Tooltip/Tooltip.cjs +2 -2
  226. package/dist/Tooltip/Tooltip.js +62 -53
  227. package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -1
  228. package/dist/Tooltip/hooks/useTooltipHandlers.js +7 -7
  229. package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
  230. package/dist/Tooltip/hooks/useTooltipLayout.js +8 -5
  231. package/dist/Typography/Typography.cjs +3 -2
  232. package/dist/Typography/Typography.js +17 -14
  233. package/dist/helpers/objects.cjs +1 -1
  234. package/dist/helpers/objects.js +1 -1
  235. package/dist/hooks/useId.cjs +1 -0
  236. package/dist/hooks/useId.js +13 -0
  237. package/dist/index.cjs +1 -1
  238. package/dist/index.js +136 -134
  239. package/dist/themes/extendTheme.cjs +1 -1
  240. package/dist/themes/extendTheme.js +4 -4
  241. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  242. package/dist/v2/Breadcrumbs/Breadcrumbs.js +4 -13
  243. package/dist/v2/Breadcrumbs/Crumb.js +11 -12
  244. package/dist/v2/Breadcrumbs/CrumbLink.js +1 -3
  245. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
  246. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +5 -11
  247. package/dist/v2/Breadcrumbs/Divider.js +1 -8
  248. package/dist/v2/Link/Link.cjs +2 -2
  249. package/dist/v2/Link/Link.js +5 -24
  250. package/dist/v2/LinkButton/LinkButton.cjs +11 -24
  251. package/dist/v2/LinkButton/LinkButton.js +62 -84
  252. package/dist/v2/MainNav/MainNav.cjs +2 -2
  253. package/dist/v2/MainNav/MainNav.js +21 -20
  254. package/dist/v2/MainNav/NavBrand.cjs +2 -2
  255. package/dist/v2/MainNav/NavBrand.js +4 -38
  256. package/dist/v2/MainNav/NavCondense.cjs +2 -2
  257. package/dist/v2/MainNav/NavCondense.js +10 -18
  258. package/dist/v2/MainNav/NavFooter.js +1 -3
  259. package/dist/v2/MainNav/NavLink.cjs +4 -4
  260. package/dist/v2/MainNav/NavLink.js +10 -39
  261. package/dist/v2/MainNav/NavSection.cjs +1 -1
  262. package/dist/v2/MainNav/NavSection.js +5 -38
  263. package/dist/v2/MainNav/NavSections.cjs +2 -2
  264. package/dist/v2/MainNav/NavSections.js +4 -15
  265. package/dist/v2/MainNav/NavUser.cjs +2 -2
  266. package/dist/v2/MainNav/NavUser.js +6 -27
  267. package/dist/v2/Pagination/Pagination.cjs +2 -2
  268. package/dist/v2/Pagination/Pagination.js +11 -16
  269. package/dist/v2/Pagination/components.cjs +2 -2
  270. package/dist/v2/Pagination/components.js +11 -39
  271. package/dist/v2/SimpleMenu/SimpleMenu.cjs +4 -4
  272. package/dist/v2/SimpleMenu/SimpleMenu.js +42 -65
  273. package/dist/v2/SubNav/SubNav.cjs +2 -2
  274. package/dist/v2/SubNav/SubNav.js +5 -9
  275. package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
  276. package/dist/v2/SubNav/SubNavHeader.js +31 -53
  277. package/dist/v2/SubNav/SubNavLink.cjs +2 -2
  278. package/dist/v2/SubNav/SubNavLink.js +18 -22
  279. package/dist/v2/SubNav/SubNavLinkSection.cjs +2 -2
  280. package/dist/v2/SubNav/SubNavLinkSection.js +5 -30
  281. package/dist/v2/SubNav/SubNavSection.cjs +2 -2
  282. package/dist/v2/SubNav/SubNavSection.js +26 -33
  283. package/dist/v2/SubNav/SubNavSectionLabel.cjs +2 -2
  284. package/dist/v2/SubNav/SubNavSectionLabel.js +15 -24
  285. package/dist/v2/SubNav/SubNavSections.cjs +1 -1
  286. package/dist/v2/SubNav/SubNavSections.js +3 -12
  287. package/package.json +7 -4
@@ -1,57 +1,50 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import a from "react";
3
- import d from "styled-components";
4
- import { buttonFocusStyle as i } from "../themes/utils.js";
5
- const n = d.button`
6
- display: flex;
7
- cursor: pointer;
8
- padding: ${({
9
- theme: r
10
- }) => r.spaces[2]};
11
- border-radius: ${({
12
- theme: r
13
- }) => r.borderRadius};
14
- background: ${({
15
- theme: r
16
- }) => r.colors.neutral0};
17
- border: 1px solid ${({
18
- theme: r
19
- }) => r.colors.neutral200};
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import s from "react";
3
+ import n from "styled-components";
4
+ import { Flex as i } from "../Flex/Flex.js";
5
+ import { buttonFocusStyle as u } from "../themes/utils.js";
6
+ const p = n(i)`
20
7
  svg {
21
8
  height: ${({
22
- theme: r
23
- }) => r.spaces[3]};
9
+ theme: t
10
+ }) => t.spaces[3]};
24
11
  width: ${({
25
- theme: r
26
- }) => r.spaces[3]};
27
- }
28
- svg {
12
+ theme: t
13
+ }) => t.spaces[3]};
14
+
29
15
  > g,
30
16
  path {
31
17
  fill: ${({
32
- theme: r
33
- }) => r.colors.neutral0};
18
+ theme: t
19
+ }) => t.colors.neutral0};
34
20
  }
35
21
  }
22
+
36
23
  &[aria-disabled='true'] {
37
24
  pointer-events: none;
38
25
  }
39
26
 
40
- ${i}
41
- `, l = a.forwardRef(({
42
- disabled: r,
43
- children: t,
27
+ ${u}
28
+ `, d = s.forwardRef(({
29
+ disabled: t,
30
+ children: r,
44
31
  ...e
45
- }, o) => s(n, {
32
+ }, o) => a(p, {
46
33
  ref: o,
47
- "aria-disabled": r,
34
+ "aria-disabled": t,
35
+ as: "button",
48
36
  type: "button",
49
- disabled: r,
37
+ disabled: t,
38
+ padding: 2,
39
+ hasRadius: !0,
40
+ background: "neutral0",
41
+ borderColor: "neutral200",
42
+ cursor: "pointer",
50
43
  ...e,
51
- children: t
44
+ children: r
52
45
  }));
53
- l.displayName = "BaseButton";
46
+ d.displayName = "BaseButton";
54
47
  export {
55
- l as BaseButton,
56
- n as BaseButtonWrapper
48
+ d as BaseButton,
49
+ p as BaseButtonWrapper
57
50
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),a=require("react"),b=require("styled-components"),p=require("../Box/Box.cjs"),s=require("./utils.cjs"),k=require("./assets/checkmark.cjs"),h=require("./assets/checkmark-black.cjs"),f=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},x=f(b),g=x.default.input`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("react"),p=require("styled-components"),f=require("./assets/checkmark-black.cjs"),k=require("./assets/checkmark.cjs"),s=require("./utils.cjs"),h=require("../Box/Box.cjs"),x=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function g(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const l=g(b),m=x(p),y=m.default.input`
2
2
  height: ${s.getCheckboxSize};
3
3
  min-width: ${s.getCheckboxSize};
4
4
  margin: 0;
@@ -25,7 +25,7 @@
25
25
  }
26
26
 
27
27
  &:disabled:after {
28
- background: url(${h}) no-repeat no-repeat center center;
28
+ background: url(${f}) no-repeat no-repeat center center;
29
29
  }
30
30
  }
31
31
 
@@ -59,4 +59,4 @@
59
59
  }
60
60
  }
61
61
  }
62
- `,n=({indeterminate:e=!1,size:l="M",name:i,value:o=!1,onValueChange:t,...u})=>{const r=a.useRef(null);a.useEffect(()=>{r.current&&e?r.current.indeterminate=e:r.current.indeterminate=!1},[e]);const d=()=>{t&&t(!o)};return c.jsx(p.Box,{children:c.jsx(g,{size:l,checked:o,onChange:d,type:"checkbox",ref:r,name:i,...u})})};n.displayName="BaseCheckbox";exports.BaseCheckbox=n;
62
+ `,i=({indeterminate:e=!1,size:o="M",name:r,value:t=!1,onValueChange:a,...u})=>{const c=l.useRef(null);l.useEffect(()=>{c.current&&e?c.current.indeterminate=e:c.current.indeterminate=!1},[e]);const d=()=>{a&&a(!t)};return n.jsx(h.Box,{children:n.jsx(y,{size:o,checked:t,onChange:d,type:"checkbox",ref:c,name:r,...u})})};i.displayName="BaseCheckbox";exports.BaseCheckbox=i;
@@ -1,13 +1,13 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { useRef as s, useEffect as d } from "react";
3
- import p from "styled-components";
4
- import { Box as u } from "../Box/Box.js";
5
- import { getCheckboxSize as c } from "./utils.js";
6
- import b from "./assets/checkmark.js";
7
- import m from "./assets/checkmark-black.js";
8
- const f = p.input`
9
- height: ${c};
10
- min-width: ${c};
2
+ import * as c from "react";
3
+ import d from "styled-components";
4
+ import p from "./assets/checkmark-black.js";
5
+ import u from "./assets/checkmark.js";
6
+ import { getCheckboxSize as n } from "./utils.js";
7
+ import { Box as b } from "../Box/Box.js";
8
+ const m = d.input`
9
+ height: ${n};
10
+ min-width: ${n};
11
11
  margin: 0;
12
12
  border-radius: ${({
13
13
  theme: r
@@ -33,7 +33,7 @@ const f = p.input`
33
33
  content: '';
34
34
  display: block;
35
35
  position: relative;
36
- background: url(${b}) no-repeat no-repeat center center;
36
+ background: url(${u}) no-repeat no-repeat center center;
37
37
  width: 10px;
38
38
  height: 10px;
39
39
  left: 50%;
@@ -42,7 +42,7 @@ const f = p.input`
42
42
  }
43
43
 
44
44
  &:disabled:after {
45
- background: url(${m}) no-repeat no-repeat center center;
45
+ background: url(${p}) no-repeat no-repeat center center;
46
46
  }
47
47
  }
48
48
 
@@ -92,32 +92,32 @@ const f = p.input`
92
92
  }
93
93
  }
94
94
  }
95
- `, h = ({
95
+ `, f = ({
96
96
  indeterminate: r = !1,
97
- size: n = "M",
98
- name: l,
97
+ size: l = "M",
98
+ name: s,
99
99
  value: e = !1,
100
100
  onValueChange: t,
101
101
  ...i
102
102
  }) => {
103
- const o = s(null);
104
- return d(() => {
103
+ const o = c.useRef(null);
104
+ return c.useEffect(() => {
105
105
  o.current && r ? o.current.indeterminate = r : o.current.indeterminate = !1;
106
- }, [r]), a(u, {
107
- children: a(f, {
108
- size: n,
106
+ }, [r]), a(b, {
107
+ children: a(m, {
108
+ size: l,
109
109
  checked: e,
110
110
  onChange: () => {
111
111
  t && t(!e);
112
112
  },
113
113
  type: "checkbox",
114
114
  ref: o,
115
- name: l,
115
+ name: s,
116
116
  ...i
117
117
  })
118
118
  });
119
119
  };
120
- h.displayName = "BaseCheckbox";
120
+ f.displayName = "BaseCheckbox";
121
121
  export {
122
- h as BaseCheckbox
122
+ f as BaseCheckbox
123
123
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),r=require("react"),g=require("styled-components"),y=require("../helpers/useId.cjs"),R=require("./context.cjs"),t=require("./utils.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},m=d(r),h=d(g),x=h.default.input`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),r=require("react"),g=require("styled-components"),y=require("./context.cjs"),t=require("./utils.cjs"),R=require("../helpers/useId.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},m=d(r),h=d(g),x=h.default.input`
2
2
  margin: 0;
3
3
  padding: 0;
4
4
  background-color: ${({theme:e})=>e.colors.neutral0};
@@ -28,4 +28,4 @@
28
28
  border: 1px solid ${({theme:e})=>e.colors.neutral300};
29
29
  background: ${({theme:e})=>e.colors.neutral200};
30
30
  }
31
- `,a=m.default.forwardRef(({value:e,disabled:n=!1,...i},c)=>{const s=y.useId(),{onChange:l,selected:u,name:p,size:f}=r.useContext(R.RadioContext),o=u===e;return b.jsx(x,{ref:c,type:"radio",name:p,value:e,tabIndex:o?0:-1,"aria-checked":o,checked:o,disabled:n,id:s,size:f,onChange:l,...i})});a.displayName="Radio";exports.BaseRadio=a;
31
+ `,a=m.default.forwardRef(({value:e,disabled:n=!1,...i},c)=>{const s=R.useId(),{onChange:l,selected:u,name:p,size:f}=r.useContext(y.RadioContext),o=u===e;return b.jsx(x,{ref:c,type:"radio",name:p,value:e,tabIndex:o?0:-1,"aria-checked":o,checked:o,disabled:n,id:s,size:f,onChange:l,...i})});a.displayName="Radio";exports.BaseRadio=a;
@@ -1,9 +1,9 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
2
  import u, { useContext as b } from "react";
3
3
  import g from "styled-components";
4
- import { useId as h } from "../helpers/useId.js";
5
- import { RadioContext as $ } from "./context.js";
4
+ import { RadioContext as h } from "./context.js";
6
5
  import { getRadioSize as r, getSelectedRadioSize as t, getSelectedRadioPosition as d } from "./utils.js";
6
+ import { useId as $ } from "../helpers/useId.js";
7
7
  const y = g.input`
8
8
  margin: 0;
9
9
  padding: 0;
@@ -57,12 +57,12 @@ const y = g.input`
57
57
  disabled: a = !1,
58
58
  ...n
59
59
  }, i) => {
60
- const c = h(), {
60
+ const c = $(), {
61
61
  onChange: l,
62
62
  selected: p,
63
63
  name: m,
64
64
  size: s
65
- } = b($), o = p === e;
65
+ } = b(h), o = p === e;
66
66
  return f(y, {
67
67
  ref: i,
68
68
  type: "radio",
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),s=require("react"),a=require("./context.cjs"),l=require("../helpers/setTabIndexOnFirstItem.cjs"),x=({children:i,labelledBy:n,onChange:u,value:e="",size:c="M",name:t,...d})=>{const r=s.useRef(null);return s.useLayoutEffect(()=>{e||l.setTabIndexOnFirstItem(r.current,`[name="${t}"]`)},[e,t]),o.jsx(a.RadioContext.Provider,{value:{onChange:u,selected:e,name:t,size:c},children:o.jsx("div",{ref:r,role:"radiogroup","aria-labelledby":n,...d,children:i})})};exports.RadioGroup=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),r=require("react"),l=require("./context.cjs"),x=require("../helpers/setTabIndexOnFirstItem.cjs"),b=({children:n,labelledBy:u,onChange:o,value:e="",size:s="M",name:t,...d})=>{const i=r.useRef(null);r.useLayoutEffect(()=>{e||x.setTabIndexOnFirstItem(i.current,`[name="${t}"]`)},[e,t]);const a=r.useMemo(()=>({onChange:o,selected:e,name:t,size:s}),[t,o,s,e]);return c.jsx(l.RadioContext.Provider,{value:a,children:c.jsx("div",{ref:i,role:"radiogroup","aria-labelledby":u,...d,children:n})})};exports.RadioGroup=b;
@@ -1,35 +1,37 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useRef as m, useLayoutEffect as p } from "react";
3
- import { RadioContext as s } from "./context.js";
4
- import { setTabIndexOnFirstItem as u } from "../helpers/setTabIndexOnFirstItem.js";
5
- const b = ({
6
- children: i,
7
- labelledBy: d,
8
- onChange: f,
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { useRef as n, useLayoutEffect as p, useMemo as u } from "react";
3
+ import { RadioContext as l } from "./context.js";
4
+ import { setTabIndexOnFirstItem as x } from "../helpers/setTabIndexOnFirstItem.js";
5
+ const G = ({
6
+ children: f,
7
+ labelledBy: c,
8
+ onChange: t,
9
9
  value: r = "",
10
- size: n = "M",
10
+ size: e = "M",
11
11
  name: o,
12
- ...l
12
+ ...s
13
13
  }) => {
14
- const e = m(null);
15
- return p(() => {
16
- r || u(e.current, `[name="${o}"]`);
17
- }, [r, o]), t(s.Provider, {
18
- value: {
19
- onChange: f,
20
- selected: r,
21
- name: o,
22
- size: n
23
- },
24
- children: t("div", {
25
- ref: e,
14
+ const i = n(null);
15
+ p(() => {
16
+ r || x(i.current, `[name="${o}"]`);
17
+ }, [r, o]);
18
+ const m = u(() => ({
19
+ onChange: t,
20
+ selected: r,
21
+ name: o,
22
+ size: e
23
+ }), [o, t, e, r]);
24
+ return d(l.Provider, {
25
+ value: m,
26
+ children: d("div", {
27
+ ref: i,
26
28
  role: "radiogroup",
27
- "aria-labelledby": d,
28
- ...l,
29
- children: i
29
+ "aria-labelledby": c,
30
+ ...s,
31
+ children: f
30
32
  })
31
33
  });
32
34
  };
33
35
  export {
34
- b as RadioGroup
36
+ G as RadioGroup
35
37
  };
package/dist/Box/Box.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),r=require("../helpers/theme.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=i(a),l={color:!0},m=d.default.div.withConfig({shouldForwardProp:(e,t)=>!l[e]&&t(e)})`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),r=require("../helpers/theme.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=a(i),l={color:!0,cursor:!0,height:!0,width:!0},m=d.default.div.withConfig({shouldForwardProp:(e,t)=>!l[e]&&t(e)})`
2
2
  // Font
3
3
  font-size: ${({fontSize:e,theme:t})=>r.extractStyleFromTheme(t.fontSizes,e,e)};
4
4
 
@@ -27,7 +27,7 @@
27
27
  border-style: ${({borderStyle:e})=>e};
28
28
  border-width: ${({borderWidth:e})=>e};
29
29
  border-color: ${({borderColor:e,theme:t})=>r.extractStyleFromTheme(t.colors,e,void 0)};
30
- border: ${({theme:e,borderColor:t,borderStyle:s,borderWidth:n})=>{if(t&&!s&&!n)return`1px solid ${e.colors[t]}`}};
30
+ border: ${({theme:e,borderColor:t,borderStyle:s,borderWidth:n})=>{if(t&&!s&&typeof n>"u")return`1px solid ${e.colors[t]}`}};
31
31
 
32
32
  // Shadows
33
33
  box-shadow: ${({theme:e,shadow:t})=>r.extractStyleFromTheme(e.shadows,t,void 0)};
package/dist/Box/Box.js CHANGED
@@ -1,64 +1,67 @@
1
1
  import d from "styled-components";
2
- import i from "../helpers/handleResponsiveValues.js";
3
- import { extractStyleFromTheme as s } from "../helpers/theme.js";
4
- const $ = {
5
- color: !0
2
+ import s from "../helpers/handleResponsiveValues.js";
3
+ import { extractStyleFromTheme as r } from "../helpers/theme.js";
4
+ const t = {
5
+ color: !0,
6
+ cursor: !0,
7
+ height: !0,
8
+ width: !0
6
9
  }, l = d.div.withConfig({
7
- shouldForwardProp: (e, o) => !$[e] && o(e)
10
+ shouldForwardProp: (e, o) => !t[e] && o(e)
8
11
  })`
9
12
  // Font
10
13
  font-size: ${({
11
14
  fontSize: e,
12
15
  theme: o
13
- }) => s(o.fontSizes, e, e)};
16
+ }) => r(o.fontSizes, e, e)};
14
17
 
15
18
  // Colors
16
19
  background: ${({
17
20
  theme: e,
18
21
  background: o
19
- }) => s(e.colors, o, void 0)};
22
+ }) => r(e.colors, o, void 0)};
20
23
  color: ${({
21
24
  theme: e,
22
25
  color: o
23
- }) => s(e.colors, o, void 0)};
26
+ }) => r(e.colors, o, void 0)};
24
27
 
25
28
  // Spaces
26
29
  ${({
27
30
  theme: e,
28
31
  padding: o
29
- }) => i("padding", o, e)}
32
+ }) => s("padding", o, e)}
30
33
  ${({
31
34
  theme: e,
32
35
  paddingTop: o
33
- }) => i("padding-top", o, e)}
36
+ }) => s("padding-top", o, e)}
34
37
  ${({
35
38
  theme: e,
36
39
  paddingRight: o
37
- }) => i("padding-right", o, e)}
40
+ }) => s("padding-right", o, e)}
38
41
  ${({
39
42
  theme: e,
40
43
  paddingBottom: o
41
- }) => i("padding-bottom", o, e)}
44
+ }) => s("padding-bottom", o, e)}
42
45
  ${({
43
46
  theme: e,
44
47
  paddingLeft: o
45
- }) => i("padding-left", o, e)}
48
+ }) => s("padding-left", o, e)}
46
49
  ${({
47
50
  theme: e,
48
51
  marginLeft: o
49
- }) => i("margin-left", o, e)}
52
+ }) => s("margin-left", o, e)}
50
53
  ${({
51
54
  theme: e,
52
55
  marginRight: o
53
- }) => i("margin-right", o, e)}
56
+ }) => s("margin-right", o, e)}
54
57
  ${({
55
58
  theme: e,
56
59
  marginTop: o
57
- }) => i("margin-top", o, e)}
60
+ }) => s("margin-top", o, e)}
58
61
  ${({
59
62
  theme: e,
60
63
  marginBottom: o
61
- }) => i("margin-bottom", o, e)}
64
+ }) => s("margin-bottom", o, e)}
62
65
 
63
66
  // Responsive hiding
64
67
  ${({
@@ -75,8 +78,8 @@ const $ = {
75
78
  border-radius: ${({
76
79
  theme: e,
77
80
  hasRadius: o,
78
- borderRadius: r
79
- }) => o ? e.borderRadius : r};
81
+ borderRadius: i
82
+ }) => o ? e.borderRadius : i};
80
83
  border-style: ${({
81
84
  borderStyle: e
82
85
  }) => e};
@@ -86,14 +89,14 @@ const $ = {
86
89
  border-color: ${({
87
90
  borderColor: e,
88
91
  theme: o
89
- }) => s(o.colors, e, void 0)};
92
+ }) => r(o.colors, e, void 0)};
90
93
  border: ${({
91
94
  theme: e,
92
95
  borderColor: o,
93
- borderStyle: r,
96
+ borderStyle: i,
94
97
  borderWidth: n
95
98
  }) => {
96
- if (o && !r && !n)
99
+ if (o && !i && typeof n > "u")
97
100
  return `1px solid ${e.colors[o]}`;
98
101
  }};
99
102
 
@@ -101,7 +104,7 @@ const $ = {
101
104
  box-shadow: ${({
102
105
  theme: e,
103
106
  shadow: o
104
- }) => s(e.shadows, o, void 0)};
107
+ }) => r(e.shadows, o, void 0)};
105
108
 
106
109
  // Handlers
107
110
  pointer-events: ${({
@@ -126,19 +129,19 @@ const $ = {
126
129
  left: ${({
127
130
  left: e,
128
131
  theme: o
129
- }) => s(o.spaces, e, e)};
132
+ }) => r(o.spaces, e, e)};
130
133
  right: ${({
131
134
  right: e,
132
135
  theme: o
133
- }) => s(o.spaces, e, e)};
136
+ }) => r(o.spaces, e, e)};
134
137
  top: ${({
135
138
  top: e,
136
139
  theme: o
137
- }) => s(o.spaces, e, e)};
140
+ }) => r(o.spaces, e, e)};
138
141
  bottom: ${({
139
142
  bottom: e,
140
143
  theme: o
141
- }) => s(o.spaces, e, e)};
144
+ }) => r(o.spaces, e, e)};
142
145
  z-index: ${({
143
146
  zIndex: e
144
147
  }) => e};
@@ -150,27 +153,27 @@ const $ = {
150
153
  width: ${({
151
154
  width: e,
152
155
  theme: o
153
- }) => s(o.spaces, e, e)};
156
+ }) => r(o.spaces, e, e)};
154
157
  max-width: ${({
155
158
  maxWidth: e,
156
159
  theme: o
157
- }) => s(o.spaces, e, e)};
160
+ }) => r(o.spaces, e, e)};
158
161
  min-width: ${({
159
162
  minWidth: e,
160
163
  theme: o
161
- }) => s(o.spaces, e, e)};
164
+ }) => r(o.spaces, e, e)};
162
165
  height: ${({
163
166
  height: e,
164
167
  theme: o
165
- }) => s(o.spaces, e, e)};
168
+ }) => r(o.spaces, e, e)};
166
169
  max-height: ${({
167
170
  maxHeight: e,
168
171
  theme: o
169
- }) => s(o.spaces, e, e)};
172
+ }) => r(o.spaces, e, e)};
170
173
  min-height: ${({
171
174
  minHeight: e,
172
175
  theme: o
173
- }) => s(o.spaces, e, e)};
176
+ }) => r(o.spaces, e, e)};
174
177
 
175
178
  // Animation
176
179
  transition: ${({
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),d=require("styled-components"),u=require("@strapi/icons"),t=require("../Typography/Typography.cjs"),s=require("../Box/Box.cjs"),i=require("../Flex/Flex.cjs"),c=require("../VisuallyHidden/VisuallyHidden.cjs"),p=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},y=p(d),h=y.default(i.Flex)`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),d=require("@strapi/icons"),u=require("styled-components"),t=require("../Box/Box.cjs"),s=require("../Flex/Flex.cjs"),i=require("../Typography/Typography.cjs"),c=require("../VisuallyHidden/VisuallyHidden.cjs"),p=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},y=p(u),h=y.default(s.Flex)`
2
2
  svg {
3
3
  height: ${10/16}rem;
4
4
  width: ${10/16}rem;
@@ -6,11 +6,11 @@
6
6
  fill: ${({theme:e})=>e.colors.neutral500};
7
7
  }
8
8
  }
9
- :last-of-type ${s.Box} {
9
+ :last-of-type ${t.Box} {
10
10
  display: none;
11
11
  }
12
- :last-of-type ${t.Typography} {
12
+ :last-of-type ${i.Typography} {
13
13
  color: ${({theme:e})=>e.colors.neutral800};
14
14
  font-weight: ${({theme:e})=>e.fontWeights.bold};
15
15
  }
16
- `,l=({children:e})=>r.jsxs(h,{inline:!0,as:"li",children:[r.jsx(t.Typography,{variant:"pi",textColor:"neutral600",children:e}),r.jsx(s.Box,{"aria-hidden":!0,paddingLeft:3,paddingRight:3,children:r.jsx(u.ChevronRight,{})})]});l.displayName="Crumb";const o=({children:e,label:n,...a})=>r.jsxs(i.Flex,{...a,children:[r.jsx(c.VisuallyHidden,{children:n}),r.jsx("ol",{"aria-hidden":!0,children:e})]});o.displayName="Breadcrumbs";exports.Breadcrumbs=o;exports.Crumb=l;
16
+ `,l=({children:e})=>r.jsxs(h,{inline:!0,as:"li",children:[r.jsx(i.Typography,{variant:"pi",textColor:"neutral600",children:e}),r.jsx(t.Box,{"aria-hidden":!0,paddingLeft:3,paddingRight:3,children:r.jsx(d.ChevronRight,{})})]});l.displayName="Crumb";const o=({children:e,label:n,...a})=>r.jsxs(s.Flex,{...a,children:[r.jsx(c.VisuallyHidden,{children:n}),r.jsx("ol",{"aria-hidden":!0,children:e})]});o.displayName="Breadcrumbs";exports.Breadcrumbs=o;exports.Crumb=l;
@@ -1,11 +1,11 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import d from "styled-components";
3
- import { ChevronRight as m } from "@strapi/icons";
4
- import { Typography as o } from "../Typography/Typography.js";
5
- import { Box as t } from "../Box/Box.js";
6
- import { Flex as l } from "../Flex/Flex.js";
2
+ import { ChevronRight as d } from "@strapi/icons";
3
+ import m from "styled-components";
4
+ import { Box as o } from "../Box/Box.js";
5
+ import { Flex as t } from "../Flex/Flex.js";
6
+ import { Typography as l } from "../Typography/Typography.js";
7
7
  import { VisuallyHidden as p } from "../VisuallyHidden/VisuallyHidden.js";
8
- const s = d(l)`
8
+ const s = m(t)`
9
9
  svg {
10
10
  height: ${10 / 16}rem;
11
11
  width: ${10 / 16}rem;
@@ -15,10 +15,10 @@ const s = d(l)`
15
15
  }) => r.colors.neutral500};
16
16
  }
17
17
  }
18
- :last-of-type ${t} {
18
+ :last-of-type ${o} {
19
19
  display: none;
20
20
  }
21
- :last-of-type ${o} {
21
+ :last-of-type ${l} {
22
22
  color: ${({
23
23
  theme: r
24
24
  }) => r.colors.neutral800};
@@ -31,15 +31,15 @@ const s = d(l)`
31
31
  }) => i(s, {
32
32
  inline: !0,
33
33
  as: "li",
34
- children: [e(o, {
34
+ children: [e(l, {
35
35
  variant: "pi",
36
36
  textColor: "neutral600",
37
37
  children: r
38
- }), e(t, {
38
+ }), e(o, {
39
39
  "aria-hidden": !0,
40
40
  paddingLeft: 3,
41
41
  paddingRight: 3,
42
- children: e(m, {})
42
+ children: e(d, {})
43
43
  })]
44
44
  });
45
45
  h.displayName = "Crumb";
@@ -47,7 +47,7 @@ const c = ({
47
47
  children: r,
48
48
  label: n,
49
49
  ...a
50
- }) => i(l, {
50
+ }) => i(t, {
51
51
  ...a,
52
52
  children: [e(p, {
53
53
  children: n
@@ -1,48 +1,31 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),f=require("styled-components"),q=require("@strapi/icons"),p=require("../Typography/Typography.cjs"),s=require("../Box/Box.cjs"),T=require("../BaseButton/BaseButton.cjs"),r=require("./utils.cjs"),u=require("./constants.cjs"),g=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},_=g(S),n=g(f),D=f.keyframes`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),q=require("react"),v=require("@strapi/icons"),l=require("styled-components"),d=require("./constants.cjs"),r=require("./utils.cjs"),S=require("../BaseButton/BaseButton.cjs"),T=require("../Box/Box.cjs"),_=require("../Flex/Flex.cjs"),$=require("../Typography/Typography.cjs"),f=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},D=f(q),p=f(l),F=l.keyframes`
2
2
  from {
3
3
  transform: rotate(0deg);
4
4
  }
5
5
  to {
6
6
  transform: rotate(359deg);
7
7
  }
8
- `,L=n.default.div`
9
- animation: ${D} 2s infinite linear;
8
+ `,L=p.default.div`
9
+ animation: ${F} 2s infinite linear;
10
10
  will-change: transform;
11
- `,R=n.default(s.Box)`
12
- height: 100%;
13
- `,y=n.default(T.BaseButton)`
14
- align-items: center;
15
- background-color: ${({theme:t})=>t.colors.buttonPrimary600};
16
- border: 1px solid ${({theme:t})=>t.colors.buttonPrimary600};
17
- height: ${({theme:t,size:i})=>t.sizes.button[i]};
18
- padding-left: ${({theme:t})=>t.spaces[4]};
19
- padding-right: ${({theme:t})=>t.spaces[4]};
20
-
21
- ${s.Box} {
22
- display: flex;
23
- align-items: center;
24
- }
25
-
26
- ${p.Typography} {
27
- color: ${({theme:t})=>t.colors.buttonNeutral0};
28
- }
11
+ `,y=p.default(S.BaseButton)`
12
+ height: ${({theme:e,size:n})=>e.sizes.button[n]};
29
13
 
30
14
  &[aria-disabled='true'] {
31
15
  ${r.getDisabledStyle}
16
+
32
17
  &:active {
33
18
  ${r.getDisabledStyle}
34
19
  }
35
20
  }
21
+
36
22
  &:hover {
37
23
  ${r.getHoverStyle}
38
24
  }
25
+
39
26
  &:active {
40
27
  ${r.getActiveStyle}
41
28
  }
29
+
42
30
  ${r.getVariantStyle}
43
- ${({fullWidth:t})=>t&&`
44
- display: inline-flex;
45
- justify-content: center;
46
- width: 100%;
47
- `}
48
- `,h=_.default.forwardRef(({variant:t=u.DEFAULT,startIcon:i,endIcon:l,disabled:B=!1,children:x,onClick:c,size:d=u.BUTTON_SIZES[0],loading:a=!1,fullWidth:b=!1,...j},m)=>{const o=B||a,$=v=>{!o&&c&&c(v)};return e.jsxs(y,{ref:m,"aria-disabled":o,disabled:o,size:d,variant:t,onClick:$,fullWidth:b,...j,children:[(i||a)&&e.jsx(R,{"aria-hidden":!0,paddingRight:2,children:a?e.jsx(L,{children:e.jsx(q.Loader,{})}):i}),e.jsx(p.Typography,{variant:d==="S"?"pi":void 0,fontWeight:"bold",lineHeight:0,children:x}),l&&e.jsx(s.Box,{"aria-hidden":!0,paddingLeft:2,children:l})]})});h.displayName="Button";exports.Button=h;exports.ButtonWrapper=y;
31
+ `,g=D.default.forwardRef(({variant:e=d.DEFAULT,startIcon:n,endIcon:s,disabled:h=!1,children:B,onClick:c,size:u=d.BUTTON_SIZES[0],loading:i=!1,fullWidth:a=!1,...j},x)=>{const o=h||i,b=m=>{!o&&c&&c(m)};return t.jsxs(y,{ref:x,"aria-disabled":o,disabled:o,size:u,variant:e,onClick:b,fullWidth:a,alignItems:"center",background:"buttonPrimary600",borderColor:"buttonPrimary600",gap:2,inline:a,justifyContent:a?"center":void 0,paddingLeft:4,paddingRight:4,width:a?"100%":void 0,...j,children:[(n||i)&&t.jsx(T.Box,{"aria-hidden":!0,children:i?t.jsx(L,{children:t.jsx(v.Loader,{})}):n}),t.jsx($.Typography,{variant:u==="S"?"pi":void 0,fontWeight:"bold",lineHeight:0,textColor:"buttonNeutral0",children:B}),s&&t.jsx(_.Flex,{"aria-hidden":!0,children:s})]})});g.displayName="Button";exports.Button=g;exports.ButtonWrapper=y;