@tenstorrent/vesper 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/components/accordion/accordion.css +1 -0
- package/dist/components/accordion/accordion.d.ts +33 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +30 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/admonition/admonition.css +1 -0
- package/dist/components/admonition/admonition.d.ts +49 -0
- package/dist/components/admonition/admonition.d.ts.map +1 -0
- package/dist/components/admonition/admonition.js +47 -0
- package/dist/components/admonition/admonition.js.map +1 -0
- package/dist/components/avatar/avatar.css +1 -0
- package/dist/components/avatar/avatar.d.ts +30 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +24 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar-group/avatar-group.css +1 -0
- package/dist/components/avatar-group/avatar-group.d.ts +36 -0
- package/dist/components/avatar-group/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar-group/avatar-group.js +30 -0
- package/dist/components/avatar-group/avatar-group.js.map +1 -0
- package/dist/components/badge/badge.css +1 -0
- package/dist/components/badge/badge.d.ts +42 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +49 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/button/button.css +1 -0
- package/dist/components/button/button.d.ts +51 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +49 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/checkbox/checkbox.css +1 -0
- package/dist/components/checkbox/checkbox.d.ts +53 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +65 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/chip/chip.css +1 -0
- package/dist/components/chip/chip.d.ts +53 -0
- package/dist/components/chip/chip.d.ts.map +1 -0
- package/dist/components/chip/chip.js +51 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/choicebox/choicebox.css +1 -0
- package/dist/components/choicebox/choicebox.d.ts +90 -0
- package/dist/components/choicebox/choicebox.d.ts.map +1 -0
- package/dist/components/choicebox/choicebox.js +131 -0
- package/dist/components/choicebox/choicebox.js.map +1 -0
- package/dist/components/code/code.css +1 -0
- package/dist/components/code/code.d.ts +23 -0
- package/dist/components/code/code.d.ts.map +1 -0
- package/dist/components/code/code.js +23 -0
- package/dist/components/code/code.js.map +1 -0
- package/dist/components/code-block/code-block.css +1 -0
- package/dist/components/code-block/code-block.d.ts +48 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +36 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/components.d.ts +4 -0
- package/dist/components/code-block/components.d.ts.map +1 -0
- package/dist/components/code-block/components.js +27 -0
- package/dist/components/code-block/components.js.map +1 -0
- package/dist/components/code-block/fixtures.d.ts +12 -0
- package/dist/components/code-block/fixtures.d.ts.map +1 -0
- package/dist/components/code-block/fixtures.js +491 -0
- package/dist/components/code-block/fixtures.js.map +1 -0
- package/dist/components/code-block/streaming-code-block.d.ts +5 -0
- package/dist/components/code-block/streaming-code-block.d.ts.map +1 -0
- package/dist/components/code-block/streaming-code-block.js +92 -0
- package/dist/components/code-block/streaming-code-block.js.map +1 -0
- package/dist/components/code-block/themes.d.ts +16 -0
- package/dist/components/code-block/themes.d.ts.map +1 -0
- package/dist/components/code-block/themes.js +2836 -0
- package/dist/components/code-block/themes.js.map +1 -0
- package/dist/components/code-block/utils.d.ts +7 -0
- package/dist/components/code-block/utils.d.ts.map +1 -0
- package/dist/components/code-block/utils.js +42 -0
- package/dist/components/code-block/utils.js.map +1 -0
- package/dist/components/combobox/combobox.css +1 -0
- package/dist/components/combobox/combobox.d.ts +106 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/combobox.js +93 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/form-input-message/form-input-message.css +1 -0
- package/dist/components/form-input-message/form-input-message.d.ts +35 -0
- package/dist/components/form-input-message/form-input-message.d.ts.map +1 -0
- package/dist/components/form-input-message/form-input-message.js +38 -0
- package/dist/components/form-input-message/form-input-message.js.map +1 -0
- package/dist/components/icon-button/icon-button.css +1 -0
- package/dist/components/icon-button/icon-button.d.ts +38 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.js +31 -0
- package/dist/components/icon-button/icon-button.js.map +1 -0
- package/dist/components/icons/add.d.ts +3 -0
- package/dist/components/icons/add.d.ts.map +1 -0
- package/dist/components/icons/add.js +5 -0
- package/dist/components/icons/add.js.map +1 -0
- package/dist/components/icons/ai-agent-solid.d.ts +3 -0
- package/dist/components/icons/ai-agent-solid.d.ts.map +1 -0
- package/dist/components/icons/ai-agent-solid.js +5 -0
- package/dist/components/icons/ai-agent-solid.js.map +1 -0
- package/dist/components/icons/ai-agent.d.ts +3 -0
- package/dist/components/icons/ai-agent.d.ts.map +1 -0
- package/dist/components/icons/ai-agent.js +5 -0
- package/dist/components/icons/ai-agent.js.map +1 -0
- package/dist/components/icons/ai-data.d.ts +3 -0
- package/dist/components/icons/ai-data.d.ts.map +1 -0
- package/dist/components/icons/ai-data.js +5 -0
- package/dist/components/icons/ai-data.js.map +1 -0
- package/dist/components/icons/ai-model.d.ts +3 -0
- package/dist/components/icons/ai-model.d.ts.map +1 -0
- package/dist/components/icons/ai-model.js +5 -0
- package/dist/components/icons/ai-model.js.map +1 -0
- package/dist/components/icons/ai-task.d.ts +3 -0
- package/dist/components/icons/ai-task.d.ts.map +1 -0
- package/dist/components/icons/ai-task.js +5 -0
- package/dist/components/icons/ai-task.js.map +1 -0
- package/dist/components/icons/ai-video-gen.d.ts +3 -0
- package/dist/components/icons/ai-video-gen.d.ts.map +1 -0
- package/dist/components/icons/ai-video-gen.js +5 -0
- package/dist/components/icons/ai-video-gen.js.map +1 -0
- package/dist/components/icons/ai.d.ts +3 -0
- package/dist/components/icons/ai.d.ts.map +1 -0
- package/dist/components/icons/ai.js +5 -0
- package/dist/components/icons/ai.js.map +1 -0
- package/dist/components/icons/arrow-down.d.ts +3 -0
- package/dist/components/icons/arrow-down.d.ts.map +1 -0
- package/dist/components/icons/arrow-down.js +5 -0
- package/dist/components/icons/arrow-down.js.map +1 -0
- package/dist/components/icons/arrow-left.d.ts +3 -0
- package/dist/components/icons/arrow-left.d.ts.map +1 -0
- package/dist/components/icons/arrow-left.js +5 -0
- package/dist/components/icons/arrow-left.js.map +1 -0
- package/dist/components/icons/arrow-right.d.ts +3 -0
- package/dist/components/icons/arrow-right.d.ts.map +1 -0
- package/dist/components/icons/arrow-right.js +5 -0
- package/dist/components/icons/arrow-right.js.map +1 -0
- package/dist/components/icons/arrow-up-left.d.ts +3 -0
- package/dist/components/icons/arrow-up-left.d.ts.map +1 -0
- package/dist/components/icons/arrow-up-left.js +5 -0
- package/dist/components/icons/arrow-up-left.js.map +1 -0
- package/dist/components/icons/arrow-up-right.d.ts +3 -0
- package/dist/components/icons/arrow-up-right.d.ts.map +1 -0
- package/dist/components/icons/arrow-up-right.js +5 -0
- package/dist/components/icons/arrow-up-right.js.map +1 -0
- package/dist/components/icons/arrow-up.d.ts +3 -0
- package/dist/components/icons/arrow-up.d.ts.map +1 -0
- package/dist/components/icons/arrow-up.js +5 -0
- package/dist/components/icons/arrow-up.js.map +1 -0
- package/dist/components/icons/auto.d.ts +3 -0
- package/dist/components/icons/auto.d.ts.map +1 -0
- package/dist/components/icons/auto.js +5 -0
- package/dist/components/icons/auto.js.map +1 -0
- package/dist/components/icons/blackhole.d.ts +3 -0
- package/dist/components/icons/blackhole.d.ts.map +1 -0
- package/dist/components/icons/blackhole.js +5 -0
- package/dist/components/icons/blackhole.js.map +1 -0
- package/dist/components/icons/board.d.ts +3 -0
- package/dist/components/icons/board.d.ts.map +1 -0
- package/dist/components/icons/board.js +5 -0
- package/dist/components/icons/board.js.map +1 -0
- package/dist/components/icons/bolt.d.ts +3 -0
- package/dist/components/icons/bolt.d.ts.map +1 -0
- package/dist/components/icons/bolt.js +5 -0
- package/dist/components/icons/bolt.js.map +1 -0
- package/dist/components/icons/bug.d.ts +3 -0
- package/dist/components/icons/bug.d.ts.map +1 -0
- package/dist/components/icons/bug.js +5 -0
- package/dist/components/icons/bug.js.map +1 -0
- package/dist/components/icons/caret-down.d.ts +3 -0
- package/dist/components/icons/caret-down.d.ts.map +1 -0
- package/dist/components/icons/caret-down.js +5 -0
- package/dist/components/icons/caret-down.js.map +1 -0
- package/dist/components/icons/caret-left.d.ts +3 -0
- package/dist/components/icons/caret-left.d.ts.map +1 -0
- package/dist/components/icons/caret-left.js +5 -0
- package/dist/components/icons/caret-left.js.map +1 -0
- package/dist/components/icons/caret-right.d.ts +3 -0
- package/dist/components/icons/caret-right.d.ts.map +1 -0
- package/dist/components/icons/caret-right.js +5 -0
- package/dist/components/icons/caret-right.js.map +1 -0
- package/dist/components/icons/caret-up.d.ts +3 -0
- package/dist/components/icons/caret-up.d.ts.map +1 -0
- package/dist/components/icons/caret-up.js +5 -0
- package/dist/components/icons/caret-up.js.map +1 -0
- package/dist/components/icons/cart.d.ts +3 -0
- package/dist/components/icons/cart.d.ts.map +1 -0
- package/dist/components/icons/cart.js +5 -0
- package/dist/components/icons/cart.js.map +1 -0
- package/dist/components/icons/chat-solid.d.ts +3 -0
- package/dist/components/icons/chat-solid.d.ts.map +1 -0
- package/dist/components/icons/chat-solid.js +5 -0
- package/dist/components/icons/chat-solid.js.map +1 -0
- package/dist/components/icons/chat.d.ts +3 -0
- package/dist/components/icons/chat.d.ts.map +1 -0
- package/dist/components/icons/chat.js +5 -0
- package/dist/components/icons/chat.js.map +1 -0
- package/dist/components/icons/checkmark.d.ts +3 -0
- package/dist/components/icons/checkmark.d.ts.map +1 -0
- package/dist/components/icons/checkmark.js +5 -0
- package/dist/components/icons/checkmark.js.map +1 -0
- package/dist/components/icons/chip.d.ts +3 -0
- package/dist/components/icons/chip.d.ts.map +1 -0
- package/dist/components/icons/chip.js +5 -0
- package/dist/components/icons/chip.js.map +1 -0
- package/dist/components/icons/circle-add-solid.d.ts +3 -0
- package/dist/components/icons/circle-add-solid.d.ts.map +1 -0
- package/dist/components/icons/circle-add-solid.js +5 -0
- package/dist/components/icons/circle-add-solid.js.map +1 -0
- package/dist/components/icons/circle-add.d.ts +3 -0
- package/dist/components/icons/circle-add.d.ts.map +1 -0
- package/dist/components/icons/circle-add.js +5 -0
- package/dist/components/icons/circle-add.js.map +1 -0
- package/dist/components/icons/circle-x-solid.d.ts +3 -0
- package/dist/components/icons/circle-x-solid.d.ts.map +1 -0
- package/dist/components/icons/circle-x-solid.js +5 -0
- package/dist/components/icons/circle-x-solid.js.map +1 -0
- package/dist/components/icons/circle-x.d.ts +3 -0
- package/dist/components/icons/circle-x.d.ts.map +1 -0
- package/dist/components/icons/circle-x.js +5 -0
- package/dist/components/icons/circle-x.js.map +1 -0
- package/dist/components/icons/clock-countdown.d.ts +3 -0
- package/dist/components/icons/clock-countdown.d.ts.map +1 -0
- package/dist/components/icons/clock-countdown.js +5 -0
- package/dist/components/icons/clock-countdown.js.map +1 -0
- package/dist/components/icons/clock-counter-clockwise.d.ts +3 -0
- package/dist/components/icons/clock-counter-clockwise.d.ts.map +1 -0
- package/dist/components/icons/clock-counter-clockwise.js +5 -0
- package/dist/components/icons/clock-counter-clockwise.js.map +1 -0
- package/dist/components/icons/clock.d.ts +3 -0
- package/dist/components/icons/clock.d.ts.map +1 -0
- package/dist/components/icons/clock.js +5 -0
- package/dist/components/icons/clock.js.map +1 -0
- package/dist/components/icons/close-panel.d.ts +3 -0
- package/dist/components/icons/close-panel.d.ts.map +1 -0
- package/dist/components/icons/close-panel.js +5 -0
- package/dist/components/icons/close-panel.js.map +1 -0
- package/dist/components/icons/close.d.ts +3 -0
- package/dist/components/icons/close.d.ts.map +1 -0
- package/dist/components/icons/close.js +5 -0
- package/dist/components/icons/close.js.map +1 -0
- package/dist/components/icons/cloud-server-solid.d.ts +3 -0
- package/dist/components/icons/cloud-server-solid.d.ts.map +1 -0
- package/dist/components/icons/cloud-server-solid.js +5 -0
- package/dist/components/icons/cloud-server-solid.js.map +1 -0
- package/dist/components/icons/cloud-server.d.ts +3 -0
- package/dist/components/icons/cloud-server.d.ts.map +1 -0
- package/dist/components/icons/cloud-server.js +5 -0
- package/dist/components/icons/cloud-server.js.map +1 -0
- package/dist/components/icons/constants.d.ts +3 -0
- package/dist/components/icons/constants.d.ts.map +1 -0
- package/dist/components/icons/constants.js +137 -0
- package/dist/components/icons/constants.js.map +1 -0
- package/dist/components/icons/copy.d.ts +3 -0
- package/dist/components/icons/copy.d.ts.map +1 -0
- package/dist/components/icons/copy.js +5 -0
- package/dist/components/icons/copy.js.map +1 -0
- package/dist/components/icons/document-solid.d.ts +3 -0
- package/dist/components/icons/document-solid.d.ts.map +1 -0
- package/dist/components/icons/document-solid.js +5 -0
- package/dist/components/icons/document-solid.js.map +1 -0
- package/dist/components/icons/document.d.ts +3 -0
- package/dist/components/icons/document.d.ts.map +1 -0
- package/dist/components/icons/document.js +5 -0
- package/dist/components/icons/document.js.map +1 -0
- package/dist/components/icons/download.d.ts +3 -0
- package/dist/components/icons/download.d.ts.map +1 -0
- package/dist/components/icons/download.js +5 -0
- package/dist/components/icons/download.js.map +1 -0
- package/dist/components/icons/ellipses.d.ts +3 -0
- package/dist/components/icons/ellipses.d.ts.map +1 -0
- package/dist/components/icons/ellipses.js +5 -0
- package/dist/components/icons/ellipses.js.map +1 -0
- package/dist/components/icons/error-solid.d.ts +3 -0
- package/dist/components/icons/error-solid.d.ts.map +1 -0
- package/dist/components/icons/error-solid.js +5 -0
- package/dist/components/icons/error-solid.js.map +1 -0
- package/dist/components/icons/error.d.ts +3 -0
- package/dist/components/icons/error.d.ts.map +1 -0
- package/dist/components/icons/error.js +5 -0
- package/dist/components/icons/error.js.map +1 -0
- package/dist/components/icons/eye-slash.d.ts +3 -0
- package/dist/components/icons/eye-slash.d.ts.map +1 -0
- package/dist/components/icons/eye-slash.js +5 -0
- package/dist/components/icons/eye-slash.js.map +1 -0
- package/dist/components/icons/eye.d.ts +3 -0
- package/dist/components/icons/eye.d.ts.map +1 -0
- package/dist/components/icons/eye.js +5 -0
- package/dist/components/icons/eye.js.map +1 -0
- package/dist/components/icons/folder.d.ts +3 -0
- package/dist/components/icons/folder.d.ts.map +1 -0
- package/dist/components/icons/folder.js +5 -0
- package/dist/components/icons/folder.js.map +1 -0
- package/dist/components/icons/galaxy-rack.d.ts +3 -0
- package/dist/components/icons/galaxy-rack.d.ts.map +1 -0
- package/dist/components/icons/galaxy-rack.js +5 -0
- package/dist/components/icons/galaxy-rack.js.map +1 -0
- package/dist/components/icons/galaxy.d.ts +3 -0
- package/dist/components/icons/galaxy.d.ts.map +1 -0
- package/dist/components/icons/galaxy.js +5 -0
- package/dist/components/icons/galaxy.js.map +1 -0
- package/dist/components/icons/gear-solid.d.ts +3 -0
- package/dist/components/icons/gear-solid.d.ts.map +1 -0
- package/dist/components/icons/gear-solid.js +5 -0
- package/dist/components/icons/gear-solid.js.map +1 -0
- package/dist/components/icons/gear.d.ts +3 -0
- package/dist/components/icons/gear.d.ts.map +1 -0
- package/dist/components/icons/gear.js +5 -0
- package/dist/components/icons/gear.js.map +1 -0
- package/dist/components/icons/globe.d.ts +3 -0
- package/dist/components/icons/globe.d.ts.map +1 -0
- package/dist/components/icons/globe.js +5 -0
- package/dist/components/icons/globe.js.map +1 -0
- package/dist/components/icons/grid.d.ts +3 -0
- package/dist/components/icons/grid.d.ts.map +1 -0
- package/dist/components/icons/grid.js +5 -0
- package/dist/components/icons/grid.js.map +1 -0
- package/dist/components/icons/icon.d.ts +7 -0
- package/dist/components/icons/icon.d.ts.map +1 -0
- package/dist/components/icons/icon.js +9 -0
- package/dist/components/icons/icon.js.map +1 -0
- package/dist/components/icons/icons.d.ts +131 -0
- package/dist/components/icons/icons.d.ts.map +1 -0
- package/dist/components/icons/icons.js +137 -0
- package/dist/components/icons/icons.js.map +1 -0
- package/dist/components/icons/info-solid.d.ts +3 -0
- package/dist/components/icons/info-solid.d.ts.map +1 -0
- package/dist/components/icons/info-solid.js +5 -0
- package/dist/components/icons/info-solid.js.map +1 -0
- package/dist/components/icons/info.d.ts +3 -0
- package/dist/components/icons/info.d.ts.map +1 -0
- package/dist/components/icons/info.js +5 -0
- package/dist/components/icons/info.js.map +1 -0
- package/dist/components/icons/link.d.ts +3 -0
- package/dist/components/icons/link.d.ts.map +1 -0
- package/dist/components/icons/link.js +5 -0
- package/dist/components/icons/link.js.map +1 -0
- package/dist/components/icons/list.d.ts +3 -0
- package/dist/components/icons/list.d.ts.map +1 -0
- package/dist/components/icons/list.js +5 -0
- package/dist/components/icons/list.js.map +1 -0
- package/dist/components/icons/location.d.ts +3 -0
- package/dist/components/icons/location.d.ts.map +1 -0
- package/dist/components/icons/location.js +5 -0
- package/dist/components/icons/location.js.map +1 -0
- package/dist/components/icons/lock-fill.d.ts +3 -0
- package/dist/components/icons/lock-fill.d.ts.map +1 -0
- package/dist/components/icons/lock-fill.js +5 -0
- package/dist/components/icons/lock-fill.js.map +1 -0
- package/dist/components/icons/lock.d.ts +3 -0
- package/dist/components/icons/lock.d.ts.map +1 -0
- package/dist/components/icons/lock.js +5 -0
- package/dist/components/icons/lock.js.map +1 -0
- package/dist/components/icons/loudbox.d.ts +3 -0
- package/dist/components/icons/loudbox.d.ts.map +1 -0
- package/dist/components/icons/loudbox.js +5 -0
- package/dist/components/icons/loudbox.js.map +1 -0
- package/dist/components/icons/menu.d.ts +3 -0
- package/dist/components/icons/menu.d.ts.map +1 -0
- package/dist/components/icons/menu.js +5 -0
- package/dist/components/icons/menu.js.map +1 -0
- package/dist/components/icons/microphone.d.ts +3 -0
- package/dist/components/icons/microphone.d.ts.map +1 -0
- package/dist/components/icons/microphone.js +5 -0
- package/dist/components/icons/microphone.js.map +1 -0
- package/dist/components/icons/minus.d.ts +3 -0
- package/dist/components/icons/minus.d.ts.map +1 -0
- package/dist/components/icons/minus.js +5 -0
- package/dist/components/icons/minus.js.map +1 -0
- package/dist/components/icons/mode-dark.d.ts +3 -0
- package/dist/components/icons/mode-dark.d.ts.map +1 -0
- package/dist/components/icons/mode-dark.js +5 -0
- package/dist/components/icons/mode-dark.js.map +1 -0
- package/dist/components/icons/mode-light.d.ts +3 -0
- package/dist/components/icons/mode-light.d.ts.map +1 -0
- package/dist/components/icons/mode-light.js +5 -0
- package/dist/components/icons/mode-light.js.map +1 -0
- package/dist/components/icons/mode-system.d.ts +3 -0
- package/dist/components/icons/mode-system.d.ts.map +1 -0
- package/dist/components/icons/mode-system.js +5 -0
- package/dist/components/icons/mode-system.js.map +1 -0
- package/dist/components/icons/model-deepseek-color.d.ts +3 -0
- package/dist/components/icons/model-deepseek-color.d.ts.map +1 -0
- package/dist/components/icons/model-deepseek-color.js +5 -0
- package/dist/components/icons/model-deepseek-color.js.map +1 -0
- package/dist/components/icons/model-deepseek.d.ts +3 -0
- package/dist/components/icons/model-deepseek.d.ts.map +1 -0
- package/dist/components/icons/model-deepseek.js +5 -0
- package/dist/components/icons/model-deepseek.js.map +1 -0
- package/dist/components/icons/model-falcon-color.d.ts +3 -0
- package/dist/components/icons/model-falcon-color.d.ts.map +1 -0
- package/dist/components/icons/model-falcon-color.js +5 -0
- package/dist/components/icons/model-falcon-color.js.map +1 -0
- package/dist/components/icons/model-falcon.d.ts +3 -0
- package/dist/components/icons/model-falcon.d.ts.map +1 -0
- package/dist/components/icons/model-falcon.js +5 -0
- package/dist/components/icons/model-falcon.js.map +1 -0
- package/dist/components/icons/model-google-color.d.ts +3 -0
- package/dist/components/icons/model-google-color.d.ts.map +1 -0
- package/dist/components/icons/model-google-color.js +5 -0
- package/dist/components/icons/model-google-color.js.map +1 -0
- package/dist/components/icons/model-google.d.ts +3 -0
- package/dist/components/icons/model-google.d.ts.map +1 -0
- package/dist/components/icons/model-google.js +5 -0
- package/dist/components/icons/model-google.js.map +1 -0
- package/dist/components/icons/model-llama-color.d.ts +3 -0
- package/dist/components/icons/model-llama-color.d.ts.map +1 -0
- package/dist/components/icons/model-llama-color.js +5 -0
- package/dist/components/icons/model-llama-color.js.map +1 -0
- package/dist/components/icons/model-llama.d.ts +3 -0
- package/dist/components/icons/model-llama.d.ts.map +1 -0
- package/dist/components/icons/model-llama.js +5 -0
- package/dist/components/icons/model-llama.js.map +1 -0
- package/dist/components/icons/model-openai.d.ts +3 -0
- package/dist/components/icons/model-openai.d.ts.map +1 -0
- package/dist/components/icons/model-openai.js +5 -0
- package/dist/components/icons/model-openai.js.map +1 -0
- package/dist/components/icons/model-qwen-color.d.ts +3 -0
- package/dist/components/icons/model-qwen-color.d.ts.map +1 -0
- package/dist/components/icons/model-qwen-color.js +5 -0
- package/dist/components/icons/model-qwen-color.js.map +1 -0
- package/dist/components/icons/model-qwen.d.ts +3 -0
- package/dist/components/icons/model-qwen.d.ts.map +1 -0
- package/dist/components/icons/model-qwen.js +5 -0
- package/dist/components/icons/model-qwen.js.map +1 -0
- package/dist/components/icons/monitor.d.ts +3 -0
- package/dist/components/icons/monitor.d.ts.map +1 -0
- package/dist/components/icons/monitor.js +5 -0
- package/dist/components/icons/monitor.js.map +1 -0
- package/dist/components/icons/open-panel.d.ts +3 -0
- package/dist/components/icons/open-panel.d.ts.map +1 -0
- package/dist/components/icons/open-panel.js +5 -0
- package/dist/components/icons/open-panel.js.map +1 -0
- package/dist/components/icons/org-developer.d.ts +3 -0
- package/dist/components/icons/org-developer.d.ts.map +1 -0
- package/dist/components/icons/org-developer.js +5 -0
- package/dist/components/icons/org-developer.js.map +1 -0
- package/dist/components/icons/org-experience.d.ts +3 -0
- package/dist/components/icons/org-experience.d.ts.map +1 -0
- package/dist/components/icons/org-experience.js +5 -0
- package/dist/components/icons/org-experience.js.map +1 -0
- package/dist/components/icons/org-operations.d.ts +3 -0
- package/dist/components/icons/org-operations.d.ts.map +1 -0
- package/dist/components/icons/org-operations.js +5 -0
- package/dist/components/icons/org-operations.js.map +1 -0
- package/dist/components/icons/org-systems.d.ts +3 -0
- package/dist/components/icons/org-systems.d.ts.map +1 -0
- package/dist/components/icons/org-systems.js +5 -0
- package/dist/components/icons/org-systems.js.map +1 -0
- package/dist/components/icons/org-university.d.ts +3 -0
- package/dist/components/icons/org-university.d.ts.map +1 -0
- package/dist/components/icons/org-university.js +5 -0
- package/dist/components/icons/org-university.js.map +1 -0
- package/dist/components/icons/phone.d.ts +3 -0
- package/dist/components/icons/phone.d.ts.map +1 -0
- package/dist/components/icons/phone.js +5 -0
- package/dist/components/icons/phone.js.map +1 -0
- package/dist/components/icons/quasar.d.ts +3 -0
- package/dist/components/icons/quasar.d.ts.map +1 -0
- package/dist/components/icons/quasar.js +5 -0
- package/dist/components/icons/quasar.js.map +1 -0
- package/dist/components/icons/quietbox.d.ts +3 -0
- package/dist/components/icons/quietbox.d.ts.map +1 -0
- package/dist/components/icons/quietbox.js +5 -0
- package/dist/components/icons/quietbox.js.map +1 -0
- package/dist/components/icons/registry.d.ts +6 -0
- package/dist/components/icons/registry.d.ts.map +1 -0
- package/dist/components/icons/registry.js +264 -0
- package/dist/components/icons/registry.js.map +1 -0
- package/dist/components/icons/reset.d.ts +3 -0
- package/dist/components/icons/reset.d.ts.map +1 -0
- package/dist/components/icons/reset.js +5 -0
- package/dist/components/icons/reset.js.map +1 -0
- package/dist/components/icons/search.d.ts +3 -0
- package/dist/components/icons/search.d.ts.map +1 -0
- package/dist/components/icons/search.js +5 -0
- package/dist/components/icons/search.js.map +1 -0
- package/dist/components/icons/server-solid.d.ts +3 -0
- package/dist/components/icons/server-solid.d.ts.map +1 -0
- package/dist/components/icons/server-solid.js +5 -0
- package/dist/components/icons/server-solid.js.map +1 -0
- package/dist/components/icons/server.d.ts +3 -0
- package/dist/components/icons/server.d.ts.map +1 -0
- package/dist/components/icons/server.js +5 -0
- package/dist/components/icons/server.js.map +1 -0
- package/dist/components/icons/shield-solid.d.ts +3 -0
- package/dist/components/icons/shield-solid.d.ts.map +1 -0
- package/dist/components/icons/shield-solid.js +5 -0
- package/dist/components/icons/shield-solid.js.map +1 -0
- package/dist/components/icons/shield.d.ts +3 -0
- package/dist/components/icons/shield.d.ts.map +1 -0
- package/dist/components/icons/shield.js +5 -0
- package/dist/components/icons/shield.js.map +1 -0
- package/dist/components/icons/sidebar.d.ts +3 -0
- package/dist/components/icons/sidebar.d.ts.map +1 -0
- package/dist/components/icons/sidebar.js +5 -0
- package/dist/components/icons/sidebar.js.map +1 -0
- package/dist/components/icons/size.d.ts +3 -0
- package/dist/components/icons/size.d.ts.map +1 -0
- package/dist/components/icons/size.js +5 -0
- package/dist/components/icons/size.js.map +1 -0
- package/dist/components/icons/social-discord.d.ts +3 -0
- package/dist/components/icons/social-discord.d.ts.map +1 -0
- package/dist/components/icons/social-discord.js +5 -0
- package/dist/components/icons/social-discord.js.map +1 -0
- package/dist/components/icons/social-facebook.d.ts +3 -0
- package/dist/components/icons/social-facebook.d.ts.map +1 -0
- package/dist/components/icons/social-facebook.js +5 -0
- package/dist/components/icons/social-facebook.js.map +1 -0
- package/dist/components/icons/social-github.d.ts +3 -0
- package/dist/components/icons/social-github.d.ts.map +1 -0
- package/dist/components/icons/social-github.js +5 -0
- package/dist/components/icons/social-github.js.map +1 -0
- package/dist/components/icons/social-linkedin.d.ts +3 -0
- package/dist/components/icons/social-linkedin.d.ts.map +1 -0
- package/dist/components/icons/social-linkedin.js +5 -0
- package/dist/components/icons/social-linkedin.js.map +1 -0
- package/dist/components/icons/social-x.d.ts +3 -0
- package/dist/components/icons/social-x.d.ts.map +1 -0
- package/dist/components/icons/social-x.js +5 -0
- package/dist/components/icons/social-x.js.map +1 -0
- package/dist/components/icons/social-youtube.d.ts +3 -0
- package/dist/components/icons/social-youtube.d.ts.map +1 -0
- package/dist/components/icons/social-youtube.js +5 -0
- package/dist/components/icons/social-youtube.js.map +1 -0
- package/dist/components/icons/spinner.d.ts +3 -0
- package/dist/components/icons/spinner.d.ts.map +1 -0
- package/dist/components/icons/spinner.js +5 -0
- package/dist/components/icons/spinner.js.map +1 -0
- package/dist/components/icons/success-solid.d.ts +3 -0
- package/dist/components/icons/success-solid.d.ts.map +1 -0
- package/dist/components/icons/success-solid.js +5 -0
- package/dist/components/icons/success-solid.js.map +1 -0
- package/dist/components/icons/success.d.ts +3 -0
- package/dist/components/icons/success.d.ts.map +1 -0
- package/dist/components/icons/success.js +5 -0
- package/dist/components/icons/success.js.map +1 -0
- package/dist/components/icons/tensix.d.ts +3 -0
- package/dist/components/icons/tensix.d.ts.map +1 -0
- package/dist/components/icons/tensix.js +5 -0
- package/dist/components/icons/tensix.js.map +1 -0
- package/dist/components/icons/tenstorrent.d.ts +3 -0
- package/dist/components/icons/tenstorrent.d.ts.map +1 -0
- package/dist/components/icons/tenstorrent.js +5 -0
- package/dist/components/icons/tenstorrent.js.map +1 -0
- package/dist/components/icons/trash-solid.d.ts +3 -0
- package/dist/components/icons/trash-solid.d.ts.map +1 -0
- package/dist/components/icons/trash-solid.js +5 -0
- package/dist/components/icons/trash-solid.js.map +1 -0
- package/dist/components/icons/trash.d.ts +3 -0
- package/dist/components/icons/trash.d.ts.map +1 -0
- package/dist/components/icons/trash.js +5 -0
- package/dist/components/icons/trash.js.map +1 -0
- package/dist/components/icons/tt-forge-fe.d.ts +3 -0
- package/dist/components/icons/tt-forge-fe.d.ts.map +1 -0
- package/dist/components/icons/tt-forge-fe.js +5 -0
- package/dist/components/icons/tt-forge-fe.js.map +1 -0
- package/dist/components/icons/tt-forge.d.ts +3 -0
- package/dist/components/icons/tt-forge.d.ts.map +1 -0
- package/dist/components/icons/tt-forge.js +5 -0
- package/dist/components/icons/tt-forge.js.map +1 -0
- package/dist/components/icons/tt-lang.d.ts +3 -0
- package/dist/components/icons/tt-lang.d.ts.map +1 -0
- package/dist/components/icons/tt-lang.js +5 -0
- package/dist/components/icons/tt-lang.js.map +1 -0
- package/dist/components/icons/tt-llk.d.ts +3 -0
- package/dist/components/icons/tt-llk.d.ts.map +1 -0
- package/dist/components/icons/tt-llk.js +5 -0
- package/dist/components/icons/tt-llk.js.map +1 -0
- package/dist/components/icons/tt-metalium.d.ts +3 -0
- package/dist/components/icons/tt-metalium.d.ts.map +1 -0
- package/dist/components/icons/tt-metalium.js +5 -0
- package/dist/components/icons/tt-metalium.js.map +1 -0
- package/dist/components/icons/tt-nn.d.ts +3 -0
- package/dist/components/icons/tt-nn.d.ts.map +1 -0
- package/dist/components/icons/tt-nn.js +5 -0
- package/dist/components/icons/tt-nn.js.map +1 -0
- package/dist/components/icons/tt-torch.d.ts +3 -0
- package/dist/components/icons/tt-torch.d.ts.map +1 -0
- package/dist/components/icons/tt-torch.js +5 -0
- package/dist/components/icons/tt-torch.js.map +1 -0
- package/dist/components/icons/tt-xla.d.ts +3 -0
- package/dist/components/icons/tt-xla.d.ts.map +1 -0
- package/dist/components/icons/tt-xla.js +5 -0
- package/dist/components/icons/tt-xla.js.map +1 -0
- package/dist/components/icons/types.d.ts +2 -0
- package/dist/components/icons/types.d.ts.map +1 -0
- package/dist/components/icons/types.js +9 -0
- package/dist/components/icons/types.js.map +1 -0
- package/dist/components/icons/upload.d.ts +3 -0
- package/dist/components/icons/upload.d.ts.map +1 -0
- package/dist/components/icons/upload.js +5 -0
- package/dist/components/icons/upload.js.map +1 -0
- package/dist/components/icons/user-multiple-solid.d.ts +3 -0
- package/dist/components/icons/user-multiple-solid.d.ts.map +1 -0
- package/dist/components/icons/user-multiple-solid.js +5 -0
- package/dist/components/icons/user-multiple-solid.js.map +1 -0
- package/dist/components/icons/user-multiple.d.ts +3 -0
- package/dist/components/icons/user-multiple.d.ts.map +1 -0
- package/dist/components/icons/user-multiple.js +5 -0
- package/dist/components/icons/user-multiple.js.map +1 -0
- package/dist/components/icons/user-solid.d.ts +3 -0
- package/dist/components/icons/user-solid.d.ts.map +1 -0
- package/dist/components/icons/user-solid.js +5 -0
- package/dist/components/icons/user-solid.js.map +1 -0
- package/dist/components/icons/user.d.ts +3 -0
- package/dist/components/icons/user.d.ts.map +1 -0
- package/dist/components/icons/user.js +5 -0
- package/dist/components/icons/user.js.map +1 -0
- package/dist/components/icons/warning-solid.d.ts +3 -0
- package/dist/components/icons/warning-solid.d.ts.map +1 -0
- package/dist/components/icons/warning-solid.js +5 -0
- package/dist/components/icons/warning-solid.js.map +1 -0
- package/dist/components/icons/warning.d.ts +3 -0
- package/dist/components/icons/warning.d.ts.map +1 -0
- package/dist/components/icons/warning.js +5 -0
- package/dist/components/icons/warning.js.map +1 -0
- package/dist/components/icons/wormhole.d.ts +3 -0
- package/dist/components/icons/wormhole.d.ts.map +1 -0
- package/dist/components/icons/wormhole.js +5 -0
- package/dist/components/icons/wormhole.js.map +1 -0
- package/dist/components/masked-input/getMaskitoOptions.d.ts +4 -0
- package/dist/components/masked-input/getMaskitoOptions.d.ts.map +1 -0
- package/dist/components/masked-input/getMaskitoOptions.js +27 -0
- package/dist/components/masked-input/getMaskitoOptions.js.map +1 -0
- package/dist/components/masked-input/masked-input.d.ts +68 -0
- package/dist/components/masked-input/masked-input.d.ts.map +1 -0
- package/dist/components/masked-input/masked-input.js +68 -0
- package/dist/components/masked-input/masked-input.js.map +1 -0
- package/dist/components/material/material.css +1 -0
- package/dist/components/material/material.d.ts +43 -0
- package/dist/components/material/material.d.ts.map +1 -0
- package/dist/components/material/material.js +43 -0
- package/dist/components/material/material.js.map +1 -0
- package/dist/components/menu/menu.css +1 -0
- package/dist/components/menu/menu.d.ts +75 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +56 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/modal/modal.d.ts +83 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/modal/modal.js +118 -0
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/progress-bar/progress-bar.css +1 -0
- package/dist/components/progress-bar/progress-bar.d.ts +38 -0
- package/dist/components/progress-bar/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar/progress-bar.js +39 -0
- package/dist/components/progress-bar/progress-bar.js.map +1 -0
- package/dist/components/radio-group/radio-group.css +1 -0
- package/dist/components/radio-group/radio-group.d.ts +70 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.js +61 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/range/range.css +1 -0
- package/dist/components/range/range.d.ts +86 -0
- package/dist/components/range/range.d.ts.map +1 -0
- package/dist/components/range/range.js +87 -0
- package/dist/components/range/range.js.map +1 -0
- package/dist/components/select/select.css +1 -0
- package/dist/components/select/select.d.ts +82 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/select/select.js +79 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/sheet/sheet.css +1 -0
- package/dist/components/sheet/sheet.d.ts +71 -0
- package/dist/components/sheet/sheet.d.ts.map +1 -0
- package/dist/components/sheet/sheet.js +116 -0
- package/dist/components/sheet/sheet.js.map +1 -0
- package/dist/components/show-more/show-more.css +1 -0
- package/dist/components/show-more/show-more.d.ts +28 -0
- package/dist/components/show-more/show-more.d.ts.map +1 -0
- package/dist/components/show-more/show-more.js +26 -0
- package/dist/components/show-more/show-more.js.map +1 -0
- package/dist/components/skeleton/skeleton.css +1 -0
- package/dist/components/skeleton/skeleton.d.ts +39 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +36 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +69 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/slider/slider.js +61 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/snippet/snippet.css +1 -0
- package/dist/components/snippet/snippet.d.ts +28 -0
- package/dist/components/snippet/snippet.d.ts.map +1 -0
- package/dist/components/snippet/snippet.js +44 -0
- package/dist/components/snippet/snippet.js.map +1 -0
- package/dist/components/split-button/split-button.css +1 -0
- package/dist/components/split-button/split-button.d.ts +78 -0
- package/dist/components/split-button/split-button.d.ts.map +1 -0
- package/dist/components/split-button/split-button.js +65 -0
- package/dist/components/split-button/split-button.js.map +1 -0
- package/dist/components/status-indicator/status-indicator.css +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts +35 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.js +33 -0
- package/dist/components/status-indicator/status-indicator.js.map +1 -0
- package/dist/components/switch/switch.css +1 -0
- package/dist/components/switch/switch.d.ts +41 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +46 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/tabs/tabs.css +1 -0
- package/dist/components/tabs/tabs.d.ts +60 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +51 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tag/tag.css +1 -0
- package/dist/components/tag/tag.d.ts +42 -0
- package/dist/components/tag/tag.d.ts.map +1 -0
- package/dist/components/tag/tag.js +48 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/text-area/text-area.css +1 -0
- package/dist/components/text-area/text-area.d.ts +35 -0
- package/dist/components/text-area/text-area.d.ts.map +1 -0
- package/dist/components/text-area/text-area.js +47 -0
- package/dist/components/text-area/text-area.js.map +1 -0
- package/dist/components/text-button/text-button.css +1 -0
- package/dist/components/text-button/text-button.d.ts +46 -0
- package/dist/components/text-button/text-button.d.ts.map +1 -0
- package/dist/components/text-button/text-button.js +46 -0
- package/dist/components/text-button/text-button.js.map +1 -0
- package/dist/components/text-input/text-input.css +1 -0
- package/dist/components/text-input/text-input.d.ts +57 -0
- package/dist/components/text-input/text-input.d.ts.map +1 -0
- package/dist/components/text-input/text-input.js +54 -0
- package/dist/components/text-input/text-input.js.map +1 -0
- package/dist/components/theme-switcher/theme-switcher.css +1 -0
- package/dist/components/theme-switcher/theme-switcher.d.ts +23 -0
- package/dist/components/theme-switcher/theme-switcher.d.ts.map +1 -0
- package/dist/components/theme-switcher/theme-switcher.js +24 -0
- package/dist/components/theme-switcher/theme-switcher.js.map +1 -0
- package/dist/components/toast/animations.d.ts +3 -0
- package/dist/components/toast/animations.d.ts.map +1 -0
- package/dist/components/toast/animations.js +28 -0
- package/dist/components/toast/animations.js.map +1 -0
- package/dist/components/toast/store.d.ts +77 -0
- package/dist/components/toast/store.d.ts.map +1 -0
- package/dist/components/toast/store.js +94 -0
- package/dist/components/toast/store.js.map +1 -0
- package/dist/components/toast/toast.css +1 -0
- package/dist/components/toast/toast.d.ts +32 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/toast/toast.js +202 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toast/utils.d.ts +10 -0
- package/dist/components/toast/utils.d.ts.map +1 -0
- package/dist/components/toast/utils.js +26 -0
- package/dist/components/toast/utils.js.map +1 -0
- package/dist/components/toggle/toggle.css +1 -0
- package/dist/components/toggle/toggle.d.ts +82 -0
- package/dist/components/toggle/toggle.d.ts.map +1 -0
- package/dist/components/toggle/toggle.js +129 -0
- package/dist/components/toggle/toggle.js.map +1 -0
- package/dist/components/tooltip/tooltip.css +1 -0
- package/dist/components/tooltip/tooltip.d.ts +58 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +52 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/typography/typography.css +1 -0
- package/dist/components/typography/typography.d.ts +33 -0
- package/dist/components/typography/typography.d.ts.map +1 -0
- package/dist/components/typography/typography.js +63 -0
- package/dist/components/typography/typography.js.map +1 -0
- package/dist/styles/animation.css +1 -0
- package/dist/styles/backgrounds.css +1 -0
- package/dist/styles/colors.css +1 -0
- package/dist/styles/fonts.css +1 -0
- package/dist/styles/globals.css +1 -0
- package/dist/styles/leading.css +1 -0
- package/dist/styles/radius.css +1 -0
- package/dist/styles/shadows.css +1 -0
- package/dist/styles/spacing.css +1 -0
- package/dist/styles/strokes.css +1 -0
- package/dist/styles/styles.css +1 -0
- package/dist/styles/tailwind-utilities.css +1 -0
- package/dist/styles/tailwind.css +1 -0
- package/dist/styles/tracking.css +1 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +2 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/generateId.d.ts +5 -0
- package/dist/utils/generateId.d.ts.map +1 -0
- package/dist/utils/generateId.js +21 -0
- package/dist/utils/generateId.js.map +1 -0
- package/dist/utils/getDisabledProps.d.ts +42 -0
- package/dist/utils/getDisabledProps.d.ts.map +1 -0
- package/dist/utils/getDisabledProps.js +36 -0
- package/dist/utils/getDisabledProps.js.map +1 -0
- package/dist/utils/getPortalContainer.d.ts +27 -0
- package/dist/utils/getPortalContainer.d.ts.map +1 -0
- package/dist/utils/getPortalContainer.js +21 -0
- package/dist/utils/getPortalContainer.js.map +1 -0
- package/dist/utils/hooks/useBaseRemSize.d.ts +9 -0
- package/dist/utils/hooks/useBaseRemSize.d.ts.map +1 -0
- package/dist/utils/hooks/useBaseRemSize.js +55 -0
- package/dist/utils/hooks/useBaseRemSize.js.map +1 -0
- package/dist/utils/hooks/useMergedRefs.d.ts +11 -0
- package/dist/utils/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/utils/hooks/useMergedRefs.js +96 -0
- package/dist/utils/hooks/useMergedRefs.js.map +1 -0
- package/dist/utils/isSingleReactElement.d.ts +3 -0
- package/dist/utils/isSingleReactElement.d.ts.map +1 -0
- package/dist/utils/isSingleReactElement.js +5 -0
- package/dist/utils/isSingleReactElement.js.map +1 -0
- package/dist/utils/polymorphic.d.ts +43 -0
- package/dist/utils/polymorphic.d.ts.map +1 -0
- package/dist/utils/polymorphic.js +2 -0
- package/dist/utils/polymorphic.js.map +1 -0
- package/dist/utils/splitFormInputProps.d.ts +119 -0
- package/dist/utils/splitFormInputProps.d.ts.map +1 -0
- package/dist/utils/splitFormInputProps.js +277 -0
- package/dist/utils/splitFormInputProps.js.map +1 -0
- package/package.json +266 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Slider as BaseSlider, } from "@base-ui/react/slider";
|
|
5
|
+
import { Typography } from "../typography/typography.js";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
const toValues = (value) => Array.isArray(value) ? value : [value];
|
|
8
|
+
/**
|
|
9
|
+
* A multi-thumb range input for selecting a span of numeric values between a minimum and maximum.
|
|
10
|
+
*
|
|
11
|
+
* @param {string[]} props.thumbAriaLabels - Accessible `aria-label` attributes for each thumb, in the same order as the values
|
|
12
|
+
* @param {number[]} [props.values] - (optional) The values of each thumb (controlled). One thumb is rendered per entry
|
|
13
|
+
* @param {number[]} [props.defaultValues] - (optional) The initial thumb values (uncontrolled). @default [min, max]
|
|
14
|
+
* @param {(value: number[]) => void} [props.onValuesChange] - (optional) Callback fired as thumb values change during interaction
|
|
15
|
+
* @param {(value: number[]) => void} [props.onValuesCommit] - (optional) Callback fired when thumb interaction is completed
|
|
16
|
+
* @param {number} [props.min] - (optional) The minimum allowed value. @default 0
|
|
17
|
+
* @param {number} [props.max] - (optional) The maximum allowed value. @default 100
|
|
18
|
+
* @param {number} [props.step] - (optional) The stepping interval. @default 1
|
|
19
|
+
* @param {number} [props.minStepsBetweenThumbs] - (optional) The minimum number of steps required between thumbs. @default 1
|
|
20
|
+
* @param {boolean} [props.showTicks] - (optional) Whether to render tick marks at each step interval. @default false
|
|
21
|
+
* @param {boolean} [props.showValueLabels] - (optional) Whether to display a value label above each thumb. @default false
|
|
22
|
+
* @param {string[]} [props.valueLabels] - (optional) Custom display labels for each thumb, falling back to that thumb's current value
|
|
23
|
+
* @param {boolean} [props.disabled] - (optional) Whether to prevent interaction. @default false
|
|
24
|
+
* @param {string} [props.name] - (optional) The form field name each thumb submits its value under
|
|
25
|
+
*
|
|
26
|
+
* You may also pass any additional props to the underlying `div` element
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Range
|
|
30
|
+
* min={0}
|
|
31
|
+
* max={100}
|
|
32
|
+
* defaultValues={[20, 80]}
|
|
33
|
+
* onValuesCommit={(values) => console.log(values)}
|
|
34
|
+
* thumbAriaLabels={["Volume (min)", "Volume (max)"]}
|
|
35
|
+
* />
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Range
|
|
39
|
+
* min={0}
|
|
40
|
+
* max={50}
|
|
41
|
+
* step={5}
|
|
42
|
+
* showTicks
|
|
43
|
+
* showValueLabels
|
|
44
|
+
* values={range}
|
|
45
|
+
* onValuesChange={setRange}
|
|
46
|
+
* thumbAriaLabels={["Volume (min)", "Volume (max)"]}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <Range
|
|
51
|
+
* variant="error"
|
|
52
|
+
* values={price}
|
|
53
|
+
* onValuesChange={setPrice}
|
|
54
|
+
* thumbAriaLabels={["Price (min)", "Price (max)"]}
|
|
55
|
+
* />
|
|
56
|
+
*/
|
|
57
|
+
export function Range(props) {
|
|
58
|
+
const { className, thumbAriaLabels, values, valueLabels, onValuesChange, onValuesCommit, showTicks = false, showValueLabels, minStepsBetweenThumbs = 1, min = 0, max = 100, step = 1, disabled, name, form, defaultValues = [min, max], ...rest } = props;
|
|
59
|
+
const tickPositions = useMemo(() => {
|
|
60
|
+
if (!showTicks)
|
|
61
|
+
return [];
|
|
62
|
+
const span = max - min;
|
|
63
|
+
if (!Number.isFinite(span) ||
|
|
64
|
+
!Number.isFinite(step) ||
|
|
65
|
+
span <= 0 ||
|
|
66
|
+
step <= 0) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
const numTicks = Math.max(Math.ceil(span / step) - 1, 0);
|
|
70
|
+
return Array.from({ length: numTicks }, (_, i) => ((i + 1) * step) / span);
|
|
71
|
+
}, [min, max, step, showTicks]);
|
|
72
|
+
const thumbValues = values ?? defaultValues;
|
|
73
|
+
return (_jsx(BaseSlider.Root, { ...rest, role: "group", className: cn("vesper-range", showValueLabels && "vesper-range-labeled", className), value: values, defaultValue: defaultValues, onValueChange: (value) => onValuesChange?.(toValues(value)), onValueCommitted: (value) => onValuesCommit?.(toValues(value)), min: min, max: max, step: step, disabled: disabled, name: name, form: form, minStepsBetweenValues: minStepsBetweenThumbs, thumbAlignment: "edge", thumbCollisionBehavior: "none", children: _jsx(BaseSlider.Control, { children: _jsxs(BaseSlider.Track, { className: "vesper-range-track", children: [showTicks &&
|
|
74
|
+
tickPositions.map((position, i) => (_jsx("span", { className: "vesper-range-tick", style: {
|
|
75
|
+
["--vesper-range-tick-position"]: position,
|
|
76
|
+
} }, i))), _jsx(BaseSlider.Indicator, { className: "vesper-range-range" }), thumbValues.map((_, index) => (_jsx(Typography, { as: BaseSlider.Thumb, variant: "label-xs", index: index, className: cn("vesper-range-thumb", showValueLabels && "vesper-range-thumb-labeled"), onPointerDown: (e) => {
|
|
77
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
78
|
+
}, "aria-label": thumbAriaLabels[index], getAriaValueText: (_, value, index) => valueLabels?.[index] ?? `${value}`, style: (state) => {
|
|
79
|
+
if (!showValueLabels)
|
|
80
|
+
return {};
|
|
81
|
+
const thumbLabel = `"${valueLabels?.[index] ?? state.values[index]}"`;
|
|
82
|
+
return {
|
|
83
|
+
["--vesper-range-thumb-label"]: thumbLabel,
|
|
84
|
+
};
|
|
85
|
+
} }, index)))] }) }) }));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.js","sourceRoot":"","sources":["../../../src/components/range/range.tsx"],"names":[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,EAAC,mBAAmB,EAC7B,KAAK,EACH;gCACE,CAAC,8BAA8B,CAAC,EAAE,QAAQ;6BAC1B,IALf,CAAC,CAON,CACH,CAAC,EACJ,KAAC,UAAU,CAAC,SAAS,IAAC,SAAS,EAAC,oBAAoB,GAAG,EACtD,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,KAAC,UAAU,IAET,EAAE,EAAE,UAAU,CAAC,KAAK,EACpB,OAAO,EAAC,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CACX,oBAAoB,EACpB,eAAe,IAAI,4BAA4B,CAChD,EACD,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE;4BACnB,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;wBACjD,CAAC,gBACW,eAAe,CAAC,KAAK,CAAC,EAClC,gBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CACpC,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,EAEpC,KAAK,EAAE,CAAC,KAAuB,EAAE,EAAE;4BACjC,IAAI,CAAC,eAAe;gCAAE,OAAO,EAAE,CAAC;4BAEhC,MAAM,UAAU,GAAG,IAAI,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;4BAEtE,OAAO;gCACL,CAAC,4BAA4B,CAAC,EAAE,UAAU;6BAC1B,CAAC;wBACrB,CAAC,IAvBI,KAAK,CAwBV,CACH,CAAC,IACe,GACA,GACL,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vesper-select{color:var(--vesper-text-primary);border:var(--vesper-stroke-base) solid var(--vesper-border-primary);background:var(--vesper-tint-neutral-100);align-items:center;display:flex}.vesper-select:not(:disabled){cursor:pointer}.vesper-select[data-popup-open] .vesper-select-state-indicator-closed{display:none}.vesper-select:not([data-popup-open]) .vesper-select-state-indicator-open{display:none}.vesper-select:disabled{border-color:var(--vesper-border-disabled);color:var(--vesper-text-disabled);background:var(--vesper-background-disabled)}.vesper-select:disabled .vesper-select-icon{color:var(--vesper-icon-disabled)}.vesper-select:disabled .vesper-select-state-indicator{color:var(--vesper-icon-disabled)}.vesper-select[data-popup-open]{border-color:var(--vesper-border-strong);box-shadow:var(--vesper-shadow-focus-ring)}@media (forced-colors:active){.vesper-select[data-popup-open]{outline:var(--vesper-stroke-strong) solid CanvasText}}@media not (forced-colors:active){.vesper-select[data-popup-open]{box-shadow:var(--vesper-shadow-focus-ring)}}.vesper-select:focus-visible{border-color:var(--vesper-border-strong);box-shadow:var(--vesper-shadow-focus-ring)}@media (forced-colors:active){.vesper-select:focus-visible{outline:var(--vesper-stroke-strong) solid CanvasText}}@media not (forced-colors:active){.vesper-select:focus-visible{box-shadow:var(--vesper-shadow-focus-ring)}}.vesper-select-item-checkmark{color:var(--vesper-icon-secondary);width:1.25rem;height:1.25rem;display:block}.vesper-select-state-indicator{margin-left:auto}.vesper-select-lg{padding:0 var(--vesper-spacing-3);gap:var(--vesper-spacing-2);border-radius:var(--vesper-radius-2);height:3rem}.vesper-select-lg .vesper-select-icon{color:var(--vesper-icon-secondary);width:1.25rem;height:1.25rem;display:block}.vesper-select-lg .vesper-select-state-indicator{color:var(--vesper-icon-secondary);width:1.25rem;height:1.25rem;display:block}.vesper-select-md{padding:0 var(--vesper-spacing-3);gap:var(--vesper-spacing-2);border-radius:var(--vesper-radius-2);height:2.5rem}.vesper-select-md .vesper-select-icon{color:var(--vesper-icon-secondary);width:1rem;height:1rem;display:block}.vesper-select-md .vesper-select-state-indicator{color:var(--vesper-icon-secondary);width:1rem;height:1rem;display:block}.vesper-select-sm{padding:0 var(--vesper-spacing-2);gap:var(--vesper-spacing-1);border-radius:var(--vesper-radius-1);height:2rem}.vesper-select-sm .vesper-select-icon{color:var(--vesper-icon-secondary);width:.875rem;height:.875rem;display:block}.vesper-select-sm .vesper-select-state-indicator{color:var(--vesper-icon-secondary);width:.875rem;height:.875rem;display:block}.vesper-select-success{border:var(--vesper-stroke-base) solid var(--vesper-border-success-base)}.vesper-select-warning{border:var(--vesper-stroke-base) solid var(--vesper-border-warning-base)}.vesper-select-error{border:var(--vesper-stroke-base) solid var(--vesper-border-error-base)}.vesper-select-positioner{min-width:var(--anchor-width);border-radius:var(--vesper-radius-3);border:var(--vesper-stroke-base) solid var(--vesper-border-tertiary);background:linear-gradient(0deg, var(--vesper-alpha-stone-50) 0%, var(--vesper-alpha-stone-50) 100%), var(--vesper-background-primary);box-shadow:var(--vesper-shadow-200);overflow:hidden}.vesper-select-popup{color:var(--vesper-text-primary);max-height:min(var(--available-height), 20rem);outline:none;overflow-y:auto}.vesper-select-viewport{padding:var(--vesper-spacing-2);gap:var(--vesper-spacing-half);flex-direction:column;display:flex}.vesper-select-item{cursor:pointer;justify-content:space-between;align-items:center;gap:var(--vesper-spacing-2);height:2.25rem;padding:var(--vesper-spacing-2);border-radius:var(--vesper-radius-1);display:flex}.vesper-select-item[data-highlighted]{background:var(--vesper-state-neutral-hover)}@media (forced-colors:active){.vesper-select-item[data-highlighted]{outline:var(--vesper-stroke-base) solid CanvasText}}.vesper-select-item[data-selected]{background:var(--vesper-tint-neutral-200)}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type PortalContainer } from "../../utils/getPortalContainer.js";
|
|
3
|
+
import { FormInputProps } from "../../utils/splitFormInputProps.js";
|
|
4
|
+
export declare const SELECT_VARIANTS: readonly ["default", "warning", "error", "success"];
|
|
5
|
+
export declare const SELECT_SIZES: readonly ["sm", "md", "lg"];
|
|
6
|
+
export type SelectVariant = (typeof SELECT_VARIANTS)[number];
|
|
7
|
+
export type SelectSize = (typeof SELECT_SIZES)[number];
|
|
8
|
+
export interface SelectItem {
|
|
9
|
+
/** The underlying value submitted with form data and passed to `onValueChange`. Must be unique across all options. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** The human-readable text displayed for this option in the dropdown list. */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SelectProps extends FormInputProps<"button", "button", "value" | "defaultValue"> {
|
|
15
|
+
/** An optional icon rendered at the leading edge of the select trigger. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** The size variant of the select trigger. Affects padding, height, and typography. @default md */
|
|
18
|
+
size?: SelectSize;
|
|
19
|
+
/** The visual variant of the select trigger, which determines its color scheme and message icon. @default default */
|
|
20
|
+
variant?: SelectVariant;
|
|
21
|
+
/** Placeholder text shown in the trigger when no value is selected. @default Select an option */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** The list of selectable options displayed in the dropdown */
|
|
24
|
+
options: (SelectItem | string)[];
|
|
25
|
+
/** The initial selected value for uncontrolled usage */
|
|
26
|
+
defaultValue?: string | null;
|
|
27
|
+
/** The currently selected value for controlled usage. Pass `null` to represent no selection. */
|
|
28
|
+
value?: string | null;
|
|
29
|
+
/** Callback invoked with the new value whenever the selection changes, or `null` when the selection is cleared. */
|
|
30
|
+
onValueChange?(value: string | null): void;
|
|
31
|
+
/** When `true`, marks the underlying select as required for form validation */
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** Specify the element or shadow root to portal the dropdown into */
|
|
34
|
+
container?: PortalContainer;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A form-ready dropdown select component, supporting both controlled and uncontrolled usage patterns with options for:
|
|
38
|
+
* - Three size variants: `sm`, `md`, `lg`
|
|
39
|
+
* - An optional leading icon
|
|
40
|
+
* - Automatic portal handling for use inside dialogs
|
|
41
|
+
*
|
|
42
|
+
* @param {(SelectItem | string)[]} props.options - The list of selectable options displayed in the dropdown. See {@link SelectItem} for the shape of each option
|
|
43
|
+
* @param {SelectSize} [props.size] - (optional) Size variant of the select trigger. Affects padding, height, and typography. @default md
|
|
44
|
+
* @param {SelectVariant} [props.variant] - (optional) The visual variant determining color scheme and message icon. @default default
|
|
45
|
+
* @param {string} [props.placeholder] - (optional) Placeholder text shown when no value is selected. @default Select an option
|
|
46
|
+
* @param {ReactNode} [props.icon] - (optional) An icon rendered at the leading edge of the select trigger
|
|
47
|
+
* @param {string} [props.value] - (optional) The currently selected value for controlled usage
|
|
48
|
+
* @param {string} [props.defaultValue] - (optional) The initial selected value for uncontrolled usage
|
|
49
|
+
* @param {(value: string) => void} [props.onValueChange] - (optional) Callback invoked with the new value whenever the selection changes
|
|
50
|
+
* @param {boolean} [props.required] - (optional) Marks the select as required for form validation
|
|
51
|
+
* @param {PortalContainer} [props.container] - (optional) Specify the element or shadow root to portal the dropdown into
|
|
52
|
+
* @param {Ref<HTMLButtonElement>} [props.ref] - (optional) A ref forwarded to the select trigger `<button>` element
|
|
53
|
+
* @param {string} [props.name] - (optional) Form field name submitted with form data
|
|
54
|
+
*
|
|
55
|
+
* You may also pass any additional props to the underlying trigger `<button>` element
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* <Select
|
|
59
|
+
* required
|
|
60
|
+
* aria-label="Fruit"
|
|
61
|
+
* name="fruit"
|
|
62
|
+
* options={[
|
|
63
|
+
* { value: "apple", label: "Apple" },
|
|
64
|
+
* { value: "banana", label: "Banana" },
|
|
65
|
+
* { value: "cherry", label: "Cherry" },
|
|
66
|
+
* ]}
|
|
67
|
+
* placeholder="Pick a fruit"
|
|
68
|
+
* onValueChange={(value) => console.log(value)}
|
|
69
|
+
* />
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* <Select
|
|
73
|
+
* size="sm"
|
|
74
|
+
* icon={<ChatSolid />}
|
|
75
|
+
* options={chatOptions}
|
|
76
|
+
* value={selectedChatOption}
|
|
77
|
+
* onValueChange={setSelectedChatOption}
|
|
78
|
+
* aria-label="Select default chat behavior"
|
|
79
|
+
* />
|
|
80
|
+
*/
|
|
81
|
+
export declare function Select(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAU1D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,cAAc,EAEf,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,eAAe,qDAKlB,CAAC;AAEX,eAAO,MAAM,YAAY,6BAA8B,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,sHAAsH;IACtH,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc,CACjD,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,cAAc,CACzB;IACC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mGAAmG;IACnG,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qHAAqH;IACrH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,OAAO,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mHAAmH;IACnH,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3C,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CA4FxC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { Select as BaseSelect } from "@base-ui/react/select";
|
|
5
|
+
import { CaretDown, CaretUp, Checkmark } from "../icons/icons.js";
|
|
6
|
+
import { Typography, } from "../typography/typography.js";
|
|
7
|
+
import { cn } from "../../utils/cn.js";
|
|
8
|
+
import { getPortalContainer, } from "../../utils/getPortalContainer.js";
|
|
9
|
+
import { useBaseRemSize } from "../../utils/hooks/useBaseRemSize.js";
|
|
10
|
+
import { useMergedRefs } from "../../utils/hooks/useMergedRefs.js";
|
|
11
|
+
import { splitFormInputProps, } from "../../utils/splitFormInputProps.js";
|
|
12
|
+
export const SELECT_VARIANTS = [
|
|
13
|
+
"default",
|
|
14
|
+
"warning",
|
|
15
|
+
"error",
|
|
16
|
+
"success",
|
|
17
|
+
];
|
|
18
|
+
export const SELECT_SIZES = ["sm", "md", "lg"];
|
|
19
|
+
const SELECT_TRIGGER_TYPOGRAPHY = {
|
|
20
|
+
sm: "copy-xs",
|
|
21
|
+
md: "copy-sm",
|
|
22
|
+
lg: "copy-md",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A form-ready dropdown select component, supporting both controlled and uncontrolled usage patterns with options for:
|
|
26
|
+
* - Three size variants: `sm`, `md`, `lg`
|
|
27
|
+
* - An optional leading icon
|
|
28
|
+
* - Automatic portal handling for use inside dialogs
|
|
29
|
+
*
|
|
30
|
+
* @param {(SelectItem | string)[]} props.options - The list of selectable options displayed in the dropdown. See {@link SelectItem} for the shape of each option
|
|
31
|
+
* @param {SelectSize} [props.size] - (optional) Size variant of the select trigger. Affects padding, height, and typography. @default md
|
|
32
|
+
* @param {SelectVariant} [props.variant] - (optional) The visual variant determining color scheme and message icon. @default default
|
|
33
|
+
* @param {string} [props.placeholder] - (optional) Placeholder text shown when no value is selected. @default Select an option
|
|
34
|
+
* @param {ReactNode} [props.icon] - (optional) An icon rendered at the leading edge of the select trigger
|
|
35
|
+
* @param {string} [props.value] - (optional) The currently selected value for controlled usage
|
|
36
|
+
* @param {string} [props.defaultValue] - (optional) The initial selected value for uncontrolled usage
|
|
37
|
+
* @param {(value: string) => void} [props.onValueChange] - (optional) Callback invoked with the new value whenever the selection changes
|
|
38
|
+
* @param {boolean} [props.required] - (optional) Marks the select as required for form validation
|
|
39
|
+
* @param {PortalContainer} [props.container] - (optional) Specify the element or shadow root to portal the dropdown into
|
|
40
|
+
* @param {Ref<HTMLButtonElement>} [props.ref] - (optional) A ref forwarded to the select trigger `<button>` element
|
|
41
|
+
* @param {string} [props.name] - (optional) Form field name submitted with form data
|
|
42
|
+
*
|
|
43
|
+
* You may also pass any additional props to the underlying trigger `<button>` element
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <Select
|
|
47
|
+
* required
|
|
48
|
+
* aria-label="Fruit"
|
|
49
|
+
* name="fruit"
|
|
50
|
+
* options={[
|
|
51
|
+
* { value: "apple", label: "Apple" },
|
|
52
|
+
* { value: "banana", label: "Banana" },
|
|
53
|
+
* { value: "cherry", label: "Cherry" },
|
|
54
|
+
* ]}
|
|
55
|
+
* placeholder="Pick a fruit"
|
|
56
|
+
* onValueChange={(value) => console.log(value)}
|
|
57
|
+
* />
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* <Select
|
|
61
|
+
* size="sm"
|
|
62
|
+
* icon={<ChatSolid />}
|
|
63
|
+
* options={chatOptions}
|
|
64
|
+
* value={selectedChatOption}
|
|
65
|
+
* onValueChange={setSelectedChatOption}
|
|
66
|
+
* aria-label="Select default chat behavior"
|
|
67
|
+
* />
|
|
68
|
+
*/
|
|
69
|
+
export function Select(props) {
|
|
70
|
+
const { className, options, onValueChange, size = "md", variant = "default", icon, container, placeholder = "Select an option", ref, ...rest } = props;
|
|
71
|
+
const { ariaProps, controlProps, formProps, wrapperProps } = splitFormInputProps(rest);
|
|
72
|
+
const [trigger, setTrigger] = useState(null);
|
|
73
|
+
const mergedTriggerRef = useMergedRefs(setTrigger, ref);
|
|
74
|
+
const portalContainer = getPortalContainer(container, trigger);
|
|
75
|
+
const baseRemSize = useBaseRemSize();
|
|
76
|
+
const items = useMemo(() => options.map((option) => typeof option === "string" ? { value: option, label: option } : option), [options]);
|
|
77
|
+
return (_jsxs(BaseSelect.Root, { ...formProps, items: items, onValueChange: (next) => onValueChange?.(next), children: [_jsxs(BaseSelect.Trigger, { ...ariaProps, ...wrapperProps, ...controlProps, ref: mergedTriggerRef, className: cn("vesper-select", `vesper-select-${size}`, `vesper-select-${variant}`, className), children: [icon && _jsx("span", { className: "vesper-select-icon", children: icon }), _jsx(Typography, { as: "span", variant: SELECT_TRIGGER_TYPOGRAPHY[size], children: _jsx(BaseSelect.Value, { placeholder: placeholder }) }), _jsxs("span", { className: "vesper-select-state-indicator", children: [_jsx(CaretDown, { className: "vesper-select-state-indicator-closed" }), _jsx(CaretUp, { className: "vesper-select-state-indicator-open" })] })] }), _jsx(BaseSelect.Portal, { container: portalContainer, children: _jsx(BaseSelect.Positioner, { className: "vesper-select-positioner", side: "bottom", align: "start", alignItemWithTrigger: false, sideOffset: 12 * (baseRemSize / 16), children: _jsx(BaseSelect.Popup, { className: "vesper-select-popup", children: _jsx(BaseSelect.List, { className: "vesper-select-viewport", children: items.map((o) => (_jsxs(BaseSelect.Item, { value: o.value, className: "vesper-select-item", children: [_jsx(BaseSelect.ItemText, { render: _jsx(Typography, { variant: "label-md" }), children: o.label }), _jsx(BaseSelect.ItemIndicator, { className: "vesper-select-item-checkmark", children: _jsx(Checkmark, {}) })] }, o.value))) }) }) }) })] }));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAkB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EACL,UAAU,GAEX,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAEL,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;CACD,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAwCxD,MAAM,yBAAyB,GAA6C;IAC1E,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EACJ,SAAS,EACT,OAAO,EACP,aAAa,EACb,IAAI,GAAG,IAAI,EACX,OAAO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,CAAC,IAAI,CAAC,YAC5D,KAAC,UAAU,CAAC,KAAK,IAAC,WAAW,EAAE,WAAW,GAAI,GACnC,EACb,gBAAM,SAAS,EAAC,+BAA+B,aAC7C,KAAC,SAAS,IAAC,SAAS,EAAC,sCAAsC,GAAG,EAC9D,KAAC,OAAO,IAAC,SAAS,EAAC,oCAAoC,GAAG,IACrD,IACY,EACrB,KAAC,UAAU,CAAC,MAAM,IAAC,SAAS,EAAE,eAAe,YAC3C,KAAC,UAAU,CAAC,UAAU,IACpB,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,OAAO,EACb,oBAAoB,EAAE,KAAK,EAC3B,UAAU,EAAE,EAAE,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,YAEnC,KAAC,UAAU,CAAC,KAAK,IAAC,SAAS,EAAC,qBAAqB,YAC/C,KAAC,UAAU,CAAC,IAAI,IAAC,SAAS,EAAC,wBAAwB,YAChD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,MAAC,UAAU,CAAC,IAAI,IAEd,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,SAAS,EAAC,oBAAoB,aAE9B,KAAC,UAAU,CAAC,QAAQ,IAClB,MAAM,EAAE,KAAC,UAAU,IAAC,OAAO,EAAC,UAAU,GAAG,YAExC,CAAC,CAAC,KAAK,GACY,EACtB,KAAC,UAAU,CAAC,aAAa,IAAC,SAAS,EAAC,8BAA8B,YAChE,KAAC,SAAS,KAAG,GACY,KAXtB,CAAC,CAAC,KAAK,CAYI,CACnB,CAAC,GACc,GACD,GACG,GACN,IACJ,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vesper-sheet{transition:display var(--vesper-transition-duration-fast) ease allow-discrete, overlay var(--vesper-transition-duration-fast) ease allow-discrete}.vesper-sheet::-ms-backdrop{opacity:0}.vesper-sheet::backdrop{opacity:0}.vesper-sheet:not([popover]):before{content:"";transition:background var(--vesper-transition-duration-fast) ease, display var(--vesper-transition-duration-fast) ease allow-discrete, overlay var(--vesper-transition-duration-fast) ease allow-discrete;background:0 0;position:fixed;top:-100vh;bottom:-100vh;left:-100vw;right:-100vw}.vesper-sheet-right .vesper-sheet-content{transform:translate(50%)}.vesper-sheet-left .vesper-sheet-content{transform:translate(-50%)}.vesper-sheet-content{opacity:0;transition:opacity var(--vesper-transition-duration-fast) ease, transform var(--vesper-transition-duration-fast) ease;gap:var(--vesper-spacing-6);width:min(calc(100vw - var(--vesper-spacing-12)), 29.5rem);background:var(--vesper-background-primary);border:var(--vesper-stroke-base) solid var(--vesper-border-primary);border-radius:var(--vesper-radius-3);top:var(--vesper-spacing-6);height:calc(100vh - var(--vesper-spacing-12));flex-direction:column;display:flex;position:fixed;overflow:hidden}.vesper-sheet:popover-open .vesper-sheet-content{opacity:1;transform:translate(0)}.vesper-sheet:popover-open:before{background:var(--vesper-scrim-contrast-base)}.vesper-sheet[open] .vesper-sheet-content{opacity:1;transform:translate(0)}.vesper-sheet[open]:before{background:var(--vesper-scrim-contrast-base)}@starting-style{.vesper-sheet-right:popover-open .vesper-sheet-content{opacity:0;transform:translate(50%)}.vesper-sheet-right:popover-open:before{background:0 0}}@starting-style{.vesper-sheet-right[open] .vesper-sheet-content{opacity:0;transform:translate(50%)}.vesper-sheet-right[open]:before{background:0 0}}@starting-style{.vesper-sheet-left:popover-open .vesper-sheet-content{opacity:0;transform:translate(-50%)}.vesper-sheet-left:popover-open:before{background:0 0}}@starting-style{.vesper-sheet-left[open] .vesper-sheet-content{opacity:0;transform:translate(-50%)}.vesper-sheet-left[open]:before{background:0 0}}.vesper-sheet-left .vesper-sheet-content{left:var(--vesper-spacing-6)}.vesper-sheet-right .vesper-sheet-content{right:var(--vesper-spacing-6)}.vesper-sheet-header{padding:var(--vesper-spacing-6) var(--vesper-spacing-6) 0 var(--vesper-spacing-6);gap:var(--vesper-spacing-10);width:100%;display:flex}.vesper-sheet-title-description{gap:var(--vesper-spacing-2);flex-direction:column;flex:1;display:flex}.vesper-sheet-title{color:var(--vesper-text-primary)}.vesper-sheet-description{color:var(--vesper-text-secondary)}.vesper-sheet-children{padding:0 var(--vesper-spacing-6);color:var(--vesper-text-primary);flex:1;overflow-y:auto}.vesper-sheet-buttons{gap:var(--vesper-spacing-4);padding:0 var(--vesper-spacing-6) var(--vesper-spacing-6) var(--vesper-spacing-6);justify-content:flex-end;display:flex}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type Ref } from "react";
|
|
2
|
+
import { type ButtonProps } from "../button/button.js";
|
|
3
|
+
interface SheetRef {
|
|
4
|
+
open(): void;
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SHEET_SIDES: readonly ["left", "right"];
|
|
8
|
+
export type SheetSide = (typeof SHEET_SIDES)[number];
|
|
9
|
+
export interface SheetProps extends Omit<ComponentPropsWithoutRef<"dialog">, "open" | "popover"> {
|
|
10
|
+
/** The title text displayed in the sheet header. Also used for the sheet's `aria-labelledby` association. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** A description displayed below the title in the sheet header. Also used for the sheet's `aria-describedby` association. */
|
|
13
|
+
description: string;
|
|
14
|
+
/** A ref that exposes imperative `open()` and `close()` methods for controlling the sheet. Can be obtained via the `useSheet` hook. */
|
|
15
|
+
ref?: Ref<SheetRef>;
|
|
16
|
+
/** The side of the viewport the sheet slides in from. @default right */
|
|
17
|
+
side?: SheetSide;
|
|
18
|
+
/** When `true`, renders the sheet as a popover instead of a modal dialog. Popovers do not render a backdrop, and allow interaction with the content behind them. @default false */
|
|
19
|
+
popover?: boolean;
|
|
20
|
+
/** An optional array of button props to render as action buttons at the bottom of the sheet. The last button defaults to `"contrast"` variant; all others default to `"tertiary"`. */
|
|
21
|
+
buttons?: Omit<ButtonProps, "size" | "as">[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A slide-in panel component for supplementary content, supporting both modal and popover modes.
|
|
25
|
+
*
|
|
26
|
+
* Unlike `Modal`, which is meant to always block user interaction with underlying content, `Sheet` can be configured to allow the user to continue to interact with the rest of the page.
|
|
27
|
+
*
|
|
28
|
+
* @see packages/vesper/src/components/modal/modal.tsx
|
|
29
|
+
*
|
|
30
|
+
* @param {string} props.title - The title text displayed in the sheet header
|
|
31
|
+
* @param {string} props.description - A description displayed below the title
|
|
32
|
+
* @param {SheetSide} [props.side] - (optional) The side of the viewport the sheet slides in from. @default right
|
|
33
|
+
* @param {boolean} [props.popover] - (optional) Render as a non-modal popover instead of a modal dialog. @default false
|
|
34
|
+
* @param {Ref<SheetRef>} [props.ref] - (optional) A ref exposing imperative `open()` and `close()` methods
|
|
35
|
+
* @param {ButtonProps[]} [props.buttons] - (optional) Action buttons rendered at the bottom of the sheet
|
|
36
|
+
*
|
|
37
|
+
* You may also pass any additional props to the underlying `dialog` element
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const { ref, open, close } = useSheet();
|
|
41
|
+
*
|
|
42
|
+
* <Sheet ref={ref} title="Settings" description="Manage your preferences.">
|
|
43
|
+
* <p>Sheet content here</p>
|
|
44
|
+
* </Sheet>
|
|
45
|
+
* <Button onClick={open}>Open Sheet</Button>
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* <Sheet
|
|
49
|
+
* title="Filters"
|
|
50
|
+
* description="Apply filters"
|
|
51
|
+
* side="left"
|
|
52
|
+
* popover
|
|
53
|
+
* buttons={[{ children: "Apply" }]}
|
|
54
|
+
* />
|
|
55
|
+
*/
|
|
56
|
+
export declare function Sheet(props: SheetProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* A convenience hook that returns a ref and imperative `open()` and `close()` functions for controlling a `Sheet` component.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const { ref, open, close } = useSheet();
|
|
62
|
+
* <Sheet ref={ref} title="Example" description="An example sheet." />
|
|
63
|
+
* <Button onClick={open}>Open sheet</Button>
|
|
64
|
+
*/
|
|
65
|
+
export declare function useSheet(): {
|
|
66
|
+
open: () => void;
|
|
67
|
+
close: () => void;
|
|
68
|
+
ref: import("react").RefObject<SheetRef>;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,GAAG,EAMT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,4BAA4B,CAAC;AAOpC,UAAU,QAAQ;IAChB,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,WAAW,4BAA6B,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,wBAAwB,CAAC,QAAQ,CAAC,EAClC,MAAM,GAAG,SAAS,CACnB;IACC,6GAA6G;IAC7G,KAAK,EAAE,MAAM,CAAC;IACd,6HAA6H;IAC7H,WAAW,EAAE,MAAM,CAAC;IACpB,uIAAuI;IACvI,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpB,wEAAwE;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mLAAmL;IACnL,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sLAAsL;IACtL,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqHtC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ;;;;EAYvB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useId, useImperativeHandle, useRef, } from "react";
|
|
4
|
+
import { Button, } from "../button/button.js";
|
|
5
|
+
import { IconButton } from "../icon-button/icon-button.js";
|
|
6
|
+
import { Close } from "../icons/icons.js";
|
|
7
|
+
import { Typography } from "../typography/typography.js";
|
|
8
|
+
import { cn } from "../../utils/cn.js";
|
|
9
|
+
export const SHEET_SIDES = ["left", "right"];
|
|
10
|
+
/**
|
|
11
|
+
* A slide-in panel component for supplementary content, supporting both modal and popover modes.
|
|
12
|
+
*
|
|
13
|
+
* Unlike `Modal`, which is meant to always block user interaction with underlying content, `Sheet` can be configured to allow the user to continue to interact with the rest of the page.
|
|
14
|
+
*
|
|
15
|
+
* @see packages/vesper/src/components/modal/modal.tsx
|
|
16
|
+
*
|
|
17
|
+
* @param {string} props.title - The title text displayed in the sheet header
|
|
18
|
+
* @param {string} props.description - A description displayed below the title
|
|
19
|
+
* @param {SheetSide} [props.side] - (optional) The side of the viewport the sheet slides in from. @default right
|
|
20
|
+
* @param {boolean} [props.popover] - (optional) Render as a non-modal popover instead of a modal dialog. @default false
|
|
21
|
+
* @param {Ref<SheetRef>} [props.ref] - (optional) A ref exposing imperative `open()` and `close()` methods
|
|
22
|
+
* @param {ButtonProps[]} [props.buttons] - (optional) Action buttons rendered at the bottom of the sheet
|
|
23
|
+
*
|
|
24
|
+
* You may also pass any additional props to the underlying `dialog` element
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const { ref, open, close } = useSheet();
|
|
28
|
+
*
|
|
29
|
+
* <Sheet ref={ref} title="Settings" description="Manage your preferences.">
|
|
30
|
+
* <p>Sheet content here</p>
|
|
31
|
+
* </Sheet>
|
|
32
|
+
* <Button onClick={open}>Open Sheet</Button>
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <Sheet
|
|
36
|
+
* title="Filters"
|
|
37
|
+
* description="Apply filters"
|
|
38
|
+
* side="left"
|
|
39
|
+
* popover
|
|
40
|
+
* buttons={[{ children: "Apply" }]}
|
|
41
|
+
* />
|
|
42
|
+
*/
|
|
43
|
+
export function Sheet(props) {
|
|
44
|
+
const { className, ref, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, children, side = "right", popover = false, title, description, buttons = [], ...rest } = props;
|
|
45
|
+
const titleId = useId();
|
|
46
|
+
const descriptionId = useId();
|
|
47
|
+
const innerRef = useRef(null);
|
|
48
|
+
const open = useCallback(() => {
|
|
49
|
+
if (!innerRef.current)
|
|
50
|
+
return;
|
|
51
|
+
if (!popover) {
|
|
52
|
+
if (!innerRef.current.open)
|
|
53
|
+
innerRef.current.showModal();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
innerRef.current?.showPopover();
|
|
57
|
+
}
|
|
58
|
+
}, [popover]);
|
|
59
|
+
const close = useCallback(() => {
|
|
60
|
+
if (!innerRef.current)
|
|
61
|
+
return;
|
|
62
|
+
if (!popover)
|
|
63
|
+
innerRef.current.close();
|
|
64
|
+
else
|
|
65
|
+
innerRef.current.hidePopover();
|
|
66
|
+
}, [popover]);
|
|
67
|
+
useImperativeHandle(ref, () => ({ open, close }), [open, close]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
// when rendered as a modal, ensure clicking outside the container closes the sheet
|
|
70
|
+
if (!popover) {
|
|
71
|
+
const handleClick = (e) => {
|
|
72
|
+
if (e.target === innerRef.current)
|
|
73
|
+
close();
|
|
74
|
+
};
|
|
75
|
+
window.addEventListener("click", handleClick);
|
|
76
|
+
return () => window.removeEventListener("click", handleClick);
|
|
77
|
+
}
|
|
78
|
+
// when rendered as a popover, ensure pressing the escape key closes the sheet
|
|
79
|
+
const handleKeyDown = (e) => {
|
|
80
|
+
if (e.key === "Escape")
|
|
81
|
+
close();
|
|
82
|
+
};
|
|
83
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
84
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
85
|
+
}, [close, popover]);
|
|
86
|
+
// If an additional aria-labelledby is supplied, this ensures that both ids get used
|
|
87
|
+
const labelledBy = [ariaLabelledby, titleId].filter(Boolean).join(" ");
|
|
88
|
+
// If an additional aria-describedby is supplied, this ensures that both ids get used
|
|
89
|
+
const describedBy = [ariaDescribedby, descriptionId]
|
|
90
|
+
.filter(Boolean)
|
|
91
|
+
.join(" ");
|
|
92
|
+
return (_jsx("dialog", { ...(popover && { popover: "manual" }), ref: innerRef, className: cn("vesper-sheet", `vesper-sheet-${side}`, className), "aria-labelledby": labelledBy, "aria-describedby": describedBy, ...rest, children: _jsxs("div", { className: "vesper-sheet-content", children: [_jsxs("div", { className: "vesper-sheet-header", children: [_jsxs("div", { className: "vesper-sheet-title-description", children: [_jsx(Typography, { variant: "heading-sm", className: "vesper-sheet-title", id: titleId, children: title }), _jsx(Typography, { variant: "copy-sm", className: "vesper-sheet-description", id: descriptionId, children: description })] }), _jsx(IconButton, { "aria-label": "Close sheet", type: "button", icon: _jsx(Close, {}), size: "md", variant: "tertiary", onClick: close })] }), _jsx("div", { className: "vesper-sheet-children", children: children }), buttons.length > 0 && (_jsx("div", { className: "vesper-sheet-buttons", children: buttons.map((button, index) => {
|
|
93
|
+
const variant = button.variant ||
|
|
94
|
+
(index === buttons.length - 1 ? "contrast" : "tertiary");
|
|
95
|
+
return (_jsx(Button, { size: "lg", ...button, variant: variant }, index));
|
|
96
|
+
}) }))] }) }));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A convenience hook that returns a ref and imperative `open()` and `close()` functions for controlling a `Sheet` component.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const { ref, open, close } = useSheet();
|
|
103
|
+
* <Sheet ref={ref} title="Example" description="An example sheet." />
|
|
104
|
+
* <Button onClick={open}>Open sheet</Button>
|
|
105
|
+
*/
|
|
106
|
+
export function useSheet() {
|
|
107
|
+
const ref = useRef({ open() { }, close() { } });
|
|
108
|
+
const open = useCallback(() => {
|
|
109
|
+
ref.current.open();
|
|
110
|
+
}, [ref]);
|
|
111
|
+
const close = useCallback(() => {
|
|
112
|
+
ref.current.close();
|
|
113
|
+
}, [ref]);
|
|
114
|
+
return { open, close, ref };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/components/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAGL,WAAW,EACX,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,GAGP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAOhC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAsBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,MAAM,EACJ,SAAS,EACT,GAAG,EACH,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,QAAQ,EACR,IAAI,GAAG,OAAO,EACd,OAAO,GAAG,KAAK,EACf,KAAK,EACL,WAAW,EACX,OAAO,GAAG,EAAE,EACZ,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,aAAa,GAAG,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:flex}.vesper-show-more:before{content:"";border-bottom:var(--vesper-stroke-base) solid var(--vesper-border-tertiary);flex:1}.vesper-show-more:after{content:"";border-bottom:var(--vesper-stroke-base) solid var(--vesper-border-tertiary);flex:1}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentProps, MouseEventHandler } from "react";
|
|
2
|
+
export interface ShowMoreProps extends Omit<ComponentProps<"div">, "onClick"> {
|
|
3
|
+
/** Whether or not the content is currently expanded. Controls the button label ("Show more" / "Show less") and the `aria-expanded` attribute. @default false */
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
/** When `true`, renders the button in a disabled state and prevents interaction. @default false */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Callback fired when the show more/less button is clicked. */
|
|
8
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A toggle button for expanding and collapsing content sections with an accessible "Show more" / "Show less" label.
|
|
12
|
+
*
|
|
13
|
+
* @param {boolean} [props.expanded] - (optional) Whether the content is currently expanded. @default false
|
|
14
|
+
* @param {boolean} [props.disabled] - (optional) Renders the button in a disabled state. @default false
|
|
15
|
+
* @param {MouseEventHandler<HTMLButtonElement>} [props.onClick] - (optional) Callback fired when the button is clicked
|
|
16
|
+
*
|
|
17
|
+
* You may also pass any additional props to the underlying `div` element
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const [expanded, setExpanded] = useState(false);
|
|
21
|
+
*
|
|
22
|
+
* <ShowMore expanded={expanded} onClick={() => setExpanded(!expanded)} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <ShowMore expanded={false} disabled />
|
|
26
|
+
*/
|
|
27
|
+
export declare function ShowMore(props: ShowMoreProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=show-more.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-more.d.ts","sourceRoot":"","sources":["../../../src/components/show-more/show-more.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAO/D,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3E,gKAAgK;IAChK,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAuB5C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { CaretDown, CaretUp } from "../icons/icons.js";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* A toggle button for expanding and collapsing content sections with an accessible "Show more" / "Show less" label.
|
|
7
|
+
*
|
|
8
|
+
* @param {boolean} [props.expanded] - (optional) Whether the content is currently expanded. @default false
|
|
9
|
+
* @param {boolean} [props.disabled] - (optional) Renders the button in a disabled state. @default false
|
|
10
|
+
* @param {MouseEventHandler<HTMLButtonElement>} [props.onClick] - (optional) Callback fired when the button is clicked
|
|
11
|
+
*
|
|
12
|
+
* You may also pass any additional props to the underlying `div` element
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const [expanded, setExpanded] = useState(false);
|
|
16
|
+
*
|
|
17
|
+
* <ShowMore expanded={expanded} onClick={() => setExpanded(!expanded)} />
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <ShowMore expanded={false} disabled />
|
|
21
|
+
*/
|
|
22
|
+
export function ShowMore(props) {
|
|
23
|
+
const { className, expanded = false, disabled = false, onClick, ...rest } = props;
|
|
24
|
+
return (_jsx("div", { className: cn("vesper-show-more", className), ...rest, children: _jsx(Button, { "aria-expanded": expanded ?? false, disabled: disabled, size: "sm", variant: "tertiary", iconRight: expanded ? _jsx(CaretUp, {}) : _jsx(CaretDown, {}), onClick: onClick, children: expanded ? "Show less" : "Show more" }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=show-more.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-more.js","sourceRoot":"","sources":["../../../src/components/show-more/show-more.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAWhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,IAAI,YACzD,KAAC,MAAM,qBACU,QAAQ,IAAI,KAAK,EAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,UAAU,EAClB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAC,OAAO,KAAG,CAAC,CAAC,CAAC,KAAC,SAAS,KAAG,EACjD,OAAO,EAAE,OAAO,YAEf,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,GAC9B,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vesper-skeleton{width:fit-content;position:relative;overflow:hidden}.vesper-skeleton-overlay{background:var(--vesper-stone-300);position:absolute;top:0;bottom:0;left:0;right:0}.vesper-skeleton-overlay:after{content:"";background:linear-gradient(to left, transparent, var(--vesper-alpha-inverse-200), transparent);width:4rem;animation:1.2s linear infinite vesper-skeleton-shimmer;position:absolute;top:0;bottom:0;left:0}@media (prefers-reduced-motion:reduce){.vesper-skeleton-overlay:after{display:none}}.vesper-skeleton-box{border-radius:var(--vesper-radius-1)}.vesper-skeleton-pill{border-radius:2147483647px}.vesper-skeleton-circle{border-radius:50%}@keyframes vesper-skeleton-shimmer{0%{left:-4rem}66%,to{left:100%}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export declare const SKELETON_SHAPES: readonly ["box", "pill", "circle"];
|
|
3
|
+
export type SkeletonShape = (typeof SKELETON_SHAPES)[number];
|
|
4
|
+
export interface SkeletonProps extends ComponentProps<"div"> {
|
|
5
|
+
/** The shape of the skeleton placeholder. @default box */
|
|
6
|
+
shape?: SkeletonShape;
|
|
7
|
+
/** Sets both the `width` and `height` of the skeleton simultaneously. Accepts a number (interpreted as pixels) or a CSS string value. Overrides individual `width` and `height` props. */
|
|
8
|
+
size?: number | string;
|
|
9
|
+
/** The `width` of the skeleton. Accepts a number (interpreted as pixels) or a CSS string value. */
|
|
10
|
+
width?: number | string;
|
|
11
|
+
/** The `height` of the skeleton. Accepts a number (interpreted as pixels) or a CSS string value. */
|
|
12
|
+
height?: number | string;
|
|
13
|
+
/** When `true`, renders the skeleton overlay. When `false`, renders only the children without the skeleton. @default true */
|
|
14
|
+
show?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A placeholder loading element that displays an animated shimmer overlay in configurable shapes and sizes.
|
|
18
|
+
*
|
|
19
|
+
* @param {SkeletonShape} [props.shape] - (optional) The shape of the skeleton placeholder. @default box
|
|
20
|
+
* @param {number | string} [props.size] - (optional) Sets both width and height simultaneously
|
|
21
|
+
* @param {number | string} [props.width] - (optional) The width of the skeleton
|
|
22
|
+
* @param {number | string} [props.height] - (optional) The height of the skeleton
|
|
23
|
+
* @param {boolean} [props.show] - (optional) Whether to render the skeleton overlay. @default true
|
|
24
|
+
*
|
|
25
|
+
* You may also pass any additional props to the underlying `div` element
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <Skeleton width={200} height={20} />
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <Skeleton shape="circle" size={48} />
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <Skeleton show={isLoading}>
|
|
35
|
+
* <Avatar src={user.avatar} />
|
|
36
|
+
* </Skeleton>
|
|
37
|
+
*/
|
|
38
|
+
export declare function Skeleton(props: SkeletonProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
|
|
39
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,eAAO,MAAM,eAAe,oCAAqC,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,0DAA0D;IAC1D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,0LAA0L;IAC1L,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,oGAAoG;IACpG,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,6HAA6H;IAC7H,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2WA6B5C"}
|