@blenx-dev/components 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/components → components}/Accordion/accordion.css.js +2 -2
- package/{dist/components → components}/Accordion/accordion.js +1 -1
- package/{dist/components → components}/Alert/alert.css.js +2 -2
- package/{dist/components → components}/Alert/alert.js +1 -1
- package/{dist/components → components}/AlertDialog/alert-dialog.css.js +2 -2
- package/{dist/components → components}/AlertDialog/alert-dialog.js +1 -1
- package/{dist/components → components}/Autocomplete/autocomplete.css.js +2 -2
- package/{dist/components → components}/Autocomplete/autocomplete.js +1 -1
- package/{dist/components → components}/Avatar/avatar.css.js +3 -3
- package/{dist/components → components}/Avatar/avatar.js +1 -1
- package/{dist/components → components}/Badge/badge.css.js +3 -3
- package/{dist/components → components}/Badge/badge.js +1 -1
- package/{dist/components → components}/Box/box.css.js +1 -1
- package/{dist/components → components}/Box/box.js +1 -1
- package/{dist/components → components}/Breadcrumbs/breadcrumbs.css.js +1 -1
- package/{dist/components → components}/Breadcrumbs/breadcrumbs.js +1 -1
- package/{dist/components → components}/Button/button.css.js +3 -3
- package/{dist/components → components}/Button/button.js +1 -1
- package/{dist/components → components}/Calendar/calendar.css.js +2 -2
- package/{dist/components → components}/Calendar/calendar.js +1 -1
- package/{dist/components → components}/Checkbox/checkbox.css.js +2 -2
- package/{dist/components → components}/Checkbox/checkbox.js +1 -1
- package/{dist/components → components}/Combobox/combobox.css.js +2 -2
- package/{dist/components → components}/Combobox/combobox.js +1 -1
- package/{dist/components → components}/Command/command.css.js +2 -2
- package/{dist/components → components}/Command/command.js +1 -1
- package/{dist/components → components}/Container/container.css.js +1 -1
- package/{dist/components → components}/Container/container.js +1 -1
- package/{dist/components → components}/Dialog/dialog.css.js +2 -2
- package/{dist/components → components}/Dialog/dialog.js +1 -1
- package/{dist/components → components}/Drawer/drawer.css.js +2 -2
- package/{dist/components → components}/Drawer/drawer.js +1 -1
- package/{dist/components → components}/Field/field.css.js +2 -2
- package/{dist/components → components}/Field/field.js +1 -1
- package/{dist/components → components}/Grid/grid.js +1 -1
- package/{dist/components → components}/Icon/icon.js +1 -1
- package/{dist/components → components}/IconButton/icon-button.js +1 -1
- package/{dist/components → components}/Input/input.css.js +2 -2
- package/{dist/components → components}/Input/input.js +1 -1
- package/{dist/components → components}/InputGroup/input-group.css.js +2 -2
- package/{dist/components → components}/InputGroup/input-group.js +1 -1
- package/{dist/components → components}/Menu/menu.css.js +2 -2
- package/{dist/components → components}/Menu/menu.js +1 -1
- package/{dist/components → components}/OTPField/otp-field.css.js +3 -3
- package/{dist/components → components}/OTPField/otp-field.js +1 -1
- package/{dist/components → components}/Popover/popover.css.js +2 -2
- package/{dist/components → components}/Popover/popover.js +1 -1
- package/{dist/components → components}/Progress/progress.css.js +2 -2
- package/{dist/components → components}/Progress/progress.js +1 -1
- package/{dist/components → components}/Radio/radio.css.js +2 -2
- package/{dist/components → components}/Radio/radio.js +1 -1
- package/{dist/components → components}/ScrollArea/scroll-area.css.js +2 -2
- package/{dist/components → components}/ScrollArea/scroll-area.js +1 -1
- package/{dist/components → components}/Select/select.css.js +2 -2
- package/{dist/components → components}/Select/select.js +1 -1
- package/{dist/components → components}/Separator/separator.css.js +3 -3
- package/{dist/components → components}/Separator/separator.js +1 -1
- package/{dist/components → components}/Sheet/sheet.css.js +2 -2
- package/{dist/components → components}/Sheet/sheet.js +1 -1
- package/{dist/components → components}/Slider/slider.css.js +2 -2
- package/{dist/components → components}/Slider/slider.js +1 -1
- package/{dist/components → components}/Spinner/spinner.js +1 -1
- package/{dist/components → components}/Splitter/splitter.css.js +2 -2
- package/{dist/components → components}/Splitter/splitter.js +1 -1
- package/{dist/components → components}/Stack/stack.css.js +3 -3
- package/{dist/components → components}/Stack/stack.js +1 -1
- package/{dist/components → components}/Surface/surface.css.js +2 -2
- package/{dist/components → components}/Surface/surface.js +1 -1
- package/{dist/components → components}/Switch/switch.css.js +2 -2
- package/{dist/components → components}/Switch/switch.js +1 -1
- package/{dist/components → components}/Table/table.css.js +2 -2
- package/{dist/components → components}/Table/table.js +1 -1
- package/{dist/components → components}/Tabs/tabs.css.js +2 -2
- package/{dist/components → components}/Tabs/tabs.js +1 -1
- package/{dist/components → components}/Text/text.css.js +3 -3
- package/{dist/components → components}/Text/text.js +1 -1
- package/{dist/components → components}/Textarea/textarea.css.js +1 -1
- package/{dist/components → components}/Textarea/textarea.js +1 -1
- package/{dist/components → components}/Toggle/toggle.css.js +3 -3
- package/{dist/components → components}/Toggle/toggle.js +1 -1
- package/{dist/components → components}/ToggleGroup/toggle-group.css.js +2 -2
- package/{dist/components → components}/ToggleGroup/toggle-group.js +1 -1
- package/package.json +209 -38
- package/{dist/utils → utils}/sprinkles.css.js +2 -2
- package/.turbo/turbo-check-types.log +0 -1
- package/MIGRATION-PLAN.md +0 -423
- package/TASKS.md +0 -192
- package/blenx-dev-ui-0.0.0.tgz +0 -0
- package/dist/node_modules/.bun/@vanilla-extract_recipes@0.5.7_19e937df7e0b57ed/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +0 -89
- package/dist/node_modules/.bun/@vanilla-extract_sprinkles@1.6.5_19e937df7e0b57ed/node_modules/@vanilla-extract/sprinkles/createRuntimeSprinkles/dist/vanilla-extract-sprinkles-createRuntimeSprinkles.esm.js +0 -8
- package/dist/node_modules/.bun/@vanilla-extract_sprinkles@1.6.5_19e937df7e0b57ed/node_modules/@vanilla-extract/sprinkles/dist/createSprinkles-74286718.esm.js +0 -141
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/package.json +0 -233
- package/dist/src/components/Accordion/accordion.demo.d.ts +0 -5
- package/dist/src/components/Alert/alert.demo.d.ts +0 -6
- package/dist/src/components/AlertDialog/alert-dialog.demo.d.ts +0 -5
- package/dist/src/components/AlertDialog/alert-dialog.doc.d.ts +0 -1
- package/dist/src/components/Avatar/avatar.doc.d.ts +0 -2
- package/dist/src/components/Badge/badge.demo.d.ts +0 -5
- package/dist/src/components/Badge/badge.doc.d.ts +0 -1
- package/dist/src/components/Box/box.doc.d.ts +0 -1
- package/dist/src/components/Breadcrumbs/breadcrumbs.doc.d.ts +0 -2
- package/dist/src/components/Button/button.demo.d.ts +0 -5
- package/dist/src/components/Calendar/calendar.doc.d.ts +0 -1
- package/dist/src/components/Card/card.demo.d.ts +0 -8
- package/dist/src/components/Card/card.doc.d.ts +0 -2
- package/dist/src/components/ColorPicker/color-picker.doc.d.ts +0 -1
- package/dist/src/components/ColorSwatch/color-swatch.doc.d.ts +0 -2
- package/dist/src/components/Command/command.demo.d.ts +0 -6
- package/dist/src/components/Command/command.doc.d.ts +0 -3
- package/dist/src/components/Container/container.doc.d.ts +0 -1
- package/dist/src/components/DatePicker/date-picker.doc.d.ts +0 -1
- package/dist/src/components/Dialog/dialog.demo.d.ts +0 -5
- package/dist/src/components/Dialog/dialog.doc.d.ts +0 -1
- package/dist/src/components/Drawer/drawer.demo.d.ts +0 -5
- package/dist/src/components/Drawer/drawer.doc.d.ts +0 -2
- package/dist/src/components/Field/field.doc.d.ts +0 -1
- package/dist/src/components/Grid/grid.doc.d.ts +0 -1
- package/dist/src/components/Icon/icon.demo.d.ts +0 -5
- package/dist/src/components/IconButton/icon-button.demo.d.ts +0 -5
- package/dist/src/components/Input/input.demo.d.ts +0 -5
- package/dist/src/components/Input/input.doc.d.ts +0 -2
- package/dist/src/components/InputGroup/input-group.demo.d.ts +0 -5
- package/dist/src/components/Menu/menu.demo.d.ts +0 -5
- package/dist/src/components/OTPField/otp-field.demo.d.ts +0 -6
- package/dist/src/components/Popover/popover.demo.d.ts +0 -5
- package/dist/src/components/ScrollArea/scroll-area.doc.d.ts +0 -2
- package/dist/src/components/SegmentedControl/segmented-control.doc.d.ts +0 -1
- package/dist/src/components/Select/select.demo.d.ts +0 -5
- package/dist/src/components/Select/select.doc.d.ts +0 -2
- package/dist/src/components/Separator/separator.doc.d.ts +0 -4
- package/dist/src/components/Sheet/sheet.demo.d.ts +0 -5
- package/dist/src/components/Spinner/spinner.demo.d.ts +0 -1
- package/dist/src/components/Stack/stack.doc.d.ts +0 -3
- package/dist/src/components/Surface/surface.doc.d.ts +0 -2
- package/dist/src/components/Switch/switch.demo.d.ts +0 -5
- package/dist/src/components/Switch/switch.doc.d.ts +0 -2
- package/dist/src/components/Table/table.demo.d.ts +0 -5
- package/dist/src/components/Tabs/tabs.demo.d.ts +0 -5
- package/dist/src/components/Tabs/tabs.doc.d.ts +0 -3
- package/dist/src/components/Text/text.doc.d.ts +0 -4
- package/dist/src/components/Textarea/textarea.doc.d.ts +0 -2
- package/dist/src/components/Toggle/toggle.doc.d.ts +0 -1
- package/dist/src/components/ToggleGroup/toggle-group.doc.d.ts +0 -3
- package/dist/src/demos/accordion.demo.d.ts +0 -5
- package/package.build.json +0 -39
- package/scripts/generate-api.ts +0 -183
- package/scripts/generate-package.ts +0 -99
- package/src/DataTable/data-table-column-toggle.tsx +0 -73
- package/src/DataTable/data-table-empty.tsx +0 -27
- package/src/DataTable/data-table-error.tsx +0 -25
- package/src/DataTable/data-table-infinite-loader.tsx +0 -73
- package/src/DataTable/data-table-loading.tsx +0 -67
- package/src/DataTable/data-table-pagination.tsx +0 -80
- package/src/DataTable/data-table-toolbar.tsx +0 -62
- package/src/DataTable/data-table.css.ts +0 -421
- package/src/DataTable/data-table.tsx +0 -507
- package/src/DataTable/index.ts +0 -24
- package/src/DataTable/registry-meta.json +0 -66
- package/src/DataTable/types.ts +0 -169
- package/src/DataTable/use-infinite-scroll.ts +0 -67
- package/src/components/Accordion/accordion.css.ts +0 -93
- package/src/components/Accordion/accordion.demo.tsx +0 -42
- package/src/components/Accordion/accordion.tsx +0 -87
- package/src/components/Accordion/docs-meta.json +0 -13
- package/src/components/Accordion/index.ts +0 -8
- package/src/components/Accordion/registry-meta.json +0 -19
- package/src/components/Alert/alert.css.ts +0 -29
- package/src/components/Alert/alert.demo.tsx +0 -34
- package/src/components/Alert/alert.tsx +0 -40
- package/src/components/Alert/docs-meta.json +0 -12
- package/src/components/Alert/index.ts +0 -1
- package/src/components/Alert/registry-meta.json +0 -20
- package/src/components/AlertDialog/alert-dialog.css.ts +0 -146
- package/src/components/AlertDialog/alert-dialog.demo.tsx +0 -59
- package/src/components/AlertDialog/alert-dialog.doc.tsx +0 -31
- package/src/components/AlertDialog/alert-dialog.tsx +0 -197
- package/src/components/AlertDialog/docs-meta.json +0 -14
- package/src/components/AlertDialog/index.ts +0 -1
- package/src/components/AlertDialog/registry-meta.json +0 -20
- package/src/components/Autocomplete/autocomplete.css.ts +0 -168
- package/src/components/Autocomplete/autocomplete.tsx +0 -226
- package/src/components/Autocomplete/docs-meta.json +0 -9
- package/src/components/Autocomplete/index.ts +0 -1
- package/src/components/Autocomplete/registry-meta.json +0 -20
- package/src/components/Avatar/avatar.css.ts +0 -72
- package/src/components/Avatar/avatar.doc.tsx +0 -32
- package/src/components/Avatar/avatar.tsx +0 -49
- package/src/components/Avatar/docs-meta.json +0 -9
- package/src/components/Avatar/index.ts +0 -1
- package/src/components/Avatar/registry-meta.json +0 -19
- package/src/components/Badge/badge.css.ts +0 -40
- package/src/components/Badge/badge.demo.tsx +0 -18
- package/src/components/Badge/badge.doc.tsx +0 -12
- package/src/components/Badge/badge.tsx +0 -13
- package/src/components/Badge/docs-meta.json +0 -9
- package/src/components/Badge/index.ts +0 -1
- package/src/components/Badge/registry-meta.json +0 -19
- package/src/components/Box/box.css.ts +0 -7
- package/src/components/Box/box.doc.tsx +0 -19
- package/src/components/Box/box.tsx +0 -21
- package/src/components/Box/docs-meta.json +0 -9
- package/src/components/Box/index.ts +0 -1
- package/src/components/Box/registry-meta.json +0 -14
- package/src/components/Breadcrumbs/breadcrumbs.css.ts +0 -72
- package/src/components/Breadcrumbs/breadcrumbs.doc.tsx +0 -61
- package/src/components/Breadcrumbs/breadcrumbs.tsx +0 -79
- package/src/components/Breadcrumbs/docs-meta.json +0 -12
- package/src/components/Breadcrumbs/index.ts +0 -9
- package/src/components/Breadcrumbs/registry-meta.json +0 -19
- package/src/components/Button/button.css.ts +0 -209
- package/src/components/Button/button.demo.tsx +0 -119
- package/src/components/Button/button.tsx +0 -55
- package/src/components/Button/docs-meta.json +0 -13
- package/src/components/Button/index.ts +0 -1
- package/src/components/Button/registry-meta.json +0 -20
- package/src/components/Calendar/calendar.css.ts +0 -188
- package/src/components/Calendar/calendar.doc.tsx +0 -10
- package/src/components/Calendar/calendar.tsx +0 -143
- package/src/components/Calendar/docs-meta.json +0 -9
- package/src/components/Calendar/index.ts +0 -1
- package/src/components/Calendar/registry-meta.json +0 -20
- package/src/components/Card/card.demo.tsx +0 -177
- package/src/components/Card/card.doc.tsx +0 -47
- package/src/components/Card/card.tsx +0 -32
- package/src/components/Card/docs-meta.json +0 -9
- package/src/components/Card/index.ts +0 -1
- package/src/components/Card/registry-meta.json +0 -15
- package/src/components/Checkbox/checkbox.css.ts +0 -77
- package/src/components/Checkbox/checkbox.tsx +0 -94
- package/src/components/Checkbox/docs-meta.json +0 -13
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Checkbox/registry-meta.json +0 -19
- package/src/components/CloseButton/close-button.css.ts +0 -11
- package/src/components/CloseButton/close-button.tsx +0 -15
- package/src/components/CloseButton/index.ts +0 -2
- package/src/components/CloseButton/registry-meta.json +0 -15
- package/src/components/ColorPicker/color-picker.doc.tsx +0 -12
- package/src/components/ColorPicker/color-picker.tsx +0 -123
- package/src/components/ColorPicker/docs-meta.json +0 -9
- package/src/components/ColorPicker/index.ts +0 -1
- package/src/components/ColorPicker/registry-meta.json +0 -15
- package/src/components/ColorSwatch/color-swatch.doc.tsx +0 -25
- package/src/components/ColorSwatch/color-swatch.tsx +0 -21
- package/src/components/ColorSwatch/docs-meta.json +0 -9
- package/src/components/ColorSwatch/index.ts +0 -1
- package/src/components/ColorSwatch/registry-meta.json +0 -20
- package/src/components/Combobox/combobox.css.ts +0 -334
- package/src/components/Combobox/combobox.tsx +0 -350
- package/src/components/Combobox/docs-meta.json +0 -9
- package/src/components/Combobox/index.ts +0 -1
- package/src/components/Combobox/registry-meta.json +0 -20
- package/src/components/Command/command.css.ts +0 -131
- package/src/components/Command/command.demo.tsx +0 -110
- package/src/components/Command/command.doc.tsx +0 -100
- package/src/components/Command/command.tsx +0 -413
- package/src/components/Command/docs-meta.json +0 -21
- package/src/components/Command/index.ts +0 -7
- package/src/components/Command/registry-meta.json +0 -20
- package/src/components/Container/container.css.ts +0 -40
- package/src/components/Container/container.doc.tsx +0 -28
- package/src/components/Container/container.tsx +0 -24
- package/src/components/Container/docs-meta.json +0 -9
- package/src/components/Container/index.ts +0 -1
- package/src/components/Container/registry-meta.json +0 -20
- package/src/components/CopyButton/copy-button.css.ts +0 -11
- package/src/components/CopyButton/copy-button.tsx +0 -45
- package/src/components/CopyButton/index.ts +0 -2
- package/src/components/CopyButton/registry-meta.json +0 -15
- package/src/components/DatePicker/date-picker.doc.tsx +0 -12
- package/src/components/DatePicker/date-picker.tsx +0 -75
- package/src/components/DatePicker/docs-meta.json +0 -9
- package/src/components/DatePicker/index.ts +0 -1
- package/src/components/DatePicker/registry-meta.json +0 -15
- package/src/components/Dialog/dialog.css.ts +0 -155
- package/src/components/Dialog/dialog.demo.tsx +0 -39
- package/src/components/Dialog/dialog.doc.tsx +0 -33
- package/src/components/Dialog/dialog.tsx +0 -186
- package/src/components/Dialog/docs-meta.json +0 -13
- package/src/components/Dialog/index.ts +0 -1
- package/src/components/Dialog/registry-meta.json +0 -20
- package/src/components/Drawer/docs-meta.json +0 -9
- package/src/components/Drawer/drawer.css.ts +0 -412
- package/src/components/Drawer/drawer.demo.tsx +0 -58
- package/src/components/Drawer/drawer.doc.tsx +0 -49
- package/src/components/Drawer/drawer.tsx +0 -574
- package/src/components/Drawer/index.ts +0 -1
- package/src/components/Drawer/registry-meta.json +0 -20
- package/src/components/Field/docs-meta.json +0 -9
- package/src/components/Field/field.css.ts +0 -35
- package/src/components/Field/field.doc.tsx +0 -19
- package/src/components/Field/field.tsx +0 -101
- package/src/components/Field/index.ts +0 -1
- package/src/components/Field/registry-meta.json +0 -20
- package/src/components/Grid/docs-meta.json +0 -9
- package/src/components/Grid/grid.css.ts +0 -12
- package/src/components/Grid/grid.doc.tsx +0 -148
- package/src/components/Grid/grid.tsx +0 -57
- package/src/components/Grid/index.ts +0 -1
- package/src/components/Grid/registry-meta.json +0 -20
- package/src/components/Icon/docs-meta.json +0 -13
- package/src/components/Icon/icon.css.ts +0 -10
- package/src/components/Icon/icon.demo.tsx +0 -97
- package/src/components/Icon/icon.tsx +0 -15
- package/src/components/Icon/index.ts +0 -1
- package/src/components/Icon/registry-meta.json +0 -20
- package/src/components/IconButton/docs-meta.json +0 -13
- package/src/components/IconButton/icon-button.css.ts +0 -6
- package/src/components/IconButton/icon-button.demo.tsx +0 -102
- package/src/components/IconButton/icon-button.tsx +0 -11
- package/src/components/IconButton/index.ts +0 -2
- package/src/components/IconButton/registry-meta.json +0 -15
- package/src/components/Input/docs-meta.json +0 -9
- package/src/components/Input/index.ts +0 -1
- package/src/components/Input/input.css.ts +0 -73
- package/src/components/Input/input.demo.tsx +0 -24
- package/src/components/Input/input.doc.tsx +0 -25
- package/src/components/Input/input.tsx +0 -50
- package/src/components/Input/registry-meta.json +0 -19
- package/src/components/InputGroup/docs-meta.json +0 -9
- package/src/components/InputGroup/index.ts +0 -1
- package/src/components/InputGroup/input-group.css.ts +0 -157
- package/src/components/InputGroup/input-group.demo.tsx +0 -53
- package/src/components/InputGroup/input-group.tsx +0 -133
- package/src/components/InputGroup/registry-meta.json +0 -19
- package/src/components/Menu/docs-meta.json +0 -13
- package/src/components/Menu/index.ts +0 -1
- package/src/components/Menu/menu.css.ts +0 -128
- package/src/components/Menu/menu.demo.tsx +0 -40
- package/src/components/Menu/menu.tsx +0 -115
- package/src/components/Menu/registry-meta.json +0 -19
- package/src/components/OTPField/docs-meta.json +0 -9
- package/src/components/OTPField/index.ts +0 -1
- package/src/components/OTPField/otp-field.css.ts +0 -55
- package/src/components/OTPField/otp-field.demo.tsx +0 -57
- package/src/components/OTPField/otp-field.tsx +0 -46
- package/src/components/OTPField/registry-meta.json +0 -19
- package/src/components/Popover/docs-meta.json +0 -13
- package/src/components/Popover/index.ts +0 -1
- package/src/components/Popover/popover.css.ts +0 -82
- package/src/components/Popover/popover.demo.tsx +0 -34
- package/src/components/Popover/popover.tsx +0 -113
- package/src/components/Popover/registry-meta.json +0 -19
- package/src/components/Progress/docs-meta.json +0 -12
- package/src/components/Progress/index.ts +0 -7
- package/src/components/Progress/progress.css.ts +0 -38
- package/src/components/Progress/progress.tsx +0 -62
- package/src/components/Progress/registry-meta.json +0 -19
- package/src/components/Radio/docs-meta.json +0 -13
- package/src/components/Radio/index.ts +0 -1
- package/src/components/Radio/radio.css.ts +0 -73
- package/src/components/Radio/radio.tsx +0 -49
- package/src/components/Radio/registry-meta.json +0 -19
- package/src/components/ScrollArea/docs-meta.json +0 -9
- package/src/components/ScrollArea/index.ts +0 -1
- package/src/components/ScrollArea/registry-meta.json +0 -19
- package/src/components/ScrollArea/scroll-area.css.ts +0 -80
- package/src/components/ScrollArea/scroll-area.doc.tsx +0 -44
- package/src/components/ScrollArea/scroll-area.tsx +0 -96
- package/src/components/SegmentedControl/docs-meta.json +0 -9
- package/src/components/SegmentedControl/index.ts +0 -1
- package/src/components/SegmentedControl/registry-meta.json +0 -15
- package/src/components/SegmentedControl/segmented-control.doc.tsx +0 -28
- package/src/components/SegmentedControl/segmented-control.tsx +0 -42
- package/src/components/Select/docs-meta.json +0 -13
- package/src/components/Select/index.ts +0 -1
- package/src/components/Select/registry-meta.json +0 -20
- package/src/components/Select/select.css.ts +0 -183
- package/src/components/Select/select.demo.tsx +0 -35
- package/src/components/Select/select.doc.tsx +0 -65
- package/src/components/Select/select.tsx +0 -165
- package/src/components/Separator/docs-meta.json +0 -12
- package/src/components/Separator/index.ts +0 -1
- package/src/components/Separator/registry-meta.json +0 -20
- package/src/components/Separator/separator.css.ts +0 -60
- package/src/components/Separator/separator.doc.tsx +0 -44
- package/src/components/Separator/separator.tsx +0 -34
- package/src/components/Sheet/docs-meta.json +0 -13
- package/src/components/Sheet/index.ts +0 -1
- package/src/components/Sheet/registry-meta.json +0 -20
- package/src/components/Sheet/sheet.css.ts +0 -192
- package/src/components/Sheet/sheet.demo.tsx +0 -53
- package/src/components/Sheet/sheet.tsx +0 -213
- package/src/components/Slider/docs-meta.json +0 -13
- package/src/components/Slider/index.ts +0 -1
- package/src/components/Slider/registry-meta.json +0 -19
- package/src/components/Slider/slider.css.ts +0 -82
- package/src/components/Slider/slider.tsx +0 -100
- package/src/components/Spinner/docs-meta.json +0 -12
- package/src/components/Spinner/index.ts +0 -1
- package/src/components/Spinner/registry-meta.json +0 -19
- package/src/components/Spinner/spinner.css.ts +0 -17
- package/src/components/Spinner/spinner.demo.tsx +0 -13
- package/src/components/Spinner/spinner.tsx +0 -15
- package/src/components/Splitter/docs-meta.json +0 -9
- package/src/components/Splitter/index.ts +0 -1
- package/src/components/Splitter/registry-meta.json +0 -19
- package/src/components/Splitter/splitter.css.ts +0 -70
- package/src/components/Splitter/splitter.tsx +0 -521
- package/src/components/Stack/docs-meta.json +0 -9
- package/src/components/Stack/index.ts +0 -1
- package/src/components/Stack/registry-meta.json +0 -20
- package/src/components/Stack/stack.css.ts +0 -42
- package/src/components/Stack/stack.doc.tsx +0 -57
- package/src/components/Stack/stack.tsx +0 -32
- package/src/components/Surface/docs-meta.json +0 -9
- package/src/components/Surface/index.ts +0 -1
- package/src/components/Surface/registry-meta.json +0 -20
- package/src/components/Surface/surface.css.ts +0 -40
- package/src/components/Surface/surface.doc.tsx +0 -32
- package/src/components/Surface/surface.tsx +0 -19
- package/src/components/Switch/docs-meta.json +0 -13
- package/src/components/Switch/index.ts +0 -1
- package/src/components/Switch/registry-meta.json +0 -20
- package/src/components/Switch/switch.css.ts +0 -47
- package/src/components/Switch/switch.demo.tsx +0 -26
- package/src/components/Switch/switch.doc.tsx +0 -25
- package/src/components/Switch/switch.tsx +0 -25
- package/src/components/Table/docs-meta.json +0 -12
- package/src/components/Table/index.ts +0 -2
- package/src/components/Table/registry-meta.json +0 -19
- package/src/components/Table/table.css.ts +0 -72
- package/src/components/Table/table.demo.tsx +0 -58
- package/src/components/Table/table.tsx +0 -116
- package/src/components/Tabs/docs-meta.json +0 -13
- package/src/components/Tabs/index.ts +0 -1
- package/src/components/Tabs/registry-meta.json +0 -19
- package/src/components/Tabs/tabs.css.ts +0 -259
- package/src/components/Tabs/tabs.demo.tsx +0 -33
- package/src/components/Tabs/tabs.doc.tsx +0 -62
- package/src/components/Tabs/tabs.tsx +0 -119
- package/src/components/Text/docs-meta.json +0 -9
- package/src/components/Text/index.ts +0 -2
- package/src/components/Text/registry-meta.json +0 -19
- package/src/components/Text/text.css.ts +0 -167
- package/src/components/Text/text.doc.tsx +0 -53
- package/src/components/Text/text.tsx +0 -64
- package/src/components/Textarea/docs-meta.json +0 -9
- package/src/components/Textarea/index.ts +0 -1
- package/src/components/Textarea/registry-meta.json +0 -19
- package/src/components/Textarea/textarea.css.ts +0 -66
- package/src/components/Textarea/textarea.doc.tsx +0 -23
- package/src/components/Textarea/textarea.tsx +0 -48
- package/src/components/Toggle/docs-meta.json +0 -12
- package/src/components/Toggle/index.ts +0 -1
- package/src/components/Toggle/registry-meta.json +0 -19
- package/src/components/Toggle/toggle.css.ts +0 -101
- package/src/components/Toggle/toggle.doc.tsx +0 -24
- package/src/components/Toggle/toggle.tsx +0 -60
- package/src/components/ToggleGroup/docs-meta.json +0 -9
- package/src/components/ToggleGroup/index.ts +0 -1
- package/src/components/ToggleGroup/registry-meta.json +0 -20
- package/src/components/ToggleGroup/toggle-group.css.ts +0 -77
- package/src/components/ToggleGroup/toggle-group.doc.tsx +0 -38
- package/src/components/ToggleGroup/toggle-group.tsx +0 -131
- package/src/components/index.ts +0 -53
- package/src/demos/accordion.demo.tsx +0 -41
- package/src/index.ts +0 -3
- package/src/utils/heights.ts +0 -16
- package/src/utils/sprinkles.css.ts +0 -251
- package/src/utils/types.ts +0 -20
- package/src/utils/ve-style.utils.ts +0 -24
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -10
- package/vite.config.ts +0 -47
- /package/{dist/assets → assets}/components.css +0 -0
- /package/{dist/components → components}/Card/card.js +0 -0
- /package/{dist/components → components}/CloseButton/close-button.css.js +0 -0
- /package/{dist/components → components}/CloseButton/close-button.js +0 -0
- /package/{dist/components → components}/CloseButton/index.js +0 -0
- /package/{dist/components → components}/ColorPicker/color-picker.js +0 -0
- /package/{dist/components → components}/ColorSwatch/color-swatch.js +0 -0
- /package/{dist/components → components}/CopyButton/copy-button.css.js +0 -0
- /package/{dist/components → components}/CopyButton/copy-button.js +0 -0
- /package/{dist/components → components}/CopyButton/index.js +0 -0
- /package/{dist/components → components}/Grid/grid.css.js +0 -0
- /package/{dist/components → components}/Icon/icon.css.js +0 -0
- /package/{dist/components → components}/IconButton/icon-button.css.js +0 -0
- /package/{dist/components → components}/IconButton/index.js +0 -0
- /package/{dist/components → components}/SegmentedControl/segmented-control.js +0 -0
- /package/{dist/components → components}/Spinner/spinner.css.js +0 -0
- /package/{dist/components → components}/Text/index.js +0 -0
- /package/{dist/components → components}/index.js +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/src → src}/DataTable/data-table-column-toggle.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-empty.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-error.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-infinite-loader.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-loading.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-pagination.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table-toolbar.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table.css.d.ts +0 -0
- /package/{dist/src → src}/DataTable/data-table.d.ts +0 -0
- /package/{dist/src → src}/DataTable/index.d.ts +0 -0
- /package/{dist/src → src}/DataTable/types.d.ts +0 -0
- /package/{dist/src → src}/DataTable/use-infinite-scroll.d.ts +0 -0
- /package/{dist/src → src}/components/Accordion/accordion.css.d.ts +0 -0
- /package/{dist/src → src}/components/Accordion/accordion.d.ts +0 -0
- /package/{dist/src → src}/components/Accordion/index.d.ts +0 -0
- /package/{dist/src → src}/components/Alert/alert.css.d.ts +0 -0
- /package/{dist/src → src}/components/Alert/alert.d.ts +0 -0
- /package/{dist/src → src}/components/Alert/index.d.ts +0 -0
- /package/{dist/src → src}/components/AlertDialog/alert-dialog.css.d.ts +0 -0
- /package/{dist/src → src}/components/AlertDialog/alert-dialog.d.ts +0 -0
- /package/{dist/src → src}/components/AlertDialog/index.d.ts +0 -0
- /package/{dist/src → src}/components/Autocomplete/autocomplete.css.d.ts +0 -0
- /package/{dist/src → src}/components/Autocomplete/autocomplete.d.ts +0 -0
- /package/{dist/src → src}/components/Autocomplete/index.d.ts +0 -0
- /package/{dist/src → src}/components/Avatar/avatar.css.d.ts +0 -0
- /package/{dist/src → src}/components/Avatar/avatar.d.ts +0 -0
- /package/{dist/src → src}/components/Avatar/index.d.ts +0 -0
- /package/{dist/src → src}/components/Badge/badge.css.d.ts +0 -0
- /package/{dist/src → src}/components/Badge/badge.d.ts +0 -0
- /package/{dist/src → src}/components/Badge/index.d.ts +0 -0
- /package/{dist/src → src}/components/Box/box.css.d.ts +0 -0
- /package/{dist/src → src}/components/Box/box.d.ts +0 -0
- /package/{dist/src → src}/components/Box/index.d.ts +0 -0
- /package/{dist/src → src}/components/Breadcrumbs/breadcrumbs.css.d.ts +0 -0
- /package/{dist/src → src}/components/Breadcrumbs/breadcrumbs.d.ts +0 -0
- /package/{dist/src → src}/components/Breadcrumbs/index.d.ts +0 -0
- /package/{dist/src → src}/components/Button/button.css.d.ts +0 -0
- /package/{dist/src → src}/components/Button/button.d.ts +0 -0
- /package/{dist/src → src}/components/Button/index.d.ts +0 -0
- /package/{dist/src → src}/components/Calendar/calendar.css.d.ts +0 -0
- /package/{dist/src → src}/components/Calendar/calendar.d.ts +0 -0
- /package/{dist/src → src}/components/Calendar/index.d.ts +0 -0
- /package/{dist/src → src}/components/Card/card.d.ts +0 -0
- /package/{dist/src → src}/components/Card/index.d.ts +0 -0
- /package/{dist/src → src}/components/Checkbox/checkbox.css.d.ts +0 -0
- /package/{dist/src → src}/components/Checkbox/checkbox.d.ts +0 -0
- /package/{dist/src → src}/components/Checkbox/index.d.ts +0 -0
- /package/{dist/src → src}/components/CloseButton/close-button.css.d.ts +0 -0
- /package/{dist/src → src}/components/CloseButton/close-button.d.ts +0 -0
- /package/{dist/src → src}/components/CloseButton/index.d.ts +0 -0
- /package/{dist/src → src}/components/ColorPicker/color-picker.d.ts +0 -0
- /package/{dist/src → src}/components/ColorPicker/index.d.ts +0 -0
- /package/{dist/src → src}/components/ColorSwatch/color-swatch.d.ts +0 -0
- /package/{dist/src → src}/components/ColorSwatch/index.d.ts +0 -0
- /package/{dist/src → src}/components/Combobox/combobox.css.d.ts +0 -0
- /package/{dist/src → src}/components/Combobox/combobox.d.ts +0 -0
- /package/{dist/src → src}/components/Combobox/index.d.ts +0 -0
- /package/{dist/src → src}/components/Command/command.css.d.ts +0 -0
- /package/{dist/src → src}/components/Command/command.d.ts +0 -0
- /package/{dist/src → src}/components/Command/index.d.ts +0 -0
- /package/{dist/src → src}/components/Container/container.css.d.ts +0 -0
- /package/{dist/src → src}/components/Container/container.d.ts +0 -0
- /package/{dist/src → src}/components/Container/index.d.ts +0 -0
- /package/{dist/src → src}/components/CopyButton/copy-button.css.d.ts +0 -0
- /package/{dist/src → src}/components/CopyButton/copy-button.d.ts +0 -0
- /package/{dist/src → src}/components/CopyButton/index.d.ts +0 -0
- /package/{dist/src → src}/components/DatePicker/date-picker.d.ts +0 -0
- /package/{dist/src → src}/components/DatePicker/index.d.ts +0 -0
- /package/{dist/src → src}/components/Dialog/dialog.css.d.ts +0 -0
- /package/{dist/src → src}/components/Dialog/dialog.d.ts +0 -0
- /package/{dist/src → src}/components/Dialog/index.d.ts +0 -0
- /package/{dist/src → src}/components/Drawer/drawer.css.d.ts +0 -0
- /package/{dist/src → src}/components/Drawer/drawer.d.ts +0 -0
- /package/{dist/src → src}/components/Drawer/index.d.ts +0 -0
- /package/{dist/src → src}/components/Field/field.css.d.ts +0 -0
- /package/{dist/src → src}/components/Field/field.d.ts +0 -0
- /package/{dist/src → src}/components/Field/index.d.ts +0 -0
- /package/{dist/src → src}/components/Grid/grid.css.d.ts +0 -0
- /package/{dist/src → src}/components/Grid/grid.d.ts +0 -0
- /package/{dist/src → src}/components/Grid/index.d.ts +0 -0
- /package/{dist/src → src}/components/Icon/icon.css.d.ts +0 -0
- /package/{dist/src → src}/components/Icon/icon.d.ts +0 -0
- /package/{dist/src → src}/components/Icon/index.d.ts +0 -0
- /package/{dist/src → src}/components/IconButton/icon-button.css.d.ts +0 -0
- /package/{dist/src → src}/components/IconButton/icon-button.d.ts +0 -0
- /package/{dist/src → src}/components/IconButton/index.d.ts +0 -0
- /package/{dist/src → src}/components/Input/index.d.ts +0 -0
- /package/{dist/src → src}/components/Input/input.css.d.ts +0 -0
- /package/{dist/src → src}/components/Input/input.d.ts +0 -0
- /package/{dist/src → src}/components/InputGroup/index.d.ts +0 -0
- /package/{dist/src → src}/components/InputGroup/input-group.css.d.ts +0 -0
- /package/{dist/src → src}/components/InputGroup/input-group.d.ts +0 -0
- /package/{dist/src → src}/components/Menu/index.d.ts +0 -0
- /package/{dist/src → src}/components/Menu/menu.css.d.ts +0 -0
- /package/{dist/src → src}/components/Menu/menu.d.ts +0 -0
- /package/{dist/src → src}/components/OTPField/index.d.ts +0 -0
- /package/{dist/src → src}/components/OTPField/otp-field.css.d.ts +0 -0
- /package/{dist/src → src}/components/OTPField/otp-field.d.ts +0 -0
- /package/{dist/src → src}/components/Popover/index.d.ts +0 -0
- /package/{dist/src → src}/components/Popover/popover.css.d.ts +0 -0
- /package/{dist/src → src}/components/Popover/popover.d.ts +0 -0
- /package/{dist/src → src}/components/Progress/index.d.ts +0 -0
- /package/{dist/src → src}/components/Progress/progress.css.d.ts +0 -0
- /package/{dist/src → src}/components/Progress/progress.d.ts +0 -0
- /package/{dist/src → src}/components/Radio/index.d.ts +0 -0
- /package/{dist/src → src}/components/Radio/radio.css.d.ts +0 -0
- /package/{dist/src → src}/components/Radio/radio.d.ts +0 -0
- /package/{dist/src → src}/components/ScrollArea/index.d.ts +0 -0
- /package/{dist/src → src}/components/ScrollArea/scroll-area.css.d.ts +0 -0
- /package/{dist/src → src}/components/ScrollArea/scroll-area.d.ts +0 -0
- /package/{dist/src → src}/components/SegmentedControl/index.d.ts +0 -0
- /package/{dist/src → src}/components/SegmentedControl/segmented-control.d.ts +0 -0
- /package/{dist/src → src}/components/Select/index.d.ts +0 -0
- /package/{dist/src → src}/components/Select/select.css.d.ts +0 -0
- /package/{dist/src → src}/components/Select/select.d.ts +0 -0
- /package/{dist/src → src}/components/Separator/index.d.ts +0 -0
- /package/{dist/src → src}/components/Separator/separator.css.d.ts +0 -0
- /package/{dist/src → src}/components/Separator/separator.d.ts +0 -0
- /package/{dist/src → src}/components/Sheet/index.d.ts +0 -0
- /package/{dist/src → src}/components/Sheet/sheet.css.d.ts +0 -0
- /package/{dist/src → src}/components/Sheet/sheet.d.ts +0 -0
- /package/{dist/src → src}/components/Slider/index.d.ts +0 -0
- /package/{dist/src → src}/components/Slider/slider.css.d.ts +0 -0
- /package/{dist/src → src}/components/Slider/slider.d.ts +0 -0
- /package/{dist/src → src}/components/Spinner/index.d.ts +0 -0
- /package/{dist/src → src}/components/Spinner/spinner.css.d.ts +0 -0
- /package/{dist/src → src}/components/Spinner/spinner.d.ts +0 -0
- /package/{dist/src → src}/components/Splitter/index.d.ts +0 -0
- /package/{dist/src → src}/components/Splitter/splitter.css.d.ts +0 -0
- /package/{dist/src → src}/components/Splitter/splitter.d.ts +0 -0
- /package/{dist/src → src}/components/Stack/index.d.ts +0 -0
- /package/{dist/src → src}/components/Stack/stack.css.d.ts +0 -0
- /package/{dist/src → src}/components/Stack/stack.d.ts +0 -0
- /package/{dist/src → src}/components/Surface/index.d.ts +0 -0
- /package/{dist/src → src}/components/Surface/surface.css.d.ts +0 -0
- /package/{dist/src → src}/components/Surface/surface.d.ts +0 -0
- /package/{dist/src → src}/components/Switch/index.d.ts +0 -0
- /package/{dist/src → src}/components/Switch/switch.css.d.ts +0 -0
- /package/{dist/src → src}/components/Switch/switch.d.ts +0 -0
- /package/{dist/src → src}/components/Table/index.d.ts +0 -0
- /package/{dist/src → src}/components/Table/table.css.d.ts +0 -0
- /package/{dist/src → src}/components/Table/table.d.ts +0 -0
- /package/{dist/src → src}/components/Tabs/index.d.ts +0 -0
- /package/{dist/src → src}/components/Tabs/tabs.css.d.ts +0 -0
- /package/{dist/src → src}/components/Tabs/tabs.d.ts +0 -0
- /package/{dist/src → src}/components/Text/index.d.ts +0 -0
- /package/{dist/src → src}/components/Text/text.css.d.ts +0 -0
- /package/{dist/src → src}/components/Text/text.d.ts +0 -0
- /package/{dist/src → src}/components/Textarea/index.d.ts +0 -0
- /package/{dist/src → src}/components/Textarea/textarea.css.d.ts +0 -0
- /package/{dist/src → src}/components/Textarea/textarea.d.ts +0 -0
- /package/{dist/src → src}/components/Toggle/index.d.ts +0 -0
- /package/{dist/src → src}/components/Toggle/toggle.css.d.ts +0 -0
- /package/{dist/src → src}/components/Toggle/toggle.d.ts +0 -0
- /package/{dist/src → src}/components/ToggleGroup/index.d.ts +0 -0
- /package/{dist/src → src}/components/ToggleGroup/toggle-group.css.d.ts +0 -0
- /package/{dist/src → src}/components/ToggleGroup/toggle-group.d.ts +0 -0
- /package/{dist/src → src}/components/index.d.ts +0 -0
- /package/{dist/src → src}/index.d.ts +0 -0
- /package/{dist/src → src}/utils/heights.d.ts +0 -0
- /package/{dist/src → src}/utils/sprinkles.css.d.ts +0 -0
- /package/{dist/src → src}/utils/types.d.ts +0 -0
- /package/{dist/src → src}/utils/ve-style.utils.d.ts +0 -0
- /package/{dist/utils → utils}/ve-style.utils.js +0 -0
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
// oxlint-disable max-statements
|
|
2
|
-
"use client";
|
|
3
|
-
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import React, {
|
|
6
|
-
createContext,
|
|
7
|
-
useCallback,
|
|
8
|
-
useContext,
|
|
9
|
-
useEffect,
|
|
10
|
-
useMemo,
|
|
11
|
-
useRef,
|
|
12
|
-
useState,
|
|
13
|
-
} from "react";
|
|
14
|
-
import {
|
|
15
|
-
HANDLE_SIZE,
|
|
16
|
-
root,
|
|
17
|
-
rootHorizontal,
|
|
18
|
-
rootVertical,
|
|
19
|
-
rootDisabled,
|
|
20
|
-
panel,
|
|
21
|
-
handle,
|
|
22
|
-
handleActive,
|
|
23
|
-
handleHorizontal,
|
|
24
|
-
handleVertical,
|
|
25
|
-
} from "./splitter.css";
|
|
26
|
-
|
|
27
|
-
// ─── Public types ──────────────────────────────────────────────────────────
|
|
28
|
-
|
|
29
|
-
export interface SplitterPanelProps {
|
|
30
|
-
defaultSize?: number;
|
|
31
|
-
size?: number;
|
|
32
|
-
minSize?: number;
|
|
33
|
-
maxSize?: number;
|
|
34
|
-
collapsible?: boolean;
|
|
35
|
-
collapsedSize?: number;
|
|
36
|
-
children?: React.ReactNode;
|
|
37
|
-
className?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface SplitterHandleProps {
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
className?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface SplitterProps {
|
|
46
|
-
orientation?: "horizontal" | "vertical";
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
storageKey?: string;
|
|
49
|
-
children?: React.ReactNode;
|
|
50
|
-
onResizeStart?: () => void;
|
|
51
|
-
onResize?: (sizes: number[]) => void;
|
|
52
|
-
onResizeEnd?: (sizes: number[]) => void;
|
|
53
|
-
className?: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ─── Internal types ────────────────────────────────────────────────────────
|
|
57
|
-
|
|
58
|
-
interface PanelConstraints {
|
|
59
|
-
minSize: number;
|
|
60
|
-
maxSize: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface InternalCtxValue {
|
|
64
|
-
orientation: "horizontal" | "vertical";
|
|
65
|
-
disabled: boolean;
|
|
66
|
-
sizes: number[];
|
|
67
|
-
panelConstraintsRef: React.MutableRefObject<(PanelConstraints | undefined)[]>;
|
|
68
|
-
panelRefs: React.MutableRefObject<(HTMLDivElement | null)[]>;
|
|
69
|
-
setSizes: React.Dispatch<React.SetStateAction<number[]>>;
|
|
70
|
-
handlePointerDown: (handleIndex: number, e: React.PointerEvent) => void;
|
|
71
|
-
handleKeyDown: (handleIndex: number, e: React.KeyboardEvent) => void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const InternalCtx = createContext<InternalCtxValue | null>(null);
|
|
75
|
-
|
|
76
|
-
function useInternalCtx(): InternalCtxValue {
|
|
77
|
-
const ctx = useContext(InternalCtx);
|
|
78
|
-
if (!ctx) {
|
|
79
|
-
throw new Error("Splitter compound components must be used within <Splitter>");
|
|
80
|
-
}
|
|
81
|
-
return ctx;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// ─── Helpers ───────────────────────────────────────────────────────────────
|
|
85
|
-
|
|
86
|
-
function isPanel(child: React.ReactNode): child is React.ReactElement<SplitterPanelProps> {
|
|
87
|
-
return React.isValidElement(child) && child.type === SplitterPanel;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function isHandle(child: React.ReactNode): child is React.ReactElement<SplitterHandleProps> {
|
|
91
|
-
return React.isValidElement(child) && child.type === SplitterHandle;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function calculateSizes(panelProps: SplitterPanelProps[], storageKey?: string): number[] {
|
|
95
|
-
const count = panelProps.length;
|
|
96
|
-
|
|
97
|
-
if (count === 0) return [];
|
|
98
|
-
|
|
99
|
-
// Restore from storage
|
|
100
|
-
if (storageKey) {
|
|
101
|
-
try {
|
|
102
|
-
const stored = localStorage.getItem(storageKey);
|
|
103
|
-
if (stored) {
|
|
104
|
-
const parsed = JSON.parse(stored) as number[];
|
|
105
|
-
if (Array.isArray(parsed) && parsed.length === count) {
|
|
106
|
-
return parsed;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
} catch {
|
|
110
|
-
/* Ignore */
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const result = Array.from({ length: count }, () => 0);
|
|
115
|
-
let usedSize = 0;
|
|
116
|
-
let unsetCount = count;
|
|
117
|
-
|
|
118
|
-
for (let i = 0; i < count; i++) {
|
|
119
|
-
const p = panelProps[i];
|
|
120
|
-
const sz = p?.size ?? p?.defaultSize;
|
|
121
|
-
if (sz != null) {
|
|
122
|
-
result[i] = sz;
|
|
123
|
-
usedSize += sz;
|
|
124
|
-
unsetCount--;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const equalShare = unsetCount > 0 ? (100 - usedSize) / unsetCount : 0;
|
|
129
|
-
for (let i = 0; i < count; i++) {
|
|
130
|
-
if (result[i] == null) {
|
|
131
|
-
result[i] = equalShare;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const total = result.reduce((a, b) => a + b, 0);
|
|
136
|
-
if (Math.abs(total - 100) > 0.01 && total > 0) {
|
|
137
|
-
for (let i = 0; i < count; i++) {
|
|
138
|
-
result[i] = ((result[i] as number) / total) * 100;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return result;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function clamp(value: number, min: number, max: number): number {
|
|
146
|
-
return Math.min(Math.max(value, min), max);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// ─── Splitter ──────────────────────────────────────────────────────────────
|
|
150
|
-
|
|
151
|
-
export function Splitter({
|
|
152
|
-
orientation = "horizontal",
|
|
153
|
-
disabled: isDisabled = false,
|
|
154
|
-
storageKey,
|
|
155
|
-
children,
|
|
156
|
-
onResizeStart,
|
|
157
|
-
onResize,
|
|
158
|
-
onResizeEnd,
|
|
159
|
-
className,
|
|
160
|
-
}: SplitterProps) {
|
|
161
|
-
const rootRef = useRef<HTMLDivElement>(null);
|
|
162
|
-
const panelConstraintsRef = useRef<(PanelConstraints | undefined)[]>([]);
|
|
163
|
-
const panelRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
164
|
-
const sizesRef = useRef<number[]>([]);
|
|
165
|
-
const isFirstRender = useRef(true);
|
|
166
|
-
|
|
167
|
-
const onResizeStartRef = useRef(onResizeStart);
|
|
168
|
-
const onResizeRef = useRef(onResize);
|
|
169
|
-
const onResizeEndRef = useRef(onResizeEnd);
|
|
170
|
-
onResizeStartRef.current = onResizeStart;
|
|
171
|
-
onResizeRef.current = onResize;
|
|
172
|
-
onResizeEndRef.current = onResizeEnd;
|
|
173
|
-
|
|
174
|
-
// Collect panel props from children (for initial size calculation)
|
|
175
|
-
const panelPropsList = useMemo(() => {
|
|
176
|
-
const list: SplitterPanelProps[] = [];
|
|
177
|
-
React.Children.forEach(children, (child) => {
|
|
178
|
-
if (isPanel(child)) {
|
|
179
|
-
list.push(child.props);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
return list;
|
|
183
|
-
}, [children]);
|
|
184
|
-
|
|
185
|
-
const panelCount = panelPropsList.length;
|
|
186
|
-
|
|
187
|
-
// ── State ──────────────────────────────────────────────────────────────
|
|
188
|
-
const [sizes, setSizes] = useState<number[]>(() => calculateSizes(panelPropsList, storageKey));
|
|
189
|
-
sizesRef.current = sizes;
|
|
190
|
-
|
|
191
|
-
// Recalculate if panel count changes
|
|
192
|
-
const prevPanelCount = useRef(panelCount);
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
if (prevPanelCount.current !== panelCount) {
|
|
195
|
-
prevPanelCount.current = panelCount;
|
|
196
|
-
setSizes(calculateSizes(panelPropsList, storageKey));
|
|
197
|
-
}
|
|
198
|
-
}, [panelCount, panelPropsList, storageKey]);
|
|
199
|
-
|
|
200
|
-
// ── Persist ────────────────────────────────────────────────────────────
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
if (isFirstRender.current) {
|
|
203
|
-
isFirstRender.current = false;
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (storageKey) {
|
|
207
|
-
try {
|
|
208
|
-
localStorage.setItem(storageKey, JSON.stringify(sizes));
|
|
209
|
-
} catch {
|
|
210
|
-
/* Ignore */
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}, [storageKey, sizes]);
|
|
214
|
-
|
|
215
|
-
// ── Pointer resize ─────────────────────────────────────────────────────
|
|
216
|
-
const handlePointerDown = useCallback(
|
|
217
|
-
(handleIndex: number, e: React.PointerEvent) => {
|
|
218
|
-
if (isDisabled) return;
|
|
219
|
-
e.preventDefault();
|
|
220
|
-
|
|
221
|
-
const root = rootRef.current;
|
|
222
|
-
if (!root) return;
|
|
223
|
-
|
|
224
|
-
const rect = root.getBoundingClientRect();
|
|
225
|
-
const totalPx = orientation === "horizontal" ? rect.width : rect.height;
|
|
226
|
-
const startPos = orientation === "horizontal" ? e.clientX : e.clientY;
|
|
227
|
-
|
|
228
|
-
const handleCount = panelCount - 1;
|
|
229
|
-
const handlesPx = handleCount * HANDLE_SIZE;
|
|
230
|
-
const availablePx = totalPx - handlesPx;
|
|
231
|
-
|
|
232
|
-
if (availablePx <= 0) return;
|
|
233
|
-
|
|
234
|
-
const startSizes = [...sizesRef.current];
|
|
235
|
-
|
|
236
|
-
onResizeStartRef.current?.();
|
|
237
|
-
|
|
238
|
-
const onMove = (ev: PointerEvent) => {
|
|
239
|
-
const currentPos = orientation === "horizontal" ? ev.clientX : ev.clientY;
|
|
240
|
-
const deltaPx = currentPos - startPos;
|
|
241
|
-
const deltaPct = (deltaPx / availablePx) * 100;
|
|
242
|
-
|
|
243
|
-
const newSizes = [...startSizes];
|
|
244
|
-
let left = (startSizes[handleIndex] ?? 0) + deltaPct;
|
|
245
|
-
let right = (startSizes[handleIndex + 1] ?? 0) - deltaPct;
|
|
246
|
-
|
|
247
|
-
const cLeft = panelConstraintsRef.current[handleIndex];
|
|
248
|
-
const cRight = panelConstraintsRef.current[handleIndex + 1];
|
|
249
|
-
const minL = cLeft?.minSize ?? 0;
|
|
250
|
-
const maxL = cLeft?.maxSize ?? 100;
|
|
251
|
-
const minR = cRight?.minSize ?? 0;
|
|
252
|
-
const maxR = cRight?.maxSize ?? 100;
|
|
253
|
-
|
|
254
|
-
if (left < minL) {
|
|
255
|
-
right += left - minL;
|
|
256
|
-
left = minL;
|
|
257
|
-
}
|
|
258
|
-
if (left > maxL) {
|
|
259
|
-
right -= left - maxL;
|
|
260
|
-
left = maxL;
|
|
261
|
-
}
|
|
262
|
-
if (right < minR) {
|
|
263
|
-
left -= minR - right;
|
|
264
|
-
right = minR;
|
|
265
|
-
}
|
|
266
|
-
if (right > maxR) {
|
|
267
|
-
left += right - maxR;
|
|
268
|
-
right = maxR;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
left = clamp(left, minL, maxL);
|
|
272
|
-
right = clamp(right, minR, maxR);
|
|
273
|
-
|
|
274
|
-
newSizes[handleIndex] = left;
|
|
275
|
-
newSizes[handleIndex + 1] = right;
|
|
276
|
-
|
|
277
|
-
setSizes(newSizes);
|
|
278
|
-
onResizeRef.current?.(newSizes);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const onUp = () => {
|
|
282
|
-
document.removeEventListener("pointermove", onMove);
|
|
283
|
-
document.removeEventListener("pointerup", onUp);
|
|
284
|
-
document.body.style.userSelect = "";
|
|
285
|
-
document.body.style.pointerEvents = "";
|
|
286
|
-
onResizeEndRef.current?.([...sizesRef.current]);
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
document.addEventListener("pointermove", onMove);
|
|
290
|
-
document.addEventListener("pointerup", onUp);
|
|
291
|
-
document.body.style.userSelect = "none";
|
|
292
|
-
document.body.style.pointerEvents = "none";
|
|
293
|
-
},
|
|
294
|
-
[isDisabled, orientation, panelCount],
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
// ── Keyboard resize ────────────────────────────────────────────────────
|
|
298
|
-
const handleKeyDown = useCallback(
|
|
299
|
-
(handleIndex: number, e: React.KeyboardEvent) => {
|
|
300
|
-
if (isDisabled) return;
|
|
301
|
-
|
|
302
|
-
let delta = 0;
|
|
303
|
-
const step = e.shiftKey ? 10 : 1;
|
|
304
|
-
|
|
305
|
-
if (orientation === "horizontal") {
|
|
306
|
-
if (e.key === "ArrowLeft") delta = -step;
|
|
307
|
-
else if (e.key === "ArrowRight") delta = step;
|
|
308
|
-
} else {
|
|
309
|
-
if (e.key === "ArrowUp") delta = -step;
|
|
310
|
-
else if (e.key === "ArrowDown") delta = step;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
if (delta === 0) return;
|
|
314
|
-
e.preventDefault();
|
|
315
|
-
|
|
316
|
-
const currentSizes = sizesRef.current;
|
|
317
|
-
const newSizes = [...currentSizes];
|
|
318
|
-
let left = (currentSizes[handleIndex] ?? 0) + delta;
|
|
319
|
-
let right = (currentSizes[handleIndex + 1] ?? 0) - delta;
|
|
320
|
-
|
|
321
|
-
const cLeft = panelConstraintsRef.current[handleIndex];
|
|
322
|
-
const cRight = panelConstraintsRef.current[handleIndex + 1];
|
|
323
|
-
const minL = cLeft?.minSize ?? 0;
|
|
324
|
-
const maxL = cLeft?.maxSize ?? 100;
|
|
325
|
-
const minR = cRight?.minSize ?? 0;
|
|
326
|
-
const maxR = cRight?.maxSize ?? 100;
|
|
327
|
-
|
|
328
|
-
if (left < minL) {
|
|
329
|
-
right += left - minL;
|
|
330
|
-
left = minL;
|
|
331
|
-
}
|
|
332
|
-
if (left > maxL) {
|
|
333
|
-
right -= left - maxL;
|
|
334
|
-
left = maxL;
|
|
335
|
-
}
|
|
336
|
-
if (right < minR) {
|
|
337
|
-
left -= minR - right;
|
|
338
|
-
right = minR;
|
|
339
|
-
}
|
|
340
|
-
if (right > maxR) {
|
|
341
|
-
left += right - maxR;
|
|
342
|
-
right = maxR;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
left = clamp(left, minL, maxL);
|
|
346
|
-
right = clamp(right, minR, maxR);
|
|
347
|
-
|
|
348
|
-
newSizes[handleIndex] = left;
|
|
349
|
-
newSizes[handleIndex + 1] = right;
|
|
350
|
-
|
|
351
|
-
setSizes(newSizes);
|
|
352
|
-
onResizeRef.current?.(newSizes);
|
|
353
|
-
},
|
|
354
|
-
[isDisabled, orientation],
|
|
355
|
-
);
|
|
356
|
-
|
|
357
|
-
// ── Context value ──────────────────────────────────────────────────────
|
|
358
|
-
const ctxValue = useMemo<InternalCtxValue>(
|
|
359
|
-
() => ({
|
|
360
|
-
orientation,
|
|
361
|
-
disabled: isDisabled,
|
|
362
|
-
sizes,
|
|
363
|
-
panelConstraintsRef,
|
|
364
|
-
panelRefs,
|
|
365
|
-
setSizes,
|
|
366
|
-
handlePointerDown,
|
|
367
|
-
handleKeyDown,
|
|
368
|
-
}),
|
|
369
|
-
[orientation, isDisabled, sizes, handlePointerDown, handleKeyDown],
|
|
370
|
-
);
|
|
371
|
-
|
|
372
|
-
// ── Render children with indices ──────────────────────────────────────
|
|
373
|
-
let panelIdx = 0;
|
|
374
|
-
let handleIdx = 0;
|
|
375
|
-
|
|
376
|
-
const mapped = React.Children.map(children, (child) => {
|
|
377
|
-
if (isPanel(child)) {
|
|
378
|
-
const idx = panelIdx++;
|
|
379
|
-
return (
|
|
380
|
-
<SplitterPanel
|
|
381
|
-
{...(child.props as SplitterPanelProps)}
|
|
382
|
-
__panelIndex={idx}
|
|
383
|
-
key={child.key ?? `splitter-panel-${idx}`}
|
|
384
|
-
/>
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
if (isHandle(child)) {
|
|
388
|
-
const idx = handleIdx++;
|
|
389
|
-
return (
|
|
390
|
-
<SplitterHandle
|
|
391
|
-
{...(child.props as SplitterHandleProps)}
|
|
392
|
-
__handleIndex={idx}
|
|
393
|
-
key={child.key ?? `splitter-handle-${idx}`}
|
|
394
|
-
/>
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
return child;
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
return (
|
|
401
|
-
<InternalCtx.Provider value={ctxValue}>
|
|
402
|
-
<div
|
|
403
|
-
ref={rootRef}
|
|
404
|
-
className={clsx(
|
|
405
|
-
root,
|
|
406
|
-
orientation === "horizontal" ? rootHorizontal : rootVertical,
|
|
407
|
-
isDisabled && rootDisabled,
|
|
408
|
-
className,
|
|
409
|
-
)}
|
|
410
|
-
data-orientation={orientation}
|
|
411
|
-
>
|
|
412
|
-
{mapped}
|
|
413
|
-
</div>
|
|
414
|
-
</InternalCtx.Provider>
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// ─── SplitterPanel ─────────────────────────────────────────────────────────
|
|
419
|
-
|
|
420
|
-
export function SplitterPanel({
|
|
421
|
-
defaultSize: _defaultSize,
|
|
422
|
-
size: _size,
|
|
423
|
-
minSize = 0,
|
|
424
|
-
maxSize = 100,
|
|
425
|
-
collapsible: _collapsible = false,
|
|
426
|
-
collapsedSize: _collapsedSize = 0,
|
|
427
|
-
children,
|
|
428
|
-
className,
|
|
429
|
-
__panelIndex,
|
|
430
|
-
}: SplitterPanelProps & { __panelIndex?: number }) {
|
|
431
|
-
const ctx = useInternalCtx();
|
|
432
|
-
const index = __panelIndex!;
|
|
433
|
-
|
|
434
|
-
// Register constraints
|
|
435
|
-
useEffect(() => {
|
|
436
|
-
const ref = ctx.panelConstraintsRef.current;
|
|
437
|
-
ref[index] = { minSize, maxSize };
|
|
438
|
-
return () => {
|
|
439
|
-
ref[index] = undefined;
|
|
440
|
-
};
|
|
441
|
-
}, [index, minSize, maxSize, ctx.panelConstraintsRef]);
|
|
442
|
-
|
|
443
|
-
const panelSize = ctx.sizes[index] ?? 0;
|
|
444
|
-
|
|
445
|
-
return (
|
|
446
|
-
<div
|
|
447
|
-
ref={(el) => {
|
|
448
|
-
ctx.panelRefs.current[index] = el;
|
|
449
|
-
}}
|
|
450
|
-
className={clsx(panel, className)}
|
|
451
|
-
style={{ flex: `${panelSize} 0 0` }}
|
|
452
|
-
data-slot="splitter-panel"
|
|
453
|
-
>
|
|
454
|
-
{children}
|
|
455
|
-
</div>
|
|
456
|
-
);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// ─── SplitterHandle ────────────────────────────────────────────────────────
|
|
460
|
-
|
|
461
|
-
export function SplitterHandle({
|
|
462
|
-
disabled: handleDisabled,
|
|
463
|
-
className,
|
|
464
|
-
__handleIndex,
|
|
465
|
-
}: SplitterHandleProps & { __handleIndex?: number }) {
|
|
466
|
-
const ctx = useInternalCtx();
|
|
467
|
-
const index = __handleIndex!;
|
|
468
|
-
const [active, setActive] = useState(false);
|
|
469
|
-
|
|
470
|
-
const onPointerDown = useCallback(
|
|
471
|
-
(e: React.PointerEvent) => {
|
|
472
|
-
if (handleDisabled || ctx.disabled) return;
|
|
473
|
-
setActive(true);
|
|
474
|
-
ctx.handlePointerDown(index, e);
|
|
475
|
-
},
|
|
476
|
-
[handleDisabled, ctx, index],
|
|
477
|
-
);
|
|
478
|
-
|
|
479
|
-
const onKeyDown = useCallback(
|
|
480
|
-
(e: React.KeyboardEvent) => {
|
|
481
|
-
ctx.handleKeyDown(index, e);
|
|
482
|
-
},
|
|
483
|
-
[ctx, index],
|
|
484
|
-
);
|
|
485
|
-
|
|
486
|
-
useEffect(() => {
|
|
487
|
-
if (!active) return;
|
|
488
|
-
const onUp = () => setActive(false);
|
|
489
|
-
document.addEventListener("pointerup", onUp);
|
|
490
|
-
return () => document.removeEventListener("pointerup", onUp);
|
|
491
|
-
}, [active]);
|
|
492
|
-
|
|
493
|
-
const panelSize = ctx.sizes[index] ?? 0;
|
|
494
|
-
|
|
495
|
-
return (
|
|
496
|
-
// oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
497
|
-
<hr
|
|
498
|
-
tabIndex={handleDisabled || ctx.disabled ? -1 : 0}
|
|
499
|
-
aria-orientation={ctx.orientation}
|
|
500
|
-
aria-valuenow={Math.round(panelSize)}
|
|
501
|
-
aria-valuemin={0}
|
|
502
|
-
aria-valuemax={100}
|
|
503
|
-
aria-disabled={handleDisabled || ctx.disabled || undefined}
|
|
504
|
-
onPointerDown={onPointerDown}
|
|
505
|
-
onKeyDown={onKeyDown}
|
|
506
|
-
className={clsx(
|
|
507
|
-
handle,
|
|
508
|
-
ctx.orientation === "horizontal" ? handleHorizontal : handleVertical,
|
|
509
|
-
active && handleActive,
|
|
510
|
-
(handleDisabled || ctx.disabled) && handleDisabled,
|
|
511
|
-
className,
|
|
512
|
-
)}
|
|
513
|
-
data-slot="splitter-handle"
|
|
514
|
-
/>
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
// ─── Namespace props ───────────────────────────────────────────────────────
|
|
519
|
-
|
|
520
|
-
Splitter.Panel = SplitterPanel;
|
|
521
|
-
Splitter.Handle = SplitterHandle;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://blenx-ui.vercel.app/docs/docs-meta.schema.json",
|
|
3
|
-
"title": "Stack",
|
|
4
|
-
"description": "A flexbox layout component with gap, alignment, and direction control. Includes VStack and HStack shorthands.",
|
|
5
|
-
"category": "Layout",
|
|
6
|
-
"status": "stable",
|
|
7
|
-
"keywords": ["stack", "flex", "layout", "vstack", "hstack", "flexbox"],
|
|
8
|
-
"related": ["Box", "Grid"]
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./stack";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
-
"name": "stack",
|
|
4
|
-
"type": "registry:ui",
|
|
5
|
-
"title": "Stack",
|
|
6
|
-
"description": "A StyleX Stack component.",
|
|
7
|
-
"registryDependencies": ["box"],
|
|
8
|
-
"files": [
|
|
9
|
-
{
|
|
10
|
-
"file": "stack.tsx",
|
|
11
|
-
"type": "registry:ui",
|
|
12
|
-
"target": "@ui/Stack/stack.tsx"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"file": "stack.css.ts",
|
|
16
|
-
"type": "registry:file",
|
|
17
|
-
"target": "@ui/Stack/stack.css.ts"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@vanilla-extract/recipes";
|
|
2
|
-
import { spacing } from "@blenx-dev/theme/tokens";
|
|
3
|
-
|
|
4
|
-
export const stackRecipe = recipe({
|
|
5
|
-
variants: {
|
|
6
|
-
gap: {
|
|
7
|
-
none: { gap: 0 },
|
|
8
|
-
xxsmall: { gap: spacing.xxsmall },
|
|
9
|
-
xsmall: { gap: spacing.xsmall },
|
|
10
|
-
small: { gap: spacing.small },
|
|
11
|
-
medium: { gap: spacing.medium },
|
|
12
|
-
large: { gap: spacing.large },
|
|
13
|
-
xlarge: { gap: spacing.xlarge },
|
|
14
|
-
xxlarge: { gap: spacing.xxlarge },
|
|
15
|
-
xxxlarge: { gap: spacing.xxxlarge },
|
|
16
|
-
huge: { gap: spacing.huge },
|
|
17
|
-
massive: { gap: spacing.massive },
|
|
18
|
-
},
|
|
19
|
-
align: {
|
|
20
|
-
start: { alignItems: "flex-start" },
|
|
21
|
-
center: { alignItems: "center" },
|
|
22
|
-
end: { alignItems: "flex-end" },
|
|
23
|
-
stretch: { alignItems: "stretch" },
|
|
24
|
-
baseline: { alignItems: "baseline" },
|
|
25
|
-
},
|
|
26
|
-
justify: {
|
|
27
|
-
start: { justifyContent: "flex-start" },
|
|
28
|
-
center: { justifyContent: "center" },
|
|
29
|
-
end: { justifyContent: "flex-end" },
|
|
30
|
-
between: { justifyContent: "space-between" },
|
|
31
|
-
around: { justifyContent: "space-around" },
|
|
32
|
-
evenly: { justifyContent: "space-evenly" },
|
|
33
|
-
stretch: { justifyContent: "stretch" },
|
|
34
|
-
},
|
|
35
|
-
wrap: {
|
|
36
|
-
true: { flexWrap: "wrap" },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
gap: "medium",
|
|
41
|
-
},
|
|
42
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Card } from "../Card/card";
|
|
2
|
-
import { Text } from "../Text/text";
|
|
3
|
-
import { HStack, Stack, VStack } from "./stack";
|
|
4
|
-
|
|
5
|
-
export function VStackStory() {
|
|
6
|
-
return (
|
|
7
|
-
<VStack gap="small">
|
|
8
|
-
<Text variant="h4">VStack (column)</Text>
|
|
9
|
-
<Card padding="small">
|
|
10
|
-
<Text variant="body2">Item 1</Text>
|
|
11
|
-
</Card>
|
|
12
|
-
<Card padding="small">
|
|
13
|
-
<Text variant="body2">Item 2</Text>
|
|
14
|
-
</Card>
|
|
15
|
-
<Card padding="small">
|
|
16
|
-
<Text variant="body2">Item 3</Text>
|
|
17
|
-
</Card>
|
|
18
|
-
</VStack>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function HStackStory() {
|
|
23
|
-
return (
|
|
24
|
-
<Stack gap="medium">
|
|
25
|
-
<Text variant="h4">HStack (row)</Text>
|
|
26
|
-
<HStack gap="small">
|
|
27
|
-
<Card padding="small">
|
|
28
|
-
<Text variant="body2">Item 1</Text>
|
|
29
|
-
</Card>
|
|
30
|
-
<Card padding="small">
|
|
31
|
-
<Text variant="body2">Item 2</Text>
|
|
32
|
-
</Card>
|
|
33
|
-
<Card padding="small">
|
|
34
|
-
<Text variant="body2">Item 3</Text>
|
|
35
|
-
</Card>
|
|
36
|
-
</HStack>
|
|
37
|
-
</Stack>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function GapVariantsStory() {
|
|
42
|
-
return (
|
|
43
|
-
<VStack gap="medium">
|
|
44
|
-
<Text variant="h4">Gap sizes</Text>
|
|
45
|
-
{(["xxsmall", "xsmall", "small", "medium", "large"] as const).map((gap) => (
|
|
46
|
-
<HStack key={gap} gap={gap}>
|
|
47
|
-
<Card padding="small">
|
|
48
|
-
<Text variant="body3">{gap}</Text>
|
|
49
|
-
</Card>
|
|
50
|
-
<Card padding="small">
|
|
51
|
-
<Text variant="body3">Item</Text>
|
|
52
|
-
</Card>
|
|
53
|
-
</HStack>
|
|
54
|
-
))}
|
|
55
|
-
</VStack>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import type { BoxProps } from "../Box/box";
|
|
3
|
-
import { Box } from "../Box/box";
|
|
4
|
-
import { stackRecipe } from "./stack.css";
|
|
5
|
-
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
6
|
-
|
|
7
|
-
type StackVariants = RecipeVariants<typeof stackRecipe>;
|
|
8
|
-
|
|
9
|
-
export type StackProps = Omit<BoxProps, "display"> & StackVariants;
|
|
10
|
-
|
|
11
|
-
export function Stack({ gap, align, justify, wrap, className, style, ...props }: StackProps) {
|
|
12
|
-
return (
|
|
13
|
-
<Box
|
|
14
|
-
display="flex"
|
|
15
|
-
className={clsx(stackRecipe({ gap, align, justify, wrap }), className)}
|
|
16
|
-
style={style}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type VStackProps = Omit<StackProps, "direction">;
|
|
23
|
-
|
|
24
|
-
export function VStack(props: VStackProps) {
|
|
25
|
-
return <Stack direction="column" {...props} />;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type HStackProps = Omit<StackProps, "direction">;
|
|
29
|
-
|
|
30
|
-
export function HStack(props: HStackProps) {
|
|
31
|
-
return <Stack direction="row" {...props} />;
|
|
32
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://blenx-ui.vercel.app/docs/docs-meta.schema.json",
|
|
3
|
-
"title": "Surface",
|
|
4
|
-
"description": "A background surface layer with variant presets for different visual depths. Supports interactive hover styles.",
|
|
5
|
-
"category": "Layout",
|
|
6
|
-
"status": "stable",
|
|
7
|
-
"keywords": ["surface", "background", "container", "elevation", "card"],
|
|
8
|
-
"related": ["Box", "Card"]
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./surface";
|