@strapi/design-system 2.0.0-rc.17 → 2.0.0-rc.18
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/index.mjs
CHANGED
|
@@ -20,12 +20,12 @@ import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
|
20
20
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
21
21
|
import { createPortal } from "react-dom";
|
|
22
22
|
import { RemoveScroll } from "react-remove-scroll";
|
|
23
|
+
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
23
24
|
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
24
25
|
import { useCodeMirror } from "@uiw/react-codemirror";
|
|
25
26
|
import { StateEffect, StateField } from "@codemirror/state";
|
|
26
27
|
import { Decoration, EditorView } from "@codemirror/view";
|
|
27
28
|
import * as Dialog$1 from "@radix-ui/react-dialog";
|
|
28
|
-
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
29
29
|
import { NumberParser, NumberFormatter } from "@internationalized/number";
|
|
30
30
|
import * as Popover$1 from "@radix-ui/react-popover";
|
|
31
31
|
import * as Progress from "@radix-ui/react-progress";
|
|
@@ -3549,6 +3549,60 @@ const Portal$1 = React.forwardRef(
|
|
|
3549
3549
|
}
|
|
3550
3550
|
);
|
|
3551
3551
|
Portal$1.displayName = "Portal";
|
|
3552
|
+
const ScrollAreaImpl$1 = React.forwardRef(
|
|
3553
|
+
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
3554
|
+
return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
3555
|
+
/* @__PURE__ */ jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
3556
|
+
/* @__PURE__ */ jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(Thumb, {}) }),
|
|
3557
|
+
/* @__PURE__ */ jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsx(Thumb, {}) })
|
|
3558
|
+
] });
|
|
3559
|
+
}
|
|
3560
|
+
);
|
|
3561
|
+
const ScrollAreaRoot = styled(ScrollArea.Root)`
|
|
3562
|
+
width: 100%;
|
|
3563
|
+
height: 100%;
|
|
3564
|
+
overflow: hidden;
|
|
3565
|
+
display: flex;
|
|
3566
|
+
`;
|
|
3567
|
+
const ScrollAreaViewport = styled(ScrollArea.Viewport)`
|
|
3568
|
+
min-width: 100%;
|
|
3569
|
+
padding-inline: 4px;
|
|
3570
|
+
`;
|
|
3571
|
+
const Scrollbar = styled(ScrollArea.Scrollbar)`
|
|
3572
|
+
display: flex;
|
|
3573
|
+
/* ensures no selection */
|
|
3574
|
+
user-select: none;
|
|
3575
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
3576
|
+
touch-action: none;
|
|
3577
|
+
|
|
3578
|
+
&[data-orientation='vertical'] {
|
|
3579
|
+
width: 0.4rem;
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3582
|
+
&[data-orientation='horizontal'] {
|
|
3583
|
+
flex-direction: column;
|
|
3584
|
+
height: 0.4rem;
|
|
3585
|
+
}
|
|
3586
|
+
`;
|
|
3587
|
+
const Thumb = styled(ScrollArea.Thumb)`
|
|
3588
|
+
position: relative;
|
|
3589
|
+
flex: 1;
|
|
3590
|
+
background-color: ${(props) => props.theme.colors.neutral150};
|
|
3591
|
+
border-radius: var(--scrollbar-size);
|
|
3592
|
+
|
|
3593
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
3594
|
+
&::before {
|
|
3595
|
+
content: '';
|
|
3596
|
+
position: absolute;
|
|
3597
|
+
top: 50%;
|
|
3598
|
+
left: 50%;
|
|
3599
|
+
transform: translate(-50%, -50%);
|
|
3600
|
+
width: 100%;
|
|
3601
|
+
height: 100%;
|
|
3602
|
+
min-width: 44px;
|
|
3603
|
+
min-height: 44px;
|
|
3604
|
+
}
|
|
3605
|
+
`;
|
|
3552
3606
|
const SelectTrigger = React.forwardRef(
|
|
3553
3607
|
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, size = "M", withTags, ...restProps }, ref) => {
|
|
3554
3608
|
const triggerRef = React.useRef(null);
|
|
@@ -3668,7 +3722,10 @@ const StyledValue = styled(Select.Value)`
|
|
|
3668
3722
|
gap: ${({ theme }) => theme.spaces[1]};
|
|
3669
3723
|
flex-wrap: wrap;
|
|
3670
3724
|
`;
|
|
3671
|
-
const SelectContent =
|
|
3725
|
+
const SelectContent = React.forwardRef((props, ref) => {
|
|
3726
|
+
return /* @__PURE__ */ jsx(StyledContent, { ref, ...props, children: /* @__PURE__ */ jsx(ScrollAreaImpl$1, { children: props.children }) });
|
|
3727
|
+
});
|
|
3728
|
+
const StyledContent = styled(Select.Content)`
|
|
3672
3729
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
3673
3730
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
3674
3731
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -5112,60 +5169,6 @@ const SkipToContent = ({ children }) => {
|
|
|
5112
5169
|
);
|
|
5113
5170
|
};
|
|
5114
5171
|
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
5115
|
-
const ScrollAreaImpl$1 = React.forwardRef(
|
|
5116
|
-
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
5117
|
-
return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
5118
|
-
/* @__PURE__ */ jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
5119
|
-
/* @__PURE__ */ jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(Thumb, {}) }),
|
|
5120
|
-
/* @__PURE__ */ jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsx(Thumb, {}) })
|
|
5121
|
-
] });
|
|
5122
|
-
}
|
|
5123
|
-
);
|
|
5124
|
-
const ScrollAreaRoot = styled(ScrollArea.Root)`
|
|
5125
|
-
width: 100%;
|
|
5126
|
-
height: 100%;
|
|
5127
|
-
overflow: hidden;
|
|
5128
|
-
display: flex;
|
|
5129
|
-
`;
|
|
5130
|
-
const ScrollAreaViewport = styled(ScrollArea.Viewport)`
|
|
5131
|
-
min-width: 100%;
|
|
5132
|
-
padding-inline: 4px;
|
|
5133
|
-
`;
|
|
5134
|
-
const Scrollbar = styled(ScrollArea.Scrollbar)`
|
|
5135
|
-
display: flex;
|
|
5136
|
-
/* ensures no selection */
|
|
5137
|
-
user-select: none;
|
|
5138
|
-
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
5139
|
-
touch-action: none;
|
|
5140
|
-
|
|
5141
|
-
&[data-orientation='vertical'] {
|
|
5142
|
-
width: 0.4rem;
|
|
5143
|
-
}
|
|
5144
|
-
|
|
5145
|
-
&[data-orientation='horizontal'] {
|
|
5146
|
-
flex-direction: column;
|
|
5147
|
-
height: 0.4rem;
|
|
5148
|
-
}
|
|
5149
|
-
`;
|
|
5150
|
-
const Thumb = styled(ScrollArea.Thumb)`
|
|
5151
|
-
position: relative;
|
|
5152
|
-
flex: 1;
|
|
5153
|
-
background-color: ${(props) => props.theme.colors.neutral150};
|
|
5154
|
-
border-radius: var(--scrollbar-size);
|
|
5155
|
-
|
|
5156
|
-
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
5157
|
-
&::before {
|
|
5158
|
-
content: '';
|
|
5159
|
-
position: absolute;
|
|
5160
|
-
top: 50%;
|
|
5161
|
-
left: 50%;
|
|
5162
|
-
transform: translate(-50%, -50%);
|
|
5163
|
-
width: 100%;
|
|
5164
|
-
height: 100%;
|
|
5165
|
-
min-width: 44px;
|
|
5166
|
-
min-height: 44px;
|
|
5167
|
-
}
|
|
5168
|
-
`;
|
|
5169
5172
|
const Root$3 = Dialog$1.Root;
|
|
5170
5173
|
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
5171
5174
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|