@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.
- package/dist/Accordion/Accordion.cjs +5 -5
- package/dist/Accordion/Accordion.js +45 -44
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +4 -4
- package/dist/Accordion/AccordionGroup.cjs +4 -4
- package/dist/Accordion/AccordionGroup.js +18 -18
- package/dist/Accordion/AccordionToggle.cjs +2 -2
- package/dist/Accordion/AccordionToggle.js +11 -11
- package/dist/Alert/Alert.cjs +1 -1
- package/dist/Alert/Alert.js +8 -8
- package/dist/Avatar/Avatar.cjs +5 -5
- package/dist/Avatar/Avatar.js +11 -11
- package/dist/Avatar/AvatarGroup.cjs +2 -2
- package/dist/Avatar/AvatarGroup.js +4 -4
- package/dist/BaseButton/BaseButton.cjs +5 -11
- package/dist/BaseButton/BaseButton.js +31 -38
- package/dist/BaseCheckbox/BaseCheckbox.cjs +3 -3
- package/dist/BaseCheckbox/BaseCheckbox.js +22 -22
- package/dist/BaseRadio/BaseRadio.cjs +2 -2
- package/dist/BaseRadio/BaseRadio.js +4 -4
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +28 -26
- package/dist/Box/Box.cjs +2 -2
- package/dist/Box/Box.js +36 -33
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +12 -12
- package/dist/Button/Button.cjs +10 -27
- package/dist/Button/Button.js +65 -85
- package/dist/Button/utils.cjs +22 -22
- package/dist/Button/utils.js +2 -2
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +15 -14
- package/dist/Card/CardAsset.js +4 -4
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +4 -4
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +6 -6
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +1 -1
- package/dist/CarouselInput/Carousel.cjs +2 -2
- package/dist/CarouselInput/Carousel.js +19 -64
- package/dist/CarouselInput/CarouselActions.js +1 -9
- package/dist/CarouselInput/CarouselImage.js +1 -10
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +19 -24
- package/dist/CarouselInput/CarouselSlide.js +13 -9
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +7 -26
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +106 -120
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +18 -17
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +47 -46
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +28 -61
- package/dist/DatePicker/DatePickerTd.js +1 -12
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +7 -16
- package/dist/DatePicker/components.cjs +3 -3
- package/dist/DatePicker/components.js +6 -6
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +64 -61
- package/dist/DateTimePicker/DateTimePickerProps.js +1 -3
- package/dist/Dialog/Dialog.cjs +4 -4
- package/dist/Dialog/Dialog.js +26 -37
- package/dist/Dialog/DialogBody.cjs +1 -1
- package/dist/Dialog/DialogBody.js +2 -11
- package/dist/Dialog/DialogFooter.cjs +1 -1
- package/dist/Dialog/DialogFooter.js +2 -7
- package/dist/DismissibleLayer/DismissibleLayer.js +1 -4
- package/dist/Divider/Divider.js +1 -5
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +1 -1
- package/dist/EmptyStateLayout/EmptyStateLayout.js +2 -16
- package/dist/EmptyStateLayout/story-assets/Illo.js +60 -45
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +12 -13
- package/dist/Field/FieldAction.cjs +1 -1
- package/dist/Field/FieldAction.js +2 -6
- package/dist/Field/FieldError.js +1 -7
- package/dist/Field/FieldHint.js +1 -6
- package/dist/Field/FieldInput.cjs +4 -4
- package/dist/Field/FieldInput.js +26 -34
- package/dist/Field/FieldLabel.cjs +1 -1
- package/dist/Field/FieldLabel.js +3 -16
- package/dist/FocusTrap/FocusTrap.js +1 -5
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +12 -15
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +5 -13
- package/dist/IconButton/IconButton.cjs +7 -12
- package/dist/IconButton/IconButton.js +88 -84
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +85 -78
- package/dist/JSONInput/JSONInputContainer.cjs +10 -10
- package/dist/JSONInput/JSONInputContainer.js +22 -15
- package/dist/Layout/ActionLayout.js +1 -13
- package/dist/Layout/ContentLayout.js +1 -4
- package/dist/Layout/HeaderLayout.cjs +1 -1
- package/dist/Layout/HeaderLayout.js +35 -64
- package/dist/Layout/Layout.js +1 -5
- package/dist/Layout/TwoColsLayout.js +1 -17
- package/dist/Link/Link.cjs +5 -5
- package/dist/Link/Link.js +55 -57
- package/dist/LinkButton/LinkButton.cjs +7 -24
- package/dist/LinkButton/LinkButton.js +60 -87
- package/dist/LiveRegions/LiveRegions.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.js +1 -1
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +26 -24
- package/dist/Main/Main.js +1 -6
- package/dist/Main/SkipToContent.cjs +2 -2
- package/dist/Main/SkipToContent.js +17 -13
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +21 -20
- package/dist/MainNav/NavBrand.cjs +2 -2
- package/dist/MainNav/NavBrand.js +4 -38
- package/dist/MainNav/NavCondense.cjs +2 -2
- package/dist/MainNav/NavCondense.js +10 -18
- package/dist/MainNav/NavFooter.js +1 -3
- package/dist/MainNav/NavLink.cjs +4 -4
- package/dist/MainNav/NavLink.js +8 -34
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +5 -38
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +4 -15
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +6 -27
- package/dist/ModalLayout/ModalBody.js +1 -4
- package/dist/ModalLayout/ModalFooter.cjs +1 -1
- package/dist/ModalLayout/ModalFooter.js +2 -10
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +8 -20
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +23 -31
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +54 -59
- package/dist/Pagination/Pagination.cjs +2 -2
- package/dist/Pagination/Pagination.js +11 -16
- package/dist/Pagination/components.cjs +3 -3
- package/dist/Pagination/components.js +31 -38
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +111 -102
- package/dist/Popover/index.cjs +1 -1
- package/dist/Popover/index.js +9 -3
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +10 -12
- package/dist/ProgressBar/ProgressBar.js +17 -14
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +4 -11
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +5 -14
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +36 -35
- package/dist/RawTable/RawTbody.js +1 -3
- package/dist/RawTable/RawThead.js +1 -3
- package/dist/RawTable/RawTr.js +1 -4
- package/dist/Searchbar/SearchForm.js +1 -4
- package/dist/Searchbar/Searchbar.cjs +3 -3
- package/dist/Searchbar/Searchbar.js +21 -25
- package/dist/Select/MultiSelectNested.js +2 -14
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +14 -10
- package/dist/Select/Option.cjs +3 -3
- package/dist/Select/Option.js +31 -33
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +87 -107
- package/dist/Select/SelectButton.cjs +1 -1
- package/dist/Select/SelectButton.js +14 -11
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +20 -16
- package/dist/Select/SelectTags.cjs +3 -3
- package/dist/Select/SelectTags.js +17 -15
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +1 -1
- package/dist/SimpleMenu/SimpleMenu.cjs +3 -3
- package/dist/SimpleMenu/SimpleMenu.js +43 -67
- package/dist/Status/Status.js +15 -13
- package/dist/SubNav/SubNav.cjs +2 -2
- package/dist/SubNav/SubNav.js +5 -9
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +31 -53
- package/dist/SubNav/SubNavLink.cjs +3 -3
- package/dist/SubNav/SubNavLink.js +18 -22
- package/dist/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/SubNav/SubNavLinkSection.js +5 -30
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +23 -30
- package/dist/SubNav/SubNavSectionLabel.cjs +2 -2
- package/dist/SubNav/SubNavSectionLabel.js +15 -24
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +3 -12
- package/dist/Switch/Switch.cjs +2 -2
- package/dist/Switch/Switch.js +16 -17
- package/dist/Table/Cell.cjs +1 -1
- package/dist/Table/Cell.js +3 -8
- package/dist/Table/TFooter.cjs +2 -2
- package/dist/Table/TFooter.js +3 -17
- package/dist/Table/Table.cjs +1 -1
- package/dist/Table/Table.js +2 -18
- package/dist/Table/Tbody.js +1 -3
- package/dist/Table/Thead.js +1 -3
- package/dist/Table/Tr.js +1 -3
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +30 -27
- package/dist/Tabs/TabPanels.js +2 -10
- package/dist/Tabs/Tabs.cjs +1 -1
- package/dist/Tabs/Tabs.js +43 -51
- package/dist/Tag/Tag.cjs +1 -1
- package/dist/Tag/Tag.js +20 -23
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +15 -15
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +14 -32
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +10 -25
- package/dist/Textarea/TextareaInput.cjs +1 -1
- package/dist/Textarea/TextareaInput.js +15 -15
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +27 -26
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +5 -5
- package/dist/ToggleCheckbox/ToggleCheckbox.js +85 -60
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +14 -32
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +62 -53
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipHandlers.js +7 -7
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipLayout.js +8 -5
- package/dist/Typography/Typography.cjs +3 -2
- package/dist/Typography/Typography.js +17 -14
- package/dist/helpers/objects.cjs +1 -1
- package/dist/helpers/objects.js +1 -1
- package/dist/hooks/useId.cjs +1 -0
- package/dist/hooks/useId.js +13 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +136 -134
- package/dist/themes/extendTheme.cjs +1 -1
- package/dist/themes/extendTheme.js +4 -4
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +4 -13
- package/dist/v2/Breadcrumbs/Crumb.js +11 -12
- package/dist/v2/Breadcrumbs/CrumbLink.js +1 -3
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +5 -11
- package/dist/v2/Breadcrumbs/Divider.js +1 -8
- package/dist/v2/Link/Link.cjs +2 -2
- package/dist/v2/Link/Link.js +5 -24
- package/dist/v2/LinkButton/LinkButton.cjs +11 -24
- package/dist/v2/LinkButton/LinkButton.js +62 -84
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +21 -20
- package/dist/v2/MainNav/NavBrand.cjs +2 -2
- package/dist/v2/MainNav/NavBrand.js +4 -38
- package/dist/v2/MainNav/NavCondense.cjs +2 -2
- package/dist/v2/MainNav/NavCondense.js +10 -18
- package/dist/v2/MainNav/NavFooter.js +1 -3
- package/dist/v2/MainNav/NavLink.cjs +4 -4
- package/dist/v2/MainNav/NavLink.js +10 -39
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +5 -38
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +4 -15
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +6 -27
- package/dist/v2/Pagination/Pagination.cjs +2 -2
- package/dist/v2/Pagination/Pagination.js +11 -16
- package/dist/v2/Pagination/components.cjs +2 -2
- package/dist/v2/Pagination/components.js +11 -39
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +4 -4
- package/dist/v2/SimpleMenu/SimpleMenu.js +42 -65
- package/dist/v2/SubNav/SubNav.cjs +2 -2
- package/dist/v2/SubNav/SubNav.js +5 -9
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +31 -53
- package/dist/v2/SubNav/SubNavLink.cjs +2 -2
- package/dist/v2/SubNav/SubNavLink.js +18 -22
- package/dist/v2/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavLinkSection.js +5 -30
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +26 -33
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +2 -2
- package/dist/v2/SubNav/SubNavSectionLabel.js +15 -24
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +3 -12
- package/package.json +7 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
border: ${
|
|
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("../helpers/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
|
+
border: ${v};
|
|
3
3
|
|
|
4
4
|
&:hover:not([aria-disabled='true']) {
|
|
5
5
|
border: 1px solid ${({theme:r})=>r.colors.primary600};
|
|
6
6
|
|
|
7
|
-
${
|
|
7
|
+
${f} {
|
|
8
8
|
color: ${({theme:r,expanded:o})=>o?void 0:r.colors.primary700};
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
${
|
|
11
|
+
${a.Typography} {
|
|
12
12
|
color: ${({theme:r,expanded:o})=>o?void 0:r.colors.primary600};
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
background: ${({theme:r})=>r.colors.primary200};
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,M=({children:r,disabled:o=!1,error:e,expanded:t=!1,hasErrorMessage:n=!0,id:x,onToggle:i,toggle:d,size:u="M",variant:s="primary",shadow:g})=>{const l=T.useId(x),j=A.useMemo(()=>({expanded:t,onToggle:i,toggle:d,id:l,size:u,variant:s,disabled:o}),[o,t,l,i,u,d,s]);return c.jsxs(b.AccordionContext.Provider,{value:j,children:[c.jsx(B,{"data-strapi-expanded":t,disabled:o,"aria-disabled":o,expanded:t,hasRadius:!0,variant:s,error:e,shadow:g,children:r}),e&&n&&c.jsx(p.Box,{paddingTop:1,children:c.jsx(a.Typography,{variant:"pi",textColor:"danger600",children:e})})]})};exports.Accordion=M;exports.AccordionTypography=f;
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Box as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsxs as y, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import m from "styled-components";
|
|
4
|
+
import { AccordionContext as h } from "./AccordionContext.js";
|
|
5
|
+
import { Box as u } from "../Box/Box.js";
|
|
6
|
+
import { Flex as b } from "../Flex/Flex.js";
|
|
7
|
+
import { useId as A } from "../helpers/useId.js";
|
|
8
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
9
|
+
const v = ({
|
|
9
10
|
theme: r,
|
|
10
11
|
expanded: o,
|
|
11
|
-
variant:
|
|
12
|
-
disabled:
|
|
12
|
+
variant: t,
|
|
13
|
+
disabled: i,
|
|
13
14
|
error: a
|
|
14
|
-
}) => a ? `1px solid ${r.colors.danger600} !important` :
|
|
15
|
-
border: ${
|
|
15
|
+
}) => a ? `1px solid ${r.colors.danger600} !important` : i ? `1px solid ${r.colors.neutral150}` : o ? `1px solid ${r.colors.primary600}` : t === "primary" ? `1px solid ${r.colors.neutral0}` : `1px solid ${r.colors.neutral100}`, j = m(p)``, k = m(u)`
|
|
16
|
+
border: ${v};
|
|
16
17
|
|
|
17
18
|
&:hover:not([aria-disabled='true']) {
|
|
18
19
|
border: 1px solid ${({
|
|
19
20
|
theme: r
|
|
20
21
|
}) => r.colors.primary600};
|
|
21
22
|
|
|
22
|
-
${
|
|
23
|
+
${j} {
|
|
23
24
|
color: ${({
|
|
24
25
|
theme: r,
|
|
25
26
|
expanded: o
|
|
26
27
|
}) => o ? void 0 : r.colors.primary700};
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
${
|
|
30
|
+
${p} {
|
|
30
31
|
color: ${({
|
|
31
32
|
theme: r,
|
|
32
33
|
expanded: o
|
|
33
34
|
}) => o ? void 0 : r.colors.primary600};
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
& > ${
|
|
37
|
+
& > ${b} {
|
|
37
38
|
background: ${({
|
|
38
39
|
theme: r
|
|
39
40
|
}) => r.colors.primary100};
|
|
@@ -48,48 +49,48 @@ const h = ({
|
|
|
48
49
|
`, F = ({
|
|
49
50
|
children: r,
|
|
50
51
|
disabled: o = !1,
|
|
51
|
-
error:
|
|
52
|
-
expanded:
|
|
52
|
+
error: t,
|
|
53
|
+
expanded: i = !1,
|
|
53
54
|
hasErrorMessage: a = !0,
|
|
54
|
-
id:
|
|
55
|
-
onToggle:
|
|
56
|
-
toggle:
|
|
57
|
-
size:
|
|
58
|
-
variant:
|
|
59
|
-
shadow:
|
|
55
|
+
id: f,
|
|
56
|
+
onToggle: s,
|
|
57
|
+
toggle: c,
|
|
58
|
+
size: e = "M",
|
|
59
|
+
variant: d = "primary",
|
|
60
|
+
shadow: $
|
|
60
61
|
}) => {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: [n(
|
|
73
|
-
"data-strapi-expanded":
|
|
62
|
+
const l = A(f), x = g.useMemo(() => ({
|
|
63
|
+
expanded: i,
|
|
64
|
+
onToggle: s,
|
|
65
|
+
toggle: c,
|
|
66
|
+
id: l,
|
|
67
|
+
size: e,
|
|
68
|
+
variant: d,
|
|
69
|
+
disabled: o
|
|
70
|
+
}), [o, i, l, s, e, c, d]);
|
|
71
|
+
return y(h.Provider, {
|
|
72
|
+
value: x,
|
|
73
|
+
children: [n(k, {
|
|
74
|
+
"data-strapi-expanded": i,
|
|
74
75
|
disabled: o,
|
|
75
76
|
"aria-disabled": o,
|
|
76
|
-
expanded:
|
|
77
|
+
expanded: i,
|
|
77
78
|
hasRadius: !0,
|
|
78
|
-
variant:
|
|
79
|
-
error:
|
|
80
|
-
shadow:
|
|
79
|
+
variant: d,
|
|
80
|
+
error: t,
|
|
81
|
+
shadow: $,
|
|
81
82
|
children: r
|
|
82
|
-
}),
|
|
83
|
+
}), t && a && n(u, {
|
|
83
84
|
paddingTop: 1,
|
|
84
|
-
children: n(
|
|
85
|
+
children: n(p, {
|
|
85
86
|
variant: "pi",
|
|
86
87
|
textColor: "danger600",
|
|
87
|
-
children:
|
|
88
|
+
children: t
|
|
88
89
|
})
|
|
89
90
|
})]
|
|
90
91
|
});
|
|
91
92
|
};
|
|
92
93
|
export {
|
|
93
94
|
F as Accordion,
|
|
94
|
-
|
|
95
|
+
j as AccordionTypography
|
|
95
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),s=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),s=require("./AccordionContext.cjs"),a=require("../Box/Box.cjs"),l=({children:o,...n})=>{const{expanded:c,id:e}=s.useAccordion();if(!c)return null;const r=`accordion-content-${e}`,t=`accordion-label-${e}`,i=`accordion-desc-${e}`;return d.jsx(a.Box,{role:"region",id:r,"aria-labelledby":t,"aria-describedby":i,...n,children:o})};exports.AccordionContent=l;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useAccordion as a } from "./AccordionContext.js";
|
|
3
|
+
import { Box as l } from "../Box/Box.js";
|
|
4
4
|
const p = ({
|
|
5
5
|
children: r,
|
|
6
6
|
...n
|
|
@@ -8,11 +8,11 @@ const p = ({
|
|
|
8
8
|
const {
|
|
9
9
|
expanded: i,
|
|
10
10
|
id: o
|
|
11
|
-
} =
|
|
11
|
+
} = a();
|
|
12
12
|
if (!i)
|
|
13
13
|
return null;
|
|
14
14
|
const c = `accordion-content-${o}`, e = `accordion-label-${o}`, t = `accordion-desc-${o}`;
|
|
15
|
-
return d(
|
|
15
|
+
return d(l, {
|
|
16
16
|
role: "region",
|
|
17
17
|
id: c,
|
|
18
18
|
"aria-labelledby": e,
|
|
@@ -1,9 +1,9 @@
|
|
|
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"),p=require("react"),b=require("styled-components"),d=require("../Box/Box.cjs"),x=require("../Flex/Flex.cjs"),y=require("../KeyboardNavigable/KeyboardNavigable.cjs"),l=require("../Typography/Typography.cjs"),g=r=>r&&typeof r=="object"&&"default"in r?r:{default:r};function f(r){if(r&&r.__esModule)return r;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const n=f(p),s=g(b),h=s.default(d.Box)`
|
|
2
2
|
border-bottom: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
3
3
|
border-right: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
4
4
|
border-left: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
5
5
|
border-radius: 0 0 ${({theme:r})=>r.borderRadius} ${({theme:r})=>r.borderRadius};
|
|
6
|
-
`,
|
|
6
|
+
`,j=s.default(d.Box)`
|
|
7
7
|
& > * {
|
|
8
8
|
& > * {
|
|
9
9
|
border-radius: unset;
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
`}
|
|
43
|
-
`,$=
|
|
43
|
+
`,$=s.default(d.Box)`
|
|
44
44
|
svg path {
|
|
45
45
|
fill: ${({theme:r})=>r.colors.neutral500};
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,m=({children:r,footer:e,label:t,labelAction:a,error:i})=>{const c=n.Children.toArray(r).map(u=>n.cloneElement(u,{hasErrorMessage:!1}));return o.jsxs(y.KeyboardNavigable,{attributeName:"data-strapi-accordion-toggle",children:[t&&o.jsxs(x.Flex,{paddingBottom:1,children:[o.jsx(l.Typography,{variant:"pi",as:"label",textColor:"neutral800",fontWeight:"bold",children:t}),a&&o.jsx($,{paddingLeft:1,children:a})]}),o.jsx(j,{footer:e,children:c}),e&&o.jsx(h,{children:e}),i&&o.jsx(d.Box,{paddingTop:1,children:o.jsx(l.Typography,{variant:"pi",textColor:"danger600",children:i})})]})};exports.AccordionGroup=m;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import t from "styled-components";
|
|
4
4
|
import { Box as e } from "../Box/Box.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
5
|
+
import { Flex as b } from "../Flex/Flex.js";
|
|
6
|
+
import { KeyboardNavigable as m } from "../KeyboardNavigable/KeyboardNavigable.js";
|
|
7
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
8
|
+
const $ = t(e)`
|
|
9
9
|
border-bottom: 1px solid ${({
|
|
10
10
|
theme: r
|
|
11
11
|
}) => r.colors.neutral200};
|
|
@@ -20,7 +20,7 @@ const h = t(e)`
|
|
|
20
20
|
}) => r.borderRadius} ${({
|
|
21
21
|
theme: r
|
|
22
22
|
}) => r.borderRadius};
|
|
23
|
-
`,
|
|
23
|
+
`, h = t(e)`
|
|
24
24
|
& > * {
|
|
25
25
|
& > * {
|
|
26
26
|
border-radius: unset;
|
|
@@ -80,44 +80,44 @@ const h = t(e)`
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
`}
|
|
83
|
-
`,
|
|
83
|
+
`, x = t(e)`
|
|
84
84
|
svg path {
|
|
85
85
|
fill: ${({
|
|
86
86
|
theme: r
|
|
87
87
|
}) => r.colors.neutral500};
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`, C = ({
|
|
90
90
|
children: r,
|
|
91
91
|
footer: d,
|
|
92
92
|
label: i,
|
|
93
93
|
labelAction: a,
|
|
94
94
|
error: s
|
|
95
95
|
}) => {
|
|
96
|
-
const
|
|
96
|
+
const c = n.Children.toArray(r).map((u) => n.cloneElement(u, {
|
|
97
97
|
hasErrorMessage: !1
|
|
98
98
|
}));
|
|
99
|
-
return l(
|
|
99
|
+
return l(m, {
|
|
100
100
|
attributeName: "data-strapi-accordion-toggle",
|
|
101
|
-
children: [i && l(
|
|
101
|
+
children: [i && l(b, {
|
|
102
102
|
paddingBottom: 1,
|
|
103
|
-
children: [o(
|
|
103
|
+
children: [o(p, {
|
|
104
104
|
variant: "pi",
|
|
105
105
|
as: "label",
|
|
106
106
|
textColor: "neutral800",
|
|
107
107
|
fontWeight: "bold",
|
|
108
108
|
children: i
|
|
109
|
-
}), a && o(
|
|
109
|
+
}), a && o(x, {
|
|
110
110
|
paddingLeft: 1,
|
|
111
111
|
children: a
|
|
112
112
|
})]
|
|
113
|
-
}), o(
|
|
113
|
+
}), o(h, {
|
|
114
114
|
footer: d,
|
|
115
|
-
children:
|
|
116
|
-
}), d && o(
|
|
115
|
+
children: c
|
|
116
|
+
}), d && o($, {
|
|
117
117
|
children: d
|
|
118
118
|
}), s && o(e, {
|
|
119
119
|
paddingTop: 1,
|
|
120
|
-
children: o(
|
|
120
|
+
children: o(p, {
|
|
121
121
|
variant: "pi",
|
|
122
122
|
textColor: "danger600",
|
|
123
123
|
children: s
|
|
@@ -126,5 +126,5 @@ const h = t(e)`
|
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
128
|
export {
|
|
129
|
-
|
|
129
|
+
C as AccordionGroup
|
|
130
130
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),v=require("@strapi/icons"),B=require("styled-components"),z=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),v=require("@strapi/icons"),B=require("styled-components"),z=require("./Accordion.cjs"),F=require("./AccordionContext.cjs"),I=require("./utils.cjs"),j=require("../Flex/Flex.cjs"),M=require("../Icon/Icon.cjs"),y=require("../Stack/Stack.cjs"),R=require("../TextButton/TextButton.cjs"),_=require("../Typography/Typography.cjs"),D=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},m=D(B),W=m.default(R.TextButton)`
|
|
2
2
|
text-align: left;
|
|
3
3
|
|
|
4
4
|
// necessary to make the ellipsis prop work on the title
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
`,P=({title:e,description:r,as:b="span",togglePosition:s="right",action:l,...T})=>{const{onToggle:c,toggle:u,expanded:t,id:d,size:n,variant:$,disabled:i}=
|
|
28
|
+
`,P=({title:e,description:r,as:b="span",togglePosition:s="right",action:l,...T})=>{const{onToggle:c,toggle:u,expanded:t,id:d,size:n,variant:$,disabled:i}=F.useAccordion(),k=`accordion-content-${d}`,p=`accordion-label-${d}`,w=`accordion-desc-${d}`,a=n==="M"?6:4,g=n==="M"?a:a-2,C=I.getBackground({expanded:t,disabled:i,variant:$}),q={as:b,fontWeight:n==="S"?"bold":void 0,id:p,textColor:t?"primary600":"neutral700",ellipsis:!0,variant:n==="M"?"delta":void 0},S=t?"primary600":"neutral600",A=t?"primary200":"neutral200",h=n==="M"?`${32/16}rem`:`${24/16}rem`,x=()=>{i||(u&&!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'),u()):c&&c())},f=o.jsx(j.Flex,{justifyContent:"center",borderRadius:"50%",height:h,width:h,transform:t?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:A,cursor:i?"not-allowed":"pointer",onClick:x,shrink:0,children:o.jsx(M.Icon,{as:v.CarretDown,width:n==="M"?`${11/16}rem`:`${8/16}rem`,color:t?"primary600":"neutral600"})});return o.jsx(L,{paddingBottom:g,paddingLeft:a,paddingRight:a,paddingTop:g,background:C,expanded:t,size:n,justifyContent:"space-between",cursor:i?"not-allowed":"",children:o.jsxs(y.Stack,{horizontal:!0,spacing:3,flex:1,maxWidth:"100%",children:[s==="left"&&f,o.jsx(W,{onClick:x,"aria-disabled":i,"aria-expanded":t,"aria-controls":k,"aria-labelledby":p,"data-strapi-accordion-toggle":!0,expanded:t,type:"button",flex:1,minWidth:0,...T,children:o.jsxs(o.Fragment,{children:[o.jsx(z.AccordionTypography,{...q,children:e}),r&&o.jsx(_.Typography,{as:"p",id:w,textColor:S,children:r})]})}),s==="right"&&o.jsxs(y.Stack,{horizontal:!0,spacing:3,children:[f,l]}),s==="left"&&l]})})};exports.AccordionToggle=P;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as i, jsxs as c, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import { CarretDown as A } from "@strapi/icons";
|
|
3
3
|
import y from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { AccordionTypography as I } from "./Accordion.js";
|
|
5
|
+
import { useAccordion as S } from "./AccordionContext.js";
|
|
6
|
+
import { getBackground as W } from "./utils.js";
|
|
6
7
|
import { Flex as $ } from "../Flex/Flex.js";
|
|
8
|
+
import { Icon as D } from "../Icon/Icon.js";
|
|
7
9
|
import { Stack as b } from "../Stack/Stack.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { getBackground as L } from "./utils.js";
|
|
12
|
-
const P = y(I)`
|
|
10
|
+
import { TextButton as F } from "../TextButton/TextButton.js";
|
|
11
|
+
import { Typography as L } from "../Typography/Typography.js";
|
|
12
|
+
const P = y(F)`
|
|
13
13
|
text-align: left;
|
|
14
14
|
|
|
15
15
|
// necessary to make the ellipsis prop work on the title
|
|
@@ -63,7 +63,7 @@ const P = y(I)`
|
|
|
63
63
|
size: t,
|
|
64
64
|
variant: k,
|
|
65
65
|
disabled: n
|
|
66
|
-
} =
|
|
66
|
+
} = S(), T = `accordion-content-${s}`, m = `accordion-label-${s}`, z = `accordion-desc-${s}`, a = t === "M" ? 6 : 4, h = t === "M" ? a : a - 2, v = W({
|
|
67
67
|
expanded: r,
|
|
68
68
|
disabled: n,
|
|
69
69
|
variant: k
|
|
@@ -89,7 +89,7 @@ const P = y(I)`
|
|
|
89
89
|
cursor: n ? "not-allowed" : "pointer",
|
|
90
90
|
onClick: f,
|
|
91
91
|
shrink: 0,
|
|
92
|
-
children: i(
|
|
92
|
+
children: i(D, {
|
|
93
93
|
as: A,
|
|
94
94
|
width: t === "M" ? `${11 / 16}rem` : `${8 / 16}rem`,
|
|
95
95
|
color: r ? "primary600" : "neutral600"
|
|
@@ -123,10 +123,10 @@ const P = y(I)`
|
|
|
123
123
|
minWidth: 0,
|
|
124
124
|
...C,
|
|
125
125
|
children: c(R, {
|
|
126
|
-
children: [i(
|
|
126
|
+
children: [i(I, {
|
|
127
127
|
...j,
|
|
128
128
|
children: o
|
|
129
|
-
}), e && i(
|
|
129
|
+
}), e && i(L, {
|
|
130
130
|
as: "p",
|
|
131
131
|
id: z,
|
|
132
132
|
textColor: B,
|
package/dist/Alert/Alert.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("@strapi/icons"),h=require("styled-components"),s=require("./utils.cjs"),o=require("../Box/Box.cjs"),g=require("../Flex/Flex.cjs"),f=require("../themes/utils.cjs"),i=require("../Typography/Typography.cjs"),j=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},l=j(h),y=l.default(o.Box)`
|
|
2
2
|
flex: 1;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
display: flex;
|
package/dist/Alert/Alert.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import d from "styled-components";
|
|
3
2
|
import { Cross as f, CheckCircle as m, ExclamationMarkCircle as u, Information as x } from "@strapi/icons";
|
|
3
|
+
import d from "styled-components";
|
|
4
|
+
import { handleBorderColor as C, handleBackgroundColor as $, handleIconColor as l } from "./utils.js";
|
|
4
5
|
import { Box as t } from "../Box/Box.js";
|
|
6
|
+
import { Flex as b } from "../Flex/Flex.js";
|
|
7
|
+
import { buttonFocusStyle as B } from "../themes/utils.js";
|
|
5
8
|
import { Typography as s } from "../Typography/Typography.js";
|
|
6
|
-
import { Flex as C } from "../Flex/Flex.js";
|
|
7
|
-
import { buttonFocusStyle as $ } from "../themes/utils.js";
|
|
8
|
-
import { handleBorderColor as b, handleBackgroundColor as B, handleIconColor as l } from "./utils.js";
|
|
9
9
|
const w = d(t)`
|
|
10
10
|
flex: 1;
|
|
11
11
|
flex-wrap: wrap;
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: row;
|
|
14
14
|
`, k = d(t)`
|
|
15
|
-
border: 1px solid ${
|
|
16
|
-
background: ${
|
|
15
|
+
border: 1px solid ${C};
|
|
16
|
+
background: ${$};
|
|
17
17
|
box-shadow: ${({
|
|
18
18
|
theme: o
|
|
19
19
|
}) => o.shadows.filterShadow};
|
|
@@ -29,7 +29,7 @@ const w = d(t)`
|
|
|
29
29
|
margin-top: ${({
|
|
30
30
|
theme: o
|
|
31
31
|
}) => o.spaces[1]};
|
|
32
|
-
${
|
|
32
|
+
${B};
|
|
33
33
|
`, A = d(t)`
|
|
34
34
|
font-size: ${20 / 16}rem;
|
|
35
35
|
svg path {
|
|
@@ -71,7 +71,7 @@ const w = d(t)`
|
|
|
71
71
|
paddingTop: 5,
|
|
72
72
|
variant: n,
|
|
73
73
|
...g,
|
|
74
|
-
children: a(
|
|
74
|
+
children: a(b, {
|
|
75
75
|
alignItems: "flex-start",
|
|
76
76
|
children: [r(A, {
|
|
77
77
|
paddingRight: 3,
|
package/dist/Avatar/Avatar.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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 i=require("react/jsx-runtime"),u=require("react"),d=require("styled-components"),t=require("./constants.cjs"),l=require("../Box/Box.cjs"),p=require("../Flex/Flex.cjs"),x=require("../Typography/Typography.cjs"),f=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function g(e){if(e&&e.__esModule)return e;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const h=g(u),n=f(d),v=n.default.img`
|
|
2
2
|
border-radius: 50%;
|
|
3
3
|
object-fit: cover;
|
|
4
4
|
display: block;
|
|
5
5
|
position: relative;
|
|
6
|
-
`,
|
|
6
|
+
`,b=n.default.img`
|
|
7
7
|
border-radius: 50%;
|
|
8
8
|
object-fit: cover;
|
|
9
9
|
position: absolute;
|
|
10
10
|
transform: translate(-${(t.previewSize-t.avatarSize)/2}px, -100%);
|
|
11
11
|
margin-top: -${({theme:e})=>e.spaces[1]};
|
|
12
|
-
`,
|
|
12
|
+
`,y=n.default(l.Box)`
|
|
13
13
|
opacity: 0.4;
|
|
14
|
-
`,
|
|
14
|
+
`,j=({src:e,alt:a,preview:r})=>{const[o,c]=h.useState(!1),s=Boolean(r&&o);return i.jsxs("span",{children:[s?i.jsx(b,{"aria-hidden":!0,alt:"",width:`${t.previewSize}px`,height:`${t.previewSize}px`,src:r===!0?e:typeof r=="string"?r:""}):null,i.jsxs(l.Box,{zIndex:s?1:void 0,position:"relative",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,children:[s?i.jsx(y,{background:"neutral0",borderRadius:"50%",position:"absolute",width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,zIndex:1}):null,i.jsx(v,{src:e,alt:a,width:`${t.avatarSize}px`,height:`${t.avatarSize}px`})]})]})},S=n.default(p.Flex)`
|
|
15
15
|
span {
|
|
16
16
|
line-height: 0;
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,z=({children:e,background:a="primary600",textColor:r="buttonNeutral0"})=>i.jsx(S,{background:a,borderRadius:"50%",width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,justifyContent:"center",children:i.jsx(x.Typography,{fontSize:0,fontWeight:"bold",textColor:r,textTransform:"uppercase",children:e})});exports.Avatar=j;exports.Initials=z;
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as h from "react";
|
|
3
3
|
import o from "styled-components";
|
|
4
|
-
import { Typography as u } from "../Typography/Typography.js";
|
|
5
|
-
import { Flex as m } from "../Flex/Flex.js";
|
|
6
|
-
import { Box as d } from "../Box/Box.js";
|
|
7
4
|
import { previewSize as s, avatarSize as t } from "./constants.js";
|
|
5
|
+
import { Box as d } from "../Box/Box.js";
|
|
6
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
7
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
8
8
|
const x = o.img`
|
|
9
9
|
border-radius: 50%;
|
|
10
10
|
object-fit: cover;
|
|
@@ -20,12 +20,12 @@ const x = o.img`
|
|
|
20
20
|
}) => e.spaces[1]};
|
|
21
21
|
`, g = o(d)`
|
|
22
22
|
opacity: 0.4;
|
|
23
|
-
`,
|
|
23
|
+
`, I = ({
|
|
24
24
|
src: e,
|
|
25
25
|
alt: n,
|
|
26
26
|
preview: r
|
|
27
27
|
}) => {
|
|
28
|
-
const [c, p] = h(!1), a = Boolean(r && c);
|
|
28
|
+
const [c, p] = h.useState(!1), a = Boolean(r && c);
|
|
29
29
|
return l("span", {
|
|
30
30
|
children: [a ? i(f, {
|
|
31
31
|
"aria-hidden": !0,
|
|
@@ -55,11 +55,11 @@ const x = o.img`
|
|
|
55
55
|
})]
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
|
-
}, b = o(
|
|
58
|
+
}, b = o(u)`
|
|
59
59
|
span {
|
|
60
60
|
line-height: 0;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`, S = ({
|
|
63
63
|
children: e,
|
|
64
64
|
background: n = "primary600",
|
|
65
65
|
textColor: r = "buttonNeutral0"
|
|
@@ -69,7 +69,7 @@ const x = o.img`
|
|
|
69
69
|
width: `${t}px`,
|
|
70
70
|
height: `${t}px`,
|
|
71
71
|
justifyContent: "center",
|
|
72
|
-
children: i(
|
|
72
|
+
children: i(m, {
|
|
73
73
|
fontSize: 0,
|
|
74
74
|
fontWeight: "bold",
|
|
75
75
|
textColor: r,
|
|
@@ -78,6 +78,6 @@ const x = o.img`
|
|
|
78
78
|
})
|
|
79
79
|
});
|
|
80
80
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
I as Avatar,
|
|
82
|
+
S as Initials
|
|
83
83
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("styled-components"),o=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("styled-components"),o=require("./constants.cjs"),s=require("../Flex/Flex.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},l=a(t),r=l.default(s.Flex)`
|
|
2
2
|
& > * + * {
|
|
3
|
-
margin-left: -${
|
|
3
|
+
margin-left: -${o.avatarSize/2}px;
|
|
4
4
|
}
|
|
5
5
|
`;exports.AvatarGroup=r;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const e = r(
|
|
2
|
+
import { avatarSize as o } from "./constants.js";
|
|
3
|
+
import { Flex as t } from "../Flex/Flex.js";
|
|
4
|
+
const e = r(t)`
|
|
5
5
|
& > * + * {
|
|
6
|
-
margin-left: -${
|
|
6
|
+
margin-left: -${o / 2}px;
|
|
7
7
|
}
|
|
8
8
|
`;
|
|
9
9
|
export {
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("react"),
|
|
2
|
-
display: flex;
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
padding: ${({theme:e})=>e.spaces[2]};
|
|
5
|
-
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
|
-
background: ${({theme:e})=>e.colors.neutral0};
|
|
7
|
-
border: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("react"),c=require("styled-components"),i=require("../Flex/Flex.cjs"),d=require("../themes/utils.cjs"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},p=t(l),f=t(c),s=f.default(i.Flex)`
|
|
8
2
|
svg {
|
|
9
3
|
height: ${({theme:e})=>e.spaces[3]};
|
|
10
4
|
width: ${({theme:e})=>e.spaces[3]};
|
|
11
|
-
|
|
12
|
-
svg {
|
|
5
|
+
|
|
13
6
|
> g,
|
|
14
7
|
path {
|
|
15
8
|
fill: ${({theme:e})=>e.colors.neutral0};
|
|
16
9
|
}
|
|
17
10
|
}
|
|
11
|
+
|
|
18
12
|
&[aria-disabled='true'] {
|
|
19
13
|
pointer-events: none;
|
|
20
14
|
}
|
|
21
15
|
|
|
22
|
-
${
|
|
23
|
-
`,r=
|
|
16
|
+
${d.buttonFocusStyle}
|
|
17
|
+
`,r=p.default.forwardRef(({disabled:e,children:a,...o},u)=>n.jsx(s,{ref:u,"aria-disabled":e,as:"button",type:"button",disabled:e,padding:2,hasRadius:!0,background:"neutral0",borderColor:"neutral200",cursor:"pointer",...o,children:a}));r.displayName="BaseButton";exports.BaseButton=r;exports.BaseButtonWrapper=s;
|