@moduix/react 1.1.1 → 2.1.0
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 +105 -177
- package/dist/components/accordion/Accordion.css +12 -5
- package/dist/components/accordion/Accordion.d.ts +3 -2
- package/dist/components/accordion/Accordion.js +17 -5
- package/dist/components/accordion/Accordion.module.js +1 -0
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/alert/Alert.css +24 -10
- package/dist/components/alert/Alert.d.ts +5 -3
- package/dist/components/alert/Alert.js +17 -5
- package/dist/components/alert/Alert.module.js +1 -0
- package/dist/components/angle-slider/AngleSlider.css +9 -9
- package/dist/components/angle-slider/AngleSlider.d.ts +18 -2
- package/dist/components/angle-slider/AngleSlider.js +34 -18
- package/dist/components/angle-slider/index.d.ts +2 -2
- package/dist/components/aspect-ratio/AspectRatio.css +3 -1
- package/dist/components/aspect-ratio/AspectRatio.js +2 -2
- package/dist/components/avatar/Avatar.d.ts +6 -3
- package/dist/components/avatar/Avatar.js +12 -5
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/Badge.css +52 -8
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bleed/Bleed.d.ts +6 -4
- package/dist/components/bleed/Bleed.js +3 -3
- package/dist/components/breadcrumbs/Breadcrumbs.css +13 -6
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -4
- package/dist/components/breadcrumbs/Breadcrumbs.module.js +2 -1
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/button/Button.css +45 -25
- package/dist/components/button/Button.d.ts +6 -0
- package/dist/components/button/Button.js +12 -7
- package/dist/components/card/Card.css +21 -5
- package/dist/components/card/Card.d.ts +1 -0
- package/dist/components/card/Card.js +12 -1
- package/dist/components/card/Card.module.js +1 -0
- package/dist/components/carousel/Carousel.css +19 -17
- package/dist/components/carousel/Carousel.d.ts +4 -0
- package/dist/components/carousel/Carousel.js +15 -2
- package/dist/components/checkbox/Checkbox.css +13 -13
- package/dist/components/checkbox/Checkbox.d.ts +2 -3
- package/dist/components/checkbox/Checkbox.js +25 -22
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/clipboard/Clipboard.css +11 -11
- package/dist/components/clipboard/Clipboard.d.ts +2 -0
- package/dist/components/clipboard/Clipboard.js +15 -4
- package/dist/components/close-button/CloseButton.css +7 -7
- package/dist/components/close-button/CloseButton.d.ts +12 -2
- package/dist/components/close-button/CloseButton.js +9 -9
- package/dist/components/collapsible/Collapsible.css +13 -6
- package/dist/components/collapsible/Collapsible.d.ts +3 -2
- package/dist/components/collapsible/Collapsible.js +18 -6
- package/dist/components/collapsible/Collapsible.module.js +1 -0
- package/dist/components/collapsible/index.d.ts +2 -2
- package/dist/components/color-picker/ColorPicker.css +63 -27
- package/dist/components/color-picker/ColorPicker.d.ts +3 -3
- package/dist/components/color-picker/ColorPicker.js +78 -27
- package/dist/components/color-picker/ColorPicker.module.js +1 -0
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/combobox/Combobox.css +69 -53
- package/dist/components/combobox/Combobox.d.ts +9 -2
- package/dist/components/combobox/Combobox.js +34 -8
- package/dist/components/combobox/index.d.ts +2 -2
- package/dist/components/command-palette/CommandPalette.css +67 -100
- package/dist/components/command-palette/CommandPalette.d.ts +13 -3
- package/dist/components/command-palette/CommandPalette.js +54 -43
- package/dist/components/command-palette/CommandPalette.module.js +0 -2
- package/dist/components/container/Container.js +1 -1
- package/dist/components/date-input/DateInput.css +8 -5
- package/dist/components/date-input/DateInput.d.ts +12 -7
- package/dist/components/date-input/DateInput.js +35 -14
- package/dist/components/date-input/index.d.ts +2 -2
- package/dist/components/date-picker/DatePicker.css +78 -57
- package/dist/components/date-picker/DatePicker.d.ts +30 -2
- package/dist/components/date-picker/DatePicker.js +94 -9
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/dialog/Dialog.css +19 -14
- package/dist/components/dialog/Dialog.d.ts +2 -2
- package/dist/components/dialog/Dialog.js +3 -3
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/drawer/Drawer.css +6 -5
- package/dist/components/drawer/Drawer.d.ts +2 -2
- package/dist/components/drawer/Drawer.js +3 -3
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/editable/Editable.css +12 -10
- package/dist/components/editable/Editable.d.ts +9 -2
- package/dist/components/editable/Editable.js +14 -5
- package/dist/components/editable/index.d.ts +2 -2
- package/dist/components/empty/Empty.css +2 -2
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/field/Field.css +6 -8
- package/dist/components/field/Field.d.ts +3 -2
- package/dist/components/field/Field.js +6 -5
- package/dist/components/field/Field.module.js +0 -1
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/fieldset/Fieldset.d.ts +2 -2
- package/dist/components/fieldset/Fieldset.js +3 -3
- package/dist/components/fieldset/index.d.ts +2 -2
- package/dist/components/file-upload/FileUpload.css +96 -23
- package/dist/components/file-upload/FileUpload.d.ts +22 -5
- package/dist/components/file-upload/FileUpload.js +79 -21
- package/dist/components/file-upload/FileUpload.module.js +3 -0
- package/dist/components/file-upload/index.d.ts +2 -2
- package/dist/components/floating-panel/FloatingPanel.css +44 -40
- package/dist/components/floating-panel/FloatingPanel.d.ts +10 -2
- package/dist/components/floating-panel/FloatingPanel.js +15 -9
- package/dist/components/heading/Heading.js +1 -1
- package/dist/components/highlight/Highlight.css +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/hover-card/HoverCard.css +19 -15
- package/dist/components/hover-card/HoverCard.d.ts +3 -2
- package/dist/components/hover-card/HoverCard.js +5 -4
- package/dist/components/hover-card/index.d.ts +2 -2
- package/dist/components/image/Image.css +7 -0
- package/dist/components/image/Image.d.ts +12 -0
- package/dist/components/image/Image.js +28 -0
- package/dist/components/image/Image.module.js +5 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image-cropper/ImageCropper.css +15 -11
- package/dist/components/image-cropper/ImageCropper.d.ts +7 -2
- package/dist/components/image-cropper/ImageCropper.js +25 -3
- package/dist/components/image-cropper/index.d.ts +2 -2
- package/dist/components/input/Input.css +9 -9
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input-group/InputGroup.css +29 -29
- package/dist/components/input-group/InputGroup.d.ts +3 -0
- package/dist/components/input-group/InputGroup.js +1 -1
- package/dist/components/kbd/Kbd.css +2 -2
- package/dist/components/kbd/Kbd.js +1 -1
- package/dist/components/lightbox/Lightbox.css +19 -17
- package/dist/components/lightbox/Lightbox.d.ts +4 -2
- package/dist/components/lightbox/Lightbox.js +9 -7
- package/dist/components/lightbox/index.d.ts +2 -2
- package/dist/components/list/List.js +1 -1
- package/dist/components/listbox/Listbox.css +87 -26
- package/dist/components/listbox/Listbox.d.ts +14 -2
- package/dist/components/listbox/Listbox.js +41 -5
- package/dist/components/listbox/Listbox.module.js +3 -0
- package/dist/components/listbox/index.d.ts +2 -2
- package/dist/components/marquee/Marquee.d.ts +2 -1
- package/dist/components/marquee/Marquee.js +4 -3
- package/dist/components/marquee/index.d.ts +2 -2
- package/dist/components/menu/Menu.css +54 -45
- package/dist/components/menu/Menu.d.ts +3 -2
- package/dist/components/menu/Menu.js +6 -5
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/native-select/NativeSelect.css +17 -12
- package/dist/components/native-select/NativeSelect.d.ts +6 -2
- package/dist/components/native-select/NativeSelect.js +5 -4
- package/dist/components/number-input/NumberInput.css +17 -24
- package/dist/components/number-input/NumberInput.d.ts +7 -2
- package/dist/components/number-input/NumberInput.js +17 -4
- package/dist/components/number-input/index.d.ts +2 -2
- package/dist/components/pagination/Pagination.css +11 -11
- package/dist/components/pagination/Pagination.d.ts +4 -0
- package/dist/components/pagination/Pagination.js +13 -4
- package/dist/components/password-input/PasswordInput.css +4 -4
- package/dist/components/password-input/PasswordInput.d.ts +4 -0
- package/dist/components/password-input/PasswordInput.js +10 -2
- package/dist/components/pin-input/PinInput.css +6 -6
- package/dist/components/pin-input/PinInput.d.ts +6 -1
- package/dist/components/pin-input/PinInput.js +25 -16
- package/dist/components/popover/Popover.css +29 -19
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.css +2 -2
- package/dist/components/progress-circular/ProgressCircular.d.ts +6 -0
- package/dist/components/progress-circular/ProgressCircular.js +14 -3
- package/dist/components/progress-linear/ProgressLinear.css +1 -1
- package/dist/components/progress-linear/ProgressLinear.d.ts +3 -0
- package/dist/components/progress-linear/ProgressLinear.js +6 -3
- package/dist/components/qr-code/QrCode.css +10 -9
- package/dist/components/qr-code/QrCode.d.ts +2 -2
- package/dist/components/qr-code/QrCode.js +3 -3
- package/dist/components/qr-code/index.d.ts +2 -2
- package/dist/components/radio-group/RadioGroup.css +12 -12
- package/dist/components/radio-group/RadioGroup.d.ts +8 -4
- package/dist/components/radio-group/RadioGroup.js +22 -14
- package/dist/components/radio-group/index.d.ts +2 -2
- package/dist/components/rating-group/RatingGroup.css +10 -10
- package/dist/components/rating-group/RatingGroup.d.ts +11 -4
- package/dist/components/rating-group/RatingGroup.js +29 -18
- package/dist/components/rating-group/index.d.ts +2 -2
- package/dist/components/scroll-area/ScrollArea.css +12 -7
- package/dist/components/scroll-area/ScrollArea.d.ts +3 -0
- package/dist/components/scroll-area/ScrollArea.js +9 -6
- package/dist/components/segment-group/SegmentGroup.css +4 -4
- package/dist/components/segment-group/SegmentGroup.d.ts +13 -3
- package/dist/components/segment-group/SegmentGroup.js +23 -15
- package/dist/components/segment-group/index.d.ts +2 -2
- package/dist/components/select/Select.css +81 -55
- package/dist/components/select/Select.d.ts +18 -4
- package/dist/components/select/Select.js +65 -20
- package/dist/components/separator/Separator.css +6 -6
- package/dist/components/separator/Separator.js +1 -1
- package/dist/components/sidebar/Sidebar.css +161 -20
- package/dist/components/sidebar/Sidebar.d.ts +26 -0
- package/dist/components/sidebar/Sidebar.js +105 -13
- package/dist/components/sidebar/Sidebar.module.js +6 -0
- package/dist/components/signature-pad/SignaturePad.css +17 -45
- package/dist/components/signature-pad/SignaturePad.d.ts +14 -6
- package/dist/components/signature-pad/SignaturePad.js +56 -17
- package/dist/components/signature-pad/index.d.ts +2 -2
- package/dist/components/simple-grid/SimpleGrid.js +3 -3
- package/dist/components/skeleton/Skeleton.css +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.css +17 -13
- package/dist/components/slider/Slider.d.ts +12 -3
- package/dist/components/slider/Slider.js +24 -15
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/spinner/Spinner.css +5 -5
- package/dist/components/spinner/Spinner.js +2 -2
- package/dist/components/split-button/SplitButton.css +10 -10
- package/dist/components/split-button/SplitButton.d.ts +1 -1
- package/dist/components/split-button/SplitButton.js +3 -4
- package/dist/components/splitter/Splitter.css +19 -18
- package/dist/components/splitter/Splitter.d.ts +2 -2
- package/dist/components/splitter/Splitter.js +12 -11
- package/dist/components/splitter/index.d.ts +2 -2
- package/dist/components/stack/Stack.d.ts +1 -3
- package/dist/components/stack/Stack.js +4 -6
- package/dist/components/steps/Steps.css +20 -19
- package/dist/components/steps/Steps.d.ts +2 -1
- package/dist/components/steps/Steps.js +5 -4
- package/dist/components/swap/Swap.css +45 -0
- package/dist/components/swap/Swap.d.ts +11 -0
- package/dist/components/swap/Swap.js +39 -0
- package/dist/components/swap/Swap.module.js +11 -0
- package/dist/components/swap/index.d.ts +2 -0
- package/dist/components/switch/Switch.css +17 -17
- package/dist/components/switch/Switch.d.ts +4 -4
- package/dist/components/switch/Switch.js +19 -16
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/table/Table.css +3 -3
- package/dist/components/table/Table.js +3 -2
- package/dist/components/table/Table.module.js +0 -1
- package/dist/components/tabs/Tabs.css +22 -20
- package/dist/components/tabs/Tabs.d.ts +3 -2
- package/dist/components/tabs/Tabs.js +5 -4
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tag/Tag.css +23 -53
- package/dist/components/tag/Tag.js +7 -20
- package/dist/components/tags-input/TagsInput.css +19 -55
- package/dist/components/tags-input/TagsInput.d.ts +7 -4
- package/dist/components/tags-input/TagsInput.js +33 -21
- package/dist/components/tags-input/index.d.ts +2 -2
- package/dist/components/text/Text.d.ts +2 -2
- package/dist/components/text/Text.js +1 -1
- package/dist/components/textarea/Textarea.css +4 -3
- package/dist/components/textarea/Textarea.js +1 -1
- package/dist/components/timer/Timer.css +7 -7
- package/dist/components/timer/Timer.d.ts +14 -2
- package/dist/components/timer/Timer.js +13 -5
- package/dist/components/timer/index.d.ts +2 -2
- package/dist/components/toast/Toast.css +16 -15
- package/dist/components/toast/Toast.d.ts +3 -1
- package/dist/components/toast/Toast.js +11 -2
- package/dist/components/toggle/Toggle.css +23 -23
- package/dist/components/toggle/Toggle.d.ts +3 -2
- package/dist/components/toggle/Toggle.js +5 -4
- package/dist/components/toggle/index.d.ts +2 -2
- package/dist/components/toggle-group/ToggleGroup.d.ts +3 -2
- package/dist/components/toggle-group/ToggleGroup.js +4 -3
- package/dist/components/toggle-group/index.d.ts +2 -2
- package/dist/components/tooltip/Tooltip.css +23 -18
- package/dist/components/tooltip/Tooltip.d.ts +3 -2
- package/dist/components/tooltip/Tooltip.js +10 -3
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tour/Tour.css +37 -32
- package/dist/components/tour/Tour.d.ts +6 -0
- package/dist/components/tour/Tour.js +8 -1
- package/dist/components/tree-view/TreeView.css +24 -21
- package/dist/components/tree-view/TreeView.d.ts +2 -2
- package/dist/components/tree-view/TreeView.js +4 -4
- package/dist/components/tree-view/index.d.ts +2 -2
- package/dist/components/typeset/Typeset.css +317 -0
- package/dist/components/typeset/Typeset.d.ts +7 -0
- package/dist/components/typeset/Typeset.js +33 -0
- package/dist/components/typeset/Typeset.module.js +8 -0
- package/dist/index.d.ts +42 -39
- package/dist/index.js +42 -39
- package/dist/lib/moduix/icons/ui/Icons.d.ts +1 -45
- package/dist/lib/moduix/icons/ui/Icons.js +36 -263
- package/dist/lib/moduix/icons/ui/index.d.ts +2 -2
- package/dist/lib/moduix/overlayPortal.js +1 -1
- package/dist/lib/moduix/presets/contrast.css +65 -0
- package/dist/lib/moduix/presets/dense.css +78 -0
- package/dist/lib/moduix/presets/soft.css +77 -0
- package/dist/lib/moduix/styles/reset.css +33 -0
- package/dist/lib/moduix/styles/style.css +17 -4
- package/dist/presets/contrast.d.ts +1 -0
- package/dist/presets/contrast.js +1 -0
- package/dist/presets/dense.d.ts +1 -0
- package/dist/presets/dense.js +1 -0
- package/dist/presets/soft.d.ts +1 -0
- package/dist/presets/soft.js +1 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,122 +1,45 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@moduix/react)
|
|
4
|
+
[](./LICENSE.md)
|
|
4
5
|
[](https://www.typescriptlang.org/)
|
|
5
|
-
[](https://turbo.build/)
|
|
6
6
|
|
|
7
|
-
# moduix
|
|
7
|
+
# @moduix/react
|
|
8
8
|
|
|
9
|
-
React
|
|
10
|
-
[Ark UI](https://ark-ui.com/)
|
|
9
|
+
Polished React components for product interfaces, built on
|
|
10
|
+
[Ark UI](https://ark-ui.com/) and styled with native CSS.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
The package combines Ark's accessible interaction model with shadcn-inspired clarity: calm defaults,
|
|
13
|
+
explicit named parts, consistent states, and a token-first theme contract. No styling framework is
|
|
14
|
+
required.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
[Documentation](https://moduix.dev/) ·
|
|
17
|
+
[Quick start](https://moduix.dev/docs/quick-start) ·
|
|
18
|
+
[Components](https://moduix.dev/docs/components) ·
|
|
19
|
+
[Tokens](https://moduix.dev/docs/tokens)
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
runtime surface, and CSS that can be owned by the application. The library is public and actively
|
|
20
|
-
developed around Ark UI primitives, shadcn-compatible source delivery, and practical defaults for
|
|
21
|
-
teams that need consistent interfaces.
|
|
21
|
+
## Highlights
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
- Ark-aligned composition, controlled and uncontrolled state, context, callbacks, and form behavior.
|
|
24
|
+
- Consistent `36px` primary controls and `32px` popup rows through shared size tokens.
|
|
25
|
+
- Native CSS, CSS Modules, cascade layers, semantic tokens, and component-level variables.
|
|
26
|
+
- Stable moduix `data-slot` hooks alongside Ark part and state attributes.
|
|
27
|
+
- Optional reset and curated `dense`, `soft`, and `contrast` presets.
|
|
28
|
+
- React 18 and 19 support.
|
|
29
|
+
- A matching hosted shadcn registry when source ownership is the better workflow.
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
reimplementing low-level interaction behavior.
|
|
27
|
-
- **Small dependency surface.** Ark UI is the only external UI primitive layer. The package
|
|
28
|
-
keeps the runtime stack intentionally small and does not bring a styling framework with it.
|
|
29
|
-
- **Two installation paths.** Use moduix as an npm package, or copy component source into your
|
|
30
|
-
project when direct ownership is more important than package-managed updates.
|
|
31
|
-
- **Composable API.** Components are exposed as named parts, so complex UI can be assembled
|
|
32
|
-
without hiding important structure.
|
|
33
|
-
- **Native CSS.** Styles are distributed as CSS, use CSS custom properties, and are designed to
|
|
34
|
-
work with your existing styling approach.
|
|
35
|
-
- **shadcn-compatible source delivery.** shadcn/ui remains a major inspiration for readable
|
|
36
|
-
component composition. moduix keeps that ownership model available through its registry.
|
|
31
|
+
## Install
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
moduix supports two installation paths:
|
|
41
|
-
|
|
42
|
-
- Install the library as a regular npm package when you want package-managed updates.
|
|
43
|
-
- Install component source into your own project with `shadcn` when you want direct ownership.
|
|
44
|
-
|
|
45
|
-
| Choose this path | When it fits best |
|
|
46
|
-
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
47
|
-
| npm package | You want the fastest setup, package-managed updates, imports from `@moduix/react`, and styles from `@moduix/react/style.css`. |
|
|
48
|
-
| `shadcn` copy-owned install | You want generated source files inside your app, direct local customization, and imports from `@/components/moduix/*`. |
|
|
49
|
-
|
|
50
|
-
### npm package
|
|
33
|
+
Install the package and its Ark UI peer dependency:
|
|
51
34
|
|
|
52
35
|
```bash
|
|
53
36
|
npm install @moduix/react @ark-ui/react
|
|
54
37
|
```
|
|
55
38
|
|
|
56
|
-
`react`, `react-dom`, and `@ark-ui/react` are peer dependencies
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### shadcn copy-owned install
|
|
60
|
-
|
|
61
|
-
`shadcn` can install selected moduix components from the GitHub registry directly into your project.
|
|
62
|
-
The files become part of your codebase instead of staying in `node_modules`.
|
|
63
|
-
|
|
64
|
-
Make sure your project resolves the `@/*` alias to `src/*` in both `tsconfig.json` and
|
|
65
|
-
`tsconfig.app.json`, and mirror it in your bundler config.
|
|
66
|
-
|
|
67
|
-
Create `components.json` in the project root when your app does not already have one:
|
|
68
|
-
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
72
|
-
"style": "new-york",
|
|
73
|
-
"rsc": false,
|
|
74
|
-
"tsx": true,
|
|
75
|
-
"tailwind": {
|
|
76
|
-
"config": "",
|
|
77
|
-
"css": "src/index.css",
|
|
78
|
-
"baseColor": "neutral",
|
|
79
|
-
"cssVariables": true,
|
|
80
|
-
"prefix": ""
|
|
81
|
-
},
|
|
82
|
-
"iconLibrary": "lucide",
|
|
83
|
-
"rtl": false,
|
|
84
|
-
"aliases": {
|
|
85
|
-
"components": "@/components",
|
|
86
|
-
"utils": "@/lib/utils",
|
|
87
|
-
"ui": "@/components/ui",
|
|
88
|
-
"lib": "@/lib",
|
|
89
|
-
"hooks": "@/hooks"
|
|
90
|
-
},
|
|
91
|
-
"registries": {}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npx shadcn@latest add Blinks44/moduix/react-button
|
|
97
|
-
npx shadcn@latest add Blinks44/moduix/react-accordion
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
The registry install also pulls in the shared moduix foundation files those components need, such as
|
|
101
|
-
styles, icons, and small utilities.
|
|
102
|
-
|
|
103
|
-
Import the generated foundation stylesheet once in your application entry point:
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import '@/lib/moduix/styles/style.css';
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
If you want the optional reset in the copy-owned path, import it explicitly before the main
|
|
110
|
-
stylesheet:
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
import '@/lib/moduix/styles/reset.css';
|
|
114
|
-
import '@/lib/moduix/styles/style.css';
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
With the aliases above, generated files land in `src/components/moduix/*` and `src/lib/moduix/*`.
|
|
39
|
+
`react`, `react-dom`, and `@ark-ui/react` are peer dependencies, so the package does not ship
|
|
40
|
+
duplicate framework or primitive runtimes.
|
|
118
41
|
|
|
119
|
-
##
|
|
42
|
+
## Add Styles
|
|
120
43
|
|
|
121
44
|
Import the required foundation stylesheet once in your application entry point:
|
|
122
45
|
|
|
@@ -124,129 +47,134 @@ Import the required foundation stylesheet once in your application entry point:
|
|
|
124
47
|
import '@moduix/react/style.css';
|
|
125
48
|
```
|
|
126
49
|
|
|
127
|
-
This
|
|
128
|
-
CSS
|
|
50
|
+
This entrypoint provides shared design tokens and base styles. Component imports bring along their
|
|
51
|
+
own CSS.
|
|
129
52
|
|
|
130
|
-
|
|
53
|
+
The reset is optional and intentionally separate:
|
|
131
54
|
|
|
132
55
|
```tsx
|
|
133
56
|
import '@moduix/react/reset.css';
|
|
134
57
|
import '@moduix/react/style.css';
|
|
135
58
|
```
|
|
136
59
|
|
|
137
|
-
|
|
60
|
+
## Use Components
|
|
61
|
+
|
|
62
|
+
Import public components from the package barrel and compose their named parts:
|
|
138
63
|
|
|
139
64
|
```tsx
|
|
140
|
-
import { Button, Dialog
|
|
65
|
+
import { Button, Dialog } from '@moduix/react';
|
|
141
66
|
|
|
142
67
|
export function Example() {
|
|
143
68
|
return (
|
|
144
69
|
<Dialog.Root>
|
|
145
70
|
<Dialog.Trigger asChild>
|
|
146
|
-
<Button>Open
|
|
71
|
+
<Button>Open settings</Button>
|
|
147
72
|
</Dialog.Trigger>
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
<Dialog.
|
|
151
|
-
<Dialog.
|
|
73
|
+
<Dialog.Backdrop />
|
|
74
|
+
<Dialog.Positioner>
|
|
75
|
+
<Dialog.Content>
|
|
76
|
+
<Dialog.Header>
|
|
152
77
|
<Dialog.Title>Project settings</Dialog.Title>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
78
|
+
<Dialog.Description>Update how this workspace behaves.</Dialog.Description>
|
|
79
|
+
</Dialog.Header>
|
|
80
|
+
<Dialog.Footer>
|
|
81
|
+
<Dialog.CloseTrigger asChild>
|
|
82
|
+
<Button variant="outline">Done</Button>
|
|
83
|
+
</Dialog.CloseTrigger>
|
|
84
|
+
</Dialog.Footer>
|
|
85
|
+
</Dialog.Content>
|
|
86
|
+
</Dialog.Positioner>
|
|
156
87
|
</Dialog.Root>
|
|
157
88
|
);
|
|
158
89
|
}
|
|
159
90
|
```
|
|
160
91
|
|
|
161
|
-
|
|
162
|
-
|
|
92
|
+
moduix keeps important Ark anatomy visible. Higher-level convenience parts are documented as the
|
|
93
|
+
recommended path where they exist, while low-level composition remains available for advanced
|
|
94
|
+
cases.
|
|
163
95
|
|
|
164
|
-
##
|
|
96
|
+
## Theme the System
|
|
165
97
|
|
|
166
|
-
|
|
167
|
-
|
|
98
|
+
Theme values are CSS custom properties. Change broad semantic decisions first and use component
|
|
99
|
+
aliases for deliberate exceptions:
|
|
168
100
|
|
|
169
101
|
```css
|
|
170
102
|
:root {
|
|
171
|
-
--
|
|
172
|
-
--
|
|
103
|
+
--primary: oklch(0.52 0.18 145);
|
|
104
|
+
--radius: 0.75rem;
|
|
105
|
+
--size-md: 36px;
|
|
106
|
+
--size-sm: 32px;
|
|
173
107
|
}
|
|
174
|
-
```
|
|
175
108
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
@layer ui.reset, ui.tokens, ui.components;
|
|
109
|
+
.compact-toolbar {
|
|
110
|
+
--button-size-md: 32px;
|
|
111
|
+
}
|
|
180
112
|
```
|
|
181
113
|
|
|
182
|
-
|
|
183
|
-
classes, or component-level variables.
|
|
114
|
+
The token hierarchy is:
|
|
184
115
|
|
|
185
|
-
|
|
116
|
+
1. theme primitives such as `--primary`, `--spacing-2`, `--size-md`, and `--radius`;
|
|
117
|
+
2. semantic aliases such as `--color-primary`, `--spacing-md`, and `--radius-md`;
|
|
118
|
+
3. shared family defaults such as `--popup-item-min-height` and `--focus-ring-width`;
|
|
119
|
+
4. component aliases such as `--input-height` and `--select-item-min-height`.
|
|
186
120
|
|
|
187
|
-
|
|
188
|
-
Button, Checkbox, Combobox, Dialog, Drawer, Field, FileUpload, Menu, NumberInput, Popover,
|
|
189
|
-
QrCode, Select, Tabs, Toast, Tooltip, TreeView, and supporting layout and display primitives.
|
|
121
|
+
Library styles use predictable cascade layers:
|
|
190
122
|
|
|
191
|
-
|
|
123
|
+
```css
|
|
124
|
+
@layer ui.reset, ui.tokens, ui.base, ui.components;
|
|
125
|
+
```
|
|
192
126
|
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
- React package README: `packages/react/README.md`
|
|
196
|
-
- Docs app README: `apps/docs/README.md`
|
|
127
|
+
Components also expose `className`, `data-slot`, and the Ark `data-scope`, `data-part`, and
|
|
128
|
+
state attributes supported by their primitives.
|
|
197
129
|
|
|
198
|
-
##
|
|
130
|
+
## Optional Presets
|
|
199
131
|
|
|
200
|
-
|
|
132
|
+
Import one preset after `style.css` and activate it on the document root:
|
|
201
133
|
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
npm run dev
|
|
134
|
+
```tsx
|
|
135
|
+
import '@moduix/react/style.css';
|
|
136
|
+
import '@moduix/react/presets/soft.css';
|
|
206
137
|
```
|
|
207
138
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- [Ark UI](https://ark-ui.com/) for the composition and accessibility primitives now shaping the library contract.
|
|
213
|
-
- [shadcn/ui](https://ui.shadcn.com/) for the API inspiration and the culture of practical,
|
|
214
|
-
readable component composition.
|
|
215
|
-
- [Tailwind CSS](https://tailwindcss.com/) for the reset.css implementation.
|
|
216
|
-
- [Fumadocs](https://fumadocs.dev/) for the documentation foundation.
|
|
217
|
-
- [TanStack](https://tanstack.com/) for the application tooling used by the docs.
|
|
218
|
-
- [Voidzero](https://voidzero.dev/) for the JavaScript tooling used by the workspace.
|
|
139
|
+
```html
|
|
140
|
+
<html data-moduix-theme="soft"></html>
|
|
141
|
+
```
|
|
219
142
|
|
|
220
|
-
|
|
143
|
+
Available presets are `dense`, `soft`, and `contrast`. See
|
|
144
|
+
[Themes](https://moduix.dev/docs/themes) before combining presets or creating a reusable custom
|
|
145
|
+
theme.
|
|
221
146
|
|
|
222
|
-
|
|
223
|
-
improvements, and focused component improvements.
|
|
147
|
+
## Prefer to Own the Source?
|
|
224
148
|
|
|
225
|
-
|
|
149
|
+
The moduix registry uses the shadcn distribution format while preserving the same Ark-aligned
|
|
150
|
+
component contracts:
|
|
226
151
|
|
|
227
|
-
|
|
152
|
+
```bash
|
|
153
|
+
npx shadcn@latest init
|
|
154
|
+
npx shadcn@latest registry add '@moduix-react=https://moduix.dev/r/react/{name}.json'
|
|
155
|
+
npx shadcn@latest add @moduix-react/button @moduix-react/dialog
|
|
156
|
+
```
|
|
228
157
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
158
|
+
Generated files are installed under `@/components/moduix/*` and `@/lib/moduix/*`. Read the
|
|
159
|
+
[complete Quick Start](https://moduix.dev/docs/quick-start) for alias setup, registry inspection,
|
|
160
|
+
dry runs, and generated stylesheet imports.
|
|
232
161
|
|
|
233
|
-
|
|
162
|
+
## Acknowledgements
|
|
234
163
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
164
|
+
- [Ark UI](https://ark-ui.com/) provides the primitive behavior and composition model.
|
|
165
|
+
- [Chakra UI](https://chakra-ui.com/) informs Ark-aligned ergonomics and design-system craft.
|
|
166
|
+
- [shadcn/ui](https://ui.shadcn.com/) inspires open-code delivery, beautiful defaults, and practical
|
|
167
|
+
documentation.
|
|
168
|
+
- [UnoCSS](https://unocss.dev/) and [Tailwind CSS](https://tailwindcss.com/) provide foundations
|
|
169
|
+
adapted by the optional reset.
|
|
238
170
|
|
|
239
|
-
|
|
171
|
+
## Links
|
|
240
172
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
```
|
|
173
|
+
- [Documentation](https://moduix.dev/)
|
|
174
|
+
- [npm package](https://www.npmjs.com/package/@moduix/react)
|
|
175
|
+
- [Source repository](https://github.com/Blinks44/moduix)
|
|
176
|
+
- [Issues](https://github.com/Blinks44/moduix/issues)
|
|
246
177
|
|
|
247
|
-
|
|
248
|
-
local component notes, public docs, and registry output so the package and docs stay in sync.
|
|
178
|
+
## License
|
|
249
179
|
|
|
250
|
-
|
|
251
|
-
agent-assisted changes should still preserve the library's direct Ark-first component contracts,
|
|
252
|
-
small APIs, and readable implementation style.
|
|
180
|
+
[MIT](./LICENSE.md)
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
.tIMeYW_root {
|
|
51
51
|
box-sizing: border-box;
|
|
52
|
-
width: var(--accordion-width,
|
|
52
|
+
width: var(--accordion-width, 100%);
|
|
53
53
|
max-width: var(--accordion-max-width, 100%);
|
|
54
54
|
min-width: 0;
|
|
55
55
|
color: var(--accordion-color, var(--color-foreground));
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
|
|
114
114
|
&:focus-visible {
|
|
115
115
|
z-index: 1;
|
|
116
|
-
outline: var(--accordion-focus-ring-width, var(--border-width-md))
|
|
117
|
-
var(--accordion-focus-ring-color, var(--color-ring));
|
|
116
|
+
outline: var(--accordion-focus-ring-width, var(--focus-ring-width, var(--border-width-md)))
|
|
117
|
+
solid var(--accordion-focus-ring-color, var(--color-ring));
|
|
118
118
|
outline-offset: calc(var(--accordion-focus-ring-offset, var(--border-width-sm)) * -1);
|
|
119
119
|
position: relative;
|
|
120
120
|
}
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
|
|
135
135
|
.tIMeYW_itemIndicator {
|
|
136
136
|
box-sizing: border-box;
|
|
137
|
-
width: var(--accordion-icon-size,
|
|
138
|
-
height: var(--accordion-icon-size,
|
|
137
|
+
width: var(--accordion-icon-size, var(--spacing-3));
|
|
138
|
+
height: var(--accordion-icon-size, var(--spacing-3));
|
|
139
139
|
transition: transform var(--accordion-icon-transition, var(--transition-default));
|
|
140
140
|
flex-shrink: 0;
|
|
141
141
|
justify-content: center;
|
|
@@ -187,4 +187,11 @@
|
|
|
187
187
|
width: var(--accordion-horizontal-content-width, 16rem);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
|
|
191
|
+
.tIMeYW_itemBody {
|
|
192
|
+
gap: var(--accordion-item-body-gap, var(--spacing-3));
|
|
193
|
+
min-width: 0;
|
|
194
|
+
padding: var(--accordion-item-body-padding, var(--spacing-3));
|
|
195
|
+
display: grid;
|
|
196
|
+
}
|
|
190
197
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion } from "@ark-ui/react/accordion";
|
|
1
|
+
import { Accordion, useAccordion } from "@ark-ui/react/accordion";
|
|
2
2
|
|
|
3
3
|
//#region src/components/accordion/Accordion.d.ts
|
|
4
4
|
declare const Accordion$1: import("react").ForwardRefExoticComponent<Omit<Accordion.RootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
@@ -8,6 +8,7 @@ declare const Accordion$1: import("react").ForwardRefExoticComponent<Omit<Accord
|
|
|
8
8
|
ItemTrigger: import("react").ForwardRefExoticComponent<Omit<Accordion.ItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
ItemIndicator: import("react").ForwardRefExoticComponent<Omit<Accordion.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
10
|
ItemContent: import("react").ForwardRefExoticComponent<Omit<Accordion.ItemContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
ItemBody: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
|
-
export { Accordion$1 as Accordion };
|
|
14
|
+
export { Accordion$1 as Accordion, useAccordion };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { PlusIcon } from "../../lib/moduix/icons/ui/Icons.js";
|
|
2
1
|
import { normalizeClassName } from "../../lib/moduix/normalizeClassName.js";
|
|
2
|
+
import { PlusIcon } from "../../lib/moduix/icons/ui/Icons.js";
|
|
3
3
|
import Accordion_module_default from "./Accordion.module.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ark } from "@ark-ui/react/factory";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Accordion, useAccordion } from "@ark-ui/react/accordion";
|
|
8
9
|
//#region src/components/accordion/Accordion.tsx
|
|
9
10
|
const AccordionRoot = forwardRef(function AccordionRoot({ className, ...props }, ref) {
|
|
10
11
|
return /* @__PURE__ */ jsx(Accordion.Root, {
|
|
@@ -55,13 +56,24 @@ const AccordionItemContent = forwardRef(function AccordionItemContent({ classNam
|
|
|
55
56
|
...props
|
|
56
57
|
});
|
|
57
58
|
});
|
|
59
|
+
const AccordionItemBody = forwardRef(function AccordionItemBody({ className, ...props }, ref) {
|
|
60
|
+
return /* @__PURE__ */ jsx(ark.div, {
|
|
61
|
+
ref,
|
|
62
|
+
"data-scope": "accordion",
|
|
63
|
+
"data-part": "item-body",
|
|
64
|
+
"data-slot": "accordion-item-body",
|
|
65
|
+
className: clsx(Accordion_module_default.itemBody, normalizeClassName(className)),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
});
|
|
58
69
|
const Accordion$1 = Object.assign(AccordionRoot, {
|
|
59
70
|
Root: AccordionRoot,
|
|
60
71
|
RootProvider: AccordionRootProvider,
|
|
61
72
|
Item: AccordionItem,
|
|
62
73
|
ItemTrigger: AccordionItemTrigger,
|
|
63
74
|
ItemIndicator: AccordionItemIndicator,
|
|
64
|
-
ItemContent: AccordionItemContent
|
|
75
|
+
ItemContent: AccordionItemContent,
|
|
76
|
+
ItemBody: AccordionItemBody
|
|
65
77
|
});
|
|
66
78
|
//#endregion
|
|
67
|
-
export { Accordion$1 as Accordion };
|
|
79
|
+
export { Accordion$1 as Accordion, useAccordion };
|
|
@@ -6,6 +6,7 @@ var Accordion_module_default = {
|
|
|
6
6
|
"accordion-item-content-open": "tIMeYW_accordion-item-content-open",
|
|
7
7
|
"accordion-item-content-open-horizontal": "tIMeYW_accordion-item-content-open-horizontal",
|
|
8
8
|
"item": "tIMeYW_item",
|
|
9
|
+
"itemBody": "tIMeYW_itemBody",
|
|
9
10
|
"itemContent": "tIMeYW_itemContent",
|
|
10
11
|
"itemIndicator": "tIMeYW_itemIndicator",
|
|
11
12
|
"itemTrigger": "tIMeYW_itemTrigger",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Accordion } from "./Accordion.js";
|
|
2
|
-
export { Accordion };
|
|
1
|
+
import { Accordion, useAccordion } from "./Accordion.js";
|
|
2
|
+
export { Accordion, useAccordion };
|
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
.ZXk2dW_root {
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
align-items: start;
|
|
5
|
-
gap: var(--alert-gap, var(--spacing-
|
|
5
|
+
row-gap: var(--alert-content-gap, var(--spacing-1));
|
|
6
|
+
column-gap: var(--alert-gap, var(--spacing-3));
|
|
6
7
|
border: var(--alert-border-width, var(--border-width-sm)) solid
|
|
7
8
|
var(--alert-border-color, var(--alert-border-color-default, var(--color-border)));
|
|
8
9
|
border-radius: var(--alert-radius, var(--radius-lg));
|
|
9
10
|
width: 100%;
|
|
10
11
|
min-width: 0;
|
|
11
|
-
padding: var(--alert-padding, var(--spacing-
|
|
12
|
+
padding: var(--alert-padding, var(--spacing-3));
|
|
12
13
|
background-color: var(--alert-bg, var(--alert-bg-default, var(--color-card)));
|
|
13
14
|
color: var(--alert-color, var(--alert-color-default, var(--color-card-foreground)));
|
|
14
15
|
box-shadow: var(--alert-shadow, none);
|
|
15
16
|
grid-template-columns: auto minmax(0, 1fr);
|
|
16
17
|
display: grid;
|
|
17
18
|
|
|
19
|
+
& > [data-part="title"], & > [data-part="description"] {
|
|
20
|
+
grid-column: 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
&[data-status="neutral"] {
|
|
19
24
|
--alert-bg-default: var(--color-card);
|
|
20
25
|
--alert-border-color-default: var(--color-border);
|
|
@@ -50,25 +55,27 @@
|
|
|
50
55
|
--alert-indicator-color-default: var(--color-destructive);
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
&:not(:has([data-part="indicator"])) {
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
&:not(:has( > [data-part="indicator"])) {
|
|
59
|
+
grid-template-columns: minmax(0, 1fr);
|
|
60
|
+
|
|
61
|
+
& > [data-part="content"], & > [data-part="title"], & > [data-part="description"] {
|
|
62
|
+
grid-column: 1;
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
.ZXk2dW_indicator {
|
|
61
|
-
width: var(--alert-indicator-size,
|
|
62
|
-
height: var(--alert-indicator-size,
|
|
68
|
+
width: var(--alert-indicator-size, var(--spacing-4));
|
|
69
|
+
height: var(--alert-indicator-size, var(--spacing-4));
|
|
63
70
|
color: var(--alert-indicator-color, var(--alert-indicator-color-default, currentColor));
|
|
64
71
|
justify-content: center;
|
|
65
72
|
align-items: center;
|
|
66
|
-
margin-block-start: var(--alert-indicator-offset,
|
|
73
|
+
margin-block-start: var(--alert-indicator-offset, var(--spacing-0-5));
|
|
67
74
|
display: inline-flex;
|
|
68
75
|
|
|
69
76
|
& :where(svg) {
|
|
70
|
-
width: var(--alert-indicator-size,
|
|
71
|
-
height: var(--alert-indicator-size,
|
|
77
|
+
width: var(--alert-indicator-size, var(--spacing-4));
|
|
78
|
+
height: var(--alert-indicator-size, var(--spacing-4));
|
|
72
79
|
pointer-events: none;
|
|
73
80
|
flex-shrink: 0;
|
|
74
81
|
}
|
|
@@ -105,4 +112,11 @@
|
|
|
105
112
|
margin-bottom: 0;
|
|
106
113
|
}
|
|
107
114
|
}
|
|
115
|
+
|
|
116
|
+
.ZXk2dW_actions {
|
|
117
|
+
gap: var(--alert-actions-gap, var(--spacing-2));
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
margin-block-start: var(--alert-actions-margin-top, var(--spacing-2));
|
|
120
|
+
display: flex;
|
|
121
|
+
}
|
|
108
122
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
//#region src/components/alert/Alert.d.ts
|
|
2
|
+
type AlertStatus = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
2
3
|
declare const Alert: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
3
|
-
status?:
|
|
4
|
+
status?: AlertStatus;
|
|
4
5
|
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
6
|
Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
6
|
-
status?:
|
|
7
|
+
status?: AlertStatus;
|
|
7
8
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
9
|
Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
9
10
|
Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
-
Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<
|
|
11
|
+
Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
11
12
|
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Actions: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
14
|
};
|
|
13
15
|
//#endregion
|
|
14
16
|
export { Alert };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeClassName } from "../../lib/moduix/normalizeClassName.js";
|
|
2
2
|
import Alert_module_default from "./Alert.module.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { ark } from "@ark-ui/react/factory";
|
|
5
4
|
import { clsx } from "clsx";
|
|
6
5
|
import { forwardRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/alert/Alert.tsx
|
|
8
|
-
const AlertRoot = forwardRef(function AlertRoot({ className, role, status = "neutral", ...props }, ref) {
|
|
8
|
+
const AlertRoot = forwardRef(function AlertRoot({ children, className, role, status = "neutral", ...props }, ref) {
|
|
9
9
|
return /* @__PURE__ */ jsx(ark.div, {
|
|
10
10
|
ref,
|
|
11
11
|
role: role ?? (status === "error" ? "alert" : "status"),
|
|
@@ -14,7 +14,8 @@ const AlertRoot = forwardRef(function AlertRoot({ className, role, status = "neu
|
|
|
14
14
|
"data-slot": "alert-root",
|
|
15
15
|
"data-status": status,
|
|
16
16
|
className: clsx(Alert_module_default.root, normalizeClassName(className)),
|
|
17
|
-
...props
|
|
17
|
+
...props,
|
|
18
|
+
children
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
21
|
const AlertIndicator = forwardRef(function AlertIndicator({ className, ...props }, ref) {
|
|
@@ -39,7 +40,7 @@ const AlertContent = forwardRef(function AlertContent({ className, ...props }, r
|
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
const AlertTitle = forwardRef(function AlertTitle({ className, ...props }, ref) {
|
|
42
|
-
return /* @__PURE__ */ jsx(ark.
|
|
43
|
+
return /* @__PURE__ */ jsx(ark.p, {
|
|
43
44
|
ref,
|
|
44
45
|
"data-scope": "alert",
|
|
45
46
|
"data-part": "title",
|
|
@@ -58,12 +59,23 @@ const AlertDescription = forwardRef(function AlertDescription({ className, ...pr
|
|
|
58
59
|
...props
|
|
59
60
|
});
|
|
60
61
|
});
|
|
62
|
+
const AlertActions = forwardRef(function AlertActions({ className, ...props }, ref) {
|
|
63
|
+
return /* @__PURE__ */ jsx(ark.div, {
|
|
64
|
+
ref,
|
|
65
|
+
"data-scope": "alert",
|
|
66
|
+
"data-part": "actions",
|
|
67
|
+
"data-slot": "alert-actions",
|
|
68
|
+
className: clsx(Alert_module_default.actions, normalizeClassName(className)),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
});
|
|
61
72
|
const Alert = Object.assign(AlertRoot, {
|
|
62
73
|
Root: AlertRoot,
|
|
63
74
|
Indicator: AlertIndicator,
|
|
64
75
|
Content: AlertContent,
|
|
65
76
|
Title: AlertTitle,
|
|
66
|
-
Description: AlertDescription
|
|
77
|
+
Description: AlertDescription,
|
|
78
|
+
Actions: AlertActions
|
|
67
79
|
});
|
|
68
80
|
//#endregion
|
|
69
81
|
export { Alert };
|