moduix 0.11.0 → 0.11.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/LICENSE.md +21 -0
- package/README.md +13 -3
- package/dist/components/Accordion/Accordion.css +99 -0
- package/dist/components/Accordion/Accordion.d.ts +17 -9
- package/dist/components/Accordion/Accordion.js +60 -0
- package/dist/components/Accordion/Accordion.module.js +12 -0
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Alert/Alert.css +114 -0
- package/dist/components/Alert/Alert.d.ts +30 -10
- package/dist/components/Alert/Alert.js +44 -0
- package/dist/components/Alert/Alert.module.js +11 -0
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/AlertDialog.css +159 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +66 -19
- package/dist/components/AlertDialog/AlertDialog.js +107 -0
- package/dist/components/AlertDialog/AlertDialog.module.js +18 -0
- package/dist/components/AlertDialog/index.d.ts +1 -1
- package/dist/components/AspectRatio/AspectRatio.css +14 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +12 -5
- package/dist/components/AspectRatio/AspectRatio.js +24 -0
- package/dist/components/AspectRatio/AspectRatio.module.js +5 -0
- package/dist/components/AspectRatio/index.d.ts +1 -2
- package/dist/components/Autocomplete/Autocomplete.css +454 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +40 -37
- package/dist/components/Autocomplete/Autocomplete.js +271 -0
- package/dist/components/Autocomplete/Autocomplete.module.js +37 -0
- package/dist/components/Autocomplete/index.d.ts +1 -1
- package/dist/components/Avatar/Avatar.css +74 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -6
- package/dist/components/Avatar/Avatar.js +29 -0
- package/dist/components/Avatar/Avatar.module.js +9 -0
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/Badge.css +66 -0
- package/dist/components/Badge/Badge.d.ts +15 -6
- package/dist/components/Badge/Badge.js +22 -0
- package/dist/components/Badge/Badge.module.js +8 -0
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Bleed/Bleed.css +51 -0
- package/dist/components/Bleed/Bleed.d.ts +15 -6
- package/dist/components/Bleed/Bleed.js +15 -0
- package/dist/components/Bleed/Bleed.module.js +5 -0
- package/dist/components/Bleed/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.css +88 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +38 -10
- package/dist/components/Breadcrumbs/Breadcrumbs.js +66 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.js +13 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Button/Button.css +194 -0
- package/dist/components/Button/Button.d.ts +9 -7
- package/dist/components/Button/Button.js +18 -0
- package/dist/components/Button/Button.module.js +5 -0
- package/dist/components/Button/index.d.ts +1 -2
- package/dist/components/Card/Card.css +136 -0
- package/dist/components/Card/Card.d.ts +45 -15
- package/dist/components/Card/Card.js +72 -0
- package/dist/components/Card/Card.module.js +14 -0
- package/dist/components/Card/index.d.ts +1 -2
- package/dist/components/Checkbox/Checkbox.css +131 -0
- package/dist/components/Checkbox/Checkbox.d.ts +27 -10
- package/dist/components/Checkbox/Checkbox.js +59 -0
- package/dist/components/Checkbox/Checkbox.module.js +13 -0
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.css +33 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +27 -9
- package/dist/components/CheckboxGroup/CheckboxGroup.js +50 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.module.js +11 -0
- package/dist/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/components/CloseButton/CloseButton.css +49 -0
- package/dist/components/CloseButton/CloseButton.d.ts +4 -2
- package/dist/components/CloseButton/CloseButton.js +22 -0
- package/dist/components/CloseButton/CloseButton.module.js +5 -0
- package/dist/components/Collapsible/Collapsible.css +92 -0
- package/dist/components/Collapsible/Collapsible.d.ts +14 -6
- package/dist/components/Collapsible/Collapsible.js +44 -0
- package/dist/components/Collapsible/Collapsible.module.js +10 -0
- package/dist/components/Collapsible/index.d.ts +1 -1
- package/dist/components/Combobox/Combobox.css +497 -0
- package/dist/components/Combobox/Combobox.d.ts +58 -43
- package/dist/components/Combobox/Combobox.js +295 -0
- package/dist/components/Combobox/Combobox.module.js +42 -0
- package/dist/components/Combobox/index.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPalette.css +375 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +134 -42
- package/dist/components/CommandPalette/CommandPalette.js +278 -0
- package/dist/components/CommandPalette/CommandPalette.module.js +30 -0
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/Container/Container.css +45 -0
- package/dist/components/Container/Container.d.ts +15 -6
- package/dist/components/Container/Container.js +15 -0
- package/dist/components/Container/Container.module.js +5 -0
- package/dist/components/Container/index.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.css +308 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +131 -38
- package/dist/components/ContextMenu/ContextMenu.js +215 -0
- package/dist/components/ContextMenu/ContextMenu.module.js +33 -0
- package/dist/components/ContextMenu/index.d.ts +1 -2
- package/dist/components/CopyButton/CopyButton.css +14 -0
- package/dist/components/CopyButton/CopyButton.d.ts +14 -13
- package/dist/components/CopyButton/CopyButton.js +66 -0
- package/dist/components/CopyButton/CopyButton.module.js +5 -0
- package/dist/components/CopyButton/index.d.ts +1 -2
- package/dist/components/Dialog/Dialog.css +186 -0
- package/dist/components/Dialog/Dialog.d.ts +68 -18
- package/dist/components/Dialog/Dialog.js +122 -0
- package/dist/components/Dialog/Dialog.module.js +18 -0
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.css +483 -0
- package/dist/components/Drawer/Drawer.d.ts +95 -27
- package/dist/components/Drawer/Drawer.js +182 -0
- package/dist/components/Drawer/Drawer.module.js +24 -0
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Empty/Empty.css +78 -0
- package/dist/components/Empty/Empty.d.ts +31 -9
- package/dist/components/Empty/Empty.js +48 -0
- package/dist/components/Empty/Empty.module.js +12 -0
- package/dist/components/Empty/index.d.ts +1 -1
- package/dist/components/Field/Field.css +86 -0
- package/dist/components/Field/Field.d.ts +30 -9
- package/dist/components/Field/Field.js +50 -0
- package/dist/components/Field/Field.module.js +12 -0
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.css +39 -0
- package/dist/components/Fieldset/Fieldset.d.ts +13 -4
- package/dist/components/Fieldset/Fieldset.js +21 -0
- package/dist/components/Fieldset/Fieldset.module.js +8 -0
- package/dist/components/Fieldset/index.d.ts +1 -1
- package/dist/components/Form/Form.css +9 -0
- package/dist/components/Form/Form.d.ts +6 -3
- package/dist/components/Form/Form.js +16 -0
- package/dist/components/Form/Form.module.js +5 -0
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Heading/Heading.css +50 -0
- package/dist/components/Heading/Heading.d.ts +21 -13
- package/dist/components/Heading/Heading.js +23 -0
- package/dist/components/Heading/Heading.module.js +5 -0
- package/dist/components/Heading/index.d.ts +1 -1
- package/dist/components/Input/Input.css +78 -0
- package/dist/components/Input/Input.d.ts +10 -8
- package/dist/components/Input/Input.js +18 -0
- package/dist/components/Input/Input.module.js +5 -0
- package/dist/components/Input/index.d.ts +1 -2
- package/dist/components/InputGroup/InputGroup.css +160 -0
- package/dist/components/InputGroup/InputGroup.d.ts +14 -10
- package/dist/components/InputGroup/InputGroup.js +73 -0
- package/dist/components/InputGroup/InputGroup.module.js +11 -0
- package/dist/components/InputGroup/index.d.ts +1 -1
- package/dist/components/Kbd/Kbd.css +49 -0
- package/dist/components/Kbd/Kbd.d.ts +13 -4
- package/dist/components/Kbd/Kbd.js +20 -0
- package/dist/components/Kbd/Kbd.module.js +8 -0
- package/dist/components/Kbd/index.d.ts +1 -1
- package/dist/components/Lightbox/Lightbox.css +114 -0
- package/dist/components/Lightbox/Lightbox.d.ts +81 -28
- package/dist/components/Lightbox/Lightbox.js +208 -0
- package/dist/components/Lightbox/Lightbox.module.js +14 -0
- package/dist/components/Lightbox/index.d.ts +1 -1
- package/dist/components/List/List.css +114 -0
- package/dist/components/List/List.d.ts +26 -12
- package/dist/components/List/List.js +28 -0
- package/dist/components/List/List.module.js +5 -0
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/Menu/Menu.css +377 -0
- package/dist/components/Menu/Menu.d.ts +141 -41
- package/dist/components/Menu/Menu.js +231 -0
- package/dist/components/Menu/Menu.module.js +36 -0
- package/dist/components/Menu/index.d.ts +1 -2
- package/dist/components/Menubar/Menubar.css +387 -0
- package/dist/components/Menubar/Menubar.d.ts +144 -42
- package/dist/components/Menubar/Menubar.js +232 -0
- package/dist/components/Menubar/Menubar.module.js +36 -0
- package/dist/components/Menubar/index.d.ts +1 -2
- package/dist/components/Meter/Meter.css +46 -0
- package/dist/components/Meter/Meter.d.ts +9 -7
- package/dist/components/Meter/Meter.js +55 -0
- package/dist/components/Meter/Meter.module.js +11 -0
- package/dist/components/NavigationMenu/NavigationMenu.css +319 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +81 -22
- package/dist/components/NavigationMenu/NavigationMenu.js +134 -0
- package/dist/components/NavigationMenu/NavigationMenu.module.js +21 -0
- package/dist/components/NavigationMenu/index.d.ts +1 -2
- package/dist/components/NumberField/NumberField.css +158 -0
- package/dist/components/NumberField/NumberField.d.ts +48 -14
- package/dist/components/NumberField/NumberField.js +75 -0
- package/dist/components/NumberField/NumberField.module.js +13 -0
- package/dist/components/NumberField/index.d.ts +1 -2
- package/dist/components/OTPField/OTPField.css +78 -0
- package/dist/components/OTPField/OTPField.d.ts +19 -5
- package/dist/components/OTPField/OTPField.js +39 -0
- package/dist/components/OTPField/OTPField.module.js +9 -0
- package/dist/components/OTPField/index.d.ts +1 -1
- package/dist/components/Pagination/Pagination.css +103 -0
- package/dist/components/Pagination/Pagination.d.ts +60 -22
- package/dist/components/Pagination/Pagination.js +116 -0
- package/dist/components/Pagination/Pagination.module.js +16 -0
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.css +19 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +14 -12
- package/dist/components/PasswordInput/PasswordInput.js +47 -0
- package/dist/components/PasswordInput/PasswordInput.module.js +9 -0
- package/dist/components/PasswordInput/index.d.ts +1 -2
- package/dist/components/Popover/Popover.css +200 -0
- package/dist/components/Popover/Popover.d.ts +79 -22
- package/dist/components/Popover/Popover.js +131 -0
- package/dist/components/Popover/Popover.module.js +22 -0
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/PreviewCard/PreviewCard.css +136 -0
- package/dist/components/PreviewCard/PreviewCard.d.ts +51 -15
- package/dist/components/PreviewCard/PreviewCard.js +87 -0
- package/dist/components/PreviewCard/PreviewCard.module.js +16 -0
- package/dist/components/PreviewCard/index.d.ts +1 -1
- package/dist/components/Progress/Progress.css +68 -0
- package/dist/components/Progress/Progress.d.ts +9 -7
- package/dist/components/Progress/Progress.js +55 -0
- package/dist/components/Progress/Progress.module.js +12 -0
- package/dist/components/Radio/Radio.css +141 -0
- package/dist/components/Radio/Radio.d.ts +39 -14
- package/dist/components/Radio/Radio.js +71 -0
- package/dist/components/Radio/Radio.module.js +14 -0
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Rating/Rating.css +79 -0
- package/dist/components/Rating/Rating.d.ts +12 -10
- package/dist/components/Rating/Rating.js +61 -0
- package/dist/components/Rating/Rating.module.js +9 -0
- package/dist/components/Rating/index.d.ts +1 -2
- package/dist/components/ScrollArea/ScrollArea.css +205 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +16 -13
- package/dist/components/ScrollArea/ScrollArea.js +76 -0
- package/dist/components/ScrollArea/ScrollArea.module.js +12 -0
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Select/Select.css +357 -0
- package/dist/components/Select/Select.d.ts +116 -30
- package/dist/components/Select/Select.js +196 -0
- package/dist/components/Select/Select.module.js +33 -0
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Separator/Separator.css +17 -0
- package/dist/components/Separator/Separator.d.ts +4 -2
- package/dist/components/Separator/Separator.js +16 -0
- package/dist/components/Separator/Separator.module.js +5 -0
- package/dist/components/Skeleton/Skeleton.css +21 -0
- package/dist/components/Skeleton/Skeleton.d.ts +22 -9
- package/dist/components/Skeleton/Skeleton.js +25 -0
- package/dist/components/Skeleton/Skeleton.module.js +5 -0
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/Slider.css +115 -0
- package/dist/components/Slider/Slider.d.ts +14 -11
- package/dist/components/Slider/Slider.js +99 -0
- package/dist/components/Slider/Slider.module.js +13 -0
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/SnapCarousel/SnapCarousel.css +131 -0
- package/dist/components/SnapCarousel/SnapCarousel.d.ts +37 -10
- package/dist/components/SnapCarousel/SnapCarousel.js +125 -0
- package/dist/components/SnapCarousel/SnapCarousel.module.js +13 -0
- package/dist/components/SnapCarousel/index.d.ts +1 -2
- package/dist/components/Spinner/Spinner.css +60 -0
- package/dist/components/Spinner/Spinner.d.ts +16 -6
- package/dist/components/Spinner/Spinner.js +28 -0
- package/dist/components/Spinner/Spinner.module.js +9 -0
- package/dist/components/Spinner/index.d.ts +1 -2
- package/dist/components/SplitButton/SplitButton.css +59 -0
- package/dist/components/SplitButton/SplitButton.d.ts +39 -20
- package/dist/components/SplitButton/SplitButton.js +66 -0
- package/dist/components/SplitButton/SplitButton.module.js +9 -0
- package/dist/components/SplitButton/index.d.ts +1 -2
- package/dist/components/Stack/Stack.css +13 -0
- package/dist/components/Stack/Stack.d.ts +27 -13
- package/dist/components/Stack/Stack.js +27 -0
- package/dist/components/Stack/Stack.module.js +5 -0
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stepper/Stepper.css +174 -0
- package/dist/components/Stepper/Stepper.d.ts +55 -16
- package/dist/components/Stepper/Stepper.js +131 -0
- package/dist/components/Stepper/Stepper.module.js +14 -0
- package/dist/components/Stepper/index.d.ts +1 -2
- package/dist/components/Switch/Switch.css +138 -0
- package/dist/components/Switch/Switch.d.ts +21 -9
- package/dist/components/Switch/Switch.js +40 -0
- package/dist/components/Switch/Switch.module.js +10 -0
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Table/Table.css +107 -0
- package/dist/components/Table/Table.d.ts +54 -16
- package/dist/components/Table/Table.js +85 -0
- package/dist/components/Table/Table.module.js +18 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.css +181 -0
- package/dist/components/Tabs/Tabs.d.ts +10 -8
- package/dist/components/Tabs/Tabs.js +66 -0
- package/dist/components/Tabs/Tabs.module.js +11 -0
- package/dist/components/Text/Text.css +73 -0
- package/dist/components/Text/Text.d.ts +20 -9
- package/dist/components/Text/Text.js +42 -0
- package/dist/components/Text/Text.module.js +5 -0
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.css +59 -0
- package/dist/components/Textarea/Textarea.d.ts +7 -5
- package/dist/components/Textarea/Textarea.js +28 -0
- package/dist/components/Textarea/Textarea.module.js +5 -0
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/Toast/Toast.css +351 -0
- package/dist/components/Toast/Toast.d.ts +79 -38
- package/dist/components/Toast/Toast.js +263 -0
- package/dist/components/Toast/Toast.module.js +26 -0
- package/dist/components/Toast/index.d.ts +1 -2
- package/dist/components/Toggle/Toggle.css +147 -0
- package/dist/components/Toggle/Toggle.d.ts +9 -6
- package/dist/components/Toggle/Toggle.js +18 -0
- package/dist/components/Toggle/Toggle.module.js +5 -0
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.css +42 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +15 -12
- package/dist/components/ToggleGroup/ToggleGroup.js +41 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.js +8 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.css +203 -0
- package/dist/components/Toolbar/Toolbar.d.ts +9 -7
- package/dist/components/Toolbar/Toolbar.js +56 -0
- package/dist/components/Toolbar/Toolbar.module.js +12 -0
- package/dist/components/Tooltip/Tooltip.css +155 -0
- package/dist/components/Tooltip/Tooltip.d.ts +51 -15
- package/dist/components/Tooltip/Tooltip.js +82 -0
- package/dist/components/Tooltip/Tooltip.module.js +15 -0
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/icons/demo/Icons.d.ts +15 -12
- package/dist/icons/demo/Icons.js +225 -0
- package/dist/icons/demo/index.d.ts +1 -1
- package/dist/icons/ui/Icons.d.ts +30 -22
- package/dist/icons/ui/Icons.js +308 -0
- package/dist/icons/ui/index.d.ts +1 -1
- package/dist/index.d.ts +68 -67
- package/dist/index.js +68 -5775
- package/dist/reset.d.ts +1 -0
- package/dist/reset.js +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +1 -0
- package/dist/styles/reset.css +175 -0
- package/dist/styles/style.css +263 -0
- package/dist/utils/mergeClassName.js +8 -0
- package/package.json +11 -10
- package/dist/components/CloseButton/index.d.ts +0 -1
- package/dist/components/Meter/index.d.ts +0 -1
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Separator/index.d.ts +0 -1
- package/dist/components/Tabs/index.d.ts +0 -1
- package/dist/components/Toolbar/index.d.ts +0 -1
- package/dist/data/insideScrollSections.d.ts +0 -4
- package/dist/index.cjs +0 -1
- package/dist/index.css +0 -1
- package/dist/reset.css +0 -334
- package/dist/utils/mergeClassName.d.ts +0 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.PtMr7W_root {
|
|
3
|
+
flex: var(--stack-flex, initial);
|
|
4
|
+
flex-direction: var(--stack-direction-mobile, column);
|
|
5
|
+
display: flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (width >= 640px) {
|
|
9
|
+
.PtMr7W_root {
|
|
10
|
+
flex-direction: var(--stack-direction-desktop, var(--stack-direction-mobile, column));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSProperties, ComponentPropsWithoutRef, ElementType } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/Stack/Stack.d.ts
|
|
2
4
|
type StackDirection = 'row' | 'column';
|
|
3
|
-
declare function Stack({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
declare function Stack({
|
|
6
|
+
as: Root,
|
|
7
|
+
className,
|
|
8
|
+
style,
|
|
9
|
+
direction,
|
|
10
|
+
gap,
|
|
11
|
+
align,
|
|
12
|
+
justify,
|
|
13
|
+
wrap,
|
|
14
|
+
fill,
|
|
15
|
+
...props
|
|
16
|
+
}: ComponentPropsWithoutRef<'div'> & {
|
|
17
|
+
as?: ElementType;
|
|
18
|
+
direction?: StackDirection | {
|
|
19
|
+
mobile?: StackDirection;
|
|
20
|
+
desktop?: StackDirection;
|
|
21
|
+
};
|
|
22
|
+
gap?: number | string;
|
|
23
|
+
align?: CSSProperties['alignItems'];
|
|
24
|
+
justify?: CSSProperties['justifyContent'];
|
|
25
|
+
wrap?: CSSProperties['flexWrap'];
|
|
26
|
+
fill?: boolean;
|
|
14
27
|
}): import("react").JSX.Element;
|
|
15
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Stack };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Stack_module_default from "./Stack.module.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
//#region src/components/Stack/Stack.tsx
|
|
5
|
+
function Stack({ as: Root = "div", className, style, direction, gap, align, justify, wrap, fill, ...props }) {
|
|
6
|
+
const responsiveDirection = typeof direction === "string" ? {
|
|
7
|
+
mobile: direction,
|
|
8
|
+
desktop: direction
|
|
9
|
+
} : direction;
|
|
10
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
11
|
+
...props,
|
|
12
|
+
"data-slot": "stack-root",
|
|
13
|
+
className: clsx(Stack_module_default.root, className),
|
|
14
|
+
style: {
|
|
15
|
+
"--stack-direction-desktop": responsiveDirection?.desktop ?? responsiveDirection?.mobile ?? "column",
|
|
16
|
+
"--stack-direction-mobile": responsiveDirection?.mobile ?? responsiveDirection?.desktop ?? "column",
|
|
17
|
+
"--stack-flex": fill ? "1 1 0" : "initial",
|
|
18
|
+
gap,
|
|
19
|
+
alignItems: align,
|
|
20
|
+
justifyContent: justify,
|
|
21
|
+
flexWrap: wrap,
|
|
22
|
+
...style
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Stack };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { Stack } from "./Stack.js";
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.-W7elW_root {
|
|
3
|
+
width: 100%;
|
|
4
|
+
color: var(--stepper-color, var(--color-foreground));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.-W7elW_list {
|
|
8
|
+
gap: var(--stepper-gap, var(--spacing-4));
|
|
9
|
+
width: 100%;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
list-style: none;
|
|
13
|
+
display: flex;
|
|
14
|
+
|
|
15
|
+
&[data-orientation="vertical"] {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.-W7elW_item {
|
|
21
|
+
flex: 1 1 0;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
position: relative;
|
|
24
|
+
|
|
25
|
+
&[data-orientation="vertical"] {
|
|
26
|
+
flex: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:not(:last-child):after {
|
|
30
|
+
content: "";
|
|
31
|
+
background-color: var(--stepper-connector-color, var(--color-border));
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
position: absolute;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[data-state="completed"]:after {
|
|
37
|
+
background-color: var(--stepper-connector-color-active, var(--color-foreground));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[data-orientation="horizontal"]:not(:last-child):after {
|
|
41
|
+
top: calc(var(--stepper-indicator-size, 2rem) / 2);
|
|
42
|
+
left: calc(var(--stepper-indicator-size, 2rem) + var(--stepper-connector-inset, .5rem));
|
|
43
|
+
right: calc(var(--stepper-gap, var(--spacing-4)) / -1);
|
|
44
|
+
height: var(--stepper-connector-thickness, var(--border-width-sm));
|
|
45
|
+
translate: 0 -50%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-orientation="vertical"]:not(:last-child):after {
|
|
49
|
+
top: calc(var(--stepper-indicator-size, 2rem) + var(--stepper-connector-inset, .5rem));
|
|
50
|
+
bottom: calc(var(--stepper-gap, var(--spacing-4)) / -1);
|
|
51
|
+
left: calc(var(--stepper-indicator-size, 2rem) / 2);
|
|
52
|
+
width: var(--stepper-connector-thickness, var(--border-width-sm));
|
|
53
|
+
translate: -50%;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.-W7elW_trigger {
|
|
58
|
+
z-index: 1;
|
|
59
|
+
width: 100%;
|
|
60
|
+
color: inherit;
|
|
61
|
+
font: inherit;
|
|
62
|
+
text-align: left;
|
|
63
|
+
background: none;
|
|
64
|
+
border: 0;
|
|
65
|
+
outline: none;
|
|
66
|
+
padding: 0;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
display: grid;
|
|
69
|
+
position: relative;
|
|
70
|
+
|
|
71
|
+
&[data-orientation="horizontal"] {
|
|
72
|
+
gap: var(--stepper-content-gap, .5rem);
|
|
73
|
+
grid-template-columns: minmax(0, 1fr);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&[data-orientation="vertical"] {
|
|
77
|
+
align-items: start;
|
|
78
|
+
gap: var(--stepper-trigger-gap, var(--spacing-3));
|
|
79
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:where(button) {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:focus-visible .-W7elW_indicator {
|
|
87
|
+
outline: var(--stepper-focus-ring-width, var(--border-width-sm)) solid
|
|
88
|
+
var(--stepper-focus-ring-color, var(--color-ring));
|
|
89
|
+
outline-offset: var(--stepper-focus-ring-offset, 2px);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&[aria-disabled="true"], &[data-disabled] {
|
|
93
|
+
opacity: var(--stepper-disabled-opacity, var(--opacity-disabled));
|
|
94
|
+
cursor: default;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (hover: hover) {
|
|
99
|
+
&:not([aria-disabled="true"]):not([data-disabled]):hover .-W7elW_indicator[data-state="inactive"] {
|
|
100
|
+
border-color: var(--stepper-indicator-border-color-hover, var(--stepper-indicator-border-color-current, var(--color-foreground)));
|
|
101
|
+
color: var(--stepper-indicator-color-hover, var(--stepper-indicator-color-current, var(--color-foreground)));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:not([aria-disabled="true"]):not([data-disabled]):hover .-W7elW_title {
|
|
105
|
+
color: var(--stepper-title-color-hover, var(--color-foreground));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.-W7elW_indicator {
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
width: var(--stepper-indicator-size, 2rem);
|
|
113
|
+
height: var(--stepper-indicator-size, 2rem);
|
|
114
|
+
border: var(--stepper-indicator-border-width, var(--border-width-sm)) solid
|
|
115
|
+
var(--stepper-indicator-border-color, var(--color-border));
|
|
116
|
+
border-radius: var(--stepper-indicator-radius, var(--radius-full));
|
|
117
|
+
background-color: var(--stepper-indicator-bg, var(--color-background));
|
|
118
|
+
color: var(--stepper-indicator-color, var(--color-muted-foreground));
|
|
119
|
+
font-size: var(--stepper-indicator-font-size, var(--text-sm));
|
|
120
|
+
font-weight: var(--stepper-indicator-font-weight, var(--weight-semibold));
|
|
121
|
+
transition: background-color var(--transition-default),
|
|
122
|
+
border-color var(--transition-default),
|
|
123
|
+
color var(--transition-default),
|
|
124
|
+
opacity var(--transition-default);
|
|
125
|
+
justify-content: center;
|
|
126
|
+
align-items: center;
|
|
127
|
+
line-height: 1;
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
|
|
130
|
+
& :where(svg) {
|
|
131
|
+
width: var(--stepper-indicator-icon-size, .875rem);
|
|
132
|
+
height: var(--stepper-indicator-icon-size, .875rem);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&[data-state="current"] {
|
|
136
|
+
border-color: var(--stepper-indicator-border-color-current, var(--stepper-indicator-border-color-completed, var(--color-foreground)));
|
|
137
|
+
background-color: var(--stepper-indicator-bg-current, var(--stepper-indicator-bg));
|
|
138
|
+
color: var(--stepper-indicator-color-current, var(--color-foreground));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&[data-state="completed"] {
|
|
142
|
+
border-color: var(--stepper-indicator-border-color-completed, var(--color-foreground));
|
|
143
|
+
background-color: var(--stepper-indicator-bg-completed, var(--color-foreground));
|
|
144
|
+
color: var(--stepper-indicator-color-completed, var(--color-background));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.-W7elW_content {
|
|
149
|
+
gap: var(--stepper-content-gap, .25rem);
|
|
150
|
+
min-width: 0;
|
|
151
|
+
display: grid;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.-W7elW_title {
|
|
155
|
+
color: var(--stepper-title-color, currentColor);
|
|
156
|
+
font-size: var(--stepper-title-font-size, var(--text-sm));
|
|
157
|
+
font-weight: var(--stepper-title-font-weight, var(--weight-medium));
|
|
158
|
+
line-height: var(--stepper-title-line-height, var(--line-height-text-sm));
|
|
159
|
+
|
|
160
|
+
&[data-state="current"] {
|
|
161
|
+
color: var(--stepper-title-color-current, var(--stepper-title-color, currentColor));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.-W7elW_description {
|
|
166
|
+
color: var(--stepper-description-color, var(--color-muted-foreground));
|
|
167
|
+
font-size: var(--stepper-description-font-size, var(--text-xs));
|
|
168
|
+
line-height: var(--stepper-description-line-height, var(--line-height-text-xs));
|
|
169
|
+
|
|
170
|
+
&[data-state="current"] {
|
|
171
|
+
color: var(--stepper-description-color-current, var(--stepper-description-color, var(--color-muted-foreground)));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -1,20 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Stepper/Stepper.d.ts
|
|
3
5
|
type StepperOrientation = 'horizontal' | 'vertical';
|
|
4
6
|
type StepperStatus = 'inactive' | 'current' | 'completed';
|
|
5
|
-
declare function Stepper({
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
declare function Stepper({
|
|
8
|
+
className,
|
|
9
|
+
currentStep,
|
|
10
|
+
orientation,
|
|
11
|
+
'aria-label': ariaLabel,
|
|
12
|
+
...props
|
|
13
|
+
}: ComponentProps<'nav'> & {
|
|
14
|
+
currentStep?: number;
|
|
15
|
+
orientation?: StepperOrientation;
|
|
8
16
|
}): import("react").JSX.Element;
|
|
9
|
-
declare function StepperList({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
declare function StepperList({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}: ComponentProps<'ol'>): import("react").JSX.Element;
|
|
21
|
+
declare function StepperItem({
|
|
22
|
+
className,
|
|
23
|
+
status,
|
|
24
|
+
step,
|
|
25
|
+
'aria-current': ariaCurrent,
|
|
26
|
+
...props
|
|
27
|
+
}: ComponentProps<'li'> & {
|
|
28
|
+
status?: StepperStatus;
|
|
29
|
+
step: number;
|
|
13
30
|
}): import("react").JSX.Element;
|
|
14
|
-
declare function StepperTrigger({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
declare function StepperTrigger({
|
|
32
|
+
className,
|
|
33
|
+
disabled,
|
|
34
|
+
render,
|
|
35
|
+
tabIndex,
|
|
36
|
+
type,
|
|
37
|
+
'aria-current': ariaCurrent,
|
|
38
|
+
'aria-disabled': ariaDisabled,
|
|
39
|
+
...props
|
|
40
|
+
}: useRender.ComponentProps<'button'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
41
|
+
declare function StepperIndicator({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: ComponentProps<'span'>): import("react").JSX.Element;
|
|
46
|
+
declare function StepperContent({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: ComponentProps<'div'>): import("react").JSX.Element;
|
|
50
|
+
declare function StepperTitle({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: ComponentProps<'span'>): import("react").JSX.Element;
|
|
54
|
+
declare function StepperDescription({
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: ComponentProps<'span'>): import("react").JSX.Element;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, type StepperOrientation, type StepperStatus, StepperTitle, StepperTrigger };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { CheckIcon } from "../../icons/ui/Icons.js";
|
|
2
|
+
import Stepper_module_default from "./Stepper.module.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { createContext, useContext, useMemo } from "react";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
//#region src/components/Stepper/Stepper.tsx
|
|
8
|
+
const StepperContext = createContext({
|
|
9
|
+
currentStep: void 0,
|
|
10
|
+
orientation: "horizontal"
|
|
11
|
+
});
|
|
12
|
+
const StepperItemContext = createContext(null);
|
|
13
|
+
const getSafeStep = (step) => Math.max(1, Math.floor(step));
|
|
14
|
+
function resolveStatus({ currentStep, status, step }) {
|
|
15
|
+
if (status != null) return status;
|
|
16
|
+
if (currentStep == null) return "inactive";
|
|
17
|
+
if (step < currentStep) return "completed";
|
|
18
|
+
if (step === currentStep) return "current";
|
|
19
|
+
return "inactive";
|
|
20
|
+
}
|
|
21
|
+
function Stepper({ className, currentStep, orientation = "horizontal", "aria-label": ariaLabel = "Steps", ...props }) {
|
|
22
|
+
const safeCurrentStep = currentStep == null ? void 0 : getSafeStep(currentStep);
|
|
23
|
+
const contextValue = useMemo(() => ({
|
|
24
|
+
currentStep: safeCurrentStep,
|
|
25
|
+
orientation
|
|
26
|
+
}), [orientation, safeCurrentStep]);
|
|
27
|
+
return /* @__PURE__ */ jsx(StepperContext.Provider, {
|
|
28
|
+
value: contextValue,
|
|
29
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
30
|
+
"data-slot": "stepper-root",
|
|
31
|
+
"data-orientation": orientation,
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
className: clsx(Stepper_module_default.root, className),
|
|
34
|
+
...props
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function StepperList({ className, ...props }) {
|
|
39
|
+
const { orientation } = useContext(StepperContext);
|
|
40
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
41
|
+
"data-slot": "stepper-list",
|
|
42
|
+
"data-orientation": orientation,
|
|
43
|
+
className: clsx(Stepper_module_default.list, className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function StepperItem({ className, status, step, "aria-current": ariaCurrent, ...props }) {
|
|
48
|
+
const { currentStep, orientation } = useContext(StepperContext);
|
|
49
|
+
const safeStep = getSafeStep(step);
|
|
50
|
+
const resolvedStatus = resolveStatus({
|
|
51
|
+
currentStep,
|
|
52
|
+
status,
|
|
53
|
+
step: safeStep
|
|
54
|
+
});
|
|
55
|
+
const contextValue = useMemo(() => ({
|
|
56
|
+
status: resolvedStatus,
|
|
57
|
+
step: safeStep
|
|
58
|
+
}), [resolvedStatus, safeStep]);
|
|
59
|
+
return /* @__PURE__ */ jsx(StepperItemContext.Provider, {
|
|
60
|
+
value: contextValue,
|
|
61
|
+
children: /* @__PURE__ */ jsx("li", {
|
|
62
|
+
"data-slot": "stepper-item",
|
|
63
|
+
"data-orientation": orientation,
|
|
64
|
+
"data-state": resolvedStatus,
|
|
65
|
+
"aria-current": ariaCurrent ?? (resolvedStatus === "current" ? "step" : void 0),
|
|
66
|
+
className: clsx(Stepper_module_default.item, className),
|
|
67
|
+
...props
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function StepperTrigger({ className, disabled, render, tabIndex, type, "aria-current": ariaCurrent, "aria-disabled": ariaDisabled, ...props }) {
|
|
72
|
+
const { orientation } = useContext(StepperContext);
|
|
73
|
+
const item = useContext(StepperItemContext);
|
|
74
|
+
return useRender({
|
|
75
|
+
defaultTagName: "button",
|
|
76
|
+
render,
|
|
77
|
+
props: {
|
|
78
|
+
...props,
|
|
79
|
+
"aria-current": ariaCurrent ?? (item?.status === "current" ? "step" : void 0),
|
|
80
|
+
"aria-disabled": ariaDisabled ?? (disabled ? true : void 0),
|
|
81
|
+
"data-disabled": disabled ? "" : void 0,
|
|
82
|
+
"data-orientation": orientation,
|
|
83
|
+
"data-slot": "stepper-trigger",
|
|
84
|
+
"data-state": item?.status,
|
|
85
|
+
className: clsx(Stepper_module_default.trigger, className),
|
|
86
|
+
disabled: render == null ? disabled : void 0,
|
|
87
|
+
tabIndex: disabled && render != null ? -1 : tabIndex,
|
|
88
|
+
type: render == null ? type ?? "button" : type
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function StepperIndicator({ children, className, ...props }) {
|
|
93
|
+
const { orientation } = useContext(StepperContext);
|
|
94
|
+
const item = useContext(StepperItemContext);
|
|
95
|
+
return /* @__PURE__ */ jsx("span", {
|
|
96
|
+
"data-slot": "stepper-indicator",
|
|
97
|
+
"data-orientation": orientation,
|
|
98
|
+
"data-state": item?.status,
|
|
99
|
+
className: clsx(Stepper_module_default.indicator, className),
|
|
100
|
+
...props,
|
|
101
|
+
children: children ?? (item?.status === "completed" ? /* @__PURE__ */ jsx(CheckIcon, {}) : item?.step)
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function StepperContent({ className, ...props }) {
|
|
105
|
+
const { orientation } = useContext(StepperContext);
|
|
106
|
+
return /* @__PURE__ */ jsx("div", {
|
|
107
|
+
"data-slot": "stepper-content",
|
|
108
|
+
"data-orientation": orientation,
|
|
109
|
+
"data-state": useContext(StepperItemContext)?.status,
|
|
110
|
+
className: clsx(Stepper_module_default.content, className),
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function StepperTitle({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx("span", {
|
|
116
|
+
"data-slot": "stepper-title",
|
|
117
|
+
"data-state": useContext(StepperItemContext)?.status,
|
|
118
|
+
className: clsx(Stepper_module_default.title, className),
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function StepperDescription({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx("span", {
|
|
124
|
+
"data-slot": "stepper-description",
|
|
125
|
+
"data-state": useContext(StepperItemContext)?.status,
|
|
126
|
+
className: clsx(Stepper_module_default.description, className),
|
|
127
|
+
...props
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperTitle, StepperTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './Stepper.css';
|
|
2
|
+
//#region src/components/Stepper/Stepper.module.css
|
|
3
|
+
var Stepper_module_default = {
|
|
4
|
+
"content": "-W7elW_content",
|
|
5
|
+
"description": "-W7elW_description",
|
|
6
|
+
"indicator": "-W7elW_indicator",
|
|
7
|
+
"item": "-W7elW_item",
|
|
8
|
+
"list": "-W7elW_list",
|
|
9
|
+
"root": "-W7elW_root",
|
|
10
|
+
"title": "-W7elW_title",
|
|
11
|
+
"trigger": "-W7elW_trigger"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Stepper_module_default as default };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type { StepperOrientation, StepperStatus } from './Stepper';
|
|
1
|
+
import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperOrientation, StepperStatus, StepperTitle, StepperTrigger } from "./Stepper.js";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.klbdca_field {
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--switch-gap, var(--spacing-2));
|
|
5
|
+
vertical-align: middle;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
|
|
9
|
+
&:has(.klbdca_root[data-disabled]), &:has(.klbdca_root[data-readonly]) {
|
|
10
|
+
cursor: default;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.klbdca_root {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
-webkit-appearance: none;
|
|
17
|
+
appearance: none;
|
|
18
|
+
width: var(--switch-width, 2.5rem);
|
|
19
|
+
height: var(--switch-height, 1.5rem);
|
|
20
|
+
--switch-thumb-translate-default: calc(var(--switch-width, 2.5rem) - var(--switch-thumb-size, 1.125rem) -
|
|
21
|
+
var(--switch-padding, .125rem) - var(--switch-padding, .125rem) -
|
|
22
|
+
var(--switch-border-width, var(--border-width-sm)) -
|
|
23
|
+
var(--switch-border-width, var(--border-width-sm)));
|
|
24
|
+
border: var(--switch-border-width, var(--border-width-sm)) solid
|
|
25
|
+
var(--switch-border-color, var(--color-border));
|
|
26
|
+
border-radius: var(--switch-radius, var(--radius-full));
|
|
27
|
+
padding: var(--switch-padding, .125rem);
|
|
28
|
+
background-color: var(--switch-bg, var(--color-muted));
|
|
29
|
+
user-select: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
transition: background-color var(--switch-transition, var(--transition-default)),
|
|
32
|
+
border-color var(--switch-transition, var(--transition-default)),
|
|
33
|
+
opacity var(--switch-transition, var(--transition-default));
|
|
34
|
+
outline: 0;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
align-items: center;
|
|
37
|
+
margin: 0;
|
|
38
|
+
line-height: 0;
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
position: relative;
|
|
41
|
+
|
|
42
|
+
&[data-checked] {
|
|
43
|
+
border-color: var(--switch-border-color-checked, var(--color-primary));
|
|
44
|
+
background-color: var(--switch-bg-checked, var(--color-primary));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:focus-visible {
|
|
48
|
+
outline: var(--switch-focus-ring-width, var(--border-width-sm)) solid
|
|
49
|
+
var(--switch-focus-ring-color, var(--color-ring));
|
|
50
|
+
outline-offset: var(--switch-focus-ring-offset, var(--border-width-sm));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (hover: hover) {
|
|
54
|
+
&[data-unchecked]:not([data-readonly]):hover {
|
|
55
|
+
background-color: var(--switch-bg-hover, var(--color-accent));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&[data-checked]:not([data-readonly]):hover {
|
|
59
|
+
background-color: var(--switch-bg-checked-hover, var(--switch-bg-checked, var(--color-primary)));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[data-disabled], &[data-readonly] {
|
|
64
|
+
cursor: default;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&[data-disabled] {
|
|
68
|
+
opacity: var(--switch-disabled-opacity, var(--opacity-disabled));
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-size="xs"] {
|
|
73
|
+
--switch-width: var(--switch-width-xs, 1.75rem);
|
|
74
|
+
--switch-height: var(--switch-height-xs, 1rem);
|
|
75
|
+
--switch-thumb-size: var(--switch-thumb-size-xs, .625rem);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-size="sm"] {
|
|
79
|
+
--switch-width: var(--switch-width-sm, 2rem);
|
|
80
|
+
--switch-height: var(--switch-height-sm, 1.25rem);
|
|
81
|
+
--switch-thumb-size: var(--switch-thumb-size-sm, .875rem);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[data-size="md"] {
|
|
85
|
+
--switch-width: var(--switch-width-md, 2.5rem);
|
|
86
|
+
--switch-height: var(--switch-height-md, 1.5rem);
|
|
87
|
+
--switch-thumb-size: var(--switch-thumb-size-md, 1.125rem);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&[data-size="lg"] {
|
|
91
|
+
--switch-width: var(--switch-width-lg, 3rem);
|
|
92
|
+
--switch-height: var(--switch-height-lg, 1.75rem);
|
|
93
|
+
--switch-thumb-size: var(--switch-thumb-size-lg, 1.375rem);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&[data-size="xl"] {
|
|
97
|
+
--switch-width: var(--switch-width-xl, 3.5rem);
|
|
98
|
+
--switch-height: var(--switch-height-xl, 2rem);
|
|
99
|
+
--switch-thumb-size: var(--switch-thumb-size-xl, 1.625rem);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.klbdca_thumb {
|
|
104
|
+
width: var(--switch-thumb-size, 1.125rem);
|
|
105
|
+
height: var(--switch-thumb-size, 1.125rem);
|
|
106
|
+
border: var(--switch-thumb-border-width, 0) solid var(--switch-thumb-border-color, transparent);
|
|
107
|
+
border-radius: var(--switch-thumb-radius, var(--radius-full));
|
|
108
|
+
background-color: var(--switch-thumb-bg-unchecked, var(--switch-thumb-bg, var(--color-background)));
|
|
109
|
+
color: var(--switch-thumb-color-unchecked, var(--switch-thumb-color, var(--color-muted)));
|
|
110
|
+
box-shadow: var(--switch-thumb-shadow, var(--shadow-sm));
|
|
111
|
+
transition: transform var(--switch-thumb-transition, var(--switch-transition, var(--transition-default))),
|
|
112
|
+
background-color var(--switch-transition, var(--transition-default)),
|
|
113
|
+
color var(--switch-transition, var(--transition-default));
|
|
114
|
+
justify-content: center;
|
|
115
|
+
align-items: center;
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
transform: translateX(0);
|
|
118
|
+
|
|
119
|
+
&[data-checked] {
|
|
120
|
+
background-color: var(--switch-thumb-bg-checked, var(--switch-thumb-bg, var(--color-primary-foreground)));
|
|
121
|
+
color: var(--switch-thumb-color-checked, var(--switch-thumb-color, var(--color-primary)));
|
|
122
|
+
transform: translateX(var(--switch-thumb-translate, var(--switch-thumb-translate-default)));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
& > svg {
|
|
126
|
+
width: var(--switch-thumb-icon-size, 65%);
|
|
127
|
+
height: var(--switch-thumb-icon-size, 65%);
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.klbdca_label {
|
|
133
|
+
color: var(--switch-label-color, var(--color-foreground));
|
|
134
|
+
font-size: var(--switch-label-font-size, var(--text-sm));
|
|
135
|
+
font-weight: var(--switch-label-font-weight, var(--weight-medium));
|
|
136
|
+
line-height: var(--switch-label-line-height, var(--line-height-text-sm));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Switch } from "@base-ui/react/switch";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Switch/Switch.d.ts
|
|
3
5
|
type SwitchSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
-
declare const Switch: import(
|
|
5
|
-
|
|
6
|
-
}, "ref"> & import(
|
|
7
|
-
declare function SwitchThumb({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
declare const Switch$1: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").SwitchRootProps & {
|
|
7
|
+
size?: SwitchSize;
|
|
8
|
+
}, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
declare function SwitchThumb({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: Switch.Thumb.Props): import("react").JSX.Element;
|
|
13
|
+
declare function SwitchField({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: ComponentProps<'label'>): import("react").JSX.Element;
|
|
17
|
+
declare function SwitchLabel({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}: ComponentProps<'span'>): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Switch$1 as Switch, SwitchField, SwitchLabel, SwitchThumb };
|