@cellarnode/ui 0.3.1 → 0.5.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/dist/__storybook__/mock-data.d.ts +16 -0
- package/dist/__storybook__/mock-data.d.ts.map +1 -0
- package/dist/__storybook__/mock-data.js +162 -0
- package/dist/__storybook__/mock-data.js.map +1 -0
- package/dist/chat/chat-toggle-button.stories.d.ts +33 -0
- package/dist/chat/chat-toggle-button.stories.d.ts.map +1 -0
- package/dist/chat/chat-toggle-button.stories.js +50 -0
- package/dist/chat/chat-toggle-button.stories.js.map +1 -0
- package/dist/chat/communication-hub-widget.d.ts.map +1 -1
- package/dist/chat/communication-hub-widget.js +3 -1
- package/dist/chat/communication-hub-widget.js.map +1 -1
- package/dist/chat/communication-hub-widget.stories.d.ts +18 -0
- package/dist/chat/communication-hub-widget.stories.d.ts.map +1 -0
- package/dist/chat/communication-hub-widget.stories.js +99 -0
- package/dist/chat/communication-hub-widget.stories.js.map +1 -0
- package/dist/chat/communication-panel.d.ts.map +1 -1
- package/dist/chat/communication-panel.js +3 -1
- package/dist/chat/communication-panel.js.map +1 -1
- package/dist/chat/communication-panel.stories.d.ts +21 -0
- package/dist/chat/communication-panel.stories.d.ts.map +1 -0
- package/dist/chat/communication-panel.stories.js +173 -0
- package/dist/chat/communication-panel.stories.js.map +1 -0
- package/dist/chat/global-chat-widget.d.ts +21 -0
- package/dist/chat/global-chat-widget.d.ts.map +1 -0
- package/dist/chat/global-chat-widget.js +53 -0
- package/dist/chat/global-chat-widget.js.map +1 -0
- package/dist/chat/global-chat-widget.stories.d.ts +34 -0
- package/dist/chat/global-chat-widget.stories.d.ts.map +1 -0
- package/dist/chat/global-chat-widget.stories.js +158 -0
- package/dist/chat/global-chat-widget.stories.js.map +1 -0
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +1 -0
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/messenger-layout.d.ts.map +1 -1
- package/dist/chat/messenger-layout.js +3 -1
- package/dist/chat/messenger-layout.js.map +1 -1
- package/dist/chat/messenger-layout.stories.d.ts +18 -0
- package/dist/chat/messenger-layout.stories.d.ts.map +1 -0
- package/dist/chat/messenger-layout.stories.js +97 -0
- package/dist/chat/messenger-layout.stories.js.map +1 -0
- package/dist/chat/negotiation-event-card.d.ts.map +1 -1
- package/dist/chat/negotiation-event-card.js.map +1 -1
- package/dist/chat/negotiation-event-card.stories.d.ts +19 -0
- package/dist/chat/negotiation-event-card.stories.d.ts.map +1 -0
- package/dist/chat/negotiation-event-card.stories.js +104 -0
- package/dist/chat/negotiation-event-card.stories.js.map +1 -0
- package/dist/chat/unified-timeline.js +4 -4
- package/dist/chat/unified-timeline.js.map +1 -1
- package/dist/chat/unified-timeline.stories.d.ts +18 -0
- package/dist/chat/unified-timeline.stories.d.ts.map +1 -0
- package/dist/chat/unified-timeline.stories.js +168 -0
- package/dist/chat/unified-timeline.stories.js.map +1 -0
- package/dist/chat/use-chat.js +10 -10
- package/dist/chat/use-chat.js.map +1 -1
- package/dist/components/accordion.stories.d.ts +7 -0
- package/dist/components/accordion.stories.d.ts.map +1 -0
- package/dist/components/accordion.stories.js +16 -0
- package/dist/components/accordion.stories.js.map +1 -0
- package/dist/components/alert.stories.d.ts +8 -0
- package/dist/components/alert.stories.d.ts.map +1 -0
- package/dist/components/alert.stories.js +26 -0
- package/dist/components/alert.stories.js.map +1 -0
- package/dist/components/animated-list.d.ts.map +1 -1
- package/dist/components/animated-list.js +3 -1
- package/dist/components/animated-list.js.map +1 -1
- package/dist/components/animated-list.stories.d.ts +18 -0
- package/dist/components/animated-list.stories.d.ts.map +1 -0
- package/dist/components/animated-list.stories.js +61 -0
- package/dist/components/animated-list.stories.js.map +1 -0
- package/dist/components/avatar.d.ts +7 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +2 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/avatar.stories.d.ts +16 -0
- package/dist/components/avatar.stories.d.ts.map +1 -0
- package/dist/components/avatar.stories.js +28 -0
- package/dist/components/avatar.stories.js.map +1 -0
- package/dist/components/badge.d.ts +7 -5
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +2 -3
- package/dist/components/badge.js.map +1 -1
- package/dist/components/badge.stories.d.ts +17 -0
- package/dist/components/badge.stories.d.ts.map +1 -0
- package/dist/components/badge.stories.js +25 -0
- package/dist/components/badge.stories.js.map +1 -0
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +2 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +18 -6
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +18 -13
- package/dist/components/card.js.map +1 -1
- package/dist/components/card.stories.d.ts +16 -0
- package/dist/components/card.stories.d.ts.map +1 -0
- package/dist/components/card.stories.js +20 -0
- package/dist/components/card.stories.js.map +1 -0
- package/dist/components/checkbox.stories.d.ts +19 -0
- package/dist/components/checkbox.stories.d.ts.map +1 -0
- package/dist/components/checkbox.stories.js +34 -0
- package/dist/components/checkbox.stories.js.map +1 -0
- package/dist/components/classification-select.d.ts.map +1 -1
- package/dist/components/classification-select.js +1 -0
- package/dist/components/classification-select.js.map +1 -1
- package/dist/components/classification-select.stories.d.ts +17 -0
- package/dist/components/classification-select.stories.d.ts.map +1 -0
- package/dist/components/classification-select.stories.js +100 -0
- package/dist/components/classification-select.stories.js.map +1 -0
- package/dist/components/combobox.stories.d.ts +15 -0
- package/dist/components/combobox.stories.d.ts.map +1 -0
- package/dist/components/combobox.stories.js +45 -0
- package/dist/components/combobox.stories.js.map +1 -0
- package/dist/components/command.stories.d.ts +9 -0
- package/dist/components/command.stories.d.ts.map +1 -0
- package/dist/components/command.stories.js +22 -0
- package/dist/components/command.stories.js.map +1 -0
- package/dist/components/description-list.stories.d.ts +15 -0
- package/dist/components/description-list.stories.d.ts.map +1 -0
- package/dist/components/description-list.stories.js +16 -0
- package/dist/components/description-list.stories.js.map +1 -0
- package/dist/components/dialog.stories.d.ts +8 -0
- package/dist/components/dialog.stories.d.ts.map +1 -0
- package/dist/components/dialog.stories.js +26 -0
- package/dist/components/dialog.stories.js.map +1 -0
- package/dist/components/divider.stories.d.ts +15 -0
- package/dist/components/divider.stories.d.ts.map +1 -0
- package/dist/components/divider.stories.js +16 -0
- package/dist/components/divider.stories.js.map +1 -0
- package/dist/components/drawer.d.ts +12 -4
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +12 -9
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/drawer.stories.d.ts +8 -0
- package/dist/components/drawer.stories.d.ts.map +1 -0
- package/dist/components/drawer.stories.js +27 -0
- package/dist/components/drawer.stories.js.map +1 -0
- package/dist/components/dropdown-menu.stories.d.ts +8 -0
- package/dist/components/dropdown-menu.stories.d.ts.map +1 -0
- package/dist/components/dropdown-menu.stories.js +17 -0
- package/dist/components/dropdown-menu.stories.js.map +1 -0
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +8 -5
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/dropdown.stories.d.ts +8 -0
- package/dist/components/dropdown.stories.d.ts.map +1 -0
- package/dist/components/dropdown.stories.js +16 -0
- package/dist/components/dropdown.stories.js.map +1 -0
- package/dist/components/fieldset.stories.d.ts +9 -0
- package/dist/components/fieldset.stories.d.ts.map +1 -0
- package/dist/components/fieldset.stories.js +24 -0
- package/dist/components/fieldset.stories.js.map +1 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +5 -4
- package/dist/components/form.js.map +1 -1
- package/dist/components/form.stories.d.ts +7 -0
- package/dist/components/form.stories.d.ts.map +1 -0
- package/dist/components/form.stories.js +46 -0
- package/dist/components/form.stories.js.map +1 -0
- package/dist/components/heading.stories.d.ts +16 -0
- package/dist/components/heading.stories.d.ts.map +1 -0
- package/dist/components/heading.stories.js +23 -0
- package/dist/components/heading.stories.js.map +1 -0
- package/dist/components/input.d.ts +4 -3
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +2 -3
- package/dist/components/input.js.map +1 -1
- package/dist/components/input.stories.d.ts +11 -0
- package/dist/components/input.stories.d.ts.map +1 -0
- package/dist/components/input.stories.js +44 -0
- package/dist/components/input.stories.js.map +1 -0
- package/dist/components/kanban-board.d.ts +4 -4
- package/dist/components/kanban-board.d.ts.map +1 -1
- package/dist/components/kanban-board.js.map +1 -1
- package/dist/components/kanban-board.stories.js +1 -1
- package/dist/components/kanban-board.stories.js.map +1 -1
- package/dist/components/kanban-card.stories.d.ts +16 -0
- package/dist/components/kanban-card.stories.d.ts.map +1 -0
- package/dist/components/kanban-card.stories.js +30 -0
- package/dist/components/kanban-card.stories.js.map +1 -0
- package/dist/components/kanban-dnd-board.d.ts +1 -1
- package/dist/components/kanban-dnd-board.d.ts.map +1 -1
- package/dist/components/kanban-dnd-board.js +2 -2
- package/dist/components/kanban-dnd-board.js.map +1 -1
- package/dist/components/kanban-dnd-board.stories.d.ts +15 -0
- package/dist/components/kanban-dnd-board.stories.d.ts.map +1 -0
- package/dist/components/kanban-dnd-board.stories.js +112 -0
- package/dist/components/kanban-dnd-board.stories.js.map +1 -0
- package/dist/components/label.stories.d.ts +16 -0
- package/dist/components/label.stories.d.ts.map +1 -0
- package/dist/components/label.stories.js +21 -0
- package/dist/components/label.stories.js.map +1 -0
- package/dist/components/link.d.ts +3 -2
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +2 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/link.stories.d.ts +15 -0
- package/dist/components/link.stories.d.ts.map +1 -0
- package/dist/components/link.stories.js +19 -0
- package/dist/components/link.stories.js.map +1 -0
- package/dist/components/listbox.stories.d.ts +8 -0
- package/dist/components/listbox.stories.d.ts.map +1 -0
- package/dist/components/listbox.stories.js +46 -0
- package/dist/components/listbox.stories.js.map +1 -0
- package/dist/components/pagination.stories.d.ts +9 -0
- package/dist/components/pagination.stories.d.ts.map +1 -0
- package/dist/components/pagination.stories.js +19 -0
- package/dist/components/pagination.stories.js.map +1 -0
- package/dist/components/popover.stories.d.ts +8 -0
- package/dist/components/popover.stories.d.ts.map +1 -0
- package/dist/components/popover.stories.js +17 -0
- package/dist/components/popover.stories.js.map +1 -0
- package/dist/components/radio.stories.d.ts +15 -0
- package/dist/components/radio.stories.d.ts.map +1 -0
- package/dist/components/radio.stories.js +32 -0
- package/dist/components/radio.stories.js.map +1 -0
- package/dist/components/scroll-area.stories.d.ts +14 -0
- package/dist/components/scroll-area.stories.d.ts.map +1 -0
- package/dist/components/scroll-area.stories.js +27 -0
- package/dist/components/scroll-area.stories.js.map +1 -0
- package/dist/components/select.d.ts +3 -2
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +2 -3
- package/dist/components/select.js.map +1 -1
- package/dist/components/select.stories.d.ts +10 -0
- package/dist/components/select.stories.d.ts.map +1 -0
- package/dist/components/select.stories.js +25 -0
- package/dist/components/select.stories.js.map +1 -0
- package/dist/components/separator.stories.d.ts +15 -0
- package/dist/components/separator.stories.d.ts.map +1 -0
- package/dist/components/separator.stories.js +16 -0
- package/dist/components/separator.stories.js.map +1 -0
- package/dist/components/shadcn-badge.stories.d.ts +15 -0
- package/dist/components/shadcn-badge.stories.d.ts.map +1 -0
- package/dist/components/shadcn-badge.stories.js +16 -0
- package/dist/components/shadcn-badge.stories.js.map +1 -0
- package/dist/components/shadcn-button.stories.d.ts +17 -0
- package/dist/components/shadcn-button.stories.d.ts.map +1 -0
- package/dist/components/shadcn-button.stories.js +22 -0
- package/dist/components/shadcn-button.stories.js.map +1 -0
- package/dist/components/shadcn-dialog.stories.d.ts +15 -0
- package/dist/components/shadcn-dialog.stories.d.ts.map +1 -0
- package/dist/components/shadcn-dialog.stories.js +26 -0
- package/dist/components/shadcn-dialog.stories.js.map +1 -0
- package/dist/components/shadcn-input.stories.d.ts +16 -0
- package/dist/components/shadcn-input.stories.d.ts.map +1 -0
- package/dist/components/shadcn-input.stories.js +22 -0
- package/dist/components/shadcn-input.stories.js.map +1 -0
- package/dist/components/shadcn-select.stories.d.ts +16 -0
- package/dist/components/shadcn-select.stories.d.ts.map +1 -0
- package/dist/components/shadcn-select.stories.js +19 -0
- package/dist/components/shadcn-select.stories.js.map +1 -0
- package/dist/components/shadcn-textarea.stories.d.ts +16 -0
- package/dist/components/shadcn-textarea.stories.d.ts.map +1 -0
- package/dist/components/shadcn-textarea.stories.js +27 -0
- package/dist/components/shadcn-textarea.stories.js.map +1 -0
- package/dist/components/sheet.d.ts +13 -5
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +12 -9
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sheet.stories.d.ts +8 -0
- package/dist/components/sheet.stories.d.ts.map +1 -0
- package/dist/components/sheet.stories.js +17 -0
- package/dist/components/sheet.stories.js.map +1 -0
- package/dist/components/sidebar.js +5 -5
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/sidebar.stories.d.ts +8 -0
- package/dist/components/sidebar.stories.d.ts.map +1 -0
- package/dist/components/sidebar.stories.js +31 -0
- package/dist/components/sidebar.stories.js.map +1 -0
- package/dist/components/skeleton.stories.d.ts +16 -0
- package/dist/components/skeleton.stories.d.ts.map +1 -0
- package/dist/components/skeleton.stories.js +21 -0
- package/dist/components/skeleton.stories.js.map +1 -0
- package/dist/components/slider.d.ts +3 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +3 -3
- package/dist/components/slider.js.map +1 -1
- package/dist/components/slider.stories.d.ts +10 -0
- package/dist/components/slider.stories.d.ts.map +1 -0
- package/dist/components/slider.stories.js +43 -0
- package/dist/components/slider.stories.js.map +1 -0
- package/dist/components/sonner.stories.d.ts +16 -0
- package/dist/components/sonner.stories.d.ts.map +1 -0
- package/dist/components/sonner.stories.js +29 -0
- package/dist/components/sonner.stories.js.map +1 -0
- package/dist/components/stat-card.stories.d.ts +17 -0
- package/dist/components/stat-card.stories.d.ts.map +1 -0
- package/dist/components/stat-card.stories.js +46 -0
- package/dist/components/stat-card.stories.js.map +1 -0
- package/dist/components/switch.stories.d.ts +12 -0
- package/dist/components/switch.stories.d.ts.map +1 -0
- package/dist/components/switch.stories.js +51 -0
- package/dist/components/switch.stories.js.map +1 -0
- package/dist/components/table.js +7 -7
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.stories.d.ts +9 -0
- package/dist/components/table.stories.d.ts.map +1 -0
- package/dist/components/table.stories.js +26 -0
- package/dist/components/table.stories.js.map +1 -0
- package/dist/components/tabs.stories.d.ts +8 -0
- package/dist/components/tabs.stories.d.ts.map +1 -0
- package/dist/components/tabs.stories.js +16 -0
- package/dist/components/tabs.stories.js.map +1 -0
- package/dist/components/text.stories.d.ts +17 -0
- package/dist/components/text.stories.d.ts.map +1 -0
- package/dist/components/text.stories.js +27 -0
- package/dist/components/text.stories.js.map +1 -0
- package/dist/components/textarea.d.ts +3 -2
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +2 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/textarea.stories.d.ts +10 -0
- package/dist/components/textarea.stories.d.ts.map +1 -0
- package/dist/components/textarea.stories.js +36 -0
- package/dist/components/textarea.stories.js.map +1 -0
- package/dist/components/toast.d.ts +20 -7
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +17 -14
- package/dist/components/toast.js.map +1 -1
- package/dist/components/tooltip.d.ts +3 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tooltip.stories.d.ts +9 -0
- package/dist/components/tooltip.stories.d.ts.map +1 -0
- package/dist/components/tooltip.stories.js +20 -0
- package/dist/components/tooltip.stories.js.map +1 -0
- package/dist/globe/electron-arc.d.ts +1 -1
- package/dist/globe/electron-arc.d.ts.map +1 -1
- package/dist/globe/electron-arc.js +16 -5
- package/dist/globe/electron-arc.js.map +1 -1
- package/dist/globe/globe-canvas.d.ts +40 -0
- package/dist/globe/globe-canvas.d.ts.map +1 -0
- package/dist/globe/globe-canvas.js +139 -0
- package/dist/globe/globe-canvas.js.map +1 -0
- package/dist/globe/globe-halo.d.ts +8 -0
- package/dist/globe/globe-halo.d.ts.map +1 -0
- package/dist/globe/globe-halo.js +39 -0
- package/dist/globe/globe-halo.js.map +1 -0
- package/dist/globe/globe-loading-skeleton.stories.d.ts +16 -0
- package/dist/globe/globe-loading-skeleton.stories.d.ts.map +1 -0
- package/dist/globe/globe-loading-skeleton.stories.js +22 -0
- package/dist/globe/globe-loading-skeleton.stories.js.map +1 -0
- package/dist/globe/globe-scene.d.ts +43 -0
- package/dist/globe/globe-scene.d.ts.map +1 -0
- package/dist/globe/globe-scene.js +442 -0
- package/dist/globe/globe-scene.js.map +1 -0
- package/dist/globe/globe-stats-fallback.d.ts +12 -0
- package/dist/globe/globe-stats-fallback.d.ts.map +1 -0
- package/dist/globe/globe-stats-fallback.js +43 -0
- package/dist/globe/globe-stats-fallback.js.map +1 -0
- package/dist/globe/globe-stats-fallback.stories.d.ts +17 -0
- package/dist/globe/globe-stats-fallback.stories.d.ts.map +1 -0
- package/dist/globe/globe-stats-fallback.stories.js +152 -0
- package/dist/globe/globe-stats-fallback.stories.js.map +1 -0
- package/dist/globe/globe-theme.js.map +1 -1
- package/dist/globe/globe-tooltip.d.ts +9 -0
- package/dist/globe/globe-tooltip.d.ts.map +1 -0
- package/dist/globe/globe-tooltip.js +51 -0
- package/dist/globe/globe-tooltip.js.map +1 -0
- package/dist/globe/globe-types.d.ts +12 -0
- package/dist/globe/globe-types.d.ts.map +1 -1
- package/dist/globe/globe-view.d.ts +4 -3
- package/dist/globe/globe-view.d.ts.map +1 -1
- package/dist/globe/globe-view.js +27 -589
- package/dist/globe/globe-view.js.map +1 -1
- package/dist/globe/globe-worker.d.ts +2 -0
- package/dist/globe/globe-worker.d.ts.map +1 -0
- package/dist/globe/globe-worker.js +5 -0
- package/dist/globe/globe-worker.js.map +1 -0
- package/dist/globe/index.d.ts +4 -7
- package/dist/globe/index.d.ts.map +1 -1
- package/dist/globe/index.js +3 -4
- package/dist/globe/index.js.map +1 -1
- package/dist/globe/map/map-geometry.d.ts.map +1 -1
- package/dist/globe/map/map-geometry.js.map +1 -1
- package/dist/globe/scene-extras.d.ts +0 -6
- package/dist/globe/scene-extras.d.ts.map +1 -1
- package/dist/globe/scene-extras.js +0 -61
- package/dist/globe/scene-extras.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -0
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/hooks/use-toast.d.ts +4 -11
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +0 -6
- package/dist/hooks/use-toast.js.map +1 -1
- package/dist/nav/app-shell.js.map +1 -1
- package/dist/nav/app-shell.stories.d.ts +21 -0
- package/dist/nav/app-shell.stories.d.ts.map +1 -0
- package/dist/nav/app-shell.stories.js +29 -0
- package/dist/nav/app-shell.stories.js.map +1 -0
- package/dist/nav/app-sidebar.stories.d.ts +11 -0
- package/dist/nav/app-sidebar.stories.d.ts.map +1 -0
- package/dist/nav/app-sidebar.stories.js +52 -0
- package/dist/nav/app-sidebar.stories.js.map +1 -0
- package/dist/nav/expandable-nav-item.d.ts.map +1 -1
- package/dist/nav/expandable-nav-item.js +1 -0
- package/dist/nav/expandable-nav-item.js.map +1 -1
- package/dist/nav/expandable-nav-item.stories.d.ts +12 -0
- package/dist/nav/expandable-nav-item.stories.d.ts.map +1 -0
- package/dist/nav/expandable-nav-item.stories.js +43 -0
- package/dist/nav/expandable-nav-item.stories.js.map +1 -0
- package/dist/offer/attachments-folder.stories.d.ts +17 -0
- package/dist/offer/attachments-folder.stories.d.ts.map +1 -0
- package/dist/offer/attachments-folder.stories.js +83 -0
- package/dist/offer/attachments-folder.stories.js.map +1 -0
- package/dist/offer/beverage-details.stories.d.ts +17 -0
- package/dist/offer/beverage-details.stories.d.ts.map +1 -0
- package/dist/offer/beverage-details.stories.js +59 -0
- package/dist/offer/beverage-details.stories.js.map +1 -0
- package/dist/offer/composition-list.stories.d.ts +18 -0
- package/dist/offer/composition-list.stories.d.ts.map +1 -0
- package/dist/offer/composition-list.stories.js +52 -0
- package/dist/offer/composition-list.stories.js.map +1 -0
- package/dist/offer/confirm-action-dialog.stories.d.ts +17 -0
- package/dist/offer/confirm-action-dialog.stories.d.ts.map +1 -0
- package/dist/offer/confirm-action-dialog.stories.js +41 -0
- package/dist/offer/confirm-action-dialog.stories.js.map +1 -0
- package/dist/offer/inline-counter-form.stories.d.ts +17 -0
- package/dist/offer/inline-counter-form.stories.d.ts.map +1 -0
- package/dist/offer/inline-counter-form.stories.js +49 -0
- package/dist/offer/inline-counter-form.stories.js.map +1 -0
- package/dist/offer/negotiation-event-card.d.ts.map +1 -1
- package/dist/offer/negotiation-event-card.js.map +1 -1
- package/dist/offer/negotiation-event-card.stories.d.ts +19 -0
- package/dist/offer/negotiation-event-card.stories.d.ts.map +1 -0
- package/dist/offer/negotiation-event-card.stories.js +90 -0
- package/dist/offer/negotiation-event-card.stories.js.map +1 -0
- package/dist/offer/offer-status-badge.stories.d.ts +15 -0
- package/dist/offer/offer-status-badge.stories.d.ts.map +1 -0
- package/dist/offer/offer-status-badge.stories.js +33 -0
- package/dist/offer/offer-status-badge.stories.js.map +1 -0
- package/dist/offer/opportunity-requirements.stories.d.ts +18 -0
- package/dist/offer/opportunity-requirements.stories.d.ts.map +1 -0
- package/dist/offer/opportunity-requirements.stories.js +75 -0
- package/dist/offer/opportunity-requirements.stories.js.map +1 -0
- package/dist/offer/org-banner.stories.d.ts +18 -0
- package/dist/offer/org-banner.stories.d.ts.map +1 -0
- package/dist/offer/org-banner.stories.js +51 -0
- package/dist/offer/org-banner.stories.js.map +1 -0
- package/dist/offer/reviews-summary.d.ts +3 -0
- package/dist/offer/reviews-summary.d.ts.map +1 -1
- package/dist/offer/reviews-summary.js +12 -1
- package/dist/offer/reviews-summary.js.map +1 -1
- package/dist/offer/reviews-summary.stories.d.ts +18 -0
- package/dist/offer/reviews-summary.stories.d.ts.map +1 -0
- package/dist/offer/reviews-summary.stories.js +104 -0
- package/dist/offer/reviews-summary.stories.js.map +1 -0
- package/dist/offer/sensory-profile.stories.d.ts +17 -0
- package/dist/offer/sensory-profile.stories.d.ts.map +1 -0
- package/dist/offer/sensory-profile.stories.js +84 -0
- package/dist/offer/sensory-profile.stories.js.map +1 -0
- package/dist/opportunities/opportunities-table.d.ts.map +1 -1
- package/dist/opportunities/opportunities-table.js +7 -2
- package/dist/opportunities/opportunities-table.js.map +1 -1
- package/dist/opportunities/opportunities-table.stories.d.ts +24 -0
- package/dist/opportunities/opportunities-table.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunities-table.stories.js +34 -0
- package/dist/opportunities/opportunities-table.stories.js.map +1 -0
- package/dist/profile/profile.stories.d.ts +15 -0
- package/dist/profile/profile.stories.d.ts.map +1 -0
- package/dist/profile/profile.stories.js +33 -0
- package/dist/profile/profile.stories.js.map +1 -0
- package/package.json +17 -4
|
@@ -7,8 +7,12 @@ declare const Drawer: {
|
|
|
7
7
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
declare const DrawerPortal: typeof import("vaul").Portal;
|
|
9
9
|
declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
declare
|
|
11
|
-
|
|
10
|
+
declare function DrawerOverlay({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay> & {
|
|
11
|
+
ref?: React.Ref<React.ElementRef<typeof DrawerPrimitive.Overlay>>;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DrawerContent({ className, children, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
14
|
+
ref?: React.Ref<React.ElementRef<typeof DrawerPrimitive.Content>>;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
declare const DrawerHeader: {
|
|
13
17
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
18
|
displayName: string;
|
|
@@ -17,7 +21,11 @@ declare const DrawerFooter: {
|
|
|
17
21
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
22
|
displayName: string;
|
|
19
23
|
};
|
|
20
|
-
declare
|
|
21
|
-
|
|
24
|
+
declare function DrawerTitle({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> & {
|
|
25
|
+
ref?: React.Ref<React.ElementRef<typeof DrawerPrimitive.Title>>;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function DrawerDescription({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> & {
|
|
28
|
+
ref?: React.Ref<React.ElementRef<typeof DrawerPrimitive.Description>>;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
30
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
23
31
|
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AAGjD,QAAA,MAAM,MAAM;0CAGT,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;;CAKnD,CAAC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,CAAC;AAGF,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;CACjE,2CAWA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,GAAG;IACtE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;CACvE,2CAQA;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
4
3
|
import { cn } from "../lib/utils";
|
|
5
4
|
const Drawer = ({ shouldScaleBackground = true, ...props }) => (_jsx(DrawerPrimitive.Root, { shouldScaleBackground: shouldScaleBackground, ...props }));
|
|
@@ -7,17 +6,21 @@ Drawer.displayName = "Drawer";
|
|
|
7
6
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
8
7
|
const DrawerPortal = DrawerPrimitive.Portal;
|
|
9
8
|
const DrawerClose = DrawerPrimitive.Close;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
DrawerContent
|
|
9
|
+
function DrawerOverlay({ className, ref, ...props }) {
|
|
10
|
+
return (_jsx(DrawerPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function DrawerContent({ className, children, ref, ...props }) {
|
|
13
|
+
return (_jsxs(DrawerPortal, { children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerPrimitive.Content, { ref: ref, className: cn("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[96vh] flex-col rounded-t-2xl border border-border bg-background", className), ...props, children: [_jsx("div", { className: "mx-auto mt-4 h-1.5 w-12 shrink-0 rounded-full bg-muted" }), children] })] }));
|
|
14
|
+
}
|
|
14
15
|
const DrawerHeader = ({ className, ...props }) => (_jsx("div", { className: cn("grid gap-1.5 p-4 text-center sm:text-left", className), ...props }));
|
|
15
16
|
DrawerHeader.displayName = "DrawerHeader";
|
|
16
17
|
const DrawerFooter = ({ className, ...props }) => (_jsx("div", { className: cn("mt-auto flex flex-col gap-2 p-4 pb-[calc(1rem+env(safe-area-inset-bottom))]", className), ...props }));
|
|
17
18
|
DrawerFooter.displayName = "DrawerFooter";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
DrawerDescription
|
|
19
|
+
function DrawerTitle({ className, ref, ...props }) {
|
|
20
|
+
return (_jsx(DrawerPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function DrawerDescription({ className, ref, ...props }) {
|
|
23
|
+
return (_jsx(DrawerPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
24
|
+
}
|
|
22
25
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
23
26
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,EACd,qBAAqB,GAAG,IAAI,EAC5B,GAAG,KAAK,EAC0C,EAAE,EAAE,CAAC,CACvD,KAAC,eAAe,CAAC,IAAI,IACnB,qBAAqB,EAAE,qBAAqB,KACxC,KAAK,GACT,CACH,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;AAE9C,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC;AAE5C,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,KACtD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,MAAC,YAAY,eACX,KAAC,aAAa,KAAG,EACjB,MAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,wHAAwH,EACxH,SAAS,CACV,KACG,KAAK,aAGT,cAAK,SAAS,EAAC,wDAAwD,GAAG,EACzE,QAAQ,IACe,IACb,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE,SAAS,CAAC,KACjE,KAAK,GACT,CACH,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,mDAAmD,EACnD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Drawer } from "./drawer";
|
|
3
|
+
declare const meta: Meta<typeof Drawer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Drawer>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithLongContent: Story;
|
|
8
|
+
//# sourceMappingURL=drawer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.stories.d.ts","sourceRoot":"","sources":["../../src/components/drawer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,MAAM,EAQP,MAAM,UAAU,CAAC;AAElB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAK7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAwCrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuC7B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "./button";
|
|
3
|
+
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "./drawer";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/Drawer",
|
|
6
|
+
component: Drawer,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Default = {
|
|
12
|
+
render: () => (_jsxs(Drawer, { children: [_jsx(DrawerTrigger, { asChild: true, children: _jsx(Button, { children: "Open Drawer" }) }), _jsxs(DrawerContent, { children: [_jsxs(DrawerHeader, { children: [_jsx(DrawerTitle, { children: "Offer Summary" }), _jsx(DrawerDescription, { children: "Review the offer before sending to the producer." })] }), _jsxs("div", { className: "p-4 flex flex-col gap-3", children: [_jsxs("div", { className: "flex justify-between text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Wine" }), _jsx("span", { children: "Opus One 2020" })] }), _jsxs("div", { className: "flex justify-between text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Quantity" }), _jsx("span", { children: "24 bottles" })] }), _jsxs("div", { className: "flex justify-between text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Price per bottle" }), _jsx("span", { children: "\u20AC320" })] }), _jsxs("div", { className: "flex justify-between text-sm font-medium", children: [_jsx("span", { children: "Total" }), _jsx("span", { children: "\u20AC7,680" })] })] }), _jsxs(DrawerFooter, { children: [_jsx(Button, { color: "brand", children: "Send Offer" }), _jsx(DrawerClose, { asChild: true, children: _jsx(Button, { plain: true, children: "Cancel" }) })] })] })] })),
|
|
13
|
+
};
|
|
14
|
+
export const WithLongContent = {
|
|
15
|
+
render: () => (_jsxs(Drawer, { children: [_jsx(DrawerTrigger, { asChild: true, children: _jsx(Button, { children: "Open Drawer with Details" }) }), _jsxs(DrawerContent, { children: [_jsxs(DrawerHeader, { children: [_jsx(DrawerTitle, { children: "Beverage Classification Details" }), _jsx(DrawerDescription, { children: "Full classification breakdown for this beverage." })] }), _jsx("div", { className: "p-4 flex flex-col gap-4 overflow-auto", children: [
|
|
16
|
+
{ label: "Category", value: "Still Wine" },
|
|
17
|
+
{ label: "Subtype", value: "Red Wine" },
|
|
18
|
+
{ label: "Region", value: "Napa Valley, California" },
|
|
19
|
+
{ label: "Appellation", value: "Oakville AVA" },
|
|
20
|
+
{ label: "Vintage", value: "2020" },
|
|
21
|
+
{ label: "Alcohol", value: "14.5%" },
|
|
22
|
+
{ label: "HS Code", value: "2204.21" },
|
|
23
|
+
{ label: "Closure", value: "Natural Cork" },
|
|
24
|
+
{ label: "Packaging", value: "Glass Bottle 750ml" },
|
|
25
|
+
].map(({ label, value }) => (_jsxs("div", { className: "flex justify-between text-sm border-b pb-2 last:border-0", children: [_jsx("span", { className: "text-muted-foreground", children: label }), _jsx("span", { className: "font-medium", children: value })] }, label))) }), _jsx(DrawerFooter, { children: _jsx(DrawerClose, { asChild: true, children: _jsx(Button, { plain: true, children: "Close" }) }) })] })] })),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=drawer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.stories.js","sourceRoot":"","sources":["../../src/components/drawer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,MAAM,eACL,KAAC,aAAa,IAAC,OAAO,kBACpB,KAAC,MAAM,8BAAqB,GACd,EAChB,MAAC,aAAa,eACZ,MAAC,YAAY,eACX,KAAC,WAAW,gCAA4B,EACxC,KAAC,iBAAiB,mEAEE,IACP,EACf,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAK,SAAS,EAAC,8BAA8B,aAC3C,eAAM,SAAS,EAAC,uBAAuB,qBAAY,EACnD,2CAA0B,IACtB,EACN,eAAK,SAAS,EAAC,8BAA8B,aAC3C,eAAM,SAAS,EAAC,uBAAuB,yBAAgB,EACvD,wCAAuB,IACnB,EACN,eAAK,SAAS,EAAC,8BAA8B,aAC3C,eAAM,SAAS,EAAC,uBAAuB,iCAAwB,EAC/D,uCAAiB,IACb,EACN,eAAK,SAAS,EAAC,0CAA0C,aACvD,mCAAkB,EAClB,yCAAmB,IACf,IACF,EACN,MAAC,YAAY,eACX,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,2BAAoB,EACzC,KAAC,WAAW,IAAC,OAAO,kBAClB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IAAC,KAAK,4BAAe,GAChB,GACD,IACD,IACT,CACV;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { DropdownMenu } from "./dropdown-menu";
|
|
3
|
+
declare const meta: Meta<typeof DropdownMenu>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DropdownMenu>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithGroups: Story;
|
|
8
|
+
//# sourceMappingURL=dropdown-menu.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.stories.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,YAAY,EAQb,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAKnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KA8BrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "./button";
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from "./dropdown-menu";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/DropdownMenu",
|
|
6
|
+
component: DropdownMenu,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Default = {
|
|
12
|
+
render: () => (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { plain: true, children: "Actions" }) }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuLabel, { children: "Offer Actions" }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsxs(DropdownMenuItem, { children: ["View details", _jsx(DropdownMenuShortcut, { children: "\u2318V" })] }), _jsxs(DropdownMenuItem, { children: ["Accept offer", _jsx(DropdownMenuShortcut, { children: "\u2318A" })] }), _jsxs(DropdownMenuItem, { children: ["Negotiate", _jsx(DropdownMenuShortcut, { children: "\u2318N" })] })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { variant: "destructive", children: "Decline offer" })] })] })),
|
|
13
|
+
};
|
|
14
|
+
export const WithGroups = {
|
|
15
|
+
render: () => (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { outline: true, children: "Producer Menu" }) }), _jsxs(DropdownMenuContent, { className: "w-48", children: [_jsx(DropdownMenuLabel, { children: "My Account" }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuItem, { children: "Profile" }), _jsx(DropdownMenuItem, { children: "Organisation" }), _jsx(DropdownMenuItem, { children: "Partnerships" })] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuItem, { children: "Beverages" }), _jsx(DropdownMenuItem, { children: "Offers" }), _jsx(DropdownMenuItem, { children: "Matches" })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { variant: "destructive", children: "Sign out" })] })] })),
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=dropdown-menu.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.stories.js","sourceRoot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,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAW9E;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,2CAwB9G"}
|
|
@@ -70,10 +70,13 @@ export function DropdownDescription({ className, ...props }) {
|
|
|
70
70
|
return (_jsx(Headless.Description, { "data-slot": "description", ...props, className: clsx(className, 'col-span-2 col-start-2 row-start-2 text-sm/5 text-zinc-500 group-data-focus:text-white sm:text-xs/5 dark:text-zinc-400 forced-colors:group-data-focus:text-[HighlightText]') }));
|
|
71
71
|
}
|
|
72
72
|
export function DropdownShortcut({ keys, className, ...props }) {
|
|
73
|
-
return (_jsx(Headless.Description, { as: "kbd", ...props, className: clsx(className, 'col-start-5 row-start-1 flex justify-self-end'), children: (Array.isArray(keys) ? keys : keys.split('')).map((char, index) =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
return (_jsx(Headless.Description, { as: "kbd", ...props, className: clsx(className, 'col-start-5 row-start-1 flex justify-self-end'), children: (Array.isArray(keys) ? keys : keys.split('')).map((char, index) => {
|
|
74
|
+
const isNotFirst = index > 0;
|
|
75
|
+
return (_jsx("kbd", { className: clsx([
|
|
76
|
+
'min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]',
|
|
77
|
+
// Make sure key names that are longer than one character (like "Tab") have extra space
|
|
78
|
+
isNotFirst && char.length > 1 && 'pl-1',
|
|
79
|
+
]), children: char }, char));
|
|
80
|
+
}) }));
|
|
78
81
|
}
|
|
79
82
|
//# sourceMappingURL=dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/components/dropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,UAAU,QAAQ,CAAC,KAAqC;IAC5D,OAAO,KAAC,QAAQ,CAAC,IAAI,IAAC,EAAE,EAAC,KAAK,KAAK,KAAK,GAAI,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAA8C,EAC1E,EAAE,GAAG,MAAM,EACX,GAAG,KAAK,EACgE;IACxE,OAAO,KAAC,QAAQ,CAAC,UAAU,IAAC,EAAE,EAAE,EAAE,KAAM,KAAK,GAAI,CAAA;AACnD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,GAAG,QAAQ,EACjB,SAAS,EACT,GAAG,KAAK,EACmE;IAC3E,OAAO,CACL,KAAC,QAAQ,CAAC,SAAS,OACb,KAAK,EACT,UAAU,QACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,IAAI,CACb,SAAS;QACT,qBAAqB;QACrB,6OAA6O;QAC7O,cAAc;QACd,8BAA8B;QAC9B,2FAA2F;QAC3F,kDAAkD;QAClD,mDAAmD;QACnD,iBAAiB;QACjB,qBAAqB;QACrB,kDAAkD;QAClD,UAAU;QACV,sEAAsE;QACtE,wDAAwD;QACxD,gIAAgI;QAChI,cAAc;QACd,wFAAwF,CACzF,GACD,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,SA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E,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,KAAM,KAAK,GAAI,CAAA;AAC/G,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACqE;IAC7E,OAAO,CACL,KAAC,QAAQ,CAAC,WAAW,iBACT,aAAa,KACnB,KAAK,EACT,SAAS,EAAE,IAAI,CACb,SAAS,EACT,4KAA4K,CAC7K,GACD,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACqG;IAC7G,OAAO,CACL,KAAC,QAAQ,CAAC,WAAW,IACnB,EAAE,EAAC,KAAK,KACJ,KAAK,EACT,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,+CAA+C,CAAC,YAE1E,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACjE,MAAM,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC;YAC7B,OAAO,CACL,cAEE,SAAS,EAAE,IAAI,CAAC;oBACd,4IAA4I;oBAC5I,uFAAuF;oBACvF,UAAU,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM;iBACxC,CAAC,YAED,IAAI,IAPA,IAAI,CAQL,CACP,CAAC;QACJ,CAAC,CAAC,GACmB,CACxB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Dropdown } from "./dropdown";
|
|
3
|
+
declare const meta: Meta<typeof Dropdown>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Dropdown>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithHeader: Story;
|
|
8
|
+
//# sourceMappingURL=dropdown.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.stories.d.ts","sourceRoot":"","sources":["../../src/components/dropdown.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,QAAQ,EAQT,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAK/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dropdown, DropdownButton, DropdownDivider, DropdownHeader, DropdownItem, DropdownLabel, DropdownMenu, DropdownSection, } from "./dropdown";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Dropdown",
|
|
5
|
+
component: Dropdown,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (_jsxs(Dropdown, { children: [_jsx(DropdownButton, { children: "Actions" }), _jsxs(DropdownMenu, { anchor: "bottom start", children: [_jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "View offer" }) }), _jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Accept offer" }) }), _jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Negotiate" }) }), _jsx(DropdownDivider, {}), _jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Decline offer" }) })] })] })),
|
|
12
|
+
};
|
|
13
|
+
export const WithHeader = {
|
|
14
|
+
render: () => (_jsxs(Dropdown, { children: [_jsx(DropdownButton, { color: "brand", children: "My Account" }), _jsxs(DropdownMenu, { anchor: "bottom end", children: [_jsxs(DropdownHeader, { children: [_jsx("div", { className: "text-sm font-semibold", children: "Jean-Pierre Dubois" }), _jsx("div", { className: "text-xs text-zinc-500", children: "jp.dubois@imports.fr" })] }), _jsx(DropdownDivider, {}), _jsxs(DropdownSection, { children: [_jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Profile settings" }) }), _jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Organisation" }) })] }), _jsx(DropdownDivider, {}), _jsx(DropdownItem, { children: _jsx(DropdownLabel, { children: "Sign out" }) })] })] })),
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=dropdown.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.stories.js","sourceRoot":"","sources":["../../src/components/dropdown.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,QAAQ,eACP,KAAC,cAAc,0BAAyB,EACxC,MAAC,YAAY,IAAC,MAAM,EAAC,cAAc,aACjC,KAAC,YAAY,cACX,KAAC,aAAa,6BAA2B,GAC5B,EACf,KAAC,YAAY,cACX,KAAC,aAAa,+BAA6B,GAC9B,EACf,KAAC,YAAY,cACX,KAAC,aAAa,4BAA0B,GAC3B,EACf,KAAC,eAAe,KAAG,EACnB,KAAC,YAAY,cACX,KAAC,aAAa,gCAA8B,GAC/B,IACF,IACN,CACZ;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,QAAQ,eACP,KAAC,cAAc,IAAC,KAAK,EAAC,OAAO,2BAA4B,EACzD,MAAC,YAAY,IAAC,MAAM,EAAC,YAAY,aAC/B,MAAC,cAAc,eACb,cAAK,SAAS,EAAC,uBAAuB,mCAAyB,EAC/D,cAAK,SAAS,EAAC,uBAAuB,qCAA2B,IAClD,EACjB,KAAC,eAAe,KAAG,EACnB,MAAC,eAAe,eACd,KAAC,YAAY,cACX,KAAC,aAAa,mCAAiC,GAClC,EACf,KAAC,YAAY,cACX,KAAC,aAAa,+BAA6B,GAC9B,IACC,EAClB,KAAC,eAAe,KAAG,EACnB,KAAC,YAAY,cACX,KAAC,aAAa,2BAAyB,GAC1B,IACF,IACN,CACZ;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Fieldset } from "./fieldset";
|
|
3
|
+
declare const meta: Meta<typeof Fieldset>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithErrors: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
//# sourceMappingURL=fieldset.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.stories.d.ts","sourceRoot":"","sources":["../../src/components/fieldset.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,QAAQ,EAOT,MAAM,YAAY,CAAC;AAIpB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAY/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA6BrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAkBxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fieldset, Legend, FieldGroup, Field, Label, Description, ErrorMessage, } from "./fieldset";
|
|
3
|
+
import { Input } from "./input";
|
|
4
|
+
import { Select } from "./select";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Fieldset",
|
|
7
|
+
component: Fieldset,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: { layout: "centered" },
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (_jsx("div", { className: "w-96", children: _jsx(Story, {}) })),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Default = {
|
|
16
|
+
render: () => (_jsxs(Fieldset, { children: [_jsx(Legend, { children: "Beverage Details" }), _jsxs(FieldGroup, { children: [_jsxs(Field, { children: [_jsx(Label, { children: "Name" }), _jsx(Input, { type: "text", placeholder: "e.g. Ch\u00E2teau Margaux 2018" })] }), _jsxs(Field, { children: [_jsx(Label, { children: "Producer" }), _jsx(Description, { children: "The winery, distillery, or brewery responsible for this product." }), _jsx(Input, { type: "text", placeholder: "e.g. Ch\u00E2teau Margaux" })] }), _jsxs(Field, { children: [_jsx(Label, { children: "Category" }), _jsxs(Select, { "aria-label": "Category", children: [_jsx("option", { value: "", children: "Select category\u2026" }), _jsx("option", { value: "red-wine", children: "Red Wine" }), _jsx("option", { value: "white-wine", children: "White Wine" }), _jsx("option", { value: "sparkling", children: "Sparkling Wine" }), _jsx("option", { value: "spirits", children: "Spirits" })] })] })] })] })),
|
|
17
|
+
};
|
|
18
|
+
export const WithErrors = {
|
|
19
|
+
render: () => (_jsxs(Fieldset, { children: [_jsx(Legend, { children: "Offer Submission" }), _jsxs(FieldGroup, { children: [_jsxs(Field, { children: [_jsx(Label, { children: "Price per unit (\u20AC)" }), _jsx(Input, { type: "number", defaultValue: "-5" }), _jsx(ErrorMessage, { children: "Price must be a positive number." })] }), _jsxs(Field, { children: [_jsx(Label, { children: "Available volume (cases)" }), _jsx(Description, { children: "Enter the number of 12-bottle cases available." }), _jsx(Input, { type: "number", placeholder: "e.g. 200" })] })] })] })),
|
|
20
|
+
};
|
|
21
|
+
export const Disabled = {
|
|
22
|
+
render: () => (_jsxs(Fieldset, { disabled: true, children: [_jsx(Legend, { children: "Contract Details (read-only)" }), _jsxs(FieldGroup, { children: [_jsxs(Field, { children: [_jsx(Label, { children: "Contract ID" }), _jsx(Input, { type: "text", defaultValue: "CNT-2026-00147" })] }), _jsxs(Field, { children: [_jsx(Label, { children: "Status" }), _jsx(Input, { type: "text", defaultValue: "Accepted" })] })] })] })),
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=fieldset.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.stories.js","sourceRoot":"","sources":["../../src/components/fieldset.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE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,KAAC,WAAW,iEAA6D,EACzE,KAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,EAAC,WAAW,EAAC,UAAU,GAAG,IACxC,IACG,IACJ,CACZ;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,QAAQ,IAAC,QAAQ,mBAChB,KAAC,MAAM,+CAAsC,EAC7C,MAAC,UAAU,eACT,MAAC,KAAK,eACJ,KAAC,KAAK,8BAAoB,EAC1B,KAAC,KAAK,IAAC,IAAI,EAAC,MAAM,EAAC,YAAY,EAAC,gBAAgB,GAAG,IAC7C,EACR,MAAC,KAAK,eACJ,KAAC,KAAK,yBAAe,EACrB,KAAC,KAAK,IAAC,IAAI,EAAC,MAAM,EAAC,YAAY,EAAC,UAAU,GAAG,IACvC,IACG,IACJ,CACZ;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAKxB,QAAA,MAAM,IAAI,4MAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAYrE;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAYlD;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,2CAgBxE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,kDAkBtE;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/dist/components/form.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { use } from "react";
|
|
4
5
|
import { Slot } from "radix-ui";
|
|
5
6
|
import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
|
|
6
7
|
import { cn } from "../lib/utils";
|
|
@@ -8,11 +9,11 @@ import { Label } from "./label";
|
|
|
8
9
|
const Form = FormProvider;
|
|
9
10
|
const FormFieldContext = React.createContext({});
|
|
10
11
|
const FormField = ({ ...props }) => {
|
|
11
|
-
return (_jsx(FormFieldContext
|
|
12
|
+
return (_jsx(FormFieldContext, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
|
|
12
13
|
};
|
|
13
14
|
const useFormField = () => {
|
|
14
|
-
const fieldContext =
|
|
15
|
-
const itemContext =
|
|
15
|
+
const fieldContext = use(FormFieldContext);
|
|
16
|
+
const itemContext = use(FormItemContext);
|
|
16
17
|
const { getFieldState } = useFormContext();
|
|
17
18
|
const formState = useFormState({ name: fieldContext.name });
|
|
18
19
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -32,7 +33,7 @@ const useFormField = () => {
|
|
|
32
33
|
const FormItemContext = React.createContext({});
|
|
33
34
|
function FormItem({ className, ...props }) {
|
|
34
35
|
const id = React.useId();
|
|
35
|
-
return (_jsx(FormItemContext
|
|
36
|
+
return (_jsx(FormItemContext, { value: { id }, children: _jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) }));
|
|
36
37
|
}
|
|
37
38
|
function FormLabel({ className, ...props }) {
|
|
38
39
|
const { error, formItemId } = useFormField();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GAIb,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,IAAI,GAAG,YAAY,CAAA;AASzB,MAAM,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a,EAAE,GAAG,YAAY,EAAE,CAAA;IAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAA;IAElE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,yBACY,cAAc,EACxB,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,YAER,IAAI,GACH,CACL,CAAA;AACH,CAAC;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export declare const WithValidationErrors: Story;
|
|
7
|
+
//# sourceMappingURL=form.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.stories.d.ts","sourceRoot":"","sources":["../../src/components/form.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAoB5D,QAAA,MAAM,IAAI,EAAE,IAWX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AA4EtB,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAoDF,eAAO,MAAM,oBAAoB,EAAE,KAElC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useForm } from "react-hook-form";
|
|
3
|
+
import { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage, } from "./form";
|
|
4
|
+
import { Input } from "./input";
|
|
5
|
+
import { Select } from "./select";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Form",
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: { layout: "centered" },
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (_jsx("div", { className: "w-96", children: _jsx(Story, {}) })),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
function DefaultRender() {
|
|
16
|
+
const form = useForm({
|
|
17
|
+
defaultValues: {
|
|
18
|
+
beverageName: "",
|
|
19
|
+
pricePerUnit: "",
|
|
20
|
+
category: "",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return (_jsx(Form, { ...form, children: _jsxs("form", { className: "space-y-6", children: [_jsx(FormField, { control: form.control, name: "beverageName", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "Beverage Name" }), _jsx(FormControl, { children: _jsx(Input, { type: "text", placeholder: "e.g. Ch\u00E2teau Margaux 2018", ...field }) }), _jsx(FormDescription, { children: "Enter the full commercial name of the product." }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "category", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "Category" }), _jsx(FormControl, { children: _jsxs(Select, { "aria-label": "Category", ...field, children: [_jsx("option", { value: "", children: "Select category\u2026" }), _jsx("option", { value: "red-wine", children: "Red Wine" }), _jsx("option", { value: "white-wine", children: "White Wine" }), _jsx("option", { value: "sparkling", children: "Sparkling Wine" }), _jsx("option", { value: "spirits", children: "Spirits" })] }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "pricePerUnit", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "Price per bottle (\u20AC)" }), _jsx(FormControl, { children: _jsx(Input, { type: "number", placeholder: "e.g. 45.00", ...field }) }), _jsx(FormDescription, { children: "FOB price at point of origin." }), _jsx(FormMessage, {})] })) })] }) }));
|
|
24
|
+
}
|
|
25
|
+
export const Default = {
|
|
26
|
+
render: () => _jsx(DefaultRender, {}),
|
|
27
|
+
};
|
|
28
|
+
function WithValidationErrorsRender() {
|
|
29
|
+
const form = useForm({
|
|
30
|
+
defaultValues: {
|
|
31
|
+
beverageName: "",
|
|
32
|
+
pricePerUnit: "-10",
|
|
33
|
+
category: "",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
// Manually set errors to demonstrate the error state
|
|
37
|
+
form.setError("beverageName", { message: "Beverage name is required." });
|
|
38
|
+
form.setError("pricePerUnit", {
|
|
39
|
+
message: "Price must be a positive number.",
|
|
40
|
+
});
|
|
41
|
+
return (_jsx(Form, { ...form, children: _jsxs("form", { className: "space-y-6", children: [_jsx(FormField, { control: form.control, name: "beverageName", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "Beverage Name" }), _jsx(FormControl, { children: _jsx(Input, { type: "text", placeholder: "e.g. Ch\u00E2teau Margaux 2018", ...field }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "pricePerUnit", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "Price per bottle (\u20AC)" }), _jsx(FormControl, { children: _jsx(Input, { type: "number", ...field }) }), _jsx(FormMessage, {})] })) })] }) }));
|
|
42
|
+
}
|
|
43
|
+
export const WithValidationErrors = {
|
|
44
|
+
render: () => _jsx(WithValidationErrorsRender, {}),
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=form.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.stories.js","sourceRoot":"","sources":["../../src/components/form.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,IAAI,EACJ,SAAS,EACT,QAA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EAAC,WAAW,aACzB,KAAC,SAAS,IACR,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAC,cAAc,EACnB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,MAAC,QAAQ,eACP,KAAC,SAAS,gCAA0B,EACpC,KAAC,WAAW,cACV,KAAC,KAAK,IAAC,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,gCAA2B,KAAK,KAAK,GAAI,GAC5D,EACd,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EAEF,KAAC,SAAS,IACR,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAC,cAAc,EACnB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,MAAC,QAAQ,eACP,KAAC,SAAS,4CAAiC,EAC3C,KAAC,WAAW,cACV,KAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,KAAK,KAAK,GAAI,GACtB,EACd,KAAC,WAAW,KAAG,IACN,CACZ,GACD,IACG,GACF,CACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAU;IACzC,MAAM,EAAE,GAAG,EAAE,CAAC,KAAC,0BAA0B,KAAG;CAC7C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Heading } from "./heading";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Heading;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const AllLevels: Story;
|
|
15
|
+
export declare const SubheadingStory: Story;
|
|
16
|
+
//# sourceMappingURL=heading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.stories.d.ts","sourceRoot":"","sources":["../../src/components/heading.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAc,MAAM,WAAW,CAAC;AAEhD,QAAA,MAAM,IAAI;;;;;;;CAKsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Heading, Subheading } from "./heading";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Heading",
|
|
5
|
+
component: Heading,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
args: {
|
|
12
|
+
level: 1,
|
|
13
|
+
children: "Château Margaux — Premium Red Wines",
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export const AllLevels = {
|
|
17
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Heading, { level: 1, children: "H1 \u2014 Ch\u00E2teau Margaux" }), _jsx(Heading, { level: 2, children: "H2 \u2014 2018 Grand Cru Reserve" }), _jsx(Heading, { level: 3, children: "H3 \u2014 Tasting Notes" }), _jsx(Heading, { level: 4, children: "H4 \u2014 Winemaker's Selection" }), _jsx(Heading, { level: 5, children: "H5 \u2014 Harvest Season" }), _jsx(Heading, { level: 6, children: "H6 \u2014 Appellation d'Origine Contr\u00F4l\u00E9e" })] })),
|
|
18
|
+
};
|
|
19
|
+
export const SubheadingStory = {
|
|
20
|
+
name: "Subheading",
|
|
21
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(Heading, { level: 1, children: "Ch\u00E2teau P\u00E9trus" }), _jsx(Subheading, { level: 2, children: "2019 Pomerol \u2014 Bordeaux, France" })] })),
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=heading.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.stories.js","sourceRoot":"","sources":["../../src/components/heading.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;CACF,CAAC;AAEjC,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,qCAAqC;KAChD;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,+CAAgC,EACjD,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,iDAAuC,EACxD,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,wCAA8B,EAC/C,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,gDAAsC,EACvD,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,yCAA+B,EAChD,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,oEAAgD,IAC7D,CACP;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,yCAA0B,EAC3C,KAAC,UAAU,IAAC,KAAK,EAAE,CAAC,qDAA8C,IAC9D,CACP;CACF,CAAC"}
|
|
@@ -3,9 +3,10 @@ import React from 'react';
|
|
|
3
3
|
export declare function InputGroup({ children }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const dateTypes: string[];
|
|
5
5
|
type DateType = (typeof dateTypes)[number];
|
|
6
|
-
export declare
|
|
6
|
+
export declare function Input({ className, ref, ...props }: {
|
|
7
7
|
className?: string;
|
|
8
|
-
type?:
|
|
9
|
-
|
|
8
|
+
type?: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | DateType;
|
|
9
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
10
|
+
} & Omit<Headless.InputProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAe9E;AAED,QAAA,MAAM,SAAS,UAAsD,CAAA;AACrE,KAAK,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1C,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IACrF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAClC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CA0DhD"}
|
package/dist/components/input.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as Headless from '@headlessui/react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
5
4
|
export function InputGroup({ children }) {
|
|
6
5
|
return (_jsx("span", { "data-slot": "control", className: clsx('relative isolate block', 'has-[[data-slot=icon]:first-child]:[&_input]:pl-10 has-[[data-slot=icon]:last-child]:[&_input]:pr-10 sm:has-[[data-slot=icon]:first-child]:[&_input]:pl-8 sm:has-[[data-slot=icon]:last-child]:[&_input]:pr-8', '*:data-[slot=icon]:pointer-events-none *:data-[slot=icon]:absolute *:data-[slot=icon]:top-3 *:data-[slot=icon]:z-10 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:top-2.5 sm:*:data-[slot=icon]:size-4', '[&>[data-slot=icon]:first-child]:left-3 sm:[&>[data-slot=icon]:first-child]:left-2.5 [&>[data-slot=icon]:last-child]:right-3 sm:[&>[data-slot=icon]:last-child]:right-2.5', '*:data-[slot=icon]:text-zinc-500 dark:*:data-[slot=icon]:text-zinc-400'), children: children }));
|
|
7
6
|
}
|
|
8
7
|
const dateTypes = ['date', 'datetime-local', 'month', 'time', 'week'];
|
|
9
|
-
export
|
|
8
|
+
export function Input({ className, ref, ...props }) {
|
|
10
9
|
return (_jsx("span", { "data-slot": "control", className: clsx([
|
|
11
10
|
className,
|
|
12
11
|
// Basic layout
|
|
@@ -53,5 +52,5 @@ export const Input = forwardRef(function Input({ className, ...props }, ref) {
|
|
|
53
52
|
// System icons
|
|
54
53
|
'dark:scheme-dark',
|
|
55
54
|
]) }) }));
|
|
56
|
-
}
|
|
55
|
+
}
|
|
57
56
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAA;AAGvB,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAA0C;IAC7E,OAAO,CACL,4BACY,SAAS,EACnB,SAAS,EAAE,IAAI,CACb,wBAAwB,EACxB,+MAA+M,EAC/M,0MAA0M,EAC1M,2KAA2K,EAC3K,wEAAwE,CACzE,YAEA,QAAQ,GACJ,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAGrE,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAKuC;IAC/C,OAAO,CACL,4BACY,SAAS,EACnB,SAAS,EAAE,IAAI,CAAC;YACd,SAAS;YACT,eAAe;YACf,uBAAuB;YACvB,wGAAwG;YACxG,8GAA8G;YAC9G,kGAAkG;YAClG,oBAAoB;YACpB,aAAa;YACb,8KAA8K;YAC9K,iBAAiB;YACjB,0GAA0G;SAC3G,CAAC,YAEF,KAAC,QAAQ,CAAC,KAAK,IACb,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,SAAS,EAAE,IAAI,CAAC;gBACd,eAAe;gBACf,KAAK,CAAC,IAAI;oBACR,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;oBAChC,+CAA+C;oBAC/C,gDAAgD;oBAChD,wCAAwC;oBACxC,gCAAgC;oBAChC,2CAA2C;oBAC3C,4CAA4C;oBAC5C,0CAA0C;oBAC1C,2CAA2C;oBAC3C,6CAA6C;oBAC7C,6CAA6C;oBAC7C,kDAAkD;oBAClD,+CAA+C;iBAChD;gBACH,eAAe;gBACf,8KAA8K;gBAC9K,aAAa;gBACb,kFAAkF;gBAClF,SAAS;gBACT,8GAA8G;gBAC9G,mBAAmB;gBACnB,gCAAgC;gBAChC,4BAA4B;gBAC5B,sBAAsB;gBACtB,gBAAgB;gBAChB,iJAAiJ;gBACjJ,iBAAiB;gBACjB,mJAAmJ;gBACnJ,eAAe;gBACf,kBAAkB;aACnB,CAAC,GACF,GACG,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Input } from "./input";
|
|
3
|
+
declare const meta: Meta<typeof Input>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithPlaceholder: Story;
|
|
8
|
+
export declare const Email: Story;
|
|
9
|
+
export declare const Password: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
//# sourceMappingURL=input.stories.d.ts.map
|