@moduix/react 2.2.4 → 2.2.5
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/README.md +1 -1
- package/dist/components/accordion/Accordion_module.css +12 -1
- package/dist/components/alert/Alert.d.ts +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/alert/Alert_module.css +22 -48
- package/dist/components/angle-slider/AngleSlider.d.ts +9 -3
- package/dist/components/angle-slider/AngleSlider.js +34 -10
- package/dist/components/angle-slider/AngleSlider_module.css +24 -5
- package/dist/components/aspect-ratio/AspectRatio.js +3 -3
- package/dist/components/aspect-ratio/AspectRatio_module.css +9 -2
- package/dist/components/avatar/Avatar.d.ts +2 -2
- package/dist/components/avatar/Avatar.js +39 -3
- package/dist/components/avatar/Avatar.module.js +2 -1
- package/dist/components/avatar/Avatar_module.css +8 -1
- package/dist/components/badge/Badge.d.ts +1 -0
- package/dist/components/badge/Badge.js +15 -5
- package/dist/components/badge/Badge_module.css +45 -30
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +4 -6
- package/dist/components/breadcrumbs/Breadcrumbs.js +4 -3
- package/dist/components/breadcrumbs/Breadcrumbs_module.css +1 -1
- package/dist/components/button/Button.js +9 -1
- package/dist/components/button/Button_module.css +0 -7
- package/dist/components/card/Card.d.ts +1 -0
- package/dist/components/card/Card.js +11 -0
- package/dist/components/card/Card.module.js +1 -0
- package/dist/components/card/Card_module.css +79 -29
- package/dist/components/carousel/Carousel_module.css +27 -5
- package/dist/components/checkbox/Checkbox.js +9 -3
- package/dist/components/checkbox/Checkbox_module.css +11 -3
- package/dist/components/clipboard/Clipboard_module.css +13 -1
- package/dist/components/close-button/CloseButton.js +14 -3
- package/dist/components/collapsible/Collapsible_module.css +11 -0
- package/dist/components/color-picker/ColorPicker.js +16 -6
- package/dist/components/color-picker/ColorPicker.module.js +2 -0
- package/dist/components/color-picker/ColorPicker_module.css +84 -9
- package/dist/components/combobox/Combobox.d.ts +1 -1
- package/dist/components/combobox/Combobox.js +2 -1
- package/dist/components/combobox/Combobox_module.css +1 -1
- package/dist/components/command-palette/CommandPalette.js +10 -18
- package/dist/components/command-palette/CommandPalette.module.js +0 -1
- package/dist/components/command-palette/CommandPalette_module.css +5 -15
- package/dist/components/container/Container_module.css +11 -11
- package/dist/components/date-picker/DatePicker.js +15 -6
- package/dist/components/dialog/Dialog.d.ts +3 -6
- package/dist/components/dialog/Dialog.js +19 -15
- package/dist/components/dialog/Dialog_module.css +12 -1
- package/dist/components/drawer/Drawer.d.ts +3 -6
- package/dist/components/drawer/Drawer.js +19 -15
- package/dist/components/drawer/Drawer_module.css +17 -6
- package/dist/components/empty/Empty_module.css +2 -2
- package/dist/components/field/Field_module.css +4 -0
- package/dist/components/fieldset/Fieldset_module.css +3 -0
- package/dist/components/file-upload/FileUpload.js +1 -1
- package/dist/components/floating-panel/FloatingPanel.d.ts +1 -2
- package/dist/components/floating-panel/FloatingPanel.js +7 -5
- package/dist/components/heading/Heading.js +2 -2
- package/dist/components/highlight/Highlight.js +2 -2
- package/dist/components/hover-card/HoverCard.js +0 -2
- package/dist/components/hover-card/HoverCard_module.css +19 -8
- package/dist/components/image/Image.d.ts +6 -2
- package/dist/components/image/Image.js +2 -1
- package/dist/components/image-cropper/ImageCropper_module.css +0 -1
- package/dist/components/input/Input_module.css +2 -2
- package/dist/components/input-group/InputGroup.js +7 -7
- package/dist/components/kbd/Kbd.js +1 -0
- package/dist/components/lightbox/Lightbox.d.ts +5 -8
- package/dist/components/lightbox/Lightbox.js +20 -16
- package/dist/components/lightbox/Lightbox_module.css +7 -0
- package/dist/components/list/List_module.css +3 -4
- package/dist/components/listbox/Listbox.d.ts +3 -6
- package/dist/components/listbox/Listbox.js +15 -12
- package/dist/components/listbox/Listbox_module.css +2 -2
- package/dist/components/menu/Menu.d.ts +4 -8
- package/dist/components/menu/Menu.js +25 -20
- package/dist/components/menu/Menu_module.css +10 -0
- package/dist/components/native-select/NativeSelect_module.css +1 -1
- package/dist/components/pagination/Pagination.js +2 -2
- package/dist/components/pagination/Pagination_module.css +1 -1
- package/dist/components/password-input/PasswordInput_module.css +4 -4
- package/dist/components/popover/Popover.d.ts +4 -7
- package/dist/components/popover/Popover.js +24 -18
- package/dist/components/popover/Popover_module.css +18 -8
- package/dist/components/progress-circular/ProgressCircular_module.css +8 -1
- package/dist/components/progress-linear/ProgressLinear_module.css +1 -0
- package/dist/components/qr-code/QrCode_module.css +2 -3
- package/dist/components/radio-group/RadioGroup_module.css +1 -1
- package/dist/components/scroll-area/ScrollArea_module.css +15 -0
- package/dist/components/segment-group/SegmentGroup.module.js +1 -1
- package/dist/components/segment-group/SegmentGroup_module.css +4 -4
- package/dist/components/select/Select.d.ts +3 -6
- package/dist/components/select/Select.js +16 -12
- package/dist/components/select/Select_module.css +15 -1
- package/dist/components/separator/Separator.js +2 -2
- package/dist/components/separator/Separator_module.css +3 -3
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/Sidebar_module.css +9 -8
- package/dist/components/signature-pad/SignaturePad.d.ts +3 -5
- package/dist/components/signature-pad/SignaturePad.js +44 -18
- package/dist/components/simple-grid/SimpleGrid.js +1 -0
- package/dist/components/slider/Slider_module.css +9 -5
- package/dist/components/split-button/SplitButton.d.ts +4 -0
- package/dist/components/split-button/SplitButton.js +4 -1
- package/dist/components/splitter/Splitter.js +3 -2
- package/dist/components/splitter/Splitter_module.css +21 -14
- package/dist/components/swap/Swap_module.css +22 -22
- package/dist/components/switch/Switch.js +9 -3
- package/dist/components/switch/Switch_module.css +30 -23
- package/dist/components/table/Table_module.css +15 -11
- package/dist/components/tabs/Tabs.js +5 -2
- package/dist/components/tag/Tag_module.css +17 -14
- package/dist/components/text/Text.js +1 -1
- package/dist/components/text/Text_module.css +2 -1
- package/dist/components/timer/Timer.d.ts +2 -4
- package/dist/components/timer/Timer.js +5 -4
- package/dist/components/toast/Toast_module.css +37 -43
- package/dist/components/toggle-group/ToggleGroup.d.ts +1 -2
- package/dist/components/toggle-group/ToggleGroup_module.css +5 -7
- package/dist/components/tooltip/Tooltip_module.css +11 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.js +2 -1
- package/dist/components/tour/Tour_module.css +16 -4
- package/dist/components/tree-view/TreeView.d.ts +2 -2
- package/dist/components/tree-view/TreeView_module.css +1 -1
- package/dist/styles/reset.css +33 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@moduix/react)
|
|
4
4
|
[](./LICENSE.md)
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
font: inherit;
|
|
96
96
|
font-size: var(--moduix-accordion-trigger-font-size, var(--moduix-text-md));
|
|
97
97
|
line-height: var(--moduix-accordion-trigger-line-height, var(--moduix-line-height-text-md));
|
|
98
|
-
text-align:
|
|
98
|
+
text-align: start;
|
|
99
99
|
-webkit-user-select: none;
|
|
100
100
|
user-select: none;
|
|
101
101
|
cursor: pointer;
|
|
@@ -199,5 +199,16 @@
|
|
|
199
199
|
padding: var(--moduix-accordion-item-body-padding, var(--moduix-spacing-3));
|
|
200
200
|
display: grid;
|
|
201
201
|
}
|
|
202
|
+
|
|
203
|
+
@media (prefers-reduced-motion: reduce) {
|
|
204
|
+
.itemTrigger-g0LwOA, .itemIndicator-oa6fbh {
|
|
205
|
+
transition: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.itemContent-Qc_5wf[data-state][data-orientation] {
|
|
209
|
+
animation-duration: 1ms;
|
|
210
|
+
animation-delay: 0s;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
202
213
|
}
|
|
203
214
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AlertStatus = '
|
|
1
|
+
type AlertStatus = 'info' | 'success' | 'warning' | 'error';
|
|
2
2
|
declare const Alert: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
3
3
|
status?: AlertStatus;
|
|
4
4
|
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
@@ -4,7 +4,7 @@ import { clsx } from "clsx";
|
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
6
6
|
import Alert_module from "./Alert.module.js";
|
|
7
|
-
const Alert_AlertRoot = /*#__PURE__*/ forwardRef(function({ children, className, role, status = '
|
|
7
|
+
const Alert_AlertRoot = /*#__PURE__*/ forwardRef(function({ children, className, role, status = 'info', ...props }, ref) {
|
|
8
8
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
9
9
|
ref: ref,
|
|
10
10
|
role: role ?? ('error' === status ? 'alert' : 'status'),
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
row-gap: var(--moduix-alert-content-gap, var(--moduix-spacing-1));
|
|
6
6
|
column-gap: var(--moduix-alert-gap, var(--moduix-spacing-3));
|
|
7
7
|
border: var(--moduix-alert-border-width, var(--moduix-border-width-sm)) solid
|
|
8
|
-
var(--moduix-alert-border-color, var(--
|
|
8
|
+
var(--moduix-alert-border-color, var(--_alert-border-color-default, var(--moduix-color-border)));
|
|
9
9
|
border-radius: var(--moduix-alert-radius, var(--moduix-radius-lg));
|
|
10
10
|
width: 100%;
|
|
11
11
|
min-width: 0;
|
|
12
12
|
padding: var(--moduix-alert-padding, var(--moduix-spacing-3));
|
|
13
|
-
background-color: var(--moduix-alert-bg, var(--
|
|
14
|
-
color: var(--moduix-alert-color, var(--
|
|
13
|
+
background-color: var(--moduix-alert-bg, var(--_alert-bg-default, var(--moduix-color-card)));
|
|
14
|
+
color: var(--moduix-alert-color, var(--_alert-color-default, var(--moduix-color-card-foreground)));
|
|
15
15
|
box-shadow: var(--moduix-alert-shadow, none);
|
|
16
|
+
--_alert-bg-default: var(--moduix-alert-info-bg, var(--moduix-color-card));
|
|
17
|
+
--_alert-border-color-default: var(--moduix-alert-info-border-color, var(--moduix-color-border));
|
|
18
|
+
--_alert-color-default: var(--moduix-alert-info-color, var(--moduix-color-card-foreground));
|
|
19
|
+
--_alert-indicator-color-default: var(--moduix-alert-info-indicator-color, var(--moduix-color-muted-foreground));
|
|
16
20
|
grid-template-columns: auto minmax(0, 1fr);
|
|
17
21
|
display: grid;
|
|
18
22
|
}
|
|
@@ -21,55 +25,25 @@
|
|
|
21
25
|
grid-column: 2;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
.root-QHB4Xj[data-status="neutral"] {
|
|
25
|
-
--moduix-alert-bg-default: var(--moduix-color-card);
|
|
26
|
-
--moduix-alert-border-color-default: var(--moduix-color-border);
|
|
27
|
-
--moduix-alert-color-default: var(--moduix-color-card-foreground);
|
|
28
|
-
--moduix-alert-indicator-color-default: var(--moduix-color-muted-foreground);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.root-QHB4Xj[data-status="info"] {
|
|
32
|
-
--moduix-alert-bg-default: color-mix(in oklab,
|
|
33
|
-
var(--moduix-color-primary) 4%,
|
|
34
|
-
var(--moduix-color-background));
|
|
35
|
-
--moduix-alert-border-color-default: color-mix(in oklab,
|
|
36
|
-
var(--moduix-color-primary) 32%,
|
|
37
|
-
transparent);
|
|
38
|
-
--moduix-alert-color-default: var(--moduix-color-foreground);
|
|
39
|
-
--moduix-alert-indicator-color-default: var(--moduix-color-primary);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
28
|
.root-QHB4Xj[data-status="success"] {
|
|
43
|
-
--
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
--
|
|
47
|
-
var(--moduix-color-success) 34%,
|
|
48
|
-
transparent);
|
|
49
|
-
--moduix-alert-color-default: var(--moduix-color-foreground);
|
|
50
|
-
--moduix-alert-indicator-color-default: var(--moduix-color-success);
|
|
29
|
+
--_alert-bg-default: var(--moduix-alert-success-bg, color-mix(in oklab, var(--moduix-color-success) 10%, var(--moduix-color-background)));
|
|
30
|
+
--_alert-border-color-default: var(--moduix-alert-success-border-color, color-mix(in oklab, var(--moduix-color-success) 34%, transparent));
|
|
31
|
+
--_alert-color-default: var(--moduix-alert-success-color, var(--moduix-color-foreground));
|
|
32
|
+
--_alert-indicator-color-default: var(--moduix-alert-success-indicator-color, var(--moduix-color-success));
|
|
51
33
|
}
|
|
52
34
|
|
|
53
35
|
.root-QHB4Xj[data-status="warning"] {
|
|
54
|
-
--
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
--
|
|
58
|
-
var(--moduix-color-warning) 38%,
|
|
59
|
-
transparent);
|
|
60
|
-
--moduix-alert-color-default: var(--moduix-color-foreground);
|
|
61
|
-
--moduix-alert-indicator-color-default: var(--moduix-color-warning);
|
|
36
|
+
--_alert-bg-default: var(--moduix-alert-warning-bg, color-mix(in oklab, var(--moduix-color-warning) 13%, var(--moduix-color-background)));
|
|
37
|
+
--_alert-border-color-default: var(--moduix-alert-warning-border-color, color-mix(in oklab, var(--moduix-color-warning) 38%, transparent));
|
|
38
|
+
--_alert-color-default: var(--moduix-alert-warning-color, var(--moduix-color-foreground));
|
|
39
|
+
--_alert-indicator-color-default: var(--moduix-alert-warning-indicator-color, var(--moduix-color-warning));
|
|
62
40
|
}
|
|
63
41
|
|
|
64
42
|
.root-QHB4Xj[data-status="error"] {
|
|
65
|
-
--
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
--
|
|
69
|
-
var(--moduix-color-destructive) 35%,
|
|
70
|
-
transparent);
|
|
71
|
-
--moduix-alert-color-default: var(--moduix-color-foreground);
|
|
72
|
-
--moduix-alert-indicator-color-default: var(--moduix-color-destructive);
|
|
43
|
+
--_alert-bg-default: var(--moduix-alert-error-bg, color-mix(in oklab, var(--moduix-color-destructive) 9%, var(--moduix-color-background)));
|
|
44
|
+
--_alert-border-color-default: var(--moduix-alert-error-border-color, color-mix(in oklab, var(--moduix-color-destructive) 35%, transparent));
|
|
45
|
+
--_alert-color-default: var(--moduix-alert-error-color, var(--moduix-color-foreground));
|
|
46
|
+
--_alert-indicator-color-default: var(--moduix-alert-error-indicator-color, var(--moduix-color-destructive));
|
|
73
47
|
}
|
|
74
48
|
|
|
75
49
|
.root-QHB4Xj:not(:has( > [data-part="indicator"])) {
|
|
@@ -83,7 +57,7 @@
|
|
|
83
57
|
.indicator-FFj13M {
|
|
84
58
|
width: var(--moduix-alert-indicator-size, var(--moduix-spacing-4));
|
|
85
59
|
height: var(--moduix-alert-indicator-size, var(--moduix-spacing-4));
|
|
86
|
-
color: var(--moduix-alert-indicator-color, var(--
|
|
60
|
+
color: var(--moduix-alert-indicator-color, var(--_alert-indicator-color-default, currentColor));
|
|
87
61
|
justify-content: center;
|
|
88
62
|
align-items: center;
|
|
89
63
|
margin-block-start: var(--moduix-alert-indicator-offset, var(--moduix-spacing-0-5));
|
|
@@ -105,7 +79,7 @@
|
|
|
105
79
|
|
|
106
80
|
.title-O9DOvg {
|
|
107
81
|
min-width: 0;
|
|
108
|
-
color: var(--moduix-alert-title-color, var(--moduix-alert-color, var(--
|
|
82
|
+
color: var(--moduix-alert-title-color, var(--moduix-alert-color, var(--_alert-color-default)));
|
|
109
83
|
font-size: var(--moduix-alert-title-font-size, var(--moduix-text-sm));
|
|
110
84
|
font-weight: var(--moduix-alert-title-font-weight, var(--moduix-weight-semibold));
|
|
111
85
|
line-height: var(--moduix-alert-title-line-height, var(--moduix-line-height-text-sm));
|
|
@@ -122,7 +96,7 @@
|
|
|
122
96
|
}
|
|
123
97
|
|
|
124
98
|
.description-ph4U3F > :first-child {
|
|
125
|
-
margin-
|
|
99
|
+
margin-block-start: 0;
|
|
126
100
|
}
|
|
127
101
|
|
|
128
102
|
.description-ph4U3F > :last-child {
|
|
@@ -9,9 +9,15 @@ type AngleSliderDialProps = Omit<ComponentProps<typeof AngleSliderPrimitive.Cont
|
|
|
9
9
|
thumbClassName?: string;
|
|
10
10
|
};
|
|
11
11
|
declare function AngleSliderDial({ children, thumbClassName, ...props }: AngleSliderDialProps): import("react").JSX.Element;
|
|
12
|
-
declare const AngleSlider: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
declare const AngleSlider: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
13
|
+
form?: string;
|
|
14
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
15
|
+
Root: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
16
|
+
form?: string;
|
|
17
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
RootProvider: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.RootProviderProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
19
|
+
form?: string;
|
|
20
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
21
|
Context: (props: AngleSliderPrimitive.ContextProps) => ReactNode;
|
|
16
22
|
Label: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.LabelProps & import("react").RefAttributes<HTMLLabelElement>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
17
23
|
Control: import("react").ForwardRefExoticComponent<Omit<AngleSliderPrimitive.ControlProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AngleSlider, useAngleSlider, useAngleSliderContext } from "@ark-ui/react/angle-slider";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
import { Children, cloneElement, forwardRef } from "react";
|
|
5
|
+
import { Children, cloneElement, forwardRef, useEffect, useRef } from "react";
|
|
6
6
|
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
7
7
|
import AngleSlider_module from "./AngleSlider.module.js";
|
|
8
|
-
const AngleSlider_AngleSliderRoot = /*#__PURE__*/ forwardRef(function({ asChild, children, className, ...props }, ref) {
|
|
8
|
+
const AngleSlider_AngleSliderRoot = /*#__PURE__*/ forwardRef(function({ asChild, children, className, defaultValue, form, value, ...props }, ref) {
|
|
9
9
|
return /*#__PURE__*/ jsx(AngleSlider.Root, {
|
|
10
10
|
ref: ref,
|
|
11
11
|
"data-slot": "angle-slider-root",
|
|
12
12
|
className: clsx(AngleSlider_module.root, normalizeClassName(className)),
|
|
13
13
|
asChild: asChild,
|
|
14
|
+
defaultValue: defaultValue,
|
|
15
|
+
value: value,
|
|
14
16
|
...props,
|
|
15
|
-
children: withHiddenInput(children, asChild)
|
|
17
|
+
children: withHiddenInput(children, asChild, form, void 0 === value ? defaultValue ?? 0 : void 0)
|
|
16
18
|
});
|
|
17
19
|
});
|
|
18
20
|
const AngleSlider_AngleSliderLabel = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
@@ -23,19 +25,41 @@ const AngleSlider_AngleSliderLabel = /*#__PURE__*/ forwardRef(function({ classNa
|
|
|
23
25
|
...props
|
|
24
26
|
});
|
|
25
27
|
});
|
|
26
|
-
const AngleSlider_AngleSliderRootProvider = /*#__PURE__*/ forwardRef(function({ asChild, children, className, ...props }, ref) {
|
|
28
|
+
const AngleSlider_AngleSliderRootProvider = /*#__PURE__*/ forwardRef(function({ asChild, children, className, form, value, ...props }, ref) {
|
|
29
|
+
const initialValue = useRef(value.value);
|
|
27
30
|
return /*#__PURE__*/ jsx(AngleSlider.RootProvider, {
|
|
28
31
|
ref: ref,
|
|
29
32
|
"data-slot": "angle-slider-root-provider",
|
|
30
33
|
className: clsx(AngleSlider_module.root, normalizeClassName(className)),
|
|
31
34
|
asChild: asChild,
|
|
35
|
+
value: value,
|
|
32
36
|
...props,
|
|
33
|
-
children: withHiddenInput(children, asChild)
|
|
37
|
+
children: withHiddenInput(children, asChild, form, initialValue.current)
|
|
34
38
|
});
|
|
35
39
|
});
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
|
|
40
|
+
function AngleSliderHiddenInput({ form, resetValue }) {
|
|
41
|
+
const angleSlider = useAngleSliderContext();
|
|
42
|
+
const inputRef = useRef(null);
|
|
43
|
+
useEffect(()=>{
|
|
44
|
+
const formElement = inputRef.current?.form;
|
|
45
|
+
if (!formElement || void 0 === resetValue) return;
|
|
46
|
+
const handleReset = ()=>angleSlider.setValue(resetValue);
|
|
47
|
+
formElement.addEventListener('reset', handleReset);
|
|
48
|
+
return ()=>formElement.removeEventListener('reset', handleReset);
|
|
49
|
+
}, [
|
|
50
|
+
angleSlider,
|
|
51
|
+
resetValue
|
|
52
|
+
]);
|
|
53
|
+
return /*#__PURE__*/ jsx(AngleSlider.HiddenInput, {
|
|
54
|
+
ref: inputRef,
|
|
55
|
+
"data-slot": "angle-slider-hidden-input",
|
|
56
|
+
form: form
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function withHiddenInput(children, asChild, form, resetValue) {
|
|
60
|
+
const hiddenInput = /*#__PURE__*/ jsx(AngleSliderHiddenInput, {
|
|
61
|
+
form: form,
|
|
62
|
+
resetValue: resetValue
|
|
39
63
|
});
|
|
40
64
|
if (!asChild) return /*#__PURE__*/ jsxs(Fragment, {
|
|
41
65
|
children: [
|
|
@@ -81,9 +105,9 @@ const AngleSlider_AngleSliderMarker = /*#__PURE__*/ forwardRef(function({ classN
|
|
|
81
105
|
function AngleSliderMarks({ values, ...props }) {
|
|
82
106
|
return /*#__PURE__*/ jsx(AngleSlider_AngleSliderMarkerGroup, {
|
|
83
107
|
...props,
|
|
84
|
-
children: values.map((value)=>/*#__PURE__*/ jsx(AngleSlider_AngleSliderMarker, {
|
|
108
|
+
children: values.map((value, index)=>/*#__PURE__*/ jsx(AngleSlider_AngleSliderMarker, {
|
|
85
109
|
value: value
|
|
86
|
-
}, value))
|
|
110
|
+
}, `${value}-${index}`))
|
|
87
111
|
});
|
|
88
112
|
}
|
|
89
113
|
function AngleSliderDial({ children, thumbClassName, ...props }) {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
width: var(--moduix-angle-slider-size, 8rem);
|
|
29
29
|
aspect-ratio: 1;
|
|
30
30
|
border-radius: var(--moduix-angle-slider-radius, var(--moduix-radius-full));
|
|
31
|
-
background: var(--moduix-angle-slider-track-bg, var(--moduix-color-muted));
|
|
31
|
+
background-color: var(--moduix-angle-slider-track-bg, var(--moduix-color-muted));
|
|
32
32
|
min-width: 0;
|
|
33
33
|
box-shadow: inset 0 0 0 var(--moduix-angle-slider-track-border-width, var(--moduix-border-width-sm))
|
|
34
34
|
var(--_angle-slider-track-border-color),
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
-webkit-user-select: none;
|
|
38
38
|
user-select: none;
|
|
39
|
+
transition: background-color
|
|
40
|
+
var(--moduix-angle-slider-transition, var(--moduix-transition-default));
|
|
39
41
|
outline: 0;
|
|
40
42
|
justify-content: center;
|
|
41
43
|
align-items: center;
|
|
@@ -43,6 +45,16 @@
|
|
|
43
45
|
position: relative;
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
@media (hover: hover) {
|
|
49
|
+
.control-TKuxcQ:not([data-disabled], [data-readonly]):hover {
|
|
50
|
+
background-color: var(--moduix-angle-slider-track-bg-hover, color-mix(in oklab, var(--moduix-color-muted) 92%, var(--moduix-color-foreground)));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.control-TKuxcQ:not([data-disabled], [data-readonly]):active {
|
|
55
|
+
background-color: var(--moduix-angle-slider-track-bg-active, color-mix(in oklab, var(--moduix-color-muted) 84%, var(--moduix-color-foreground)));
|
|
56
|
+
}
|
|
57
|
+
|
|
46
58
|
.control-TKuxcQ:after {
|
|
47
59
|
z-index: 1;
|
|
48
60
|
inset: var(--moduix-angle-slider-ring-thickness, .875rem);
|
|
@@ -74,8 +86,8 @@
|
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
.control-TKuxcQ[data-invalid] {
|
|
77
|
-
--_angle-slider-control-border-color: var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive));
|
|
78
|
-
--_angle-slider-track-border-color: var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive));
|
|
89
|
+
--_angle-slider-control-border-color: var(--moduix-angle-slider-invalid-border-color, var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive)));
|
|
90
|
+
--_angle-slider-track-border-color: var(--moduix-angle-slider-invalid-border-color, var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive)));
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
.control-TKuxcQ:is([data-disabled], [data-readonly]) {
|
|
@@ -139,12 +151,13 @@
|
|
|
139
151
|
}
|
|
140
152
|
|
|
141
153
|
.thumb-BSrcel[data-invalid]:before {
|
|
142
|
-
border-color: var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive));
|
|
154
|
+
border-color: var(--moduix-angle-slider-invalid-border-color, var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive)));
|
|
155
|
+
background: var(--moduix-angle-slider-invalid-indicator-bg, var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive)));
|
|
143
156
|
}
|
|
144
157
|
|
|
145
158
|
.thumb-BSrcel[data-invalid]:after {
|
|
146
159
|
background: linear-gradient(to bottom,
|
|
147
|
-
var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive)),
|
|
160
|
+
var(--moduix-angle-slider-invalid-indicator-bg, var(--moduix-angle-slider-invalid-color, var(--moduix-color-destructive))),
|
|
148
161
|
transparent);
|
|
149
162
|
}
|
|
150
163
|
|
|
@@ -191,5 +204,11 @@
|
|
|
191
204
|
line-height: var(--moduix-angle-slider-value-text-line-height, var(--moduix-line-height-text-sm));
|
|
192
205
|
text-align: center;
|
|
193
206
|
}
|
|
207
|
+
|
|
208
|
+
@media (prefers-reduced-motion: reduce) {
|
|
209
|
+
.control-TKuxcQ, .thumb-BSrcel:before {
|
|
210
|
+
transition: none;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
194
213
|
}
|
|
195
214
|
|
|
@@ -7,6 +7,7 @@ import AspectRatio_module from "./AspectRatio.module.js";
|
|
|
7
7
|
const AspectRatio_AspectRatioRoot = /*#__PURE__*/ forwardRef(function({ ratio, className, style, ...props }, ref) {
|
|
8
8
|
if (!Number.isFinite(ratio) || ratio <= 0) throw new RangeError('AspectRatio `ratio` must be a finite number greater than zero.');
|
|
9
9
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
10
|
+
...props,
|
|
10
11
|
ref: ref,
|
|
11
12
|
"data-scope": "aspect-ratio",
|
|
12
13
|
"data-part": "root",
|
|
@@ -14,9 +15,8 @@ const AspectRatio_AspectRatioRoot = /*#__PURE__*/ forwardRef(function({ ratio, c
|
|
|
14
15
|
className: clsx(AspectRatio_module.root, normalizeClassName(className)),
|
|
15
16
|
style: {
|
|
16
17
|
...style,
|
|
17
|
-
'--
|
|
18
|
-
}
|
|
19
|
-
...props
|
|
18
|
+
'--_aspect-ratio-value': ratio
|
|
19
|
+
}
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
const AspectRatio = Object.assign(AspectRatio_AspectRatioRoot, {
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
@layer moduix.components {
|
|
2
2
|
.root-_8OMdK {
|
|
3
|
-
--
|
|
3
|
+
--_aspect-ratio-value: 1;
|
|
4
|
+
box-sizing: border-box;
|
|
4
5
|
width: 100%;
|
|
5
|
-
aspect-ratio: var(--
|
|
6
|
+
aspect-ratio: var(--_aspect-ratio-value);
|
|
6
7
|
border-radius: var(--moduix-aspect-ratio-radius, var(--moduix-radius-md));
|
|
8
|
+
display: block;
|
|
7
9
|
position: relative;
|
|
8
10
|
overflow: hidden;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
.root-_8OMdK > :where(img, video, iframe, canvas, svg) {
|
|
14
|
+
box-sizing: border-box;
|
|
12
15
|
width: 100%;
|
|
13
16
|
height: 100%;
|
|
14
17
|
display: block;
|
|
15
18
|
}
|
|
19
|
+
|
|
20
|
+
.root-_8OMdK > iframe {
|
|
21
|
+
border: 0;
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Avatar as AvatarPrimitive, useAvatar, useAvatarContext } from '@ark-ui/react/avatar';
|
|
2
|
-
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
3
|
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
type AvatarRootProps = ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
5
5
|
size?: AvatarSize;
|
|
@@ -13,7 +13,7 @@ type AvatarFallbackProps = ComponentProps<typeof AvatarPrimitive.Fallback> & {
|
|
|
13
13
|
declare const Avatar: import("react").ForwardRefExoticComponent<Omit<AvatarRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
14
14
|
Root: import("react").ForwardRefExoticComponent<Omit<AvatarRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
15
|
RootProvider: import("react").ForwardRefExoticComponent<Omit<AvatarRootProviderProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
-
Context: (props: AvatarPrimitive.ContextProps) =>
|
|
16
|
+
Context: (props: AvatarPrimitive.ContextProps) => ReactNode;
|
|
17
17
|
Image: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.ImageProps & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
18
18
|
Fallback: import("react").ForwardRefExoticComponent<Omit<AvatarFallbackProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
19
19
|
};
|
|
@@ -1,14 +1,50 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar, useAvatar, useAvatarContext } from "@ark-ui/react/avatar";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
6
6
|
import Avatar_module from "./Avatar.module.js";
|
|
7
|
+
const graphemeSegmenter = new Intl.Segmenter(void 0, {
|
|
8
|
+
granularity: 'grapheme'
|
|
9
|
+
});
|
|
10
|
+
const getFirstGrapheme = (value)=>{
|
|
11
|
+
const [firstGrapheme] = graphemeSegmenter.segment(value);
|
|
12
|
+
return firstGrapheme?.segment ?? '';
|
|
13
|
+
};
|
|
7
14
|
const getInitials = (name)=>{
|
|
8
15
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
9
16
|
const firstName = parts[0] ?? '';
|
|
10
17
|
const lastName = parts.length > 1 ? parts[parts.length - 1] : '';
|
|
11
|
-
return firstName && lastName ? `${firstName
|
|
18
|
+
return firstName && lastName ? `${getFirstGrapheme(firstName)}${getFirstGrapheme(lastName)}` : getFirstGrapheme(firstName);
|
|
19
|
+
};
|
|
20
|
+
function AvatarFallbackIcon() {
|
|
21
|
+
return /*#__PURE__*/ jsxs("svg", {
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
focusable: "false",
|
|
24
|
+
"data-slot": "avatar-fallback-icon",
|
|
25
|
+
className: Avatar_module.fallbackIcon,
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
fill: "none",
|
|
28
|
+
stroke: "currentColor",
|
|
29
|
+
strokeWidth: "2",
|
|
30
|
+
strokeLinecap: "round",
|
|
31
|
+
strokeLinejoin: "round",
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ jsx("circle", {
|
|
34
|
+
cx: "12",
|
|
35
|
+
cy: "8",
|
|
36
|
+
r: "5"
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx("path", {
|
|
39
|
+
d: "M20 21a8 8 0 0 0-16 0"
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const getFallbackContent = (children, name)=>{
|
|
45
|
+
if (null != children) return children;
|
|
46
|
+
const initials = name ? getInitials(name) : '';
|
|
47
|
+
return initials || /*#__PURE__*/ jsx(AvatarFallbackIcon, {});
|
|
12
48
|
};
|
|
13
49
|
const Avatar_AvatarRoot = /*#__PURE__*/ forwardRef(function({ className, size, ...props }, ref) {
|
|
14
50
|
return /*#__PURE__*/ jsx(Avatar.Root, {
|
|
@@ -42,7 +78,7 @@ const Avatar_AvatarFallback = /*#__PURE__*/ forwardRef(function({ children, clas
|
|
|
42
78
|
"data-slot": "avatar-fallback",
|
|
43
79
|
className: clsx(Avatar_module.fallback, normalizeClassName(className)),
|
|
44
80
|
...props,
|
|
45
|
-
children: children
|
|
81
|
+
children: getFallbackContent(children, name)
|
|
46
82
|
});
|
|
47
83
|
});
|
|
48
84
|
const Avatar_Avatar = Object.assign(Avatar_AvatarRoot, {
|
|
@@ -58,20 +58,27 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.fallback-UO951k {
|
|
61
|
+
box-sizing: border-box;
|
|
61
62
|
width: 100%;
|
|
62
63
|
height: 100%;
|
|
63
64
|
padding: var(--moduix-avatar-fallback-padding, 0);
|
|
64
65
|
background-color: var(--moduix-avatar-fallback-bg, var(--moduix-avatar-bg, var(--moduix-color-muted)));
|
|
65
66
|
color: var(--moduix-avatar-fallback-color, inherit);
|
|
66
67
|
border-radius: inherit;
|
|
68
|
+
line-height: inherit;
|
|
67
69
|
justify-content: center;
|
|
68
70
|
align-items: center;
|
|
69
|
-
line-height: 1;
|
|
70
71
|
display: inline-flex;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
.fallback-UO951k[data-state="hidden"] {
|
|
74
75
|
display: none;
|
|
75
76
|
}
|
|
77
|
+
|
|
78
|
+
.fallbackIcon-OJh0sm {
|
|
79
|
+
width: var(--moduix-avatar-fallback-icon-size, 55%);
|
|
80
|
+
height: var(--moduix-avatar-fallback-icon-size, 55%);
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
}
|
|
76
83
|
}
|
|
77
84
|
|
|
@@ -4,6 +4,7 @@ declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("reac
|
|
|
4
4
|
Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
5
5
|
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
6
6
|
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
8
|
Dot: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
9
|
};
|
|
9
10
|
export { Badge };
|
|
@@ -4,18 +4,27 @@ import { clsx } from "clsx";
|
|
|
4
4
|
import { Children, forwardRef } from "react";
|
|
5
5
|
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
6
6
|
import Badge_module from "./Badge.module.js";
|
|
7
|
+
const Badge_BadgeLabel = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
8
|
+
return /*#__PURE__*/ jsx(ark.span, {
|
|
9
|
+
ref: ref,
|
|
10
|
+
...props,
|
|
11
|
+
"data-scope": "badge",
|
|
12
|
+
"data-part": "label",
|
|
13
|
+
"data-slot": "badge-label",
|
|
14
|
+
className: clsx(Badge_module.label, normalizeClassName(className))
|
|
15
|
+
});
|
|
16
|
+
});
|
|
7
17
|
const Badge_BadgeRoot = /*#__PURE__*/ forwardRef(function({ asChild, children, className, variant = 'default', ...props }, ref) {
|
|
8
18
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
9
19
|
ref: ref,
|
|
20
|
+
...props,
|
|
10
21
|
"data-scope": "badge",
|
|
11
22
|
"data-part": "root",
|
|
12
23
|
"data-slot": "badge-root",
|
|
13
24
|
"data-variant": variant,
|
|
14
25
|
className: clsx(Badge_module.root, normalizeClassName(className)),
|
|
15
26
|
asChild: asChild,
|
|
16
|
-
|
|
17
|
-
children: asChild ? children : Children.map(children, (child)=>'string' == typeof child || 'number' == typeof child ? /*#__PURE__*/ jsx("span", {
|
|
18
|
-
className: Badge_module.label,
|
|
27
|
+
children: asChild ? children : Children.map(children, (child)=>'string' == typeof child || 'number' == typeof child ? /*#__PURE__*/ jsx(Badge_BadgeLabel, {
|
|
19
28
|
children: child
|
|
20
29
|
}) : child)
|
|
21
30
|
});
|
|
@@ -23,16 +32,17 @@ const Badge_BadgeRoot = /*#__PURE__*/ forwardRef(function({ asChild, children, c
|
|
|
23
32
|
const Badge_BadgeDot = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
24
33
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
25
34
|
ref: ref,
|
|
35
|
+
...props,
|
|
26
36
|
"data-scope": "badge",
|
|
27
37
|
"data-part": "dot",
|
|
28
38
|
"data-slot": "badge-dot",
|
|
29
39
|
"aria-hidden": "true",
|
|
30
|
-
className: clsx(Badge_module.dot, normalizeClassName(className))
|
|
31
|
-
...props
|
|
40
|
+
className: clsx(Badge_module.dot, normalizeClassName(className))
|
|
32
41
|
});
|
|
33
42
|
});
|
|
34
43
|
const Badge = Object.assign(Badge_BadgeRoot, {
|
|
35
44
|
Root: Badge_BadgeRoot,
|
|
45
|
+
Label: Badge_BadgeLabel,
|
|
36
46
|
Dot: Badge_BadgeDot
|
|
37
47
|
});
|
|
38
48
|
export { Badge };
|