@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 @@
|
|
|
1
|
+
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/theme-switcher/theme-switcher.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAM5C,eAAO,MAAM,oBAAoB,uBAAwB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,CACX;IACC,kDAAkD;IAClD,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAuCtD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ModeDark, ModeLight, ModeSystem } from "../icons/icons.js";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
export const THEME_SWITCHER_SIZES = ["sm", "lg"];
|
|
6
|
+
const setTheme = (theme) => document.documentElement.setAttribute("data-vesper-theme", theme);
|
|
7
|
+
/**
|
|
8
|
+
* A three-way toggle for switching between system, light, and dark color themes by setting the `data-vesper-theme` attribute on the document root.
|
|
9
|
+
*
|
|
10
|
+
* @param {ThemeSwitcherSize} [props.size] - (optional) The size of the theme switcher. @default lg
|
|
11
|
+
*
|
|
12
|
+
* You may also pass any additional props to the underlying `div` element
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <ThemeSwitcher />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <ThemeSwitcher size="sm" />
|
|
19
|
+
*/
|
|
20
|
+
export function ThemeSwitcher(props) {
|
|
21
|
+
const { className, size = "lg", ...rest } = props;
|
|
22
|
+
return (_jsxs("div", { className: cn("vesper-theme-switcher", `vesper-theme-switcher-${size}`, className), ...rest, children: [_jsx("button", { type: "button", className: "vesper-theme-switcher-button vesper-theme-switcher-button-system", onClick: () => setTheme("system"), "aria-label": "Switch color theme to system preference", children: _jsx(ModeSystem, {}) }), _jsx("button", { type: "button", className: "vesper-theme-switcher-button vesper-theme-switcher-button-light", onClick: () => setTheme("light"), "aria-label": "Switch color theme to light mode", children: _jsx(ModeLight, {}) }), _jsx("button", { type: "button", className: "vesper-theme-switcher-button vesper-theme-switcher-button-dark", onClick: () => setTheme("dark"), "aria-label": "Switch color theme to dark mode", children: _jsx(ModeDark, {}) }), _jsx("span", { className: "vesper-theme-switcher-indicator" })] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=theme-switcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-switcher.js","sourceRoot":"","sources":["../../../src/components/theme-switcher/theme-switcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AAc1D,MAAM,QAAQ,GAAG,CAAC,KAAkB,EAAE,EAAE,CACtC,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAElD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,uBAAuB,EACvB,yBAAyB,IAAI,EAAE,EAC/B,SAAS,CACV,KACG,IAAI,aAER,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kEAAkE,EAC5E,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBACtB,yCAAyC,YAEpD,KAAC,UAAU,KAAG,GACP,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iEAAiE,EAC3E,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,gBACrB,kCAAkC,YAE7C,KAAC,SAAS,KAAG,GACN,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,gEAAgE,EAC1E,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,gBACpB,iCAAiC,YAE5C,KAAC,QAAQ,KAAG,GACL,EACT,eAAM,SAAS,EAAC,iCAAiC,GAAG,IAChD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const animateToastEnter: (wrapper: HTMLDivElement | null, toast: HTMLDivElement | null, onFinished: () => void) => Promise<void> | undefined;
|
|
2
|
+
export declare const animateToastExit: (wrapper: HTMLDivElement | null, toast: HTMLDivElement | null, onFinished: () => void) => Promise<void> | undefined;
|
|
3
|
+
//# sourceMappingURL=animations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../../src/components/toast/animations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,GAC5B,SAAS,cAAc,GAAG,IAAI,EAC9B,OAAO,cAAc,GAAG,IAAI,EAC5B,YAAY,MAAM,IAAI,8BAeM,CAAC;AAE/B,eAAO,MAAM,gBAAgB,GAC3B,SAAS,cAAc,GAAG,IAAI,EAC9B,OAAO,cAAc,GAAG,IAAI,EAC5B,YAAY,MAAM,IAAI,8BAmBM,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const getIsReducedMotion = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2
|
+
export const animateToastEnter = (wrapper, toast, onFinished) => wrapper
|
|
3
|
+
?.animate({
|
|
4
|
+
opacity: [0, 1],
|
|
5
|
+
transform: [
|
|
6
|
+
"translateX(calc(100% + var(--vesper-spacing-6)))",
|
|
7
|
+
"translateX(0%)",
|
|
8
|
+
],
|
|
9
|
+
marginTop: ["0px", "var(--vesper-spacing-4)"],
|
|
10
|
+
height: ["0px", (toast?.getBoundingClientRect().height || 0) + "px"],
|
|
11
|
+
}, { duration: getIsReducedMotion() ? 0 : 300, easing: "ease" })
|
|
12
|
+
.finished.then(onFinished);
|
|
13
|
+
export const animateToastExit = (wrapper, toast, onFinished) => wrapper
|
|
14
|
+
?.animate({
|
|
15
|
+
opacity: [1, 0],
|
|
16
|
+
transform: [
|
|
17
|
+
"translateX(0%)",
|
|
18
|
+
"translateX(calc(100% + var(--vesper-spacing-6)))",
|
|
19
|
+
],
|
|
20
|
+
marginTop: ["var(--vesper-spacing-4)", "0px"],
|
|
21
|
+
height: [(toast?.getBoundingClientRect().height || 0) + "px", "0px"],
|
|
22
|
+
}, {
|
|
23
|
+
fill: "forwards",
|
|
24
|
+
duration: getIsReducedMotion() ? 0 : 300,
|
|
25
|
+
easing: "ease",
|
|
26
|
+
})
|
|
27
|
+
.finished.then(onFinished);
|
|
28
|
+
//# sourceMappingURL=animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.js","sourceRoot":"","sources":["../../../src/components/toast/animations.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAC9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,0 +1,77 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare const TOAST_VARIANTS: readonly ["default", "loading", "success", "warning", "danger"];
|
|
3
|
+
export interface ToastOptions {
|
|
4
|
+
/** The content displayed in the toast. Typically this will be just text, though any `ReactNode` is supported. */
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
/** Optional action to render a button at the bottom of the toast. */
|
|
7
|
+
action?: ToastAction;
|
|
8
|
+
/** The duration in milliseconds the toast will be visible for. Omitting or setting this property to false will show the toast indefinitely until the user dismisses it manually. @default false */
|
|
9
|
+
timeout?: number | false;
|
|
10
|
+
/** Determines which visual style to render the toast in. @default default */
|
|
11
|
+
variant?: ToastVariant;
|
|
12
|
+
/** Customizes the `aria-label` text for the dismiss button. */
|
|
13
|
+
dismissText?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastAction {
|
|
16
|
+
/** Callback function that fires when the user clicks the action button. */
|
|
17
|
+
handler: () => void;
|
|
18
|
+
/** The content displayed in the button. Typically this will be just text, though any `ReactNode` is supported. */
|
|
19
|
+
content: ReactNode;
|
|
20
|
+
/** Short description of an alternative way for users to achieve the desired action. This field is important for screen reader users who may not be able to access the toast easily, especially if it is time-sensitive. */
|
|
21
|
+
altText?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ToastHandle {
|
|
24
|
+
/** Dismisses the toast */
|
|
25
|
+
dismiss(): void;
|
|
26
|
+
/** Updates the toast */
|
|
27
|
+
update(options: Partial<ToastOptions>): void;
|
|
28
|
+
}
|
|
29
|
+
export type ToastState = "entering" | "active" | "dismissed";
|
|
30
|
+
export type ToastVariant = (typeof TOAST_VARIANTS)[number];
|
|
31
|
+
export interface ToastData {
|
|
32
|
+
options: ToastOptions;
|
|
33
|
+
id: string;
|
|
34
|
+
state: ToastState;
|
|
35
|
+
}
|
|
36
|
+
declare class ToastsStore {
|
|
37
|
+
data: {
|
|
38
|
+
toasts: ToastData[];
|
|
39
|
+
announcement: string | null;
|
|
40
|
+
};
|
|
41
|
+
listeners: Set<() => void>;
|
|
42
|
+
subscribe: (listener: () => void) => () => boolean;
|
|
43
|
+
getSnapshot: () => {
|
|
44
|
+
toasts: ToastData[];
|
|
45
|
+
announcement: string | null;
|
|
46
|
+
};
|
|
47
|
+
emitChange: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Spawns a new toast, and returns a handle to that toast which allows you to update or dismiss it.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const toast = addToast({
|
|
53
|
+
* variant: 'loading',
|
|
54
|
+
* content: 'Loading...',
|
|
55
|
+
* })
|
|
56
|
+
* await someAsynchronousTask()
|
|
57
|
+
* toast.update({
|
|
58
|
+
* variant: 'success',
|
|
59
|
+
* content: 'Success!',
|
|
60
|
+
* timeout: 5000,
|
|
61
|
+
* })
|
|
62
|
+
* */
|
|
63
|
+
addToast: (options: ToastOptions) => ToastHandle;
|
|
64
|
+
updateToast: (id: string, updates: Partial<ToastOptions>) => void;
|
|
65
|
+
updateToastState: (id: string, state: ToastState) => void;
|
|
66
|
+
dismissToast: (id: string) => void;
|
|
67
|
+
destroyToast: (id: string) => void;
|
|
68
|
+
destroyAllToasts: () => void;
|
|
69
|
+
setAnnouncement: (announcement: string | null) => void;
|
|
70
|
+
}
|
|
71
|
+
export declare const store: ToastsStore;
|
|
72
|
+
export declare const useStore: () => {
|
|
73
|
+
toasts: ToastData[];
|
|
74
|
+
announcement: string | null;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/components/toast/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAI7D,eAAO,MAAM,cAAc,iEAMjB,CAAC;AAEX,MAAM,WAAW,YAAY;IAC3B,iHAAiH;IACjH,OAAO,EAAE,SAAS,CAAC;IACnB,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,MAAM,EAAE,OAAO,UAAU,UAO/C;IAEF,YAAY,GAAI,IAAI,MAAM,UAGxB;IAEF,YAAY,GAAI,IAAI,MAAM,UAIxB;IAEF,gBAAgB,aAGd;IAEF,eAAe,GAAI,cAAc,MAAM,GAAG,IAAI,UAG5C;CACH;AAED,eAAO,MAAM,KAAK,aAAoB,CAAC;AAEvC,eAAO,MAAM,QAAQ;YA7FH,SAAS,EAAE;kBACH,MAAM,GAAG,IAAI;CA6FsC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
import { generateId } from "../../utils/generateId.js";
|
|
4
|
+
export const TOAST_VARIANTS = [
|
|
5
|
+
"default",
|
|
6
|
+
"loading",
|
|
7
|
+
"success",
|
|
8
|
+
"warning",
|
|
9
|
+
"danger",
|
|
10
|
+
];
|
|
11
|
+
class ToastsStore {
|
|
12
|
+
data = {
|
|
13
|
+
toasts: [],
|
|
14
|
+
announcement: null,
|
|
15
|
+
};
|
|
16
|
+
listeners = new Set();
|
|
17
|
+
subscribe = (listener) => {
|
|
18
|
+
this.listeners.add(listener);
|
|
19
|
+
return () => this.listeners.delete(listener);
|
|
20
|
+
};
|
|
21
|
+
getSnapshot = () => this.data;
|
|
22
|
+
emitChange = () => {
|
|
23
|
+
for (const listener of this.listeners) {
|
|
24
|
+
listener();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Spawns a new toast, and returns a handle to that toast which allows you to update or dismiss it.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const toast = addToast({
|
|
32
|
+
* variant: 'loading',
|
|
33
|
+
* content: 'Loading...',
|
|
34
|
+
* })
|
|
35
|
+
* await someAsynchronousTask()
|
|
36
|
+
* toast.update({
|
|
37
|
+
* variant: 'success',
|
|
38
|
+
* content: 'Success!',
|
|
39
|
+
* timeout: 5000,
|
|
40
|
+
* })
|
|
41
|
+
* */
|
|
42
|
+
addToast = (options) => {
|
|
43
|
+
const toast = {
|
|
44
|
+
options,
|
|
45
|
+
id: generateId(),
|
|
46
|
+
state: "entering",
|
|
47
|
+
};
|
|
48
|
+
const toasts = [...this.data.toasts, toast];
|
|
49
|
+
this.data = { ...this.data, toasts };
|
|
50
|
+
this.emitChange();
|
|
51
|
+
return {
|
|
52
|
+
dismiss: () => this.dismissToast(toast.id),
|
|
53
|
+
update: (updates) => this.updateToast(toast.id, updates),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
updateToast = (id, updates) => {
|
|
57
|
+
const toasts = this.data.toasts.map((t) => {
|
|
58
|
+
if (t.id !== id)
|
|
59
|
+
return t;
|
|
60
|
+
return { ...t, options: { ...t.options, ...updates } };
|
|
61
|
+
});
|
|
62
|
+
this.data = { ...this.data, toasts };
|
|
63
|
+
this.emitChange();
|
|
64
|
+
};
|
|
65
|
+
updateToastState = (id, state) => {
|
|
66
|
+
const toasts = this.data.toasts.map((t) => {
|
|
67
|
+
if (t.id !== id)
|
|
68
|
+
return t;
|
|
69
|
+
return { ...t, state };
|
|
70
|
+
});
|
|
71
|
+
this.data = { ...this.data, toasts };
|
|
72
|
+
this.emitChange();
|
|
73
|
+
};
|
|
74
|
+
dismissToast = (id) => {
|
|
75
|
+
this.updateToastState(id, "dismissed");
|
|
76
|
+
this.emitChange();
|
|
77
|
+
};
|
|
78
|
+
destroyToast = (id) => {
|
|
79
|
+
const toasts = this.data.toasts.filter((t) => t.id !== id);
|
|
80
|
+
this.data = { ...this.data, toasts };
|
|
81
|
+
this.emitChange();
|
|
82
|
+
};
|
|
83
|
+
destroyAllToasts = () => {
|
|
84
|
+
this.data = { ...this.data, toasts: [] };
|
|
85
|
+
this.emitChange();
|
|
86
|
+
};
|
|
87
|
+
setAnnouncement = (announcement) => {
|
|
88
|
+
this.data = { ...this.data, announcement };
|
|
89
|
+
this.emitChange();
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export const store = new ToastsStore();
|
|
93
|
+
export const useStore = () => useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
94
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/components/toast/store.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAkB,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,QAAQ;CACA,CAAC;AAyCX,MAAM,WAAW;IACf,IAAI,GAAG;QACL,MAAM,EAAE,EAAiB;QACzB,YAAY,EAAE,IAAqB;KACpC,CAAC;IAEF,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAClC,SAAS,GAAG,CAAC,QAAoB,EAAE,EAAE;QACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;IAE9B,UAAU,GAAG,GAAG,EAAE;QAChB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC;IAEF;;;;;;;;;;;;;;SAcK;IACL,QAAQ,GAAG,CAAC,OAAqB,EAAe,EAAE;QAChD,MAAM,KAAK,GAAc;YACvB,OAAO;YACP,EAAE,EAAE,UAAU,EAAE;YAChB,KAAK,EAAE,UAAU;SAClB,CAAC;QAEF,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KA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;max-width:100vw;position:fixed;bottom:0;right:0}.vesper-toast-wrapper{margin-top:var(--vesper-spacing-4);position:relative;overflow:visible}.vesper-toast{width:100%;padding:var(--vesper-spacing-5);box-shadow:var(--vesper-shadow-200);border:var(--vesper-stroke-base) solid var(--vesper-border-secondary);background:var(--vesper-background-primary);border-radius:var(--vesper-radius-2);transition:background-color var(--vesper-transition-duration-fast) ease, border-color var(--vesper-transition-duration-fast) ease;position:absolute;bottom:0}@media (forced-colors:active){.vesper-toast{background:canvas;border-color:canvastext}.vesper-toast:focus-visible{outline:var(--vesper-stroke-strong) solid CanvasText}}@media not (forced-colors:active){.vesper-toast:focus-visible{box-shadow:var(--vesper-shadow-focus-ring)}}.vesper-toast-entering{pointer-events:auto}.vesper-toast-active{pointer-events:auto;position:relative}.vesper-toast-dismissed{pointer-events:none}.vesper-toast-content{align-items:center;gap:var(--vesper-spacing-3);display:flex}.vesper-toast-icon{width:1rem;height:1rem;transition:color var(--vesper-transition-duration-default) ease}@media (forced-colors:active){.vesper-toast-icon{color:canvastext}}@media not (forced-colors:active){.vesper-toast-loading .vesper-toast-icon{color:var(--vesper-icon-tertiary)}}.vesper-toast-loading .vesper-toast-icon{animation:vesper-toast-icon-spin var(--vesper-transition-duration-slow) linear infinite}@keyframes vesper-toast-icon-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.vesper-toast-success{border-color:var(--vesper-border-success-subtle);background:var(--vesper-background-success-subtle)}@media not (forced-colors:active){.vesper-toast-success .vesper-toast-icon{color:var(--vesper-text-success)}}@media not (forced-colors:active){.vesper-toast-success .vesper-toast-children{color:var(--vesper-text-success)}}.vesper-toast-warning{border-color:var(--vesper-border-warning-subtle);background:var(--vesper-background-warning-subtle)}@media not (forced-colors:active){.vesper-toast-warning .vesper-toast-icon{color:var(--vesper-text-warning)}}@media not (forced-colors:active){.vesper-toast-warning .vesper-toast-children{color:var(--vesper-text-warning)}}.vesper-toast-danger{border-color:var(--vesper-border-error-subtle);background:var(--vesper-background-error-subtle)}@media not (forced-colors:active){.vesper-toast-danger .vesper-toast-icon{color:var(--vesper-text-error)}}@media not (forced-colors:active){.vesper-toast-danger .vesper-toast-children{color:var(--vesper-text-error)}}.vesper-toast-children{color:var(--vesper-text-primary);flex:1}@media (forced-colors:active){.vesper-toast-children{color:canvastext}}.vesper-toast-close-button{cursor:pointer;color:var(--vesper-icon-primary);border-radius:var(--vesper-radius-half);width:1rem;height:1rem}.vesper-toast-close-button svg{width:100%}@media (forced-colors:active){.vesper-toast-close-button{color:canvastext}.vesper-toast-close-button:focus-visible{outline:var(--vesper-stroke-strong) solid CanvasText}}@media not (forced-colors:active){.vesper-toast-close-button:focus-visible{box-shadow:var(--vesper-shadow-focus-ring)}}.vesper-toast-buttons{justify-content:flex-end;gap:var(--vesper-spacing-3);margin-top:var(--vesper-spacing-3);display:flex}.vesper-toast-announcer{opacity:0;width:0;height:0;position:absolute;overflow:hidden}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { TOAST_VARIANTS, type ToastAction, type ToastHandle, type ToastOptions, } from "./store.js";
|
|
2
|
+
export declare const addToast: (options: import("./store.js").ToastOptions) => import("./store.js").ToastHandle;
|
|
3
|
+
export type ToastsShortcut = string | {
|
|
4
|
+
key: string;
|
|
5
|
+
alt?: boolean;
|
|
6
|
+
ctrl?: boolean;
|
|
7
|
+
shift?: boolean;
|
|
8
|
+
meta?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface ToastsProps {
|
|
11
|
+
/** The accessible label for the toast region, announced by screen readers. The keyboard shortcut is automatically appended. Defaults to `"Notifications"`. */
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
/** A keyboard shortcut that moves focus to the oldest active toast. Accepts a key name string or an object specifying modifier keys. Defaults to `"F8"`. */
|
|
14
|
+
shortcut?: ToastsShortcut;
|
|
15
|
+
/** The DOM element or shadow root to portal the toast container into. Defaults to the `document.body`. */
|
|
16
|
+
container?: Element | DocumentFragment;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A toast notification container that renders and manages active toasts with keyboard navigation and screen-reader announcements.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} [props.ariaLabel] - (optional) The accessible label for the toast region. @default Notifications`
|
|
22
|
+
* @param {ToastsShortcut} [props.shortcut] - (optional) Keyboard shortcut that moves focus to the oldest active toast. @default F8`
|
|
23
|
+
* @param {Element | DocumentFragment} [props.container] - (optional) The DOM element to portal toasts into. @default document.body
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Toasts />
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Toasts shortcut={{ key: "t", ctrl: true }} ariaLabel="Alerts" />
|
|
30
|
+
*/
|
|
31
|
+
export declare function Toasts(props: ToastsProps): import("react").ReactPortal | null;
|
|
32
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast.tsx"],"names":[],"mappings":"AAqBA,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAQ,QAAQ,4EAAU,CAAC;AAkMlC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEN,MAAM,WAAW,WAAW;IAC1B,8JAA8J;IAC9J,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4JAA4J;IAC5J,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,0GAA0G;IAC1G,SAAS,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,sCAmHxC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
import { Close, ErrorSolid, Spinner, SuccessSolid, WarningSolid, } from "../icons/icons.js";
|
|
7
|
+
import { Typography } from "../typography/typography.js";
|
|
8
|
+
import { cn } from "../../utils/cn.js";
|
|
9
|
+
import { animateToastEnter, animateToastExit } from "./animations.js";
|
|
10
|
+
import { store, useStore } from "./store.js";
|
|
11
|
+
import { focusOldestToast, getNearestActiveToast, isFocusable } from "./utils.js";
|
|
12
|
+
export { TOAST_VARIANTS, } from "./store.js";
|
|
13
|
+
export const { addToast } = store;
|
|
14
|
+
function Toast({ options: { content, action, timeout = false, variant = "default", dismissText = "Dismiss", }, state, id, }) {
|
|
15
|
+
const wrapperRef = useRef(null);
|
|
16
|
+
const toastRef = useRef(null);
|
|
17
|
+
// handle updating announcement text when content changes
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (state === "dismissed" || !toastRef.current)
|
|
20
|
+
return;
|
|
21
|
+
const updateAnnouncement = () => {
|
|
22
|
+
if (!toastRef.current)
|
|
23
|
+
return;
|
|
24
|
+
const contentText = toastRef.current.querySelector(".vesper-toast-children")?.innerText;
|
|
25
|
+
const announcement = [contentText, action?.altText]
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
.join(". ");
|
|
28
|
+
store.setAnnouncement(announcement);
|
|
29
|
+
};
|
|
30
|
+
updateAnnouncement();
|
|
31
|
+
const observer = new MutationObserver(updateAnnouncement);
|
|
32
|
+
observer.observe(toastRef.current, {
|
|
33
|
+
childList: true,
|
|
34
|
+
characterData: true,
|
|
35
|
+
subtree: true,
|
|
36
|
+
});
|
|
37
|
+
return () => observer.disconnect();
|
|
38
|
+
}, [state, action]);
|
|
39
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
40
|
+
const [hasPointer, setHasPointer] = useState(false);
|
|
41
|
+
// handle timeout if present
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (timeout === false || hasFocus || hasPointer) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const t = setTimeout(() => {
|
|
47
|
+
store.dismissToast(id);
|
|
48
|
+
}, timeout);
|
|
49
|
+
return () => clearTimeout(t);
|
|
50
|
+
}, [timeout, id, hasFocus, hasPointer]);
|
|
51
|
+
// handle enter and exit animations
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
switch (state) {
|
|
54
|
+
case "entering":
|
|
55
|
+
animateToastEnter(wrapperRef.current, toastRef.current, () => store.updateToastState(id, "active"));
|
|
56
|
+
break;
|
|
57
|
+
case "dismissed":
|
|
58
|
+
animateToastExit(wrapperRef.current, toastRef.current, () => store.destroyToast(id));
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}, [state, id]);
|
|
64
|
+
// move focus to the nearest active toast if this one was dismissed while focused
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (state === "dismissed" && hasFocus && toastRef.current) {
|
|
67
|
+
const ref = toastRef.current;
|
|
68
|
+
/**
|
|
69
|
+
* requestAnimationFrame gives React a chance to flush all pending state updates
|
|
70
|
+
* (e.g., if multiple toasts were dismissed in the same batch), so by the time we
|
|
71
|
+
* query for the nearest active toast, the DOM reflects the true current state
|
|
72
|
+
* */
|
|
73
|
+
requestAnimationFrame(() => {
|
|
74
|
+
const nearestToast = getNearestActiveToast(ref);
|
|
75
|
+
if (nearestToast)
|
|
76
|
+
nearestToast.focus();
|
|
77
|
+
else
|
|
78
|
+
ref.blur();
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}, [state, hasFocus]);
|
|
82
|
+
return (_jsx("div", { ref: wrapperRef, className: "vesper-toast-wrapper", inert: state === "dismissed", onPointerEnter: () => setHasPointer(true), onPointerLeave: () => setHasPointer(false), onFocus: () => setHasFocus(true), onBlur: (e) => {
|
|
83
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
84
|
+
setHasFocus(false);
|
|
85
|
+
}
|
|
86
|
+
}, onKeyDown: (e) => {
|
|
87
|
+
if (e.key !== "Escape")
|
|
88
|
+
return;
|
|
89
|
+
store.dismissToast(id);
|
|
90
|
+
}, children: _jsxs("div", { ref: toastRef, "data-state": state, className: cn("vesper-toast", `vesper-toast-${state}`, `vesper-toast-${variant}`), tabIndex: 0, children: [_jsxs("div", { className: "vesper-toast-content", children: [variant === "loading" && (_jsx(Spinner, { "aria-hidden": true, className: "vesper-toast-icon" })), variant === "success" && (_jsx(SuccessSolid, { "aria-hidden": true, className: "vesper-toast-icon" })), variant === "warning" && (_jsx(WarningSolid, { "aria-hidden": true, className: "vesper-toast-icon" })), variant === "danger" && (_jsx(ErrorSolid, { "aria-hidden": true, className: "vesper-toast-icon" })), _jsx(Typography, { as: "span", className: "vesper-toast-children", variant: "copy-sm", children: content }), !action && (_jsx("button", { type: "button", "aria-label": dismissText, className: "vesper-toast-close-button", onClick: () => store.dismissToast(id), children: _jsx(Close, { "aria-hidden": true }) }))] }), action && (_jsxs("div", { className: "vesper-toast-buttons", children: [_jsx(Button, { size: "xs", type: "button", variant: "ghost", onClick: () => store.dismissToast(id), children: dismissText }), _jsx(Button, { size: "xs", type: "button", variant: "contrast", onClick: action.handler, children: action.content })] }))] }) }));
|
|
91
|
+
}
|
|
92
|
+
function ToastAnnouncer() {
|
|
93
|
+
const { announcement, toasts } = useStore();
|
|
94
|
+
const numToasts = toasts.length;
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (numToasts === 0)
|
|
97
|
+
store.setAnnouncement(null);
|
|
98
|
+
}, [numToasts]);
|
|
99
|
+
return (_jsx("span", { className: "vesper-toast-announcer", role: "status", "aria-atomic": false, children: announcement }));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A toast notification container that renders and manages active toasts with keyboard navigation and screen-reader announcements.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} [props.ariaLabel] - (optional) The accessible label for the toast region. @default Notifications`
|
|
105
|
+
* @param {ToastsShortcut} [props.shortcut] - (optional) Keyboard shortcut that moves focus to the oldest active toast. @default F8`
|
|
106
|
+
* @param {Element | DocumentFragment} [props.container] - (optional) The DOM element to portal toasts into. @default document.body
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* <Toasts />
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* <Toasts shortcut={{ key: "t", ctrl: true }} ariaLabel="Alerts" />
|
|
113
|
+
*/
|
|
114
|
+
export function Toasts(props) {
|
|
115
|
+
const { ariaLabel = "Notifications", shortcut = "F8", container } = props;
|
|
116
|
+
const { toasts } = useStore();
|
|
117
|
+
const ref = useRef(null);
|
|
118
|
+
const shortcutString = typeof shortcut === "string"
|
|
119
|
+
? `(${shortcut})`
|
|
120
|
+
: `(${[
|
|
121
|
+
shortcut.ctrl && "Ctrl",
|
|
122
|
+
shortcut.alt && "Alt",
|
|
123
|
+
shortcut.shift && "Shift",
|
|
124
|
+
shortcut.meta && "Cmd",
|
|
125
|
+
shortcut.key,
|
|
126
|
+
]
|
|
127
|
+
.filter(Boolean)
|
|
128
|
+
.join("+")})`;
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const handleKeydown = (e) => {
|
|
131
|
+
if (typeof shortcut === "string") {
|
|
132
|
+
if (e.key === shortcut) {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
focusOldestToast();
|
|
135
|
+
}
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (e.key === shortcut.key &&
|
|
139
|
+
!!shortcut.alt === e.altKey &&
|
|
140
|
+
!!shortcut.meta === e.metaKey &&
|
|
141
|
+
!!shortcut.ctrl === e.ctrlKey &&
|
|
142
|
+
!!shortcut.shift === e.shiftKey) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
focusOldestToast();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
window.addEventListener("keydown", handleKeydown);
|
|
148
|
+
return () => window.removeEventListener("keydown", handleKeydown);
|
|
149
|
+
}, [shortcut, toasts]);
|
|
150
|
+
const previouslyFocused = useRef(null);
|
|
151
|
+
const pointerDown = useRef(false);
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const handlePointerDown = () => (pointerDown.current = true);
|
|
154
|
+
const handlePointerUp = () => (pointerDown.current = false);
|
|
155
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
156
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
157
|
+
return () => {
|
|
158
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
159
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
160
|
+
};
|
|
161
|
+
}, []);
|
|
162
|
+
// makes rendering Toasts SSR-safe
|
|
163
|
+
const [mounted, setMounted] = useState(false);
|
|
164
|
+
useEffect(() => setMounted(true), []);
|
|
165
|
+
if (!mounted)
|
|
166
|
+
return null;
|
|
167
|
+
return createPortal(_jsxs("div", { className: "vesper-toasts-container", role: "region", "aria-label": `${ariaLabel} ${shortcutString}`, ref: ref, onFocus: (e) => {
|
|
168
|
+
if (document.body.contains(e.relatedTarget) &&
|
|
169
|
+
!ref.current?.contains(e.relatedTarget) &&
|
|
170
|
+
e.relatedTarget instanceof HTMLElement) {
|
|
171
|
+
previouslyFocused.current = e.relatedTarget;
|
|
172
|
+
}
|
|
173
|
+
}, onBlur: (e) => {
|
|
174
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
175
|
+
const elementToRestore = previouslyFocused.current;
|
|
176
|
+
previouslyFocused.current = null;
|
|
177
|
+
/**
|
|
178
|
+
* If focus is moving to a specific element outside the container
|
|
179
|
+
* (e.g., the user clicked a button), don't interfere.
|
|
180
|
+
* */
|
|
181
|
+
if (e.relatedTarget)
|
|
182
|
+
return;
|
|
183
|
+
/**
|
|
184
|
+
* If the blur was triggered by a pointer event
|
|
185
|
+
* (e.g., clicking on empty space), don't restore focus.
|
|
186
|
+
* */
|
|
187
|
+
if (pointerDown.current)
|
|
188
|
+
return;
|
|
189
|
+
/**
|
|
190
|
+
* requestAnimationFrame gives React a chance to flush all pending state updates
|
|
191
|
+
* in case the DOM structure changes and the element we want to restore focus to
|
|
192
|
+
* no longer exists in the dom or otherwise becomes not focusable.
|
|
193
|
+
*/
|
|
194
|
+
requestAnimationFrame(() => {
|
|
195
|
+
if (elementToRestore && isFocusable(elementToRestore)) {
|
|
196
|
+
elementToRestore.focus();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}, children: [_jsx(ToastAnnouncer, {}), toasts.map(({ id, options, state }) => (_jsx(Toast, { id: id, options: options, state: state }, id)))] }), container || document.body);
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,KAAK,EACL,UAAU,EACV,OAAO,EACP,YAAY,EACZ,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,KAAK,EAAkB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EA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AAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,aAED,KAAC,cAAc,KAAG,EACjB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACtC,KAAC,KAAK,IAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,IAA1C,EAAE,CAA4C,CAC3D,CAAC,IACE,EACN,SAAS,IAAI,QAAQ,CAAC,IAAI,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const focusOldestToast: () => void;
|
|
2
|
+
export declare const getNearestActiveToast: (ref: HTMLDivElement) => HTMLDivElement | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Checks where an element can be focused. An element can be focused if:
|
|
5
|
+
* - It exists in the document
|
|
6
|
+
* - Neither it nor any of its ancestors are inert or disabled
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare function isFocusable(el: HTMLElement): boolean;
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/toast/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAM5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,cAAc,+BAgBxD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAMpD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const focusOldestToast = () => {
|
|
2
|
+
document
|
|
3
|
+
.querySelector('.vesper-toast:not([data-state="dismissed"])')
|
|
4
|
+
?.focus();
|
|
5
|
+
};
|
|
6
|
+
export const getNearestActiveToast = (ref) => {
|
|
7
|
+
const toastElements = Array.from(document.querySelectorAll(".vesper-toast"));
|
|
8
|
+
const currentIndex = toastElements.indexOf(ref);
|
|
9
|
+
const prev = toastElements
|
|
10
|
+
.filter((e, i) => i < currentIndex && e.dataset.state !== "dismissed")
|
|
11
|
+
.reverse()[0];
|
|
12
|
+
const next = toastElements.filter((e, i) => i > currentIndex && e.dataset.state !== "dismissed")[0];
|
|
13
|
+
return prev || next;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Checks where an element can be focused. An element can be focused if:
|
|
17
|
+
* - It exists in the document
|
|
18
|
+
* - Neither it nor any of its ancestors are inert or disabled
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export function isFocusable(el) {
|
|
22
|
+
return (document.body.contains(el) &&
|
|
23
|
+
!el.closest("[disabled], [inert]") &&
|
|
24
|
+
el.checkVisibility());
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/toast/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,QAAQ;SACL,aAAa,CACZ,6CAA6C,CAC9C;QACD,EAAE,KAAK,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAmB,EAAE,EAAE;IAC3D,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAC9B,QAAQ,CAAC,gBAAgB,CAAiB,eAAe,CAAC,CAC3D,CAAC;IAEF,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhD,MAAM,IAAI,GAAG,aAAa;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;SACrE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAEhB,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAC/B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,KAAK,WAAW,CAC9D,CAAC,CAAC,CAAC,CAAC;IAEL,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAe;IACzC,OAAO,CACL,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,CAAC,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAClC,EAAE,CAAC,eAAe,EAAE,CACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vesper-toggle{gap:var(--vesper-spacing-1);width:fit-content;padding:var(--vesper-spacing-1);border-radius:var(--vesper-radius-2);border:var(--vesper-stroke-base) solid var(--vesper-border-secondary);background:var(--vesper-tint-inverse-400);display:inline-flex}.vesper-toggle-select{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.vesper-toggle-sm .vesper-toggle-item{height:1.5rem;padding:0 var(--vesper-spacing-3)}.vesper-toggle-sm .vesper-toggle-icon{width:1.25rem;height:1.25rem}.vesper-toggle-md .vesper-toggle-item{height:2rem;padding:0 var(--vesper-spacing-3)}.vesper-toggle-md .vesper-toggle-icon{width:1.25rem;height:1.25rem}.vesper-toggle-lg .vesper-toggle-item{height:2.5rem;padding:0 var(--vesper-spacing-4)}.vesper-toggle-lg .vesper-toggle-icon{width:1.5rem;height:1.5rem}.vesper-toggle-item{cursor:pointer;border-radius:var(--vesper-radius-1);color:var(--vesper-text-secondary);align-items:center;display:inline-flex}.vesper-toggle-item:hover{background:var(--vesper-tint-neutral-200)}.vesper-toggle-item.vesper-toggle-item-active{background:var(--vesper-tint-neutral-400);color:var(--vesper-text-primary)}@media (forced-colors:active){.vesper-toggle-item.vesper-toggle-item-active{color:canvas;forced-color-adjust:none;background:canvastext}}.vesper-toggle-disabled{pointer-events:none;border-color:var(--vesper-border-disabled);background:var(--vesper-background-disabled)}.vesper-toggle-disabled .vesper-toggle-item{color:var(--vesper-text-disabled)}.vesper-toggle-disabled .vesper-toggle-item.vesper-toggle-item-active{background:var(--vesper-background-disabled)}
|