@strapi/design-system 2.0.0-rc.8 → 2.0.0-rc.9
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/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/index.js +65 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1704,11 +1704,14 @@ const IconButtonWrapper = styled(Flex)`
|
|
|
1704
1704
|
}}
|
|
1705
1705
|
${getVariantStyle}
|
|
1706
1706
|
${(props) => props.$variant === "tertiary" ? css`
|
|
1707
|
-
color: ${props.theme.colors.
|
|
1707
|
+
color: ${props.theme.colors.neutral500};
|
|
1708
1708
|
` : ""}
|
|
1709
1709
|
|
|
1710
1710
|
&:hover {
|
|
1711
1711
|
${getHoverStyle}
|
|
1712
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1713
|
+
color: ${props.theme.colors.neutral600};
|
|
1714
|
+
` : ""}
|
|
1712
1715
|
}
|
|
1713
1716
|
|
|
1714
1717
|
&:active {
|
|
@@ -1782,24 +1785,19 @@ const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
|
1782
1785
|
`;
|
|
1783
1786
|
const MenuRoot = DropdownMenu.Root;
|
|
1784
1787
|
const MenuTrigger = React.forwardRef(
|
|
1785
|
-
({ label,
|
|
1788
|
+
({ label, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1786
1789
|
const props = {
|
|
1787
1790
|
...rest,
|
|
1788
1791
|
ref,
|
|
1789
|
-
type: "button"
|
|
1790
|
-
variant: "ghost",
|
|
1791
|
-
paddingTop: size === "S" ? 1 : 2,
|
|
1792
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1793
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1794
|
-
paddingRight: size === "S" ? 3 : 4
|
|
1792
|
+
type: "button"
|
|
1795
1793
|
};
|
|
1796
|
-
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, ...props }) });
|
|
1794
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, variant: "tertiary", ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, variant: "ghost", ...props }) });
|
|
1797
1795
|
}
|
|
1798
1796
|
);
|
|
1799
1797
|
const MenuContent = React.forwardRef(
|
|
1800
1798
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1801
1799
|
const [side, align] = popoverPlacement.split("-");
|
|
1802
|
-
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
1800
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuContent, { align, side, loop: true, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1803
1801
|
Viewport$2,
|
|
1804
1802
|
{
|
|
1805
1803
|
ref,
|
|
@@ -1810,6 +1808,8 @@ const MenuContent = React.forwardRef(
|
|
|
1810
1808
|
shadow: "filterShadow",
|
|
1811
1809
|
maxHeight: "15rem",
|
|
1812
1810
|
padding: 1,
|
|
1811
|
+
marginTop: 1,
|
|
1812
|
+
marginBottom: 1,
|
|
1813
1813
|
alignItems: "flex-start",
|
|
1814
1814
|
position: "relative",
|
|
1815
1815
|
overflow: "auto",
|
|
@@ -1831,6 +1831,23 @@ const Viewport$2 = styled(Flex)`
|
|
|
1831
1831
|
display: none;
|
|
1832
1832
|
}
|
|
1833
1833
|
`;
|
|
1834
|
+
const DropdownMenuContent = styled(DropdownMenu.Content)`
|
|
1835
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1836
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
1837
|
+
|
|
1838
|
+
&[data-state='open'] {
|
|
1839
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
1840
|
+
|
|
1841
|
+
&[data-side='top'] {
|
|
1842
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
&[data-side='bottom'] {
|
|
1846
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
`;
|
|
1834
1851
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1835
1852
|
return /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, onSelect, disabled, children: isLink || props.isExternal ? /* @__PURE__ */ jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) });
|
|
1836
1853
|
};
|
|
@@ -2113,12 +2130,6 @@ const CheckboxRoot = styled(Checkbox.Root)`
|
|
|
2113
2130
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
2114
2131
|
flex: 0 0 2rem;
|
|
2115
2132
|
|
|
2116
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2117
|
-
transition:
|
|
2118
|
-
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
2119
|
-
${(props) => props.theme.transitions.backgroundColor};
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
2133
|
&[data-state='checked'],
|
|
2123
2134
|
&[data-state='indeterminate'] {
|
|
2124
2135
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -8009,10 +8020,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
8009
8020
|
return null;
|
|
8010
8021
|
}
|
|
8011
8022
|
return /* @__PURE__ */ jsxs(
|
|
8012
|
-
|
|
8023
|
+
TypographyLabel,
|
|
8013
8024
|
{
|
|
8014
8025
|
ref: composedRefs,
|
|
8015
|
-
display: "flex",
|
|
8016
8026
|
variant: "pi",
|
|
8017
8027
|
textColor: "neutral800",
|
|
8018
8028
|
fontWeight: "bold",
|
|
@@ -8029,6 +8039,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
8029
8039
|
}
|
|
8030
8040
|
);
|
|
8031
8041
|
});
|
|
8042
|
+
const TypographyLabel = styled(Typography)`
|
|
8043
|
+
display: flex;
|
|
8044
|
+
`;
|
|
8032
8045
|
const LabelAction = styled(Flex)`
|
|
8033
8046
|
line-height: 0;
|
|
8034
8047
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -8452,7 +8465,7 @@ const Combobox = React.forwardRef(
|
|
|
8452
8465
|
children: [
|
|
8453
8466
|
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8454
8467
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8455
|
-
startIcon ? /* @__PURE__ */ jsx(
|
|
8468
|
+
startIcon ? /* @__PURE__ */ jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8456
8469
|
/* @__PURE__ */ jsx(
|
|
8457
8470
|
TextInput$1,
|
|
8458
8471
|
{
|
|
@@ -8486,7 +8499,7 @@ const Combobox = React.forwardRef(
|
|
|
8486
8499
|
children: /* @__PURE__ */ jsx(Cross, {})
|
|
8487
8500
|
}
|
|
8488
8501
|
) : null,
|
|
8489
|
-
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
|
|
8502
|
+
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, { fill: "neutral500" }) })
|
|
8490
8503
|
] })
|
|
8491
8504
|
] }),
|
|
8492
8505
|
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
@@ -8575,6 +8588,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
|
|
|
8575
8588
|
background: transparent;
|
|
8576
8589
|
padding: 0;
|
|
8577
8590
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8591
|
+
display: flex;
|
|
8578
8592
|
|
|
8579
8593
|
&[aria-disabled='true'] {
|
|
8580
8594
|
cursor: inherit;
|
|
@@ -8598,11 +8612,11 @@ const Content$5 = styled(Combobox$1.Content)`
|
|
|
8598
8612
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8599
8613
|
|
|
8600
8614
|
&[data-side='top'] {
|
|
8601
|
-
animation-name: ${ANIMATIONS.
|
|
8615
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8602
8616
|
}
|
|
8603
8617
|
|
|
8604
8618
|
&[data-side='bottom'] {
|
|
8605
|
-
animation-name: ${ANIMATIONS.
|
|
8619
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8606
8620
|
}
|
|
8607
8621
|
}
|
|
8608
8622
|
}
|
|
@@ -9046,6 +9060,7 @@ const SelectTrigger = React.forwardRef(
|
|
|
9046
9060
|
);
|
|
9047
9061
|
const IconBox$2 = styled(Box)`
|
|
9048
9062
|
border: none;
|
|
9063
|
+
display: flex;
|
|
9049
9064
|
|
|
9050
9065
|
svg {
|
|
9051
9066
|
height: 1.1rem;
|
|
@@ -9053,7 +9068,7 @@ const IconBox$2 = styled(Box)`
|
|
|
9053
9068
|
}
|
|
9054
9069
|
|
|
9055
9070
|
svg path {
|
|
9056
|
-
fill: ${({ theme }) => theme.colors.
|
|
9071
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
9057
9072
|
}
|
|
9058
9073
|
`;
|
|
9059
9074
|
const StyledTrigger = styled(Flex)`
|
|
@@ -9076,7 +9091,7 @@ const StyledTrigger = styled(Flex)`
|
|
|
9076
9091
|
}}
|
|
9077
9092
|
|
|
9078
9093
|
&[aria-disabled='true'] {
|
|
9079
|
-
color: ${(props) => props.theme.colors.
|
|
9094
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
9080
9095
|
}
|
|
9081
9096
|
|
|
9082
9097
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -9087,8 +9102,9 @@ const StyledTrigger = styled(Flex)`
|
|
|
9087
9102
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
9088
9103
|
`;
|
|
9089
9104
|
const DownIcon = styled(Select.Icon)`
|
|
9105
|
+
display: flex;
|
|
9090
9106
|
& > svg {
|
|
9091
|
-
fill: ${({ theme }) => theme.colors.
|
|
9107
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
9092
9108
|
}
|
|
9093
9109
|
`;
|
|
9094
9110
|
const SelectValue = React.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsx(StyledValue, { placeholder, children }) }));
|
|
@@ -9119,11 +9135,11 @@ const SelectContent = styled(Select.Content)`
|
|
|
9119
9135
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9120
9136
|
|
|
9121
9137
|
&[data-side='top'] {
|
|
9122
|
-
animation-name: ${ANIMATIONS.
|
|
9138
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9123
9139
|
}
|
|
9124
9140
|
|
|
9125
9141
|
&[data-side='bottom'] {
|
|
9126
|
-
animation-name: ${ANIMATIONS.
|
|
9142
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9127
9143
|
}
|
|
9128
9144
|
}
|
|
9129
9145
|
}
|
|
@@ -9781,7 +9797,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9781
9797
|
(props, forwardedRef) => {
|
|
9782
9798
|
const { label = "Choose date", ...restProps } = props;
|
|
9783
9799
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9784
|
-
const { x, y, refs, strategy } = useFloating({
|
|
9800
|
+
const { x, y, refs, strategy, placement } = useFloating({
|
|
9785
9801
|
strategy: "fixed",
|
|
9786
9802
|
placement: "bottom-start",
|
|
9787
9803
|
middleware: [
|
|
@@ -9828,6 +9844,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9828
9844
|
{
|
|
9829
9845
|
ref: composedRefs,
|
|
9830
9846
|
"data-state": context.open ? "open" : "closed",
|
|
9847
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9831
9848
|
onContextMenu: (event) => event.preventDefault(),
|
|
9832
9849
|
id: context.contentId,
|
|
9833
9850
|
role: "dialog",
|
|
@@ -9852,6 +9869,22 @@ const ContentElement = styled(Box)`
|
|
|
9852
9869
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9853
9870
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9854
9871
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
9872
|
+
|
|
9873
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9874
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
9875
|
+
|
|
9876
|
+
&[data-state='open'] {
|
|
9877
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9878
|
+
|
|
9879
|
+
&[data-side='top'] {
|
|
9880
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9881
|
+
}
|
|
9882
|
+
|
|
9883
|
+
&[data-side='bottom'] {
|
|
9884
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9855
9888
|
`;
|
|
9856
9889
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9857
9890
|
const DatePickerCalendar = React.forwardRef(
|
|
@@ -10962,11 +10995,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10962
10995
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10963
10996
|
|
|
10964
10997
|
&[data-side='top'] {
|
|
10965
|
-
animation-name: ${ANIMATIONS.
|
|
10998
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
10966
10999
|
}
|
|
10967
11000
|
|
|
10968
11001
|
&[data-side='bottom'] {
|
|
10969
|
-
animation-name: ${ANIMATIONS.
|
|
11002
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
10970
11003
|
}
|
|
10971
11004
|
}
|
|
10972
11005
|
|
|
@@ -10974,11 +11007,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10974
11007
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10975
11008
|
|
|
10976
11009
|
&[data-side='top'] {
|
|
10977
|
-
animation-name: ${ANIMATIONS.
|
|
11010
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
10978
11011
|
}
|
|
10979
11012
|
|
|
10980
11013
|
&[data-side='bottom'] {
|
|
10981
|
-
animation-name: ${ANIMATIONS.
|
|
11014
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
10982
11015
|
}
|
|
10983
11016
|
}
|
|
10984
11017
|
}
|
|
@@ -12054,10 +12087,6 @@ const TabBar = styled.span`
|
|
|
12054
12087
|
left: 0;
|
|
12055
12088
|
opacity: 0;
|
|
12056
12089
|
height: 0.2rem;
|
|
12057
|
-
|
|
12058
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12059
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
12060
|
-
}
|
|
12061
12090
|
`;
|
|
12062
12091
|
const TriggerTypography = styled(Typography)``;
|
|
12063
12092
|
const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
@@ -12111,10 +12140,6 @@ const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
|
12111
12140
|
}
|
|
12112
12141
|
}}
|
|
12113
12142
|
|
|
12114
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12115
|
-
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
12116
|
-
}
|
|
12117
|
-
|
|
12118
12143
|
&[data-disabled] {
|
|
12119
12144
|
cursor: not-allowed;
|
|
12120
12145
|
color: ${(props) => props.theme.colors.neutral400};
|