@strapi/design-system 1.7.6 → 1.7.8
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/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +5 -5
- package/dist/Box/Box.cjs +2 -2
- package/dist/Box/Box.js +1 -1
- package/dist/CarouselInput/Carousel.cjs +6 -7
- package/dist/CarouselInput/Carousel.js +25 -79
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +1 -14
- package/dist/CarouselInput/CarouselImage.cjs +3 -4
- package/dist/CarouselInput/CarouselImage.js +13 -23
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +12 -75
- package/dist/CarouselInput/CarouselSlide.cjs +1 -3
- package/dist/CarouselInput/CarouselSlide.js +4 -29
- package/dist/Checkbox/Checkbox.cjs +3 -3
- package/dist/Checkbox/Checkbox.js +18 -40
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +21 -49
- package/dist/Dialog/DialogBody.cjs +2 -2
- package/dist/Dialog/DialogBody.js +6 -19
- package/dist/Dialog/DialogFooter.cjs +2 -2
- package/dist/Dialog/DialogFooter.js +7 -21
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +8 -22
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +10 -27
- package/dist/Layout/ActionLayout.cjs +1 -9
- package/dist/Layout/ActionLayout.js +4 -27
- package/dist/Layout/ContentLayout.cjs +1 -1
- package/dist/Layout/ContentLayout.js +4 -9
- package/dist/Layout/GridLayout.cjs +3 -3
- package/dist/Layout/GridLayout.js +4 -8
- package/dist/Layout/HeaderLayout.cjs +4 -4
- package/dist/Layout/HeaderLayout.js +25 -120
- package/dist/Layout/Layout.cjs +4 -4
- package/dist/Layout/Layout.js +7 -19
- package/dist/Layout/TwoColsLayout.cjs +1 -1
- package/dist/Layout/TwoColsLayout.js +6 -15
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +4 -5
- package/dist/ModalLayout/ModalContext.cjs +1 -1
- package/dist/ModalLayout/ModalContext.js +2 -1
- package/dist/ModalLayout/ModalFooter.cjs +2 -6
- package/dist/ModalLayout/ModalFooter.js +9 -26
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +10 -22
- package/dist/ModalLayout/ModalLayout.cjs +3 -5
- package/dist/ModalLayout/ModalLayout.js +10 -30
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +68 -168
- package/dist/Pagination/Pagination.cjs +1 -5
- package/dist/Pagination/Pagination.js +7 -21
- package/dist/Pagination/components.cjs +7 -10
- package/dist/Pagination/components.js +34 -81
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +67 -66
- package/dist/ProgressBar/ProgressBar.cjs +5 -5
- package/dist/ProgressBar/ProgressBar.js +6 -37
- package/dist/Radio/Radio.cjs +1 -4
- package/dist/Radio/Radio.js +5 -18
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +2 -3
- package/dist/Searchbar/Searchbar.cjs +10 -11
- package/dist/Searchbar/Searchbar.js +25 -54
- package/dist/Status/Status.cjs +6 -6
- package/dist/Status/Status.js +8 -46
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +16 -52
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +10 -23
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +8 -20
- package/dist/Table/Table.cjs +12 -12
- package/dist/Table/Table.js +19 -31
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +4 -5
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +6 -7
- package/dist/Table/Tr.cjs +1 -1
- package/dist/Table/Tr.js +3 -4
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +13 -37
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +11 -22
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +55 -110
- package/dist/Tabs/TabsContext.cjs +1 -1
- package/dist/Tabs/TabsContext.js +11 -4
- package/dist/Textarea/Textarea.cjs +14 -12
- package/dist/Textarea/Textarea.js +33 -55
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +17 -70
- package/dist/Typography/Typography.cjs +1 -1
- package/dist/Typography/Typography.js +6 -6
- package/dist/hooks/useControllableState.cjs +1 -1
- package/dist/hooks/useControllableState.js +6 -6
- package/dist/themes/utils.cjs +2 -2
- package/dist/themes/utils.js +1 -1
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +9 -31
- package/dist/v2/MainNav/MainNavContext.cjs +1 -1
- package/dist/v2/MainNav/MainNavContext.js +1 -1
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +13 -36
- package/dist/v2/MainNav/NavCondense.cjs +2 -5
- package/dist/v2/MainNav/NavCondense.js +15 -22
- package/dist/v2/MainNav/NavFooter.cjs +1 -1
- package/dist/v2/MainNav/NavFooter.js +4 -10
- package/dist/v2/MainNav/NavLink.cjs +10 -10
- package/dist/v2/MainNav/NavLink.js +18 -39
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +8 -42
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +8 -22
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +13 -27
- package/dist/v2/Pagination/Pagination.cjs +1 -5
- package/dist/v2/Pagination/Pagination.js +7 -21
- package/dist/v2/Pagination/components.cjs +7 -10
- package/dist/v2/Pagination/components.js +32 -65
- package/dist/v2/SubNav/SubNav.cjs +5 -5
- package/dist/v2/SubNav/SubNav.js +8 -13
- package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
- package/dist/v2/SubNav/SubNavHeader.js +30 -77
- package/dist/v2/SubNav/SubNavLink.cjs +5 -5
- package/dist/v2/SubNav/SubNavLink.js +13 -47
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +19 -34
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +16 -55
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/v2/SubNav/SubNavSectionLabel.js +10 -38
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +4 -18
- package/package.json +4 -4
- package/dist/Grid/GridContext.cjs +0 -1
- package/dist/Grid/GridContext.js +0 -6
- package/dist/Tabs/useTabsFocus.cjs +0 -1
- package/dist/Tabs/useTabsFocus.js +0 -17
- package/dist/Textarea/TextareaInput.cjs +0 -30
- package/dist/Textarea/TextareaInput.js +0 -65
package/dist/Status/Status.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
margin-right: ${({theme:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("styled-components"),b=require("../Box/Box.cjs"),x=require("../Typography/Typography.cjs"),$=require("../Flex/Flex.cjs"),h=o=>o&&o.__esModule?o:{default:o},u=h(p),y=u.default.div`
|
|
2
|
+
margin-right: ${({theme:o})=>o.spaces[3]};
|
|
3
3
|
width: ${6/16}rem;
|
|
4
4
|
height: ${6/16}rem;
|
|
5
5
|
border-radius: 50%;
|
|
6
|
-
background: ${({theme:
|
|
7
|
-
`,
|
|
6
|
+
background: ${({theme:o,backgroundColor:t})=>o.colors[t]};
|
|
7
|
+
`,f=u.default(b.Box)`
|
|
8
8
|
${x.Typography} {
|
|
9
|
-
color: ${({theme:
|
|
9
|
+
color: ${({theme:o,textColor:t})=>o.colors[t]};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,m=({variant:o="primary",showBullet:t=!0,size:e="M",children:s,...l})=>{const c=`${o}100`,a=`${o}200`,i=`${o}600`,g=`${o}600`,d=e==="S"?2:5,n=e==="S"?1:4;return r.jsx(f,{borderColor:a,textColor:g,background:c,hasRadius:!0,paddingTop:n,paddingBottom:n,paddingLeft:d,paddingRight:d,...l,children:t?r.jsxs($.Flex,{children:[r.jsx(y,{backgroundColor:i}),s]}):s})};exports.Status=m;
|
package/dist/Status/Status.js
CHANGED
|
@@ -1,60 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import t from "prop-types";
|
|
1
|
+
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
4
2
|
import p from "styled-components";
|
|
5
|
-
import { Box as
|
|
3
|
+
import { Box as u } from "../Box/Box.js";
|
|
6
4
|
import { Typography as $ } from "../Typography/Typography.js";
|
|
7
5
|
import { Flex as b } from "../Flex/Flex.js";
|
|
8
|
-
const
|
|
6
|
+
const h = p.div`
|
|
9
7
|
margin-right: ${({ theme: o }) => o.spaces[3]};
|
|
10
8
|
width: ${6 / 16}rem;
|
|
11
9
|
height: ${6 / 16}rem;
|
|
12
10
|
border-radius: 50%;
|
|
13
11
|
background: ${({ theme: o, backgroundColor: r }) => o.colors[r]};
|
|
14
|
-
`, x = p(
|
|
12
|
+
`, x = p(u)`
|
|
15
13
|
${$} {
|
|
16
14
|
color: ${({ theme: o, textColor: r }) => o.colors[r]};
|
|
17
15
|
}
|
|
18
|
-
`,
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
x,
|
|
22
|
-
{
|
|
23
|
-
borderColor: m,
|
|
24
|
-
textColor: g,
|
|
25
|
-
background: c,
|
|
26
|
-
hasRadius: !0,
|
|
27
|
-
paddingTop: d,
|
|
28
|
-
paddingBottom: d,
|
|
29
|
-
paddingLeft: n,
|
|
30
|
-
paddingRight: n,
|
|
31
|
-
...l,
|
|
32
|
-
children: r ? /* @__PURE__ */ h(b, { children: [
|
|
33
|
-
/* @__PURE__ */ i(y, { backgroundColor: u }),
|
|
34
|
-
s
|
|
35
|
-
] }) : s
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
a.defaultProps = {
|
|
40
|
-
showBullet: !0,
|
|
41
|
-
size: "M",
|
|
42
|
-
variant: "primary"
|
|
43
|
-
};
|
|
44
|
-
a.propTypes = {
|
|
45
|
-
children: t.node.isRequired,
|
|
46
|
-
/**
|
|
47
|
-
* If `false`, the preceeding bullet of the status won't be displayed.
|
|
48
|
-
* This prop and the bullet will be removed in the next major version.
|
|
49
|
-
*/
|
|
50
|
-
showBullet: t.bool,
|
|
51
|
-
// TODO V2: remove prop and bullet
|
|
52
|
-
size: t.oneOf(["S", "M"]),
|
|
53
|
-
/**
|
|
54
|
-
* Color variation
|
|
55
|
-
*/
|
|
56
|
-
variant: t.oneOf(["alternative", "danger", "neutral", "primary", "secondary", "success", "warning"])
|
|
16
|
+
`, B = ({ variant: o = "primary", showBullet: r = !0, size: t = "M", children: d, ...c }) => {
|
|
17
|
+
const i = `${o}100`, l = `${o}200`, g = `${o}600`, m = `${o}600`, s = t === "S" ? 2 : 5, e = t === "S" ? 1 : 4;
|
|
18
|
+
return n(x, { borderColor: l, textColor: m, background: i, hasRadius: !0, paddingTop: e, paddingBottom: e, paddingLeft: s, paddingRight: s, ...c, children: r ? a(b, { children: [n(h, { backgroundColor: g }), d] }) : d });
|
|
57
19
|
};
|
|
58
20
|
export {
|
|
59
|
-
|
|
21
|
+
B as Status
|
|
60
22
|
};
|
package/dist/Switch/Switch.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),f=require("styled-components"),p=require("../Flex/Flex.cjs"),b=require("../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},g=i(h),c=i(f),n=c.default.div`
|
|
2
2
|
background: ${({theme:e})=>e.colors.danger500};
|
|
3
3
|
border: none;
|
|
4
4
|
border-radius: 16px;
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
transition: none;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,x=c.default.button`
|
|
31
31
|
background: transparent;
|
|
32
32
|
padding: 0;
|
|
33
33
|
border: none;
|
|
34
34
|
|
|
35
|
-
&[aria-checked='true'] ${
|
|
35
|
+
&[aria-checked='true'] ${n} {
|
|
36
36
|
background: ${({theme:e})=>e.colors.success500};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
&[aria-checked='true'] ${
|
|
39
|
+
&[aria-checked='true'] ${n}:before {
|
|
40
40
|
transform: translateX(1rem);
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,m=g.default.forwardRef(({label:e,onChange:d,onLabel:o="On",offLabel:s="Off",selected:t,visibleLabels:a=!1,...u},l)=>r.jsx(x,{ref:l,role:"switch","aria-checked":t,"aria-label":e,onClick:d,visibleLabels:a,type:"button",...u,children:r.jsxs(p.Flex,{children:[r.jsxs(n,{children:[r.jsx("span",{children:o}),r.jsx("span",{children:s})]}),a&&r.jsx(b.Box,{as:"span","aria-hidden":!0,paddingLeft:2,color:t?"success600":"danger600",children:t?o:s})]})}));exports.Switch=m;
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Flex as h } from "../Flex/Flex.js";
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import c from "styled-components";
|
|
4
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
6
5
|
import { Box as m } from "../Box/Box.js";
|
|
7
|
-
const
|
|
8
|
-
background: ${({ theme:
|
|
6
|
+
const t = c.div`
|
|
7
|
+
background: ${({ theme: r }) => r.colors.danger500};
|
|
9
8
|
border: none;
|
|
10
9
|
border-radius: 16px;
|
|
11
10
|
position: relative;
|
|
@@ -13,19 +12,19 @@ const n = l.div`
|
|
|
13
12
|
width: ${40 / 16}rem;
|
|
14
13
|
|
|
15
14
|
& span {
|
|
16
|
-
font-size: ${({ visibleLabels:
|
|
15
|
+
font-size: ${({ visibleLabels: r }) => r ? "1rem" : 0};
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
&:before {
|
|
20
19
|
content: '';
|
|
21
|
-
background: ${({ theme:
|
|
20
|
+
background: ${({ theme: r }) => r.colors.neutral0};
|
|
22
21
|
width: 1rem;
|
|
23
22
|
height: 1rem;
|
|
24
23
|
border-radius: 50%;
|
|
25
24
|
position: absolute;
|
|
26
25
|
transition: all 0.5s;
|
|
27
|
-
left: ${({ theme:
|
|
28
|
-
top: ${({ theme:
|
|
26
|
+
left: ${({ theme: r }) => r.spaces[1]};
|
|
27
|
+
top: ${({ theme: r }) => r.spaces[1]};
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -33,54 +32,19 @@ const n = l.div`
|
|
|
33
32
|
transition: none;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
`,
|
|
35
|
+
`, f = c.button`
|
|
37
36
|
background: transparent;
|
|
38
37
|
padding: 0;
|
|
39
38
|
border: none;
|
|
40
39
|
|
|
41
|
-
&[aria-checked='true'] ${
|
|
42
|
-
background: ${({ theme:
|
|
40
|
+
&[aria-checked='true'] ${t} {
|
|
41
|
+
background: ${({ theme: r }) => r.colors.success500};
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
&[aria-checked='true'] ${
|
|
44
|
+
&[aria-checked='true'] ${t}:before {
|
|
46
45
|
transform: translateX(1rem);
|
|
47
46
|
}
|
|
48
|
-
`,
|
|
49
|
-
({ label: e, onChange: p, onLabel: a, offLabel: s, selected: t, visibleLabels: d, ...u }, f) => /* @__PURE__ */ o(
|
|
50
|
-
g,
|
|
51
|
-
{
|
|
52
|
-
ref: f,
|
|
53
|
-
role: "switch",
|
|
54
|
-
"aria-checked": t,
|
|
55
|
-
"aria-label": e,
|
|
56
|
-
onClick: p,
|
|
57
|
-
visibleLabels: d,
|
|
58
|
-
type: "button",
|
|
59
|
-
...u,
|
|
60
|
-
children: /* @__PURE__ */ c(h, { children: [
|
|
61
|
-
/* @__PURE__ */ c(n, { children: [
|
|
62
|
-
/* @__PURE__ */ o("span", { children: a }),
|
|
63
|
-
/* @__PURE__ */ o("span", { children: s })
|
|
64
|
-
] }),
|
|
65
|
-
d && /* @__PURE__ */ o(m, { as: "span", "aria-hidden": !0, paddingLeft: 2, color: t ? "success600" : "danger600", children: t ? a : s })
|
|
66
|
-
] })
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
i.defaultProps = {
|
|
71
|
-
onLabel: "On",
|
|
72
|
-
offLabel: "Off",
|
|
73
|
-
visibleLabels: !1
|
|
74
|
-
};
|
|
75
|
-
i.propTypes = {
|
|
76
|
-
label: r.string.isRequired,
|
|
77
|
-
offLabel: r.string,
|
|
78
|
-
onChange: r.func.isRequired,
|
|
79
|
-
onLabel: r.string,
|
|
80
|
-
selected: r.bool.isRequired,
|
|
81
|
-
visibleLabels: r.bool
|
|
82
|
-
};
|
|
83
|
-
i.displayName = "Switch";
|
|
47
|
+
`, x = h.forwardRef(({ label: r, onChange: d, onLabel: n = "On", offLabel: i = "Off", selected: o, visibleLabels: a = !1, ...l }, p) => e(f, { ref: p, role: "switch", "aria-checked": o, "aria-label": r, onClick: d, visibleLabels: a, type: "button", ...l, children: s(u, { children: [s(t, { children: [e("span", { children: n }), e("span", { children: i })] }), a && e(m, { as: "span", "aria-hidden": !0, paddingLeft: 2, color: o ? "success600" : "danger600", children: o ? n : i })] }) }));
|
|
84
48
|
export {
|
|
85
|
-
|
|
49
|
+
x as Switch
|
|
86
50
|
};
|
package/dist/Table/Cell.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("styled-components"),r=require("../RawTable/RawCell.cjs"),i=require("../Flex/Flex.cjs"),a=e=>e&&e.__esModule?e:{default:e},n=a(c),s=n.default(r.RawTd)`
|
|
2
2
|
vertical-align: middle;
|
|
3
3
|
text-align: left;
|
|
4
4
|
color: ${({theme:e})=>e.colors.neutral600};
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
input {
|
|
11
11
|
vertical-align: sub;
|
|
12
12
|
}
|
|
13
|
-
`,
|
|
13
|
+
`,u=n.default.span`
|
|
14
14
|
svg {
|
|
15
15
|
height: ${4/16}rem;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,d=({children:e,action:l,...o})=>t.jsx(s,{as:r.RawTh,...o,children:t.jsxs(i.Flex,{children:[e,t.jsx(u,{children:l})]})}),h=({children:e,...l})=>t.jsx(s,{...l,children:e});exports.Td=h;exports.Th=d;
|
package/dist/Table/Cell.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { Flex as d } from "../Flex/Flex.js";
|
|
7
|
-
const i = t(a)`
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import o from "styled-components";
|
|
3
|
+
import { RawTd as c, RawTh as s } from "../RawTable/RawCell.js";
|
|
4
|
+
import { Flex as a } from "../Flex/Flex.js";
|
|
5
|
+
const l = o(c)`
|
|
8
6
|
vertical-align: middle;
|
|
9
7
|
text-align: left;
|
|
10
|
-
color: ${({ theme:
|
|
8
|
+
color: ${({ theme: r }) => r.colors.neutral600};
|
|
11
9
|
outline-offset: -4px;
|
|
12
10
|
|
|
13
11
|
/**
|
|
@@ -16,23 +14,12 @@ const i = t(a)`
|
|
|
16
14
|
input {
|
|
17
15
|
vertical-align: sub;
|
|
18
16
|
}
|
|
19
|
-
`,
|
|
17
|
+
`, p = o.span`
|
|
20
18
|
svg {
|
|
21
19
|
height: ${4 / 16}rem;
|
|
22
20
|
}
|
|
23
|
-
`,
|
|
24
|
-
o,
|
|
25
|
-
/* @__PURE__ */ r(m, { children: l })
|
|
26
|
-
] }) });
|
|
27
|
-
n.defaultProps = {
|
|
28
|
-
action: void 0
|
|
29
|
-
};
|
|
30
|
-
n.propTypes = {
|
|
31
|
-
action: e.node,
|
|
32
|
-
children: e.node.isRequired
|
|
33
|
-
};
|
|
34
|
-
const k = (o) => /* @__PURE__ */ r(i, { ...o });
|
|
21
|
+
`, u = ({ children: r, action: e, ...i }) => t(l, { as: s, ...i, children: n(a, { children: [r, t(p, { children: e })] }) }), x = ({ children: r, ...e }) => t(l, { ...e, children: r });
|
|
35
22
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
x as Td,
|
|
24
|
+
u as Th
|
|
38
25
|
};
|
package/dist/Table/TFooter.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("styled-components"),t=require("../Box/Box.cjs"),s=require("../Divider/Divider.cjs"),a=require("../Flex/Flex.cjs"),l=require("../Typography/Typography.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(n),u=i.default(t.Box)`
|
|
2
2
|
height: ${24/16}rem;
|
|
3
3
|
width: ${24/16}rem;
|
|
4
4
|
border-radius: 50%;
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
svg path {
|
|
15
15
|
fill: ${({theme:e})=>e.colors.primary600};
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,h=i.default(t.Box)`
|
|
18
18
|
border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
|
|
19
19
|
display: block;
|
|
20
20
|
width: 100%;
|
|
21
21
|
border: none;
|
|
22
|
-
`,
|
|
22
|
+
`,x=({children:e,icon:o,...d})=>r.jsxs("div",{children:[r.jsx(s.Divider,{}),r.jsx(h,{as:"button",background:"primary100",padding:5,...d,children:r.jsxs(a.Flex,{children:[r.jsx(u,{"aria-hidden":!0,background:"primary200",children:o}),r.jsx(t.Box,{paddingLeft:3,children:r.jsx(l.Typography,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:e})})]})})]});exports.TFooter=x;
|
package/dist/Table/TFooter.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import t from "prop-types";
|
|
4
|
-
import d from "styled-components";
|
|
2
|
+
import t from "styled-components";
|
|
5
3
|
import { Box as o } from "../Box/Box.js";
|
|
6
|
-
import { Divider as
|
|
7
|
-
import { Flex as
|
|
8
|
-
import { Typography as
|
|
9
|
-
const
|
|
4
|
+
import { Divider as a } from "../Divider/Divider.js";
|
|
5
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
6
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
7
|
+
const s = t(o)`
|
|
10
8
|
height: ${24 / 16}rem;
|
|
11
9
|
width: ${24 / 16}rem;
|
|
12
10
|
border-radius: 50%;
|
|
@@ -22,22 +20,12 @@ const c = d(o)`
|
|
|
22
20
|
svg path {
|
|
23
21
|
fill: ${({ theme: r }) => r.colors.primary600};
|
|
24
22
|
}
|
|
25
|
-
`, l =
|
|
23
|
+
`, l = t(o)`
|
|
26
24
|
border-radius: 0 0 ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius};
|
|
27
25
|
display: block;
|
|
28
26
|
width: 100%;
|
|
29
27
|
border: none;
|
|
30
|
-
`,
|
|
31
|
-
/* @__PURE__ */ i(m, {}),
|
|
32
|
-
/* @__PURE__ */ i(l, { as: "button", background: "primary100", padding: 5, ...p, children: /* @__PURE__ */ e(s, { children: [
|
|
33
|
-
/* @__PURE__ */ i(c, { "aria-hidden": !0, background: "primary200", children: n }),
|
|
34
|
-
/* @__PURE__ */ i(o, { paddingLeft: 3, children: /* @__PURE__ */ i(a, { variant: "pi", fontWeight: "bold", textColor: "primary600", children: r }) })
|
|
35
|
-
] }) })
|
|
36
|
-
] });
|
|
37
|
-
h.propTypes = {
|
|
38
|
-
children: t.string.isRequired,
|
|
39
|
-
icon: t.node.isRequired
|
|
40
|
-
};
|
|
28
|
+
`, y = ({ children: r, icon: d, ...n }) => e("div", { children: [i(a, {}), i(l, { as: "button", background: "primary100", padding: 5, ...n, children: e(m, { children: [i(s, { "aria-hidden": !0, background: "primary200", children: d }), i(o, { paddingLeft: 3, children: i(p, { variant: "pi", fontWeight: "bold", textColor: "primary600", children: r }) })] }) })] });
|
|
41
29
|
export {
|
|
42
|
-
|
|
30
|
+
y as TFooter
|
|
43
31
|
};
|
package/dist/Table/Table.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),f=require("styled-components"),h=require("../RawTable/RawTable.cjs"),s=require("../Box/Box.cjs"),b=t=>t&&t.__esModule?t:{default:t},a=b(f),g=a.default(s.Box)`
|
|
2
2
|
overflow: hidden;
|
|
3
|
-
border: 1px solid ${({theme:
|
|
4
|
-
`,
|
|
3
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
4
|
+
`,w=a.default(h.RawTable)`
|
|
5
5
|
width: 100%;
|
|
6
6
|
white-space: nowrap;
|
|
7
|
-
`,
|
|
7
|
+
`,p=a.default(s.Box)`
|
|
8
8
|
&:before {
|
|
9
9
|
// TODO: make sure to add a token for this weird stuff
|
|
10
10
|
background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
|
|
11
11
|
opacity: 0.2;
|
|
12
12
|
position: absolute;
|
|
13
13
|
height: 100%;
|
|
14
|
-
content: ${({overflowing:
|
|
15
|
-
box-shadow: ${({theme:
|
|
16
|
-
width: ${({theme:
|
|
14
|
+
content: ${({overflowing:t})=>t==="both"||t==="left"?"''":void 0};
|
|
15
|
+
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
16
|
+
width: ${({theme:t})=>t.spaces[2]};
|
|
17
17
|
left: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
opacity: 0.2;
|
|
24
24
|
position: absolute;
|
|
25
25
|
height: 100%;
|
|
26
|
-
content: ${({overflowing:
|
|
27
|
-
box-shadow: ${({theme:
|
|
28
|
-
width: ${({theme:
|
|
26
|
+
content: ${({overflowing:t})=>t==="both"||t==="right"?"''":void 0};
|
|
27
|
+
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
28
|
+
width: ${({theme:t})=>t.spaces[2]};
|
|
29
29
|
right: 0;
|
|
30
30
|
top: 0;
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,x=a.default(s.Box)`
|
|
33
33
|
overflow-x: auto;
|
|
34
|
-
`,
|
|
34
|
+
`,S=({footer:t,...i})=>{const l=n.useRef(null),[d,o]=n.useState(),c=e=>{const u=e.target.scrollWidth-e.target.clientWidth;if(e.target.scrollLeft===0){o("right");return}if(e.target.scrollLeft===u){o("left");return}e.target.scrollLeft>0&&o("both")};return n.useEffect(()=>{l.current.scrollWidth>l.current.clientWidth&&o("right")},[]),r.jsxs(g,{shadow:"tableShadow",hasRadius:!0,background:"neutral0",children:[r.jsx(p,{overflowing:d,position:"relative",children:r.jsx(x,{ref:l,onScroll:c,paddingLeft:6,paddingRight:6,children:r.jsx(w,{...i})})}),t]})};exports.Table=S;
|
package/dist/Table/Table.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import s from "prop-types";
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, useState as u, useEffect as g } from "react";
|
|
4
3
|
import r from "styled-components";
|
|
5
|
-
import { RawTable as
|
|
4
|
+
import { RawTable as b } from "../RawTable/RawTable.js";
|
|
6
5
|
import { Box as n } from "../Box/Box.js";
|
|
7
|
-
const
|
|
6
|
+
const p = r(n)`
|
|
8
7
|
overflow: hidden;
|
|
9
8
|
border: 1px solid ${({ theme: t }) => t.colors.neutral150};
|
|
10
|
-
`,
|
|
9
|
+
`, w = r(b)`
|
|
11
10
|
width: 100%;
|
|
12
11
|
white-space: nowrap;
|
|
13
|
-
`,
|
|
12
|
+
`, m = r(n)`
|
|
14
13
|
&:before {
|
|
15
14
|
// TODO: make sure to add a token for this weird stuff
|
|
16
15
|
background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
|
|
@@ -35,36 +34,25 @@ const T = r(n)`
|
|
|
35
34
|
right: 0;
|
|
36
35
|
top: 0;
|
|
37
36
|
}
|
|
38
|
-
`,
|
|
37
|
+
`, x = r(n)`
|
|
39
38
|
overflow-x: auto;
|
|
40
|
-
`,
|
|
41
|
-
const a =
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
39
|
+
`, O = ({ footer: t, ...l }) => {
|
|
40
|
+
const a = h(null), [s, o] = u(), d = (e) => {
|
|
41
|
+
const c = e.target.scrollWidth - e.target.clientWidth;
|
|
42
|
+
if (e.target.scrollLeft === 0) {
|
|
43
|
+
o("right");
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
|
-
if (
|
|
48
|
-
|
|
46
|
+
if (e.target.scrollLeft === c) {
|
|
47
|
+
o("left");
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
|
-
|
|
50
|
+
e.target.scrollLeft > 0 && o("both");
|
|
52
51
|
};
|
|
53
|
-
return
|
|
54
|
-
a.current.scrollWidth > a.current.clientWidth &&
|
|
55
|
-
}, []),
|
|
56
|
-
/* @__PURE__ */ i(k, { overflowing: h, position: "relative", children: /* @__PURE__ */ i(R, { ref: a, onScroll: u, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ i(S, { colCount: t, rowCount: d, ...f }) }) }),
|
|
57
|
-
c
|
|
58
|
-
] });
|
|
59
|
-
};
|
|
60
|
-
l.defaultProps = {
|
|
61
|
-
footer: void 0
|
|
62
|
-
};
|
|
63
|
-
l.propTypes = {
|
|
64
|
-
colCount: s.number.isRequired,
|
|
65
|
-
footer: s.node,
|
|
66
|
-
rowCount: s.number.isRequired
|
|
52
|
+
return g(() => {
|
|
53
|
+
a.current.scrollWidth > a.current.clientWidth && o("right");
|
|
54
|
+
}, []), f(p, { shadow: "tableShadow", hasRadius: !0, background: "neutral0", children: [i(m, { overflowing: s, position: "relative", children: i(x, { ref: a, onScroll: d, paddingLeft: 6, paddingRight: 6, children: i(w, { ...l }) }) }), t] });
|
|
67
55
|
};
|
|
68
56
|
export {
|
|
69
|
-
|
|
57
|
+
O as Table
|
|
70
58
|
};
|
package/dist/Table/Tbody.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("styled-components"),d=require("../RawTable/RawTbody.cjs"),n=t=>t&&t.__esModule?t:{default:t},s=n(r),u=s.default(d.RawTbody)`
|
|
2
2
|
& tr:last-of-type {
|
|
3
3
|
border-bottom: none;
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,l=({children:t,...e})=>o.jsx(u,{...e,children:t});exports.Tbody=l;
|
package/dist/Table/Tbody.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import t from "styled-components";
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "styled-components";
|
|
4
3
|
import { RawTbody as m } from "../RawTable/RawTbody.js";
|
|
5
|
-
const p =
|
|
4
|
+
const p = e(m)`
|
|
6
5
|
& tr:last-of-type {
|
|
7
6
|
border-bottom: none;
|
|
8
7
|
}
|
|
9
|
-
`, s = (o) =>
|
|
8
|
+
`, s = ({ children: o, ...r }) => t(p, { ...r, children: o });
|
|
10
9
|
export {
|
|
11
10
|
s as Tbody
|
|
12
11
|
};
|
package/dist/Table/Thead.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("styled-components"),d=require("../RawTable/RawThead.cjs"),s=e=>e&&e.__esModule?e:{default:e},a=s(o),l=a.default(d.RawThead)`
|
|
2
2
|
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
3
|
-
`,
|
|
3
|
+
`,n=({children:e,...t})=>r.jsx(l,{...t,children:e});exports.Thead=n;
|
package/dist/Table/Thead.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`, i = (o) => /* @__PURE__ */ r(m, { ...o });
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "styled-components";
|
|
3
|
+
import { RawThead as d } from "../RawTable/RawThead.js";
|
|
4
|
+
const m = e(d)`
|
|
5
|
+
border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral150};
|
|
6
|
+
`, i = ({ children: r, ...o }) => t(m, { ...o, children: r });
|
|
8
7
|
export {
|
|
9
8
|
i as Thead
|
|
10
9
|
};
|
package/dist/Table/Tr.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("styled-components"),o=require("../RawTable/RawTr.cjs"),s=t=>t&&t.__esModule?t:{default:t},d=s(r),i=d.default(o.RawTr)`
|
|
2
2
|
border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
3
3
|
|
|
4
4
|
& td,
|
package/dist/Table/Tr.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import o from "styled-components";
|
|
4
3
|
import { RawTr as p } from "../RawTable/RawTr.js";
|
|
5
|
-
const
|
|
4
|
+
const d = o(p)`
|
|
6
5
|
border-bottom: 1px solid ${({ theme: t }) => t.colors.neutral150};
|
|
7
6
|
|
|
8
7
|
& td,
|
|
@@ -21,7 +20,7 @@ const i = o(p)`
|
|
|
21
20
|
padding-bottom: 0;
|
|
22
21
|
height: ${56 / 16}rem;
|
|
23
22
|
}
|
|
24
|
-
`,
|
|
23
|
+
`, a = (t) => r(d, { ...t });
|
|
25
24
|
export {
|
|
26
|
-
|
|
25
|
+
a as Tr
|
|
27
26
|
};
|
package/dist/Tabs/TabGroup.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),p=require("react"),m=require("./TabsContext.cjs"),x=require("../hooks/useId.cjs");function T(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=T(p),i=o.forwardRef(({id:e,initialSelectedTabIndex:r=0,label:t,onTabChange:n,variant:s,...l},b)=>{const c=x.useId(e),[u,a]=o.useState(r);o.useImperativeHandle(b,()=>({_handlers:{setSelectedTabIndex:a}}));const f=o.useMemo(()=>({id:c,selectedTabIndex:u,selectTabIndex:a,label:t,variant:s,onTabChange:n}),[t,n,u,c,s]);return d.jsx(m.TabsContext.Provider,{value:f,children:d.jsx("div",{...l})})});i.displayName="TabGroup";exports.TabGroup=i;
|
package/dist/Tabs/TabGroup.js
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import e from "prop-types";
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
4
3
|
import { TabsContext as x } from "./TabsContext.js";
|
|
5
|
-
import { useId as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const v = r.useMemo(
|
|
16
|
-
() => ({ id: l, selectedTabIndex: m, selectTabIndex: b, label: n, variant: a, onTabChange: s }),
|
|
17
|
-
[n, s, m, l, a]
|
|
18
|
-
);
|
|
19
|
-
return /* @__PURE__ */ f(x.Provider, { value: v, children: /* @__PURE__ */ f("div", { ...p }) });
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
t.displayName = "TabGroup";
|
|
23
|
-
t.defaultProps = {
|
|
24
|
-
id: void 0,
|
|
25
|
-
initialSelectedTabIndex: void 0,
|
|
26
|
-
onTabChange() {
|
|
27
|
-
},
|
|
28
|
-
variant: void 0
|
|
29
|
-
};
|
|
30
|
-
t.propTypes = {
|
|
31
|
-
children: e.node.isRequired,
|
|
32
|
-
id: e.string,
|
|
33
|
-
initialSelectedTabIndex: e.number,
|
|
34
|
-
label: e.string.isRequired,
|
|
35
|
-
onTabChange: e.func,
|
|
36
|
-
variant: e.oneOf(["simple"])
|
|
37
|
-
};
|
|
4
|
+
import { useId as f } from "../hooks/useId.js";
|
|
5
|
+
const l = e.forwardRef(({ id: c, initialSelectedTabIndex: n = 0, label: t, onTabChange: o, variant: r, ...i }, p) => {
|
|
6
|
+
const s = f(c), [d, a] = e.useState(n);
|
|
7
|
+
e.useImperativeHandle(p, () => ({
|
|
8
|
+
_handlers: { setSelectedTabIndex: a }
|
|
9
|
+
}));
|
|
10
|
+
const u = e.useMemo(() => ({ id: s, selectedTabIndex: d, selectTabIndex: a, label: t, variant: r, onTabChange: o }), [t, o, d, s, r]);
|
|
11
|
+
return m(x.Provider, { value: u, children: m("div", { ...i }) });
|
|
12
|
+
});
|
|
13
|
+
l.displayName = "TabGroup";
|
|
38
14
|
export {
|
|
39
|
-
|
|
15
|
+
l as TabGroup
|
|
40
16
|
};
|