@strapi/design-system 1.4.0-beta.0 → 1.4.0-beta.2
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 +8 -8
- package/dist/Accordion/Accordion.js +11 -12
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +37 -17
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +96 -75
- package/dist/Alert/Alert.cjs +12 -12
- package/dist/Alert/Alert.js +102 -83
- package/dist/Badge/Badge.cjs +4 -1
- package/dist/Badge/Badge.js +56 -26
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +42 -20
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +56 -36
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +43 -21
- package/dist/BaseRadio/BaseRadio.cjs +8 -8
- package/dist/BaseRadio/BaseRadio.js +51 -31
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +44 -24
- package/dist/Box/BoxProps.cjs +1 -1
- package/dist/Box/BoxProps.js +19 -10
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +50 -29
- package/dist/Button/Button.cjs +14 -14
- package/dist/Button/Button.js +73 -53
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +37 -17
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +42 -19
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +18 -9
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +19 -8
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +22 -12
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +32 -11
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +19 -9
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +42 -20
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +27 -16
- package/dist/CarouselInput/Carousel.cjs +6 -6
- package/dist/CarouselInput/Carousel.js +107 -77
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +17 -7
- package/dist/CarouselInput/CarouselImage.cjs +3 -3
- package/dist/CarouselInput/CarouselImage.js +38 -26
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +84 -49
- package/dist/CarouselInput/CarouselSlide.cjs +2 -2
- package/dist/CarouselInput/CarouselSlide.js +42 -20
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +63 -44
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +262 -194
- package/dist/Combobox/ComboboxList.cjs +1 -1
- package/dist/Combobox/ComboboxList.js +5 -5
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +47 -25
- package/dist/Combobox/components.cjs +2 -2
- package/dist/Combobox/components.js +1 -1
- package/dist/Combobox/utils.cjs +1 -1
- package/dist/Combobox/utils.js +21 -21
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +110 -80
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +18 -13
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +42 -23
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +44 -23
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +7 -6
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +124 -89
- package/dist/DateTimePicker/DateTimePickerProps.cjs +1 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +19 -10
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +58 -39
- package/dist/Dialog/DialogBody.cjs +2 -2
- package/dist/Dialog/DialogBody.js +14 -11
- package/dist/DismissibleLayer/DismissibleLayer.cjs +1 -1
- package/dist/DismissibleLayer/DismissibleLayer.js +22 -27
- package/dist/Divider/Divider.cjs +2 -2
- package/dist/Divider/Divider.js +38 -15
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +38 -19
- package/dist/Field/FieldAction.cjs +2 -2
- package/dist/Field/FieldAction.js +35 -13
- package/dist/Field/FieldInput.cjs +6 -6
- package/dist/Field/FieldInput.js +67 -47
- package/dist/Field/FieldLabel.cjs +3 -3
- package/dist/Field/FieldLabel.js +45 -25
- package/dist/Flex/FlexProps.cjs +1 -1
- package/dist/Flex/FlexProps.js +20 -10
- package/dist/FocusTrap/ExampleComponent.cjs +1 -1
- package/dist/FocusTrap/ExampleComponent.js +3 -2
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +56 -35
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +42 -20
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +41 -22
- package/dist/Icon/Icon.cjs +2 -2
- package/dist/Icon/Icon.js +27 -17
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +68 -49
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +58 -38
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +96 -78
- package/dist/Link/Link.cjs +6 -6
- package/dist/Link/Link.js +59 -37
- package/dist/LinkButton/LinkButton.cjs +10 -10
- package/dist/LinkButton/LinkButton.js +71 -49
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +47 -25
- package/dist/Main/Main.cjs +2 -2
- package/dist/Main/Main.js +35 -15
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +39 -17
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +40 -20
- package/dist/MainNav/NavLink.cjs +9 -9
- package/dist/MainNav/NavLink.js +72 -53
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +67 -46
- package/dist/MainNav/NavSections.cjs +1 -1
- package/dist/MainNav/NavSections.js +40 -18
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +51 -31
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +19 -9
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +52 -30
- package/dist/NumberInput/NumberInput.cjs +6 -6
- package/dist/NumberInput/NumberInput.js +149 -117
- package/dist/Pagination/components.cjs +7 -7
- package/dist/Pagination/components.js +88 -65
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +93 -66
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +12 -11
- package/dist/ProgressBar/ProgressBar.cjs +2 -2
- package/dist/ProgressBar/ProgressBar.js +49 -27
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +40 -19
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +97 -62
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +67 -46
- package/dist/RawTable/RawTableContext.cjs +1 -1
- package/dist/RawTable/RawTableContext.js +1 -1
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +30 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +29 -10
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +34 -14
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +16 -5
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +65 -45
- package/dist/Select/MultiSelectNested.cjs +1 -1
- package/dist/Select/MultiSelectNested.js +45 -23
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +35 -15
- package/dist/Select/Option.cjs +7 -7
- package/dist/Select/Option.js +57 -37
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +187 -148
- package/dist/Select/SelectButton.cjs +2 -2
- package/dist/Select/SelectButton.js +53 -33
- package/dist/SimpleMenu/SimpleMenu.cjs +7 -7
- package/dist/SimpleMenu/SimpleMenu.js +143 -102
- package/dist/Stack/Stack.cjs +3 -3
- package/dist/Stack/Stack.js +50 -29
- package/dist/Status/Status.cjs +4 -4
- package/dist/Status/Status.js +50 -30
- package/dist/SubNav/SubNav.cjs +3 -3
- package/dist/SubNav/SubNav.js +37 -15
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +44 -43
- package/dist/SubNav/SubNavLink.cjs +6 -6
- package/dist/SubNav/SubNavLink.js +61 -40
- package/dist/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/SubNav/SubNavLinkSection.js +8 -7
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +11 -10
- package/dist/SubNav/SubNavSectionLabel.cjs +1 -1
- package/dist/SubNav/SubNavSectionLabel.js +1 -1
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +39 -17
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +57 -35
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +40 -20
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +50 -28
- package/dist/Table/Table.cjs +5 -5
- package/dist/Table/Table.js +59 -36
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +17 -8
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +17 -8
- package/dist/Table/Tr.cjs +2 -2
- package/dist/Table/Tr.js +17 -8
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +46 -27
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +43 -24
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +112 -94
- package/dist/Tabs/useTabsFocus.cjs +1 -1
- package/dist/Tabs/useTabsFocus.js +12 -11
- package/dist/Tag/Tag.cjs +4 -4
- package/dist/Tag/Tag.js +50 -27
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +59 -39
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +69 -49
- package/dist/Textarea/Textarea.cjs +3 -3
- package/dist/Textarea/Textarea.js +63 -43
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +49 -29
- package/dist/TimePicker/TimePicker.cjs +3 -3
- package/dist/TimePicker/TimePicker.js +93 -60
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +75 -53
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +98 -66
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +57 -38
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipLayout.js +9 -9
- package/dist/Typography/TypographyProps.cjs +1 -1
- package/dist/Typography/TypographyProps.js +22 -13
- package/dist/helpers/getDefaultLocale.cjs +1 -1
- package/dist/helpers/getDefaultLocale.js +1 -1
- package/dist/helpers/handleResponsiveValues.cjs +5 -5
- package/dist/helpers/handleResponsiveValues.js +14 -14
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +13 -11
- package/dist/helpers/useResizeObserver.cjs +1 -1
- package/dist/helpers/useResizeObserver.js +10 -8
- package/dist/hooks/useControllableState.cjs +1 -0
- package/dist/hooks/useControllableState.js +25 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +285 -284
- package/dist/themes/ColorButton.cjs +2 -2
- package/dist/themes/ColorButton.js +4 -4
- package/dist/themes/darkTheme/index.cjs +1 -1
- package/dist/themes/darkTheme/index.js +18 -8
- package/dist/themes/extendTheme.cjs +5 -5
- package/dist/themes/extendTheme.js +30 -19
- package/dist/themes/lightTheme/index.cjs +1 -1
- package/dist/themes/lightTheme/index.js +18 -8
- package/dist/themes/sizes.cjs +1 -1
- package/dist/themes/sizes.js +4 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +43 -23
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +44 -22
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +35 -14
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +41 -19
- package/dist/v2/Link/Link.cjs +5 -5
- package/dist/v2/Link/Link.js +64 -42
- package/dist/v2/LinkButton/LinkButton.cjs +10 -10
- package/dist/v2/LinkButton/LinkButton.js +77 -53
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +39 -17
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +78 -57
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +40 -20
- package/dist/v2/MainNav/NavLink.cjs +9 -9
- package/dist/v2/MainNav/NavLink.js +77 -56
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +67 -46
- package/dist/v2/MainNav/NavSections.cjs +1 -1
- package/dist/v2/MainNav/NavSections.js +40 -18
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +51 -31
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +89 -65
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +7 -7
- package/dist/v2/SimpleMenu/SimpleMenu.js +155 -120
- package/dist/v2/SubNav/SubNav.cjs +3 -3
- package/dist/v2/SubNav/SubNav.js +37 -15
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +44 -43
- package/dist/v2/SubNav/SubNavLink.cjs +6 -6
- package/dist/v2/SubNav/SubNavLink.js +64 -43
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +8 -8
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +1 -1
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +1 -1
- package/dist/v2/SubNav/SubNavSectionLabel.js +1 -1
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +39 -17
- package/package.json +8 -15
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var $=Object.defineProperty,C=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var q=(e,t,a)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,l=(e,t)=>{for(var a in t||(t={}))k.call(t,a)&&q(e,a,t[a]);if(f)for(var a of f(t))T.call(t,a)&&q(e,a,t[a]);return e},g=(e,t)=>C(e,w(t));var d=(e,t)=>{var a={};for(var r in e)k.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&f)for(var r of f(e))t.indexOf(r)<0&&T.call(e,r)&&(a[r]=e[r]);return a};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("react"),N=require("styled-components"),V=require("prop-types"),j=require("@strapi/icons/ChevronLeft"),D=require("@strapi/icons/ChevronRight"),S=require("react-router-dom"),h=require("../VisuallyHidden/VisuallyHidden.cjs"),v=require("./PaginationContext.cjs"),W=require("../Typography/Typography.cjs"),A=require("../themes/utils.cjs"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},n=c(H),p=c(N),u=c(V),F=c(j),I=c(D),_=p.default(W.Typography)`
|
|
2
2
|
line-height: revert;
|
|
3
|
-
`,
|
|
3
|
+
`,M={active:!0},m=p.default(S.NavLink).withConfig({shouldForwardProp:(e,t)=>!M[e]&&t(e)})`
|
|
4
4
|
padding: ${({theme:e})=>e.spaces[3]};
|
|
5
5
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
6
|
box-shadow: ${({active:e,theme:t})=>e?t.shadows.filterShadow:void 0};
|
|
7
7
|
text-decoration: none;
|
|
8
8
|
display: flex;
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
`,
|
|
10
|
+
${A.buttonFocusStyle}
|
|
11
|
+
`,z=p.default(m)`
|
|
12
12
|
color: ${({theme:e,active:t})=>t?e.colors.primary700:e.colors.neutral800};
|
|
13
13
|
background: ${({theme:e,active:t})=>t?e.colors.neutral0:void 0};
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,x=p.default(m)`
|
|
19
19
|
font-size: 0.7rem;
|
|
20
20
|
svg path {
|
|
21
21
|
fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
${e=>e["aria-disabled"]?`
|
|
32
32
|
pointer-events: none;
|
|
33
33
|
`:void 0}
|
|
34
|
-
`,
|
|
34
|
+
`,O=p.default(m)`
|
|
35
35
|
color: ${({theme:e})=>e.colors.neutral800};
|
|
36
|
-
`,
|
|
36
|
+
`,P=r=>{var o=r,{children:e,to:t}=o,a=d(o,["children","to"]);const{activePage:s}=v.usePagination(),i=s===1;return n.default.createElement(x,l({to:i?"#":t,"aria-disabled":i,tabIndex:i?-1:void 0},a),n.default.createElement(h.VisuallyHidden,null,e),n.default.createElement(F.default,{"aria-hidden":!0}))};P.displayName="PreviousLink";const b=r=>{var o=r,{children:e,to:t}=o,a=d(o,["children","to"]);const{activePage:s,pageCount:i}=v.usePagination(),y=s===i;return n.default.createElement(x,l({to:y?"#":t,"aria-disabled":y,tabIndex:y?-1:void 0},a),n.default.createElement(h.VisuallyHidden,null,e),n.default.createElement(I.default,{"aria-hidden":!0}))};b.displayName="NextLink";const L=r=>{var o=r,{number:e,children:t}=o,a=d(o,["number","children"]);const{activePage:s}=v.usePagination(),i=s===e;return n.default.createElement(z,g(l({},a),{active:i}),n.default.createElement(h.VisuallyHidden,null,t),n.default.createElement(_,{"aria-hidden":!0,variant:"pi",fontWeight:i?"bold":null},e))};L.displayName="PageLink";const E=a=>{var r=a,{children:e}=r,t=d(r,["children"]);return n.default.createElement(O,g(l({},t),{as:"div"}),n.default.createElement(h.VisuallyHidden,null,e),n.default.createElement(_,{"aria-hidden":!0,variant:"pi"},"\u2026"))};L.propTypes={children:u.default.node.isRequired,number:u.default.number.isRequired};const R={children:u.default.node.isRequired,to:u.default.string.isRequired};b.propTypes=R;P.propTypes=R;E.propTypes={children:u.default.node.isRequired};exports.Dots=E;exports.NextLink=b;exports.PageLink=L;exports.PreviousLink=P;
|
|
@@ -1,19 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var R = Object.defineProperty, T = Object.defineProperties;
|
|
2
|
+
var N = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var b = (e, r, t) => r in e ? R(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, l = (e, r) => {
|
|
6
|
+
for (var t in r || (r = {}))
|
|
7
|
+
y.call(r, t) && b(e, t, r[t]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var t of m(r))
|
|
10
|
+
P.call(r, t) && b(e, t, r[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, v = (e, r) => T(e, N(r));
|
|
13
|
+
var d = (e, r) => {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var o in e)
|
|
16
|
+
y.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
17
|
+
if (e != null && m)
|
|
18
|
+
for (var o of m(e))
|
|
19
|
+
r.indexOf(o) < 0 && P.call(e, o) && (t[o] = e[o]);
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import i from "react";
|
|
23
|
+
import p from "styled-components";
|
|
24
|
+
import c from "prop-types";
|
|
25
|
+
import q from "@strapi/icons/ChevronLeft";
|
|
26
|
+
import W from "@strapi/icons/ChevronRight";
|
|
27
|
+
import { NavLink as C } from "react-router-dom";
|
|
28
|
+
import { VisuallyHidden as u } from "../VisuallyHidden/VisuallyHidden.js";
|
|
29
|
+
import { usePagination as f } from "./PaginationContext.js";
|
|
30
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
31
|
+
import { buttonFocusStyle as A } from "../themes/utils.js";
|
|
32
|
+
const E = p(S)`
|
|
12
33
|
line-height: revert;
|
|
13
|
-
`,
|
|
34
|
+
`, D = {
|
|
14
35
|
active: !0
|
|
15
|
-
},
|
|
16
|
-
shouldForwardProp: (e, r) => !
|
|
36
|
+
}, g = p(C).withConfig({
|
|
37
|
+
shouldForwardProp: (e, r) => !D[e] && r(e)
|
|
17
38
|
})`
|
|
18
39
|
padding: ${({ theme: e }) => e.spaces[3]};
|
|
19
40
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
@@ -21,15 +42,15 @@ const m = s(E)`
|
|
|
21
42
|
text-decoration: none;
|
|
22
43
|
display: flex;
|
|
23
44
|
|
|
24
|
-
${
|
|
25
|
-
`,
|
|
45
|
+
${A}
|
|
46
|
+
`, F = p(g)`
|
|
26
47
|
color: ${({ theme: e, active: r }) => r ? e.colors.primary700 : e.colors.neutral800};
|
|
27
48
|
background: ${({ theme: e, active: r }) => r ? e.colors.neutral0 : void 0};
|
|
28
49
|
|
|
29
50
|
&:hover {
|
|
30
51
|
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
31
52
|
}
|
|
32
|
-
`,
|
|
53
|
+
`, k = p(g)`
|
|
33
54
|
font-size: 0.7rem;
|
|
34
55
|
svg path {
|
|
35
56
|
fill: ${(e) => e["aria-disabled"] ? e.theme.colors.neutral300 : e.theme.colors.neutral600};
|
|
@@ -45,67 +66,69 @@ const m = s(E)`
|
|
|
45
66
|
${(e) => e["aria-disabled"] ? `
|
|
46
67
|
pointer-events: none;
|
|
47
68
|
` : void 0}
|
|
48
|
-
`,
|
|
69
|
+
`, I = p(g)`
|
|
49
70
|
color: ${({ theme: e }) => e.colors.neutral800};
|
|
50
|
-
`,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, /* @__PURE__ */
|
|
71
|
+
`, L = (o) => {
|
|
72
|
+
var a = o, { children: e, to: r } = a, t = d(a, ["children", "to"]);
|
|
73
|
+
const { activePage: s } = f(), n = s === 1;
|
|
74
|
+
return /* @__PURE__ */ i.createElement(k, l({
|
|
75
|
+
to: n ? "#" : r,
|
|
76
|
+
"aria-disabled": n,
|
|
77
|
+
tabIndex: n ? -1 : void 0
|
|
78
|
+
}, t), /* @__PURE__ */ i.createElement(u, null, e), /* @__PURE__ */ i.createElement(q, {
|
|
58
79
|
"aria-hidden": !0
|
|
59
80
|
}));
|
|
60
81
|
};
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, /* @__PURE__ */
|
|
82
|
+
L.displayName = "PreviousLink";
|
|
83
|
+
const $ = (o) => {
|
|
84
|
+
var a = o, { children: e, to: r } = a, t = d(a, ["children", "to"]);
|
|
85
|
+
const { activePage: s, pageCount: n } = f(), h = s === n;
|
|
86
|
+
return /* @__PURE__ */ i.createElement(k, l({
|
|
87
|
+
to: h ? "#" : r,
|
|
88
|
+
"aria-disabled": h,
|
|
89
|
+
tabIndex: h ? -1 : void 0
|
|
90
|
+
}, t), /* @__PURE__ */ i.createElement(u, null, e), /* @__PURE__ */ i.createElement(W, {
|
|
70
91
|
"aria-hidden": !0
|
|
71
92
|
}));
|
|
72
93
|
};
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
active:
|
|
79
|
-
}, /* @__PURE__ */
|
|
94
|
+
$.displayName = "NextLink";
|
|
95
|
+
const x = (o) => {
|
|
96
|
+
var a = o, { number: e, children: r } = a, t = d(a, ["number", "children"]);
|
|
97
|
+
const { activePage: s } = f(), n = s === e;
|
|
98
|
+
return /* @__PURE__ */ i.createElement(F, v(l({}, t), {
|
|
99
|
+
active: n
|
|
100
|
+
}), /* @__PURE__ */ i.createElement(u, null, r), /* @__PURE__ */ i.createElement(E, {
|
|
80
101
|
"aria-hidden": !0,
|
|
81
102
|
variant: "pi",
|
|
82
|
-
fontWeight:
|
|
103
|
+
fontWeight: n ? "bold" : null
|
|
83
104
|
}, e));
|
|
84
105
|
};
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
x.displayName = "PageLink";
|
|
107
|
+
const _ = (t) => {
|
|
108
|
+
var o = t, { children: e } = o, r = d(o, ["children"]);
|
|
109
|
+
return /* @__PURE__ */ i.createElement(I, v(l({}, r), {
|
|
110
|
+
as: "div"
|
|
111
|
+
}), /* @__PURE__ */ i.createElement(u, null, e), /* @__PURE__ */ i.createElement(E, {
|
|
112
|
+
"aria-hidden": !0,
|
|
113
|
+
variant: "pi"
|
|
114
|
+
}, "\u2026"));
|
|
115
|
+
};
|
|
116
|
+
x.propTypes = {
|
|
117
|
+
children: c.node.isRequired,
|
|
118
|
+
number: c.number.isRequired
|
|
96
119
|
};
|
|
97
|
-
const
|
|
98
|
-
children:
|
|
99
|
-
to:
|
|
120
|
+
const w = {
|
|
121
|
+
children: c.node.isRequired,
|
|
122
|
+
to: c.string.isRequired
|
|
100
123
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children:
|
|
124
|
+
$.propTypes = w;
|
|
125
|
+
L.propTypes = w;
|
|
126
|
+
_.propTypes = {
|
|
127
|
+
children: c.node.isRequired
|
|
105
128
|
};
|
|
106
129
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
130
|
+
_ as Dots,
|
|
131
|
+
$ as NextLink,
|
|
132
|
+
x as PageLink,
|
|
133
|
+
L as PreviousLink
|
|
111
134
|
};
|
package/dist/Popover/Popover.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var W=Object.defineProperty;var i=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var g=(e,o,t)=>o in e?W(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,u=(e,o)=>{for(var t in o||(o={}))P.call(o,t)&&g(e,t,o[t]);if(i)for(var t of i(o))y.call(o,t)&&g(e,t,o[t]);return e};var v=(e,o)=>{var t={};for(var r in e)P.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&i)for(var r of i(e))o.indexOf(r)<0&&y.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("react"),D=require("prop-types"),z=require("styled-components"),s=require("@floating-ui/react-dom"),d=require("../Box/Box.cjs"),A=require("../Portal/Portal.cjs"),C=require("../helpers/useIntersection.cjs"),x=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function N(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const a=N(L),n=x(D),w=x(z),E=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],I=w.default(d.Box)`
|
|
2
2
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
3
3
|
z-index: 4;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
5
5
|
background: ${({theme:e})=>e.colors.neutral0};
|
|
6
|
-
`,
|
|
6
|
+
`,V=w.default(d.Box)`
|
|
7
7
|
// 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
|
|
8
8
|
max-height: ${3*5}rem;
|
|
9
9
|
overflow-y: auto;
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
24
24
|
margin-right: 10px;
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,f=F=>{var b=F,{source:e,children:o,spacing:t,fullWidth:r,placement:k,onReachEnd:c,intersectionId:l,centered:R}=b,q=v(b,["source","children","spacing","fullWidth","placement","onReachEnd","intersectionId","centered"]);const m=a.useRef(null),[j,S]=a.useState(void 0),{x:T,y:$,reference:h,floating:M,strategy:B}=s.useFloating({strategy:"fixed",placement:R?"bottom":k,middleware:[s.offset({mainAxis:t}),s.shift(),s.flip()],whileElementsMounted:s.autoUpdate});return a.useLayoutEffect(()=>{h(e.current)},[e,h]),a.useLayoutEffect(()=>{r&&S(e.current.offsetWidth)},[r,e]),C.useIntersection(m,c,{selectorToWatch:`#${l}`,skipWhen:!l||!c}),a.createElement(I,{ref:M,style:{left:T,top:$,position:B,width:j||void 0},hasRadius:!0,background:"neutral0",padding:1},a.createElement(V,u({ref:m},q),o,l&&c&&a.createElement(d.Box,{id:l,width:"100%",height:"1px"})))},p=e=>a.createElement(A.Portal,null,a.createElement(f,u({},e))),_={fullWidth:!1,intersectionId:void 0,onReachEnd:void 0,centered:!1,placement:"bottom-start",spacing:0},O={centered:n.default.bool,children:n.default.node.isRequired,fullWidth:n.default.bool,intersectionId:n.default.string,onReachEnd:n.default.func,placement:n.default.oneOf(E),source:n.default.shape({current:(typeof Element=="undefined"?n.default.any:n.default.instanceOf(Element)).isRequired}).isRequired,spacing:n.default.number};f.propTypes=O;f.defaultProps=_;p.propTypes=O;p.defaultProps=_;exports.POPOVER_PLACEMENTS=E;exports.Popover=p;
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var i = Object.getOwnPropertySymbols;
|
|
3
|
+
var b = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var h = (e, o, t) => o in e ? L(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, p = (e, o) => {
|
|
5
|
+
for (var t in o || (o = {}))
|
|
6
|
+
b.call(o, t) && h(e, t, o[t]);
|
|
7
|
+
if (i)
|
|
8
|
+
for (var t of i(o))
|
|
9
|
+
g.call(o, t) && h(e, t, o[t]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
var w = (e, o) => {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var r in e)
|
|
15
|
+
b.call(e, r) && o.indexOf(r) < 0 && (t[r] = e[r]);
|
|
16
|
+
if (e != null && i)
|
|
17
|
+
for (var r of i(e))
|
|
18
|
+
o.indexOf(r) < 0 && g.call(e, r) && (t[r] = e[r]);
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import * as s from "react";
|
|
22
|
+
import n from "prop-types";
|
|
23
|
+
import v from "styled-components";
|
|
24
|
+
import { useFloating as z, offset as A, shift as C, flip as M, autoUpdate as B } from "@floating-ui/react-dom";
|
|
25
|
+
import { Box as d } from "../Box/Box.js";
|
|
26
|
+
import { Portal as D } from "../Portal/Portal.js";
|
|
27
|
+
import { useIntersection as F } from "../helpers/useIntersection.js";
|
|
28
|
+
const N = [
|
|
9
29
|
"top",
|
|
10
30
|
"top-start",
|
|
11
31
|
"top-end",
|
|
@@ -18,12 +38,12 @@ const L = [
|
|
|
18
38
|
"left",
|
|
19
39
|
"left-start",
|
|
20
40
|
"left-end"
|
|
21
|
-
],
|
|
41
|
+
], U = v(d)`
|
|
22
42
|
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
23
43
|
z-index: 4;
|
|
24
44
|
border: 1px solid ${({ theme: e }) => e.colors.neutral150};
|
|
25
45
|
background: ${({ theme: e }) => e.colors.neutral0};
|
|
26
|
-
`,
|
|
46
|
+
`, V = v(d)`
|
|
27
47
|
// 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
|
|
28
48
|
max-height: ${3 * 5}rem;
|
|
29
49
|
overflow-y: auto;
|
|
@@ -43,80 +63,87 @@ const L = [
|
|
|
43
63
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
44
64
|
margin-right: 10px;
|
|
45
65
|
}
|
|
46
|
-
`,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
66
|
+
`, c = (_) => {
|
|
67
|
+
var f = _, {
|
|
68
|
+
source: e,
|
|
69
|
+
children: o,
|
|
70
|
+
spacing: t,
|
|
71
|
+
fullWidth: r,
|
|
72
|
+
placement: P,
|
|
73
|
+
onReachEnd: l,
|
|
74
|
+
intersectionId: a,
|
|
75
|
+
centered: k
|
|
76
|
+
} = f, R = w(f, [
|
|
77
|
+
"source",
|
|
78
|
+
"children",
|
|
79
|
+
"spacing",
|
|
80
|
+
"fullWidth",
|
|
81
|
+
"placement",
|
|
82
|
+
"onReachEnd",
|
|
83
|
+
"intersectionId",
|
|
84
|
+
"centered"
|
|
85
|
+
]);
|
|
86
|
+
const u = s.useRef(null), [$, W] = s.useState(void 0), { x: T, y: O, reference: m, floating: S, strategy: q } = z({
|
|
58
87
|
strategy: "fixed",
|
|
59
|
-
placement:
|
|
88
|
+
placement: k ? "bottom" : P,
|
|
60
89
|
middleware: [
|
|
61
|
-
|
|
62
|
-
mainAxis:
|
|
90
|
+
A({
|
|
91
|
+
mainAxis: t
|
|
63
92
|
}),
|
|
64
|
-
|
|
65
|
-
|
|
93
|
+
C(),
|
|
94
|
+
M()
|
|
66
95
|
],
|
|
67
|
-
whileElementsMounted:
|
|
96
|
+
whileElementsMounted: B
|
|
68
97
|
});
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
}, [e]),
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
selectorToWatch: `#${
|
|
75
|
-
skipWhen: !
|
|
76
|
-
}), /* @__PURE__ */
|
|
77
|
-
ref:
|
|
98
|
+
return s.useLayoutEffect(() => {
|
|
99
|
+
m(e.current);
|
|
100
|
+
}, [e, m]), s.useLayoutEffect(() => {
|
|
101
|
+
r && W(e.current.offsetWidth);
|
|
102
|
+
}, [r, e]), F(u, l, {
|
|
103
|
+
selectorToWatch: `#${a}`,
|
|
104
|
+
skipWhen: !a || !l
|
|
105
|
+
}), /* @__PURE__ */ s.createElement(U, {
|
|
106
|
+
ref: S,
|
|
78
107
|
style: {
|
|
79
|
-
left:
|
|
80
|
-
top:
|
|
81
|
-
position:
|
|
82
|
-
width:
|
|
108
|
+
left: T,
|
|
109
|
+
top: O,
|
|
110
|
+
position: q,
|
|
111
|
+
width: $ || void 0
|
|
83
112
|
},
|
|
84
113
|
hasRadius: !0,
|
|
85
114
|
background: "neutral0",
|
|
86
115
|
padding: 1
|
|
87
|
-
}, /* @__PURE__ */
|
|
88
|
-
ref:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
id: r,
|
|
116
|
+
}, /* @__PURE__ */ s.createElement(V, p({
|
|
117
|
+
ref: u
|
|
118
|
+
}, R), o, a && l && /* @__PURE__ */ s.createElement(d, {
|
|
119
|
+
id: a,
|
|
92
120
|
width: "100%",
|
|
93
121
|
height: "1px"
|
|
94
122
|
})));
|
|
95
|
-
},
|
|
96
|
-
...e
|
|
97
|
-
})), f = {
|
|
123
|
+
}, x = (e) => /* @__PURE__ */ s.createElement(D, null, /* @__PURE__ */ s.createElement(c, p({}, e))), y = {
|
|
98
124
|
fullWidth: !1,
|
|
99
125
|
intersectionId: void 0,
|
|
100
126
|
onReachEnd: void 0,
|
|
101
127
|
centered: !1,
|
|
102
|
-
placement: "bottom-start"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
placement: "bottom-start",
|
|
129
|
+
spacing: 0
|
|
130
|
+
}, E = {
|
|
131
|
+
centered: n.bool,
|
|
132
|
+
children: n.node.isRequired,
|
|
133
|
+
fullWidth: n.bool,
|
|
134
|
+
intersectionId: n.string,
|
|
135
|
+
onReachEnd: n.func,
|
|
136
|
+
placement: n.oneOf(N),
|
|
137
|
+
source: n.shape({
|
|
138
|
+
current: (typeof Element == "undefined" ? n.any : n.instanceOf(Element)).isRequired
|
|
112
139
|
}).isRequired,
|
|
113
|
-
spacing:
|
|
140
|
+
spacing: n.number
|
|
114
141
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
c.propTypes = E;
|
|
143
|
+
c.defaultProps = y;
|
|
144
|
+
x.propTypes = E;
|
|
145
|
+
x.defaultProps = y;
|
|
119
146
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
147
|
+
N as POPOVER_PLACEMENTS,
|
|
148
|
+
x as Popover
|
|
122
149
|
};
|
package/dist/Portal/Portal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),a=require("react-dom"),s=require("prop-types"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=l(s),o=({children:e})=>{const t=r.useRef(null),[n,c]=r.useState(!1);return r.useLayoutEffect(()=>(t.current=document.createElement("div"),t.current.setAttribute("data-react-portal","true"),document.body.appendChild(t.current),c(!0),()=>{var u;(u=t.current)==null||u.remove()}),[]),!n||!t.current?null:a.createPortal(e,t.current)};o.propTypes={children:d.default.node.isRequired};exports.Portal=o;
|
package/dist/Portal/Portal.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useRef as n, useState as c, useLayoutEffect as a } from "react";
|
|
2
|
+
import { createPortal as d } from "react-dom";
|
|
3
|
+
import p from "prop-types";
|
|
4
|
+
const s = ({ children: t }) => {
|
|
5
|
+
const e = n(null), [o, u] = c(!1);
|
|
6
|
+
return a(() => (e.current = document.createElement("div"), e.current.setAttribute("data-react-portal", "true"), document.body.appendChild(e.current), u(!0), () => {
|
|
7
|
+
var r;
|
|
8
|
+
(r = e.current) == null || r.remove();
|
|
9
|
+
}), []), !o || !e.current ? null : d(t, e.current);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
children:
|
|
11
|
+
s.propTypes = {
|
|
12
|
+
children: p.node.isRequired
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
s as Portal
|
|
15
16
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var g=Object.defineProperty;var s=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var d=(e,r,t)=>r in e?g(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,f=(e,r)=>{for(var t in r||(r={}))c.call(r,t)&&d(e,t,r[t]);if(s)for(var t of s(r))p.call(r,t)&&d(e,t,r[t]);return e};var b=(e,r)=>{var t={};for(var o in e)c.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&s)for(var o of s(e))r.indexOf(o)<0&&p.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),x=require("prop-types"),_=require("styled-components"),v=require("../Box/Box.cjs"),u=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},B=u(y),a=u(x),P=u(_),h=P.default(v.Box)`
|
|
2
2
|
&:before {
|
|
3
3
|
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
4
4
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
top: 0;
|
|
9
9
|
width: ${({value:e})=>`${e}%`};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,l=q=>{var i=q,{min:e,max:r,value:t,children:o,size:n}=i,m=b(i,["min","max","value","children","size"]);return B.default.createElement(h,f({background:"neutral600",hasRadius:!0,"aria-label":o,"aria-valuemax":r,"aria-valuemin":e,"aria-valuenow":t,height:n==="S"?1:2,position:"relative",role:"progressbar",value:t,width:n==="S"?"78px":"102px"},m))};l.defaultProps={min:0,max:100,value:0,size:"M"};l.propTypes={children:a.default.node.isRequired,max:a.default.number,min:a.default.number,size:a.default.oneOf(["S","M"]),value:a.default.number};exports.ProgressBar=l;
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var i = Object.getOwnPropertySymbols;
|
|
3
|
+
var m = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var u = (r, o, e) => o in r ? f(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, p = (r, o) => {
|
|
5
|
+
for (var e in o || (o = {}))
|
|
6
|
+
m.call(o, e) && u(r, e, o[e]);
|
|
7
|
+
if (i)
|
|
8
|
+
for (var e of i(o))
|
|
9
|
+
l.call(o, e) && u(r, e, o[e]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
var d = (r, o) => {
|
|
13
|
+
var e = {};
|
|
14
|
+
for (var a in r)
|
|
15
|
+
m.call(r, a) && o.indexOf(a) < 0 && (e[a] = r[a]);
|
|
16
|
+
if (r != null && i)
|
|
17
|
+
for (var a of i(r))
|
|
18
|
+
o.indexOf(a) < 0 && l.call(r, a) && (e[a] = r[a]);
|
|
19
|
+
return e;
|
|
20
|
+
};
|
|
21
|
+
import x from "react";
|
|
22
|
+
import t from "prop-types";
|
|
23
|
+
import g from "styled-components";
|
|
24
|
+
import { Box as h } from "../Box/Box.js";
|
|
25
|
+
const v = g(h)`
|
|
6
26
|
&:before {
|
|
7
27
|
background-color: ${({ theme: r }) => r.colors.neutral0};
|
|
8
28
|
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
@@ -12,33 +32,35 @@ const p = m(l)`
|
|
|
12
32
|
top: 0;
|
|
13
33
|
width: ${({ value: r }) => `${r}%`};
|
|
14
34
|
}
|
|
15
|
-
`,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
`, b = (P) => {
|
|
36
|
+
var n = P, { min: r, max: o, value: e, children: a, size: s } = n, c = d(n, ["min", "max", "value", "children", "size"]);
|
|
37
|
+
return /* @__PURE__ */ x.createElement(v, p({
|
|
38
|
+
background: "neutral600",
|
|
39
|
+
hasRadius: !0,
|
|
40
|
+
"aria-label": a,
|
|
41
|
+
"aria-valuemax": o,
|
|
42
|
+
"aria-valuemin": r,
|
|
43
|
+
"aria-valuenow": e,
|
|
44
|
+
height: s === "S" ? 1 : 2,
|
|
45
|
+
position: "relative",
|
|
46
|
+
role: "progressbar",
|
|
47
|
+
value: e,
|
|
48
|
+
width: s === "S" ? "78px" : "102px"
|
|
49
|
+
}, c));
|
|
50
|
+
};
|
|
51
|
+
b.defaultProps = {
|
|
30
52
|
min: 0,
|
|
31
53
|
max: 100,
|
|
32
54
|
value: 0,
|
|
33
55
|
size: "M"
|
|
34
56
|
};
|
|
35
|
-
|
|
36
|
-
children:
|
|
37
|
-
max:
|
|
38
|
-
min:
|
|
39
|
-
size:
|
|
40
|
-
value:
|
|
57
|
+
b.propTypes = {
|
|
58
|
+
children: t.node.isRequired,
|
|
59
|
+
max: t.number,
|
|
60
|
+
min: t.number,
|
|
61
|
+
size: t.oneOf(["S", "M"]),
|
|
62
|
+
value: t.number
|
|
41
63
|
};
|
|
42
64
|
export {
|
|
43
|
-
|
|
65
|
+
b as ProgressBar
|
|
44
66
|
};
|
package/dist/Radio/Radio.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var f=Object.defineProperty;var r=Object.getOwnPropertySymbols;var n=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var d=(e,t,a)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var a in t||(t={}))n.call(t,a)&&d(e,a,t[a]);if(r)for(var a of r(t))u.call(t,a)&&d(e,a,t[a]);return e};var i=(e,t)=>{var a={};for(var o in e)n.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&r)for(var o of r(e))t.indexOf(o)<0&&u.call(e,o)&&(a[o]=e[o]);return a};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("react"),g=require("prop-types"),T=require("styled-components"),_=require("../BaseRadio/BaseRadio.cjs"),q=require("../Typography/Typography.cjs"),B=require("../Box/Box.cjs"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},s=l(R),p=l(g),x=l(T),m=x.default(q.Typography)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
`,
|
|
4
|
+
`,y=a=>{var o=a,{children:e}=o,t=i(o,["children"]);return s.default.createElement(m,{as:"label",textColor:"neutral800"},s.default.createElement(_.BaseRadio,c({},t)),s.default.createElement(B.Box,{paddingLeft:2},e))};y.propTypes={children:p.default.node.isRequired,value:p.default.any.isRequired};exports.Radio=y;
|