@strapi/design-system 1.6.4 → 1.6.6
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.
- package/dist/Accordion/Accordion.cjs +1 -1
- package/dist/Accordion/Accordion.js +1 -1
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +48 -51
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +17 -16
- package/dist/BaseRadio/BaseRadio.cjs +1 -1
- package/dist/BaseRadio/BaseRadio.js +1 -1
- package/dist/Box/Box.cjs +3 -3
- package/dist/Box/Box.js +26 -26
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +1 -1
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +16 -4
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +13 -13
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +13 -13
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +62 -63
- package/dist/DatePicker/DatePicker.cjs +8 -1
- package/dist/DatePicker/DatePicker.js +71 -98
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +125 -57
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +43 -26
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +31 -15
- package/dist/DatePicker/components.cjs +8 -6
- package/dist/DatePicker/components.js +15 -13
- package/dist/DatePicker/utils/getDayOfWeek.js +8 -8
- package/dist/DatePicker/utils/getMonths.cjs +1 -1
- package/dist/DatePicker/utils/getMonths.js +3 -3
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +1 -1
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -104
- package/dist/Dialog/Dialog.cjs +4 -4
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Dialog/DialogFooter.cjs +3 -3
- package/dist/Dialog/DialogFooter.js +2 -2
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +31 -27
- package/dist/Field/FieldAction.cjs +2 -8
- package/dist/Field/FieldAction.js +27 -16
- package/dist/Field/FieldContext.cjs +1 -1
- package/dist/Field/FieldContext.js +2 -2
- package/dist/Field/FieldError.cjs +1 -1
- package/dist/Field/FieldError.js +14 -4
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +17 -7
- package/dist/Field/FieldInput.cjs +14 -16
- package/dist/Field/FieldInput.js +104 -72
- package/dist/Field/FieldLabel.cjs +6 -3
- package/dist/Field/FieldLabel.js +43 -25
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +34 -38
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +32 -30
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +29 -27
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +3 -3
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +33 -13
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +20 -10
- package/dist/ModalLayout/ModalLayout.cjs +1 -1
- package/dist/ModalLayout/ModalLayout.js +1 -1
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +32 -32
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +1 -1
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +64 -67
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +39 -37
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +14 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +13 -8
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +20 -13
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +7 -6
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +66 -65
- package/dist/Select/SelectButton.cjs +3 -3
- package/dist/Select/SelectButton.js +17 -15
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +10 -8
- package/dist/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +2 -2
- package/dist/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/SubNav/SubNavLinkSection.js +1 -1
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +7 -7
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +17 -7
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +1 -1
- package/dist/Tag/Tag.cjs +8 -8
- package/dist/Tag/Tag.js +52 -49
- package/dist/TextButton/TextButton.cjs +6 -12
- package/dist/TextButton/TextButton.js +32 -46
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +48 -47
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +12 -13
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +13 -12
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +48 -100
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +2 -2
- package/dist/ToggleCheckbox/ToggleCheckbox.js +1 -0
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +28 -29
- package/dist/Tooltip/Tooltip.cjs +1 -1
- package/dist/Tooltip/Tooltip.js +1 -1
- package/dist/helpers/deprecations.cjs +1 -1
- package/dist/helpers/deprecations.js +7 -7
- package/dist/helpers/useElementOnScreen.cjs +1 -1
- package/dist/helpers/useElementOnScreen.js +4 -13
- package/dist/helpers/useId.cjs +1 -1
- package/dist/helpers/useId.js +4 -11
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +4 -21
- package/dist/helpers/useLockScroll.cjs +1 -1
- package/dist/helpers/useLockScroll.js +4 -7
- package/dist/helpers/usePrevious.cjs +1 -1
- package/dist/helpers/usePrevious.js +4 -8
- package/dist/helpers/useResizeObserver.cjs +1 -1
- package/dist/helpers/useResizeObserver.js +4 -14
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useIntersection.js +3 -3
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +33 -13
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +20 -10
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/v2/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +2 -2
- package/dist/v2/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/v2/SubNav/SubNavLinkSection.js +1 -1
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +10 -10
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +17 -7
- package/package.json +5 -3
- package/dist/DateTimePicker/DateTimePickerProps.cjs +0 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +0 -40
- package/dist/DateTimePicker/__tests__/parseDate.test.cjs +0 -1
- package/dist/DateTimePicker/__tests__/parseDate.test.js +0 -8
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -7
- package/dist/Select/SingleSelect.cjs +0 -82
- package/dist/Select/SingleSelect.js +0 -285
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),m=require("react"),$=require("styled-components"),b=require("./AccordionContext.cjs"),p=require("../Box/Box.cjs"),h=require("../Flex/Flex.cjs"),T=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),m=require("react"),$=require("styled-components"),b=require("./AccordionContext.cjs"),p=require("../Box/Box.cjs"),h=require("../Flex/Flex.cjs"),T=require("../hooks/useId.cjs"),a=require("../Typography/Typography.cjs"),_=r=>r&&typeof r=="object"&&"default"in r?r:{default:r};function q(r){if(r&&r.__esModule)return r;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return o.default=r,Object.freeze(o)}const A=q(m),y=_($),v=({theme:r,expanded:o,variant:e,disabled:t,error:n})=>n?`1px solid ${r.colors.danger600} !important`:t?`1px solid ${r.colors.neutral150}`:o?`1px solid ${r.colors.primary600}`:e==="primary"?`1px solid ${r.colors.neutral0}`:`1px solid ${r.colors.neutral100}`,f=y.default(a.Typography)``,B=y.default(p.Box)`
|
|
2
2
|
border: ${v};
|
|
3
3
|
|
|
4
4
|
&:hover:not([aria-disabled='true']) {
|
|
@@ -4,7 +4,7 @@ import m from "styled-components";
|
|
|
4
4
|
import { AccordionContext as h } from "./AccordionContext.js";
|
|
5
5
|
import { Box as u } from "../Box/Box.js";
|
|
6
6
|
import { Flex as b } from "../Flex/Flex.js";
|
|
7
|
-
import { useId as A } from "../
|
|
7
|
+
import { useId as A } from "../hooks/useId.js";
|
|
8
8
|
import { Typography as p } from "../Typography/Typography.js";
|
|
9
9
|
const v = ({
|
|
10
10
|
theme: r,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),F=require("@strapi/icons"),v=require("styled-components"),B=require("./Accordion.cjs"),I=require("./AccordionContext.cjs"),M=require("./utils.cjs"),s=require("../Flex/Flex.cjs"),R=require("../Icon/Icon.cjs"),z=require("../TextButton/TextButton.cjs"),S=require("../Typography/Typography.cjs"),_=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},m=_(v),D=m.default(z.TextButton)`
|
|
2
2
|
text-align: left;
|
|
3
3
|
|
|
4
4
|
// necessary to make the ellipsis prop work on the title
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
height: ${14/16}rem;
|
|
12
12
|
|
|
13
13
|
path {
|
|
14
|
-
fill: ${({theme:e,expanded:
|
|
14
|
+
fill: ${({theme:e,expanded:t})=>t?e.colors.primary600:e.colors.neutral500};
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
18
|
-
min-height: ${({theme:e,size:
|
|
19
|
-
border-radius: ${({theme:e,expanded:
|
|
17
|
+
`,W=m.default(s.Flex)`
|
|
18
|
+
min-height: ${({theme:e,size:t})=>e.sizes.accordions[t]};
|
|
19
|
+
border-radius: ${({theme:e,expanded:t})=>t?`${e.borderRadius} ${e.borderRadius} 0 0`:e.borderRadius};
|
|
20
20
|
|
|
21
21
|
&:hover {
|
|
22
22
|
svg {
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
`,
|
|
28
|
+
`,L=({title:e,description:t,as:b="span",togglePosition:d="right",action:u,...j})=>{const{onToggle:c,toggle:p,expanded:r,id:l,size:n,variant:T,disabled:i}=I.useAccordion(),$=`accordion-content-${l}`,g=`accordion-label-${l}`,w=`accordion-desc-${l}`,a=n==="M"?6:4,x=n==="M"?a:a-2,C=M.getBackground({expanded:r,disabled:i,variant:T}),q={as:b,fontWeight:n==="S"?"bold":void 0,id:g,textColor:r?"primary600":"neutral700",ellipsis:!0,variant:n==="M"?"delta":void 0},k=r?"primary600":"neutral600",A=r?"primary200":"neutral200",h=n==="M"?`${32/16}rem`:`${24/16}rem`,f=()=>{i||(p&&!c?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),p()):c&&c())},y=o.jsx(s.Flex,{justifyContent:"center",borderRadius:"50%",height:h,width:h,transform:r?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:A,cursor:i?"not-allowed":"pointer",onClick:f,shrink:0,children:o.jsx(R.Icon,{as:F.CarretDown,width:n==="M"?`${11/16}rem`:`${8/16}rem`,color:r?"primary600":"neutral600"})});return o.jsx(W,{paddingBottom:x,paddingLeft:a,paddingRight:a,paddingTop:x,background:C,expanded:r,size:n,justifyContent:"space-between",cursor:i?"not-allowed":"",children:o.jsxs(s.Flex,{gap:3,flex:1,maxWidth:"100%",children:[d==="left"&&y,o.jsx(D,{onClick:f,"aria-disabled":i,"aria-expanded":r,"aria-controls":$,"aria-labelledby":g,"data-strapi-accordion-toggle":!0,expanded:r,type:"button",flex:1,minWidth:0,...j,children:o.jsxs(o.Fragment,{children:[o.jsx(B.AccordionTypography,{...q,children:e}),t&&o.jsx(S.Typography,{as:"p",id:w,textColor:k,children:t})]})}),d==="right"&&o.jsxs(s.Flex,{gap:3,children:[y,u]}),d==="left"&&u]})})};exports.AccordionToggle=L;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { CarretDown as
|
|
1
|
+
import { jsx as i, jsxs as p, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { CarretDown as R } from "@strapi/icons";
|
|
3
3
|
import y from "styled-components";
|
|
4
|
-
import { AccordionTypography as
|
|
5
|
-
import { useAccordion as
|
|
4
|
+
import { AccordionTypography as A } from "./Accordion.js";
|
|
5
|
+
import { useAccordion as I } from "./AccordionContext.js";
|
|
6
6
|
import { getBackground as W } from "./utils.js";
|
|
7
|
-
import { Flex as
|
|
7
|
+
import { Flex as d } from "../Flex/Flex.js";
|
|
8
8
|
import { Icon as D } from "../Icon/Icon.js";
|
|
9
|
-
import { Stack as b } from "../Stack/Stack.js";
|
|
10
9
|
import { TextButton as F } from "../TextButton/TextButton.js";
|
|
11
|
-
import { Typography as
|
|
12
|
-
const
|
|
10
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
11
|
+
const L = y(F)`
|
|
13
12
|
text-align: left;
|
|
14
13
|
|
|
15
14
|
// necessary to make the ellipsis prop work on the title
|
|
@@ -28,7 +27,7 @@ const P = y(F)`
|
|
|
28
27
|
}) => e ? o.colors.primary600 : o.colors.neutral500};
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
`,
|
|
30
|
+
`, P = y(d)`
|
|
32
31
|
min-height: ${({
|
|
33
32
|
theme: o,
|
|
34
33
|
size: e
|
|
@@ -47,100 +46,98 @@ const P = y(F)`
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
`,
|
|
49
|
+
`, Q = ({
|
|
51
50
|
title: o,
|
|
52
51
|
description: e,
|
|
53
|
-
as:
|
|
54
|
-
togglePosition:
|
|
55
|
-
action:
|
|
56
|
-
...
|
|
52
|
+
as: $ = "span",
|
|
53
|
+
togglePosition: l = "right",
|
|
54
|
+
action: g,
|
|
55
|
+
...w
|
|
57
56
|
}) => {
|
|
58
57
|
const {
|
|
59
|
-
onToggle:
|
|
60
|
-
toggle:
|
|
58
|
+
onToggle: s,
|
|
59
|
+
toggle: m,
|
|
61
60
|
expanded: r,
|
|
62
|
-
id:
|
|
61
|
+
id: c,
|
|
63
62
|
size: t,
|
|
64
|
-
variant:
|
|
63
|
+
variant: C,
|
|
65
64
|
disabled: n
|
|
66
|
-
} =
|
|
65
|
+
} = I(), T = `accordion-content-${c}`, h = `accordion-label-${c}`, k = `accordion-desc-${c}`, a = t === "M" ? 6 : 4, u = t === "M" ? a : a - 2, v = W({
|
|
67
66
|
expanded: r,
|
|
68
67
|
disabled: n,
|
|
69
|
-
variant:
|
|
68
|
+
variant: C
|
|
70
69
|
}), j = {
|
|
71
|
-
as:
|
|
70
|
+
as: $,
|
|
72
71
|
fontWeight: t === "S" ? "bold" : void 0,
|
|
73
|
-
id:
|
|
72
|
+
id: h,
|
|
74
73
|
textColor: r ? "primary600" : "neutral700",
|
|
75
74
|
ellipsis: !0,
|
|
76
75
|
variant: t === "M" ? "delta" : void 0
|
|
77
|
-
},
|
|
78
|
-
n || (
|
|
79
|
-
},
|
|
76
|
+
}, z = r ? "primary600" : "neutral600", B = r ? "primary200" : "neutral200", f = t === "M" ? `${32 / 16}rem` : `${24 / 16}rem`, x = () => {
|
|
77
|
+
n || (m && !s ? (console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'), m()) : s && s());
|
|
78
|
+
}, b = i(d, {
|
|
80
79
|
justifyContent: "center",
|
|
81
80
|
borderRadius: "50%",
|
|
82
|
-
height:
|
|
83
|
-
width:
|
|
81
|
+
height: f,
|
|
82
|
+
width: f,
|
|
84
83
|
transform: r ? "rotate(180deg)" : void 0,
|
|
85
84
|
"data-strapi-dropdown": !0,
|
|
86
85
|
"aria-hidden": !0,
|
|
87
86
|
as: "span",
|
|
88
|
-
background:
|
|
87
|
+
background: B,
|
|
89
88
|
cursor: n ? "not-allowed" : "pointer",
|
|
90
|
-
onClick:
|
|
89
|
+
onClick: x,
|
|
91
90
|
shrink: 0,
|
|
92
91
|
children: i(D, {
|
|
93
|
-
as:
|
|
92
|
+
as: R,
|
|
94
93
|
width: t === "M" ? `${11 / 16}rem` : `${8 / 16}rem`,
|
|
95
94
|
color: r ? "primary600" : "neutral600"
|
|
96
95
|
})
|
|
97
96
|
});
|
|
98
|
-
return i(
|
|
99
|
-
paddingBottom:
|
|
97
|
+
return i(P, {
|
|
98
|
+
paddingBottom: u,
|
|
100
99
|
paddingLeft: a,
|
|
101
100
|
paddingRight: a,
|
|
102
|
-
paddingTop:
|
|
101
|
+
paddingTop: u,
|
|
103
102
|
background: v,
|
|
104
103
|
expanded: r,
|
|
105
104
|
size: t,
|
|
106
105
|
justifyContent: "space-between",
|
|
107
106
|
cursor: n ? "not-allowed" : "",
|
|
108
|
-
children:
|
|
109
|
-
|
|
110
|
-
spacing: 3,
|
|
107
|
+
children: p(d, {
|
|
108
|
+
gap: 3,
|
|
111
109
|
flex: 1,
|
|
112
110
|
maxWidth: "100%",
|
|
113
|
-
children: [
|
|
114
|
-
onClick:
|
|
111
|
+
children: [l === "left" && b, i(L, {
|
|
112
|
+
onClick: x,
|
|
115
113
|
"aria-disabled": n,
|
|
116
114
|
"aria-expanded": r,
|
|
117
115
|
"aria-controls": T,
|
|
118
|
-
"aria-labelledby":
|
|
116
|
+
"aria-labelledby": h,
|
|
119
117
|
"data-strapi-accordion-toggle": !0,
|
|
120
118
|
expanded: r,
|
|
121
119
|
type: "button",
|
|
122
120
|
flex: 1,
|
|
123
121
|
minWidth: 0,
|
|
124
|
-
...
|
|
125
|
-
children:
|
|
126
|
-
children: [i(
|
|
122
|
+
...w,
|
|
123
|
+
children: p(M, {
|
|
124
|
+
children: [i(A, {
|
|
127
125
|
...j,
|
|
128
126
|
children: o
|
|
129
|
-
}), e && i(
|
|
127
|
+
}), e && i(S, {
|
|
130
128
|
as: "p",
|
|
131
|
-
id:
|
|
132
|
-
textColor:
|
|
129
|
+
id: k,
|
|
130
|
+
textColor: z,
|
|
133
131
|
children: e
|
|
134
132
|
})]
|
|
135
133
|
})
|
|
136
|
-
}),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}), d === "left" && p]
|
|
134
|
+
}), l === "right" && p(d, {
|
|
135
|
+
gap: 3,
|
|
136
|
+
children: [b, g]
|
|
137
|
+
}), l === "left" && g]
|
|
141
138
|
})
|
|
142
139
|
});
|
|
143
140
|
};
|
|
144
141
|
export {
|
|
145
|
-
|
|
142
|
+
Q as AccordionToggle
|
|
146
143
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),c=require("react"),i=require("styled-components"),d=require("../Flex/Flex.cjs"),p=require("../themes/utils.cjs"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},f=t(c),b=t(i),s=b.default(d.Flex)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${({theme:e})=>e.spaces[3]};
|
|
4
4
|
width: ${({theme:e})=>e.spaces[3]};
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
pointer-events: none;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
${
|
|
17
|
-
`,r=
|
|
16
|
+
${p.buttonFocusStyle}
|
|
17
|
+
`,r=f.default.forwardRef(({disabled:e,children:a,background:o="neutral0",...u},n)=>l.jsx(s,{ref:n,"aria-disabled":e,as:"button",type:"button",disabled:e,padding:2,hasRadius:!0,background:o,borderColor:"neutral200",cursor:"pointer",...u,children:a}));r.displayName="BaseButton";exports.BaseButton=r;exports.BaseButtonWrapper=s;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { buttonFocusStyle as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import i from "styled-components";
|
|
4
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
5
|
+
import { buttonFocusStyle as p } from "../themes/utils.js";
|
|
6
|
+
const d = i(u)`
|
|
7
7
|
svg {
|
|
8
8
|
height: ${({
|
|
9
9
|
theme: t
|
|
@@ -24,27 +24,28 @@ const p = n(i)`
|
|
|
24
24
|
pointer-events: none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
${
|
|
28
|
-
`,
|
|
27
|
+
${p}
|
|
28
|
+
`, l = n.forwardRef(({
|
|
29
29
|
disabled: t,
|
|
30
30
|
children: r,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
background: e = "neutral0",
|
|
32
|
+
...o
|
|
33
|
+
}, a) => s(d, {
|
|
34
|
+
ref: a,
|
|
34
35
|
"aria-disabled": t,
|
|
35
36
|
as: "button",
|
|
36
37
|
type: "button",
|
|
37
38
|
disabled: t,
|
|
38
39
|
padding: 2,
|
|
39
40
|
hasRadius: !0,
|
|
40
|
-
background:
|
|
41
|
+
background: e,
|
|
41
42
|
borderColor: "neutral200",
|
|
42
43
|
cursor: "pointer",
|
|
43
|
-
...
|
|
44
|
+
...o,
|
|
44
45
|
children: r
|
|
45
46
|
}));
|
|
46
|
-
|
|
47
|
+
l.displayName = "BaseButton";
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
l as BaseButton,
|
|
50
|
+
d as BaseButtonWrapper
|
|
50
51
|
};
|
|
@@ -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("./context.cjs"),t=require("./utils.cjs"),R=require("../
|
|
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("../hooks/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};
|
|
@@ -3,7 +3,7 @@ import u, { useContext as b } from "react";
|
|
|
3
3
|
import g from "styled-components";
|
|
4
4
|
import { RadioContext as h } from "./context.js";
|
|
5
5
|
import { getRadioSize as r, getSelectedRadioSize as t, getSelectedRadioPosition as d } from "./utils.js";
|
|
6
|
-
import { useId as $ } from "../
|
|
6
|
+
import { useId as $ } from "../hooks/useId.js";
|
|
7
7
|
const y = g.input`
|
|
8
8
|
margin: 0;
|
|
9
9
|
padding: 0;
|
package/dist/Box/Box.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=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(n),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
|
|
|
5
5
|
// Colors
|
|
6
|
-
background: ${({theme:e,background:t})=>r.extractStyleFromTheme(e.colors,t,
|
|
6
|
+
background: ${({theme:e,background:t})=>r.extractStyleFromTheme(e.colors,t,t)};
|
|
7
7
|
color: ${({theme:e,color:t})=>r.extractStyleFromTheme(e.colors,t,void 0)};
|
|
8
8
|
|
|
9
9
|
// Spaces
|
|
@@ -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:
|
|
30
|
+
border: ${({theme:e,borderColor:t,borderStyle:s,borderWidth:i})=>{if(t&&!s&&typeof i>"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,6 +1,6 @@
|
|
|
1
1
|
import d from "styled-components";
|
|
2
|
-
import
|
|
3
|
-
import { extractStyleFromTheme as
|
|
2
|
+
import r from "../helpers/handleResponsiveValues.js";
|
|
3
|
+
import { extractStyleFromTheme as s } from "../helpers/theme.js";
|
|
4
4
|
const t = {
|
|
5
5
|
color: !0,
|
|
6
6
|
cursor: !0,
|
|
@@ -13,55 +13,55 @@ const t = {
|
|
|
13
13
|
font-size: ${({
|
|
14
14
|
fontSize: e,
|
|
15
15
|
theme: o
|
|
16
|
-
}) =>
|
|
16
|
+
}) => s(o.fontSizes, e, e)};
|
|
17
17
|
|
|
18
18
|
// Colors
|
|
19
19
|
background: ${({
|
|
20
20
|
theme: e,
|
|
21
21
|
background: o
|
|
22
|
-
}) =>
|
|
22
|
+
}) => s(e.colors, o, o)};
|
|
23
23
|
color: ${({
|
|
24
24
|
theme: e,
|
|
25
25
|
color: o
|
|
26
|
-
}) =>
|
|
26
|
+
}) => s(e.colors, o, void 0)};
|
|
27
27
|
|
|
28
28
|
// Spaces
|
|
29
29
|
${({
|
|
30
30
|
theme: e,
|
|
31
31
|
padding: o
|
|
32
|
-
}) =>
|
|
32
|
+
}) => r("padding", o, e)}
|
|
33
33
|
${({
|
|
34
34
|
theme: e,
|
|
35
35
|
paddingTop: o
|
|
36
|
-
}) =>
|
|
36
|
+
}) => r("padding-top", o, e)}
|
|
37
37
|
${({
|
|
38
38
|
theme: e,
|
|
39
39
|
paddingRight: o
|
|
40
|
-
}) =>
|
|
40
|
+
}) => r("padding-right", o, e)}
|
|
41
41
|
${({
|
|
42
42
|
theme: e,
|
|
43
43
|
paddingBottom: o
|
|
44
|
-
}) =>
|
|
44
|
+
}) => r("padding-bottom", o, e)}
|
|
45
45
|
${({
|
|
46
46
|
theme: e,
|
|
47
47
|
paddingLeft: o
|
|
48
|
-
}) =>
|
|
48
|
+
}) => r("padding-left", o, e)}
|
|
49
49
|
${({
|
|
50
50
|
theme: e,
|
|
51
51
|
marginLeft: o
|
|
52
|
-
}) =>
|
|
52
|
+
}) => r("margin-left", o, e)}
|
|
53
53
|
${({
|
|
54
54
|
theme: e,
|
|
55
55
|
marginRight: o
|
|
56
|
-
}) =>
|
|
56
|
+
}) => r("margin-right", o, e)}
|
|
57
57
|
${({
|
|
58
58
|
theme: e,
|
|
59
59
|
marginTop: o
|
|
60
|
-
}) =>
|
|
60
|
+
}) => r("margin-top", o, e)}
|
|
61
61
|
${({
|
|
62
62
|
theme: e,
|
|
63
63
|
marginBottom: o
|
|
64
|
-
}) =>
|
|
64
|
+
}) => r("margin-bottom", o, e)}
|
|
65
65
|
|
|
66
66
|
// Responsive hiding
|
|
67
67
|
${({
|
|
@@ -89,7 +89,7 @@ const t = {
|
|
|
89
89
|
border-color: ${({
|
|
90
90
|
borderColor: e,
|
|
91
91
|
theme: o
|
|
92
|
-
}) =>
|
|
92
|
+
}) => s(o.colors, e, void 0)};
|
|
93
93
|
border: ${({
|
|
94
94
|
theme: e,
|
|
95
95
|
borderColor: o,
|
|
@@ -104,7 +104,7 @@ const t = {
|
|
|
104
104
|
box-shadow: ${({
|
|
105
105
|
theme: e,
|
|
106
106
|
shadow: o
|
|
107
|
-
}) =>
|
|
107
|
+
}) => s(e.shadows, o, void 0)};
|
|
108
108
|
|
|
109
109
|
// Handlers
|
|
110
110
|
pointer-events: ${({
|
|
@@ -129,19 +129,19 @@ const t = {
|
|
|
129
129
|
left: ${({
|
|
130
130
|
left: e,
|
|
131
131
|
theme: o
|
|
132
|
-
}) =>
|
|
132
|
+
}) => s(o.spaces, e, e)};
|
|
133
133
|
right: ${({
|
|
134
134
|
right: e,
|
|
135
135
|
theme: o
|
|
136
|
-
}) =>
|
|
136
|
+
}) => s(o.spaces, e, e)};
|
|
137
137
|
top: ${({
|
|
138
138
|
top: e,
|
|
139
139
|
theme: o
|
|
140
|
-
}) =>
|
|
140
|
+
}) => s(o.spaces, e, e)};
|
|
141
141
|
bottom: ${({
|
|
142
142
|
bottom: e,
|
|
143
143
|
theme: o
|
|
144
|
-
}) =>
|
|
144
|
+
}) => s(o.spaces, e, e)};
|
|
145
145
|
z-index: ${({
|
|
146
146
|
zIndex: e
|
|
147
147
|
}) => e};
|
|
@@ -153,27 +153,27 @@ const t = {
|
|
|
153
153
|
width: ${({
|
|
154
154
|
width: e,
|
|
155
155
|
theme: o
|
|
156
|
-
}) =>
|
|
156
|
+
}) => s(o.spaces, e, e)};
|
|
157
157
|
max-width: ${({
|
|
158
158
|
maxWidth: e,
|
|
159
159
|
theme: o
|
|
160
|
-
}) =>
|
|
160
|
+
}) => s(o.spaces, e, e)};
|
|
161
161
|
min-width: ${({
|
|
162
162
|
minWidth: e,
|
|
163
163
|
theme: o
|
|
164
|
-
}) =>
|
|
164
|
+
}) => s(o.spaces, e, e)};
|
|
165
165
|
height: ${({
|
|
166
166
|
height: e,
|
|
167
167
|
theme: o
|
|
168
|
-
}) =>
|
|
168
|
+
}) => s(o.spaces, e, e)};
|
|
169
169
|
max-height: ${({
|
|
170
170
|
maxHeight: e,
|
|
171
171
|
theme: o
|
|
172
|
-
}) =>
|
|
172
|
+
}) => s(o.spaces, e, e)};
|
|
173
173
|
min-height: ${({
|
|
174
174
|
minHeight: e,
|
|
175
175
|
theme: o
|
|
176
|
-
}) =>
|
|
176
|
+
}) => s(o.spaces, e, e)};
|
|
177
177
|
|
|
178
178
|
// Animation
|
|
179
179
|
transition: ${({
|
package/dist/Card/Card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),d=require("./CardContext.cjs"),u=require("../Box/Box.cjs"),n=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),d=require("./CardContext.cjs"),u=require("../Box/Box.cjs"),n=require("../hooks/useId.cjs"),c=({id:r,...o})=>{const e=n.useId(r),s=a.useMemo(()=>({id:e}),[e]);return t.jsx(d.CardContext.Provider,{value:s,children:t.jsx(u.Box,{id:r,tabIndex:0,hasRadius:!0,background:"neutral0",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",shadow:"tableShadow",as:"article","aria-labelledby":`${e}-title`,...o})})};exports.Card=c;
|
package/dist/Card/Card.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo as a } from "react";
|
|
3
3
|
import { CardContext as i } from "./CardContext.js";
|
|
4
4
|
import { Box as l } from "../Box/Box.js";
|
|
5
|
-
import { useId as n } from "../
|
|
5
|
+
import { useId as n } from "../hooks/useId.js";
|
|
6
6
|
const p = ({
|
|
7
7
|
id: o,
|
|
8
8
|
...t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),l=require("../Flex/Flex.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=n(c),s=({horizontal:e=!0,spacing:t=1,...o})=>r.default.createElement(l.Flex,{justifyContent:"center",gap:t,direction:e?"row":"column",alignItems:e?"center":"stretch",position:"absolute",width:"100%",bottom:1,...o});exports.CarouselActions=s;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import r from "react";
|
|
2
|
+
import { Flex as n } from "../Flex/Flex.js";
|
|
3
|
+
const m = ({ horizontal: t = !0, spacing: e = 1, ...o }) => /* @__PURE__ */ r.createElement(
|
|
4
|
+
n,
|
|
5
|
+
{
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
gap: e,
|
|
8
|
+
direction: t ? "row" : "column",
|
|
9
|
+
alignItems: t ? "center" : "stretch",
|
|
10
|
+
position: "absolute",
|
|
11
|
+
width: "100%",
|
|
12
|
+
bottom: 1,
|
|
13
|
+
...o
|
|
14
|
+
}
|
|
15
|
+
);
|
|
4
16
|
export {
|
|
5
|
-
|
|
17
|
+
m as CarouselActions
|
|
6
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),v=require("prop-types"),E=require("./Carousel.cjs"),R=require("../Field/Field.cjs"),I=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const L=require("../Field/FieldHint.cjs"),x=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const _=require("../Flex/Flex.cjs"),C=require("../hooks/useId.cjs"),u=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},l=u(y),e=u(v),i=({actions:t,children:n,error:a,hint:o,label:r,labelAction:s,nextLabel:c,onNext:f,onPrevious:F,previousLabel:q,required:p,secondaryLabel:b,selectedSlide:g,id:j,...m})=>{const d=C.useId(j);return l.default.createElement(R.Field,{hint:o,error:a,id:d,required:p},l.default.createElement(_.Flex,{direction:"column",alignItems:"stretch",gap:1},r&&l.default.createElement(I.FieldLabel,{action:s},r),l.default.createElement(E.Carousel,{actions:t,label:r,nextLabel:c,onNext:f,onPrevious:F,previousLabel:q,secondaryLabel:b,selectedSlide:g,id:d,...m},n),l.default.createElement(L.FieldHint,null),l.default.createElement(x.FieldError,null)))};i.defaultProps={actions:void 0,error:void 0,hint:void 0,id:void 0,labelAction:void 0,required:!1,secondaryLabel:void 0};i.propTypes={actions:e.default.node,children:e.default.node.isRequired,error:e.default.string,hint:e.default.oneOfType([e.default.string,e.default.node,e.default.arrayOf(e.default.node)]),id:e.default.string,label:e.default.string.isRequired,labelAction:e.default.element,nextLabel:e.default.string.isRequired,onNext:e.default.func.isRequired,onPrevious:e.default.func.isRequired,previousLabel:e.default.string.isRequired,required:e.default.bool,secondaryLabel:e.default.string,selectedSlide:e.default.number.isRequired};exports.CarouselInput=i;
|
|
@@ -4,12 +4,12 @@ import { Carousel as R } from "./Carousel.js";
|
|
|
4
4
|
import { Field as E } from "../Field/Field.js";
|
|
5
5
|
import { FieldLabel as y } from "../Field/FieldLabel.js";
|
|
6
6
|
import "../Field/FieldInput.js";
|
|
7
|
-
import { FieldHint as
|
|
8
|
-
import { FieldError as
|
|
7
|
+
import { FieldHint as F } from "../Field/FieldHint.js";
|
|
8
|
+
import { FieldError as L } from "../Field/FieldError.js";
|
|
9
9
|
import "../Field/FieldContext.js";
|
|
10
10
|
import "../Field/FieldAction.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { Flex as h } from "../Flex/Flex.js";
|
|
12
|
+
import { useId as x } from "../hooks/useId.js";
|
|
13
13
|
const t = ({
|
|
14
14
|
actions: n,
|
|
15
15
|
children: d,
|
|
@@ -18,32 +18,32 @@ const t = ({
|
|
|
18
18
|
label: i,
|
|
19
19
|
labelAction: m,
|
|
20
20
|
nextLabel: a,
|
|
21
|
-
onNext:
|
|
22
|
-
onPrevious:
|
|
23
|
-
previousLabel:
|
|
21
|
+
onNext: u,
|
|
22
|
+
onPrevious: c,
|
|
23
|
+
previousLabel: p,
|
|
24
24
|
required: f,
|
|
25
25
|
secondaryLabel: g,
|
|
26
26
|
selectedSlide: q,
|
|
27
27
|
id: b,
|
|
28
28
|
...v
|
|
29
29
|
}) => {
|
|
30
|
-
const o =
|
|
31
|
-
return /* @__PURE__ */ r.createElement(E, { hint: s, error: l, id: o, required: f }, /* @__PURE__ */ r.createElement(
|
|
30
|
+
const o = x(b);
|
|
31
|
+
return /* @__PURE__ */ r.createElement(E, { hint: s, error: l, id: o, required: f }, /* @__PURE__ */ r.createElement(h, { direction: "column", alignItems: "stretch", gap: 1 }, i && /* @__PURE__ */ r.createElement(y, { action: m }, i), /* @__PURE__ */ r.createElement(
|
|
32
32
|
R,
|
|
33
33
|
{
|
|
34
34
|
actions: n,
|
|
35
35
|
label: i,
|
|
36
36
|
nextLabel: a,
|
|
37
|
-
onNext:
|
|
38
|
-
onPrevious:
|
|
39
|
-
previousLabel:
|
|
37
|
+
onNext: u,
|
|
38
|
+
onPrevious: c,
|
|
39
|
+
previousLabel: p,
|
|
40
40
|
secondaryLabel: g,
|
|
41
41
|
selectedSlide: q,
|
|
42
42
|
id: o,
|
|
43
43
|
...v
|
|
44
44
|
},
|
|
45
45
|
d
|
|
46
|
-
), /* @__PURE__ */ r.createElement(
|
|
46
|
+
), /* @__PURE__ */ r.createElement(F, null), /* @__PURE__ */ r.createElement(L, null)));
|
|
47
47
|
};
|
|
48
48
|
t.defaultProps = {
|
|
49
49
|
actions: void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),p=require("prop-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),p=require("prop-types"),F=require("styled-components"),y=require("../BaseCheckbox/BaseCheckbox.cjs"),x=require("../Box/Box.cjs"),b=require("../Field/Field.cjs");require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const h=require("../Field/FieldHint.cjs"),q=require("../Field/FieldError.cjs"),g=require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const j=require("../Flex/Flex.cjs"),m=require("../hooks/useId.cjs"),C=require("../Typography/Typography.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=i(f),t=i(p),E=i(F),T=E.default(C.Typography)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: flex-start;
|
|
4
4
|
* {
|
|
5
5
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,k=e=>{const{id:l}=g.useField();return r.default.createElement(y.BaseCheckbox,{id:l,...e})},a=({children:e,disabled:l,id:c,hint:s,error:n,...u})=>{const o=m.useId(c);let d;return n?d=`${o}-error`:s&&(d=`${o}-hint`),r.default.createElement(b.Field,{id:o,hint:s,error:n},r.default.createElement(j.Flex,{direction:"column",alignItems:"stretch",gap:1},r.default.createElement(T,{as:"label",textColor:"neutral800",disabled:l},r.default.createElement(k,{disabled:l,"aria-describedby":d,...u}),r.default.createElement(x.Box,{paddingLeft:2},e)),r.default.createElement(h.FieldHint,null),r.default.createElement(q.FieldError,null)))};a.defaultProps={disabled:!1,id:void 0,error:void 0,hint:void 0};a.propTypes={children:t.default.node.isRequired,disabled:t.default.bool,error:t.default.string,hint:t.default.oneOfType([t.default.string,t.default.node,t.default.arrayOf(t.default.node)]),id:t.default.oneOfType([t.default.string,t.default.number])};exports.Checkbox=a;
|