@wonderflow/react-components 3.0.0-beta.1 → 3.0.0-beta.2
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/.changeset/README.md +8 -0
- package/.changeset/config.json +13 -0
- package/.changeset/moody-otters-leave.md +5 -0
- package/.changeset/nice-starfishes-deny.md +5 -0
- package/.changeset/pre.json +12 -0
- package/.changeset/tender-chicken-serve.md +5 -0
- package/.commitlintrc.json +3 -0
- package/.cz.json +3 -0
- package/.editorconfig +9 -0
- package/.eslintrc.json +5 -0
- package/.github/workflows/continous-integration.yml +105 -0
- package/.github/workflows/pull-request.yml +23 -0
- package/.github/workflows/release.yml +49 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/prepare-commit-msg +4 -0
- package/.releaserc.json +24 -0
- package/.storybook/main.js +36 -0
- package/.storybook/manager.js +9 -0
- package/.storybook/overrides.css +72 -0
- package/.storybook/preview.js +36 -0
- package/.storybook/wonderflow-theme.js +22 -0
- package/.stylelintrc.json +10 -0
- package/.vscode/css.code-snippets +42 -0
- package/.vscode/extensions.json +15 -0
- package/.vscode/settings.json +30 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +26 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/package.json +5 -3
- package/postcss.config.js +3 -0
- package/src/avatar/avatar.module.css +34 -0
- package/src/avatar/avatar.stories.tsx +21 -0
- package/src/avatar/avatar.tsx +58 -0
- package/src/avatar/index.ts +2 -0
- package/src/button/button.module.css +157 -0
- package/src/button/button.stories.tsx +69 -0
- package/src/button/button.tsx +140 -0
- package/src/button/index.ts +2 -0
- package/src/card/card.module.css +51 -0
- package/src/card/card.stories.tsx +62 -0
- package/src/card/card.tsx +110 -0
- package/src/card/index.ts +2 -0
- package/src/chip/chip.module.css +60 -0
- package/src/chip/chip.stories.tsx +34 -0
- package/src/chip/chip.tsx +69 -0
- package/src/chip/index.ts +2 -0
- package/src/circular-progress/circular-progress.module.css +55 -0
- package/src/circular-progress/circular-progress.stories.tsx +32 -0
- package/src/circular-progress/circular-progress.tsx +64 -0
- package/{circular-progress/index.d.ts → src/circular-progress/index.ts} +2 -2
- package/src/clamp-text/clamp-text.module.css +7 -0
- package/src/clamp-text/clamp-text.stories.tsx +30 -0
- package/src/clamp-text/clamp-text.tsx +42 -0
- package/src/clamp-text/index.ts +2 -0
- package/src/container/container.module.css +35 -0
- package/src/container/container.stories.tsx +55 -0
- package/src/container/container.tsx +38 -0
- package/src/container/index.ts +2 -0
- package/src/core/basic.css +49 -0
- package/src/core/elevations.css +56 -0
- package/src/core/elevations.stories.tsx +34 -0
- package/src/core/typography.css +117 -0
- package/src/core/typography.stories.tsx +173 -0
- package/{core → src/core}/utils/media.css +0 -0
- package/{core → src/core}/utils/vibrancy.css +0 -0
- package/src/core.css +5 -0
- package/src/disclosure/disclosure.module.css +93 -0
- package/src/disclosure/disclosure.stories.tsx +36 -0
- package/src/disclosure/disclosure.tsx +138 -0
- package/src/disclosure/index.ts +2 -0
- package/src/dropdown/dropdown.module.css +9 -0
- package/src/dropdown/dropdown.stories.tsx +108 -0
- package/src/dropdown/dropdown.tsx +145 -0
- package/src/dropdown/index.ts +4 -0
- package/src/dropdown/item/dropdown-item.module.css +63 -0
- package/src/dropdown/item/dropdown-item.tsx +132 -0
- package/src/dropdown/item-checkbox/dropdown-item-checkbox.tsx +25 -0
- package/src/dropdown/menu/dropdown-menu.module.css +13 -0
- package/src/dropdown/menu/dropdown-menu.tsx +49 -0
- package/src/elevator/elevator.stories.tsx +23 -0
- package/src/elevator/elevator.tsx +36 -0
- package/src/elevator/index.ts +2 -0
- package/src/grid/grid.module.css +20 -0
- package/src/grid/grid.stories.tsx +42 -0
- package/src/grid/grid.tsx +89 -0
- package/src/grid/index.ts +3 -0
- package/src/grid/item/grid-item.module.css +9 -0
- package/src/grid/item/grid-item.tsx +53 -0
- package/src/icon/icon.stories.tsx +18 -0
- package/src/icon/icon.tsx +51 -0
- package/src/icon/index.ts +2 -0
- package/src/icon-button/icon-button.module.css +22 -0
- package/src/icon-button/icon-button.stories.tsx +42 -0
- package/src/icon-button/icon-button.tsx +35 -0
- package/src/icon-button/index.ts +2 -0
- package/src/icons/sprites.js +54 -0
- package/src/icons/svgo.config.js +39 -0
- package/{icons → src/icons}/svgs/16/arrow-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-down-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-down-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-down-to-bracket-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-rotate-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-trend-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-trend-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-up-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/arrow-up-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/backward-step-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/ban-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/bars-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/bars-sort-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/bars-sort-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/bell-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/bookmark-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/calendar-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/calendar-plus-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/cart-shopping-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/check-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/chevron-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/chevron-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/chevron-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/chevron-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-check-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-exclamation-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-info-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-question-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/circle-x-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/clock-rotate-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/code-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/comment-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/compass-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/crown-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/earth-europa-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/envelope-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/eye-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/eye-slash-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/facebook-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/file-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/file-alt-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/file-image-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/file-pdf-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/file-xmark-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/filter-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/forward-step-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/frown-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/gear-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/github-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/graduation-cap-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/grid-2-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/grip-vertical-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/hand-pointer-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/house-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/layer-group-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/link-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/linkedin-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/lock-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/lock-open-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/magnifying-glass-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/meh-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/message-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/minus-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/moon-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/nps-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/pause-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/pc-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/play-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/plus-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/rectangle-barcode-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/right-from-bracket-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/share-from-square-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/signal-stream-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/smile-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/smile-rotate-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-alt-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-left-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sort-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/star-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/stop-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/sun-bright-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/tags-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/text-slash-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/thumbs-down-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/thumbs-up-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/thumbtack-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/triangle-exclamation-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/turn-down-right-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/twitter-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/user-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/wave-sine-16.svg +0 -0
- package/{icons → src/icons}/svgs/16/xmark-16.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-down-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-down-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-down-to-bracket-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-rotate-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-trend-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-trend-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-up-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/arrow-up-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/backward-step-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/ban-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/bars-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/bars-sort-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/bars-sort-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/bell-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/bookmark-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/calendar-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/calendar-plus-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/cart-shopping-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/check-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/chevron-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/chevron-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/chevron-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/chevron-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-check-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-exclamation-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-info-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-question-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/circle-x-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/clock-rotate-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/code-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/comment-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/compass-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/crown-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/earth-europa-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/envelope-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/eye-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/eye-slash-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/facebook-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/file-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/file-alt-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/file-image-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/file-pdf-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/file-xmark-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/filter-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/forward-step-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/frown-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/gear-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/github-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/graduation-cap-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/grid-2-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/grip-vertical-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/hand-pointer-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/house-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/layer-group-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/link-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/linkedin-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/lock-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/lock-open-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/magnifying-glass-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/meh-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/message-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/minus-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/moon-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/nps-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/pause-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/pc-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/play-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/plus-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/rectangle-barcode-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/right-from-bracket-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/share-from-square-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/signal-stream-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/smile-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/smile-rotate-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-alt-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-left-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sort-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/star-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/stop-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/sun-bright-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/tags-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/text-slash-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/thumbs-down-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/thumbs-up-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/thumbtack-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/triangle-exclamation-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/turn-down-right-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/twitter-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/user-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/wave-sine-24.svg +0 -0
- package/{icons → src/icons}/svgs/24/xmark-24.svg +0 -0
- package/src/index.ts +131 -0
- package/src/info-state/index.ts +2 -0
- package/src/info-state/info-state.module.css +80 -0
- package/src/info-state/info-state.stories.tsx +54 -0
- package/src/info-state/info-state.tsx +89 -0
- package/src/input-group/index.ts +2 -0
- package/src/input-group/input-group.module.css +33 -0
- package/src/input-group/input-group.stories.tsx +44 -0
- package/src/input-group/input-group.tsx +92 -0
- package/src/linear-progress/index.ts +2 -0
- package/src/linear-progress/linear-progress.module.css +81 -0
- package/src/linear-progress/linear-progress.stories.tsx +29 -0
- package/src/linear-progress/linear-progress.tsx +78 -0
- package/src/list/index.ts +2 -0
- package/src/list/list.module.css +55 -0
- package/src/list/list.stories.tsx +42 -0
- package/src/list/list.tsx +83 -0
- package/src/masonry/index.ts +2 -0
- package/src/masonry/masonry.module.css +14 -0
- package/src/masonry/masonry.stories.tsx +41 -0
- package/src/masonry/masonry.tsx +85 -0
- package/src/modal/content/modal-content.module.css +40 -0
- package/src/modal/content/modal-content.tsx +47 -0
- package/src/modal/index.ts +3 -0
- package/src/modal/modal-context.tsx +39 -0
- package/src/modal/modal.module.css +51 -0
- package/src/modal/modal.stories.tsx +72 -0
- package/src/modal/modal.tsx +85 -0
- package/{overlay-container/index.d.ts → src/overlay-container/index.ts} +2 -2
- package/src/overlay-container/overlay-container.tsx +42 -0
- package/src/pagination/index.ts +2 -0
- package/src/pagination/pagination.module.css +31 -0
- package/src/pagination/pagination.stories.tsx +440 -0
- package/src/pagination/pagination.tsx +74 -0
- package/src/polymorphic/index.ts +1 -0
- package/src/polymorphic/polymorphic.ts +59 -0
- package/src/prose/index.ts +2 -0
- package/src/prose/prose.module.css +23 -0
- package/src/prose/prose.stories.tsx +65 -0
- package/src/prose/prose.tsx +25 -0
- package/src/select/index.ts +2 -0
- package/src/select/select.module.css +108 -0
- package/src/select/select.stories.tsx +78 -0
- package/src/select/select.tsx +98 -0
- package/src/selection-controls/checkbox.stories.tsx +41 -0
- package/src/selection-controls/checkbox.tsx +49 -0
- package/src/selection-controls/index.ts +6 -0
- package/src/selection-controls/radio.stories.tsx +36 -0
- package/src/selection-controls/radio.tsx +42 -0
- package/src/selection-controls/selection-controls.module.css +119 -0
- package/src/selection-controls/toggle.stories.tsx +23 -0
- package/src/selection-controls/toggle.tsx +42 -0
- package/src/separator/index.ts +2 -0
- package/src/separator/separator.module.css +6 -0
- package/src/separator/separator.stories.tsx +10 -0
- package/src/separator/separator.tsx +20 -0
- package/src/skeleton-block/index.ts +2 -0
- package/src/skeleton-block/skeleton-block.stories.tsx +33 -0
- package/src/skeleton-block/skeleton-block.tsx +27 -0
- package/{slider → src/slider}/_mixins.css +0 -0
- package/src/slider/index.ts +2 -0
- package/src/slider/slider.module.css +101 -0
- package/src/slider/slider.stories.tsx +41 -0
- package/src/slider/slider.tsx +105 -0
- package/src/snackbar/index.ts +2 -0
- package/src/snackbar/snackbar.module.css +46 -0
- package/src/snackbar/snackbar.stories.tsx +28 -0
- package/src/snackbar/snackbar.tsx +89 -0
- package/src/spinner/index.ts +2 -0
- package/src/spinner/spinner.stories.tsx +21 -0
- package/src/spinner/spinner.tsx +74 -0
- package/src/split-button/index.ts +2 -0
- package/src/split-button/split-button.module.css +28 -0
- package/src/split-button/split-button.stories.tsx +48 -0
- package/src/split-button/split-button.tsx +69 -0
- package/src/stack/index.ts +2 -0
- package/src/stack/stack.module.css +27 -0
- package/src/stack/stack.stories.tsx +50 -0
- package/src/stack/stack.tsx +103 -0
- package/src/star-meter/index.ts +2 -0
- package/src/star-meter/star-meter.module.css +30 -0
- package/src/star-meter/star-meter.stories.tsx +26 -0
- package/src/star-meter/star-meter.tsx +130 -0
- package/src/tab/index.ts +2 -0
- package/src/tab/primitive-tab.tsx +88 -0
- package/src/tab/tab-item.tsx +75 -0
- package/src/tab/tab-list.tsx +33 -0
- package/src/tab/tab-panel.tsx +53 -0
- package/src/tab/tab.module.css +103 -0
- package/src/tab/tab.stories.tsx +103 -0
- package/src/tab/tab.tsx +122 -0
- package/src/tab/use-constant.ts +13 -0
- package/src/table/index.ts +2 -0
- package/src/table/table.module.css +28 -0
- package/src/table/table.stories.tsx +159 -0
- package/src/table/table.tsx +92 -0
- package/src/table/theme.ts +81 -0
- package/src/text/index.ts +2 -0
- package/src/text/text.module.css +87 -0
- package/src/text/text.stories.tsx +40 -0
- package/src/text/text.tsx +79 -0
- package/src/textfield/base-field/base-field.module.css +119 -0
- package/src/textfield/base-field/base-field.tsx +39 -0
- package/{textfield/base-field/index.d.ts → src/textfield/base-field/index.ts} +2 -2
- package/src/textfield/index.ts +2 -0
- package/src/textfield/textfield.module.css +103 -0
- package/src/textfield/textfield.stories.tsx +111 -0
- package/src/textfield/textfield.tsx +161 -0
- package/src/themes/combine.js +49 -0
- package/src/themes/dark.json +112 -0
- package/src/themes/index.js +7 -0
- package/src/themes/light.json +112 -0
- package/src/themes/themes.config.js +30 -0
- package/src/title/index.ts +2 -0
- package/src/title/title.module.css +110 -0
- package/src/title/title.stories.tsx +55 -0
- package/src/title/title.tsx +67 -0
- package/src/toggle-button/index.ts +2 -0
- package/src/toggle-button/toggle-button.module.css +51 -0
- package/src/toggle-button/toggle-button.stories.tsx +32 -0
- package/src/toggle-button/toggle-button.tsx +124 -0
- package/src/tooltip/index.ts +2 -0
- package/src/tooltip/tooltip.module.css +72 -0
- package/src/tooltip/tooltip.stories.tsx +21 -0
- package/src/tooltip/tooltip.tsx +127 -0
- package/tsconfig.eslint.json +3 -0
- package/tsconfig.json +43 -0
- package/tsconfig.nocomments.json +7 -0
- package/types/main.d.ts +22 -0
- package/types/modules.d.ts +0 -0
- package/avatar/avatar.d.ts +0 -21
- package/avatar/avatar.js +0 -8
- package/avatar/avatar.module.css +0 -1
- package/avatar/index.d.ts +0 -2
- package/avatar/index.js +0 -1
- package/button/button.d.ts +0 -56
- package/button/button.js +0 -23
- package/button/button.module.css +0 -1
- package/button/index.d.ts +0 -2
- package/button/index.js +0 -1
- package/card/card.d.ts +0 -40
- package/card/card.js +0 -13
- package/card/card.module.css +0 -1
- package/card/index.d.ts +0 -2
- package/card/index.js +0 -1
- package/chip/chip.d.ts +0 -39
- package/chip/chip.js +0 -20
- package/chip/chip.module.css +0 -1
- package/chip/index.d.ts +0 -2
- package/chip/index.js +0 -1
- package/circular-progress/circular-progress.d.ts +0 -43
- package/circular-progress/circular-progress.js +0 -13
- package/circular-progress/circular-progress.module.css +0 -1
- package/circular-progress/index.js +0 -1
- package/clamp-text/clamp-text.d.ts +0 -15
- package/clamp-text/clamp-text.js +0 -10
- package/clamp-text/clamp-text.module.css +0 -1
- package/clamp-text/index.d.ts +0 -2
- package/clamp-text/index.js +0 -1
- package/container/container.d.ts +0 -14
- package/container/container.js +0 -7
- package/container/container.module.css +0 -1
- package/container/index.d.ts +0 -2
- package/container/index.js +0 -1
- package/core/basic.css +0 -1
- package/core/elevations.css +0 -1
- package/core/typography.css +0 -1
- package/core.css +0 -1
- package/disclosure/disclosure.d.ts +0 -71
- package/disclosure/disclosure.js +0 -30
- package/disclosure/disclosure.module.css +0 -1
- package/disclosure/index.d.ts +0 -2
- package/disclosure/index.js +0 -1
- package/dropdown/dropdown.d.ts +0 -36
- package/dropdown/dropdown.js +0 -52
- package/dropdown/dropdown.module.css +0 -1
- package/dropdown/index.d.ts +0 -4
- package/dropdown/index.js +0 -1
- package/dropdown/item/dropdown-item.d.ts +0 -47
- package/dropdown/item/dropdown-item.js +0 -23
- package/dropdown/item/dropdown-item.module.css +0 -1
- package/dropdown/item-checkbox/dropdown-item-checkbox.d.ts +0 -11
- package/dropdown/item-checkbox/dropdown-item-checkbox.js +0 -5
- package/dropdown/menu/dropdown-menu.d.ts +0 -13
- package/dropdown/menu/dropdown-menu.js +0 -13
- package/dropdown/menu/dropdown-menu.module.css +0 -1
- package/elevator/elevator.d.ts +0 -18
- package/elevator/elevator.js +0 -8
- package/elevator/index.d.ts +0 -2
- package/elevator/index.js +0 -1
- package/grid/grid.d.ts +0 -48
- package/grid/grid.js +0 -19
- package/grid/grid.module.css +0 -1
- package/grid/index.d.ts +0 -3
- package/grid/index.js +0 -1
- package/grid/item/grid-item.d.ts +0 -41
- package/grid/item/grid-item.js +0 -12
- package/grid/item/grid-item.module.css +0 -1
- package/icon/icon.d.ts +0 -37
- package/icon/icon.js +0 -8
- package/icon/index.d.ts +0 -2
- package/icon/index.js +0 -1
- package/icon-button/icon-button.d.ts +0 -5
- package/icon-button/icon-button.js +0 -6
- package/icon-button/icon-button.module.css +0 -1
- package/icon-button/index.d.ts +0 -2
- package/icon-button/index.js +0 -1
- package/icons/all.svg +0 -446
- package/icons/structure.json +0 -101
- package/icons/types.d.ts +0 -201
- package/index.d.ts +0 -80
- package/index.js +0 -41
- package/info-state/index.d.ts +0 -2
- package/info-state/index.js +0 -1
- package/info-state/info-state.d.ts +0 -65
- package/info-state/info-state.js +0 -9
- package/info-state/info-state.module.css +0 -1
- package/input-group/index.d.ts +0 -2
- package/input-group/index.js +0 -1
- package/input-group/input-group.d.ts +0 -45
- package/input-group/input-group.js +0 -18
- package/input-group/input-group.module.css +0 -1
- package/linear-progress/index.d.ts +0 -2
- package/linear-progress/index.js +0 -1
- package/linear-progress/linear-progress.d.ts +0 -43
- package/linear-progress/linear-progress.js +0 -14
- package/linear-progress/linear-progress.module.css +0 -1
- package/list/index.d.ts +0 -2
- package/list/index.js +0 -1
- package/list/list.d.ts +0 -24
- package/list/list.js +0 -23
- package/list/list.module.css +0 -1
- package/masonry/index.d.ts +0 -2
- package/masonry/index.js +0 -1
- package/masonry/masonry.d.ts +0 -36
- package/masonry/masonry.js +0 -26
- package/masonry/masonry.module.css +0 -1
- package/modal/content/modal-content.d.ts +0 -25
- package/modal/content/modal-content.js +0 -11
- package/modal/content/modal-content.module.css +0 -1
- package/modal/index.d.ts +0 -3
- package/modal/index.js +0 -2
- package/modal/modal-context.d.ts +0 -9
- package/modal/modal-context.js +0 -23
- package/modal/modal.d.ts +0 -25
- package/modal/modal.js +0 -15
- package/modal/modal.module.css +0 -1
- package/overlay-container/index.js +0 -1
- package/overlay-container/overlay-container.d.ts +0 -19
- package/overlay-container/overlay-container.js +0 -13
- package/pagination/index.d.ts +0 -2
- package/pagination/index.js +0 -1
- package/pagination/pagination.d.ts +0 -34
- package/pagination/pagination.js +0 -17
- package/pagination/pagination.module.css +0 -1
- package/polymorphic/index.d.ts +0 -1
- package/polymorphic/index.js +0 -1
- package/polymorphic/polymorphic.d.ts +0 -42
- package/polymorphic/polymorphic.js +0 -1
- package/prose/index.d.ts +0 -2
- package/prose/index.js +0 -1
- package/prose/prose.d.ts +0 -5
- package/prose/prose.js +0 -7
- package/prose/prose.module.css +0 -1
- package/select/index.d.ts +0 -2
- package/select/index.js +0 -1
- package/select/select.d.ts +0 -62
- package/select/select.js +0 -16
- package/select/select.module.css +0 -1
- package/selection-controls/checkbox.d.ts +0 -41
- package/selection-controls/checkbox.js +0 -8
- package/selection-controls/index.d.ts +0 -6
- package/selection-controls/index.js +0 -3
- package/selection-controls/radio.d.ts +0 -31
- package/selection-controls/radio.js +0 -8
- package/selection-controls/selection-controls.module.css +0 -1
- package/selection-controls/toggle.d.ts +0 -31
- package/selection-controls/toggle.js +0 -8
- package/separator/index.d.ts +0 -2
- package/separator/index.js +0 -1
- package/separator/separator.d.ts +0 -3
- package/separator/separator.js +0 -8
- package/separator/separator.module.css +0 -1
- package/skeleton-block/index.d.ts +0 -2
- package/skeleton-block/index.js +0 -1
- package/skeleton-block/skeleton-block.d.ts +0 -12
- package/skeleton-block/skeleton-block.js +0 -6
- package/slider/index.d.ts +0 -2
- package/slider/index.js +0 -1
- package/slider/slider.d.ts +0 -86
- package/slider/slider.js +0 -15
- package/slider/slider.module.css +0 -1
- package/snackbar/index.d.ts +0 -2
- package/snackbar/index.js +0 -1
- package/snackbar/snackbar.d.ts +0 -41
- package/snackbar/snackbar.js +0 -15
- package/snackbar/snackbar.module.css +0 -1
- package/spinner/index.d.ts +0 -2
- package/spinner/index.js +0 -1
- package/spinner/spinner.d.ts +0 -9
- package/spinner/spinner.js +0 -23
- package/split-button/index.d.ts +0 -2
- package/split-button/index.js +0 -1
- package/split-button/split-button.d.ts +0 -10
- package/split-button/split-button.js +0 -12
- package/split-button/split-button.module.css +0 -1
- package/stack/index.d.ts +0 -2
- package/stack/index.js +0 -1
- package/stack/stack.d.ts +0 -50
- package/stack/stack.js +0 -22
- package/stack/stack.module.css +0 -1
- package/star-meter/index.d.ts +0 -2
- package/star-meter/index.js +0 -1
- package/star-meter/star-meter.d.ts +0 -32
- package/star-meter/star-meter.js +0 -44
- package/star-meter/star-meter.module.css +0 -1
- package/tab/index.d.ts +0 -2
- package/tab/index.js +0 -1
- package/tab/primitive-tab.d.ts +0 -11
- package/tab/primitive-tab.js +0 -51
- package/tab/tab-item.d.ts +0 -22
- package/tab/tab-item.js +0 -19
- package/tab/tab-list.d.ts +0 -7
- package/tab/tab-list.js +0 -7
- package/tab/tab-panel.d.ts +0 -32
- package/tab/tab-panel.js +0 -12
- package/tab/tab.d.ts +0 -34
- package/tab/tab.js +0 -29
- package/tab/tab.module.css +0 -1
- package/tab/use-constant.d.ts +0 -1
- package/tab/use-constant.js +0 -8
- package/table/index.d.ts +0 -2
- package/table/index.js +0 -1
- package/table/table.d.ts +0 -25
- package/table/table.js +0 -18
- package/table/table.module.css +0 -1
- package/table/theme.d.ts +0 -2
- package/table/theme.js +0 -77
- package/text/index.d.ts +0 -2
- package/text/index.js +0 -1
- package/text/text.d.ts +0 -40
- package/text/text.js +0 -11
- package/text/text.module.css +0 -1
- package/textfield/base-field/base-field.d.ts +0 -18
- package/textfield/base-field/base-field.js +0 -8
- package/textfield/base-field/base-field.module.css +0 -1
- package/textfield/base-field/index.js +0 -1
- package/textfield/index.d.ts +0 -2
- package/textfield/index.js +0 -1
- package/textfield/textfield.d.ts +0 -97
- package/textfield/textfield.js +0 -35
- package/textfield/textfield.module.css +0 -1
- package/themes/dark.css +0 -41
- package/themes/dark.json +0 -36
- package/themes/light.css +0 -41
- package/themes/light.json +0 -36
- package/themes.css +0 -1
- package/title/index.d.ts +0 -2
- package/title/index.js +0 -1
- package/title/title.d.ts +0 -11
- package/title/title.js +0 -12
- package/title/title.module.css +0 -1
- package/toggle-button/index.d.ts +0 -2
- package/toggle-button/index.js +0 -1
- package/toggle-button/toggle-button.d.ts +0 -10
- package/toggle-button/toggle-button.js +0 -46
- package/toggle-button/toggle-button.module.css +0 -1
- package/tooltip/index.d.ts +0 -2
- package/tooltip/index.js +0 -1
- package/tooltip/tooltip.d.ts +0 -13
- package/tooltip/tooltip.js +0 -42
- package/tooltip/tooltip.module.css +0 -1
package/tab/primitive-tab.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useState, useMemo, useContext } from 'react';
|
|
3
|
-
import useConstant from './use-constant';
|
|
4
|
-
const TabsState = createContext([]);
|
|
5
|
-
const Elements = createContext({
|
|
6
|
-
tabs: [],
|
|
7
|
-
panels: []
|
|
8
|
-
});
|
|
9
|
-
export const Tabs = ({ state: outerState, children }) => {
|
|
10
|
-
const innerState = useState(0);
|
|
11
|
-
const elements = useConstant(() => ({ tabs: [], panels: [] }));
|
|
12
|
-
const state = outerState || innerState;
|
|
13
|
-
return (_jsx(Elements.Provider, { value: elements, children: _jsx(TabsState.Provider, { value: state, children: children }, void 0) }, void 0));
|
|
14
|
-
};
|
|
15
|
-
export const useTabState = (children) => {
|
|
16
|
-
const [activeIndex, setActive] = useContext(TabsState);
|
|
17
|
-
const elements = useContext(Elements);
|
|
18
|
-
const tabIndex = useConstant(() => {
|
|
19
|
-
const currentIndex = elements.tabs.length;
|
|
20
|
-
const childrenIndex = elements.tabs.indexOf(children);
|
|
21
|
-
const isChildrenUnique = !elements.tabs.includes(children);
|
|
22
|
-
if (isChildrenUnique) {
|
|
23
|
-
elements.tabs.push(children);
|
|
24
|
-
}
|
|
25
|
-
return isChildrenUnique ? currentIndex : childrenIndex;
|
|
26
|
-
});
|
|
27
|
-
const onClick = useConstant(() => () => {
|
|
28
|
-
if (setActive) {
|
|
29
|
-
setActive(tabIndex);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const state = useMemo(() => ({
|
|
33
|
-
isActive: activeIndex === tabIndex,
|
|
34
|
-
onClick
|
|
35
|
-
}), [activeIndex, onClick, tabIndex]);
|
|
36
|
-
return state;
|
|
37
|
-
};
|
|
38
|
-
export const usePanelState = (children) => {
|
|
39
|
-
const [activeIndex] = useContext(TabsState);
|
|
40
|
-
const elements = useContext(Elements);
|
|
41
|
-
const panelIndex = useConstant(() => {
|
|
42
|
-
const currentIndex = elements.panels.length;
|
|
43
|
-
const childrenIndex = elements.panels.indexOf(children);
|
|
44
|
-
const isChildrenUnique = !elements.panels.includes(children);
|
|
45
|
-
if (isChildrenUnique) {
|
|
46
|
-
elements.panels.push(children);
|
|
47
|
-
}
|
|
48
|
-
return isChildrenUnique ? currentIndex : childrenIndex;
|
|
49
|
-
});
|
|
50
|
-
return panelIndex === activeIndex;
|
|
51
|
-
};
|
package/tab/tab-item.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import { IconNames } from '../icons/types';
|
|
3
|
-
/**
|
|
4
|
-
* Tab.Item
|
|
5
|
-
* Public api
|
|
6
|
-
*/
|
|
7
|
-
export declare type TabItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
-
/**
|
|
9
|
-
* An optional icon to show beside the tab label.
|
|
10
|
-
*/
|
|
11
|
-
icon?: IconNames;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Tab.Item
|
|
15
|
-
* Component
|
|
16
|
-
*/
|
|
17
|
-
export declare const TabItem: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
18
|
-
/**
|
|
19
|
-
* An optional icon to show beside the tab label.
|
|
20
|
-
*/
|
|
21
|
-
icon?: IconNames | undefined;
|
|
22
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
package/tab/tab-item.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useRef, forwardRef } from 'react';
|
|
3
|
-
import { useRovingTabIndex, useFocusEffect } from 'react-roving-tabindex';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { Stack, Icon } from '../';
|
|
6
|
-
import { useTabState } from './primitive-tab';
|
|
7
|
-
import { TabItem as TabItemClass } from './tab.module.css';
|
|
8
|
-
export const TabItem = forwardRef(({ children, className, icon, ...otherProps }, forwardedRef) => {
|
|
9
|
-
const { onClick, isActive } = useTabState(children);
|
|
10
|
-
const internalRef = useRef(forwardedRef);
|
|
11
|
-
const [, focused, handleKeyDown, handleClick] = useRovingTabIndex(internalRef, false);
|
|
12
|
-
useFocusEffect(focused, internalRef);
|
|
13
|
-
const fireClick = useCallback(() => {
|
|
14
|
-
onClick();
|
|
15
|
-
handleClick();
|
|
16
|
-
}, [handleClick, onClick]);
|
|
17
|
-
return (_jsxs(Stack, { as: "button", direction: "row", verticalAlign: "center", horizontalAlign: "start", fill: false, columnGap: 8, role: "tab", ref: internalRef, className: clsx(TabItemClass, className), "aria-selected": isActive, onClick: fireClick, onKeyDown: handleKeyDown, onFocus: fireClick, type: "button", tabIndex: isActive ? 0 : -1, ...otherProps, children: [icon && _jsx(Icon, { name: icon, dimension: 16 }, void 0), children] }, void 0));
|
|
18
|
-
});
|
|
19
|
-
TabItem.displayName = 'Tab.Item';
|
package/tab/tab-list.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare type TabListProps = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
/**
|
|
4
|
-
* Tab.List
|
|
5
|
-
* Component
|
|
6
|
-
*/
|
|
7
|
-
export declare const TabList: import("react").ForwardRefExoticComponent<TabListProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/tab/tab-list.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { RovingTabIndexProvider } from 'react-roving-tabindex';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { TabList as TabListClass } from './tab.module.css';
|
|
6
|
-
export const TabList = forwardRef(({ children, className, ...otherProps }, forwardedRef) => (_jsx("div", { ref: forwardedRef, role: "tablist", tabIndex: -1, className: clsx(TabListClass, className), ...otherProps, children: _jsx(RovingTabIndexProvider, { children: children }, void 0) }, void 0)));
|
|
7
|
-
TabList.displayName = 'Tab.List';
|
package/tab/tab-panel.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { IconNames } from '../icons/types';
|
|
3
|
-
/**
|
|
4
|
-
* Tab.Panel
|
|
5
|
-
* Public api
|
|
6
|
-
*/
|
|
7
|
-
export declare type TabPanelProps = PropsWithClass & {
|
|
8
|
-
/**
|
|
9
|
-
* Set the tab panel name and accessible label
|
|
10
|
-
*/
|
|
11
|
-
label: ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Add an additional icon to the tab panel label, enforcing
|
|
14
|
-
* the meaning of the name and context.
|
|
15
|
-
*/
|
|
16
|
-
icon?: IconNames;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Tab.Panel
|
|
20
|
-
* Component
|
|
21
|
-
*/
|
|
22
|
-
export declare const TabPanel: import("react").ForwardRefExoticComponent<PropsWithClass & {
|
|
23
|
-
/**
|
|
24
|
-
* Set the tab panel name and accessible label
|
|
25
|
-
*/
|
|
26
|
-
label: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* Add an additional icon to the tab panel label, enforcing
|
|
29
|
-
* the meaning of the name and context.
|
|
30
|
-
*/
|
|
31
|
-
icon?: IconNames | undefined;
|
|
32
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
package/tab/tab-panel.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { usePanelState } from './primitive-tab';
|
|
5
|
-
import { TabPanel as TabPanelClass } from './tab.module.css';
|
|
6
|
-
export const TabPanel = forwardRef(({ children, className, ...otherProps }, forwardedRef) => {
|
|
7
|
-
const isActive = usePanelState(children);
|
|
8
|
-
return isActive
|
|
9
|
-
? (_jsx("div", { ref: forwardedRef, tabIndex: 0, className: clsx(TabPanelClass, className), ...otherProps, children: children }, void 0))
|
|
10
|
-
: null;
|
|
11
|
-
});
|
|
12
|
-
TabPanel.displayName = 'Tab.Panel';
|
package/tab/tab.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { TabItem } from './tab-item';
|
|
3
|
-
import { TabListProps } from './tab-list';
|
|
4
|
-
import { TabPanelProps } from './tab-panel';
|
|
5
|
-
import { Polymorphic } from '../';
|
|
6
|
-
/**
|
|
7
|
-
* Tab.Root
|
|
8
|
-
* Public api
|
|
9
|
-
*/
|
|
10
|
-
export declare type TabProps = PropsWithClass & {
|
|
11
|
-
/**
|
|
12
|
-
* Pass the children Tab.Panel components.
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Set the index of the tab to be selected.
|
|
17
|
-
*/
|
|
18
|
-
state?: [number, React.Dispatch<React.SetStateAction<number>>];
|
|
19
|
-
/**
|
|
20
|
-
* Callback function called when the selected tab changes.
|
|
21
|
-
*/
|
|
22
|
-
onChange?(index: number): void;
|
|
23
|
-
};
|
|
24
|
-
declare type TabComponent = React.ForwardRefExoticComponent<TabProps> & {
|
|
25
|
-
Panel: React.ForwardRefExoticComponent<TabPanelProps>;
|
|
26
|
-
Item: React.ForwardRefExoticComponent<Polymorphic.OwnProps<typeof TabItem>>;
|
|
27
|
-
List: React.ForwardRefExoticComponent<TabListProps>;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Tab.Root
|
|
31
|
-
* Component
|
|
32
|
-
*/
|
|
33
|
-
export declare const Tab: TabComponent;
|
|
34
|
-
export {};
|
package/tab/tab.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState, forwardRef, Children, cloneElement } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useUIDSeed } from 'react-uid';
|
|
5
|
-
import { TabItem } from './tab-item';
|
|
6
|
-
import { TabList } from './tab-list';
|
|
7
|
-
import { TabPanel } from './tab-panel';
|
|
8
|
-
import { Tabs as TabsWrapper } from './primitive-tab';
|
|
9
|
-
import { Tab as TabClass } from './tab.module.css';
|
|
10
|
-
export const Tab = forwardRef(({ children, className, state, onChange, ...otherProps }, forwardedRef) => {
|
|
11
|
-
const renderedChildren = Children.toArray(children).filter(Boolean);
|
|
12
|
-
const innerState = useState(0);
|
|
13
|
-
const tabState = state || innerState;
|
|
14
|
-
const [currentTab] = tabState;
|
|
15
|
-
const seedID = useUIDSeed();
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (typeof onChange === 'function') {
|
|
18
|
-
onChange(currentTab);
|
|
19
|
-
}
|
|
20
|
-
}, [currentTab, onChange]);
|
|
21
|
-
return (_jsx("div", { ref: forwardedRef, className: clsx(TabClass, className), ...otherProps, children: _jsxs(TabsWrapper, { state: tabState, children: [_jsx(TabList, { children: Children.map(renderedChildren, (child, index) => (_jsx(TabItem, { id: seedID(`tab-item-${index}`), "aria-controls": seedID(`tab-panel-${index}`), icon: child.props.icon, children: child.props.label }, void 0))) }, void 0), Children.map(renderedChildren, (child, index) => cloneElement(child, {
|
|
22
|
-
id: seedID(`tab-panel-${index}`),
|
|
23
|
-
'aria-labelledby': seedID(`tab-item-${index}`)
|
|
24
|
-
}))] }, void 0) }, void 0));
|
|
25
|
-
});
|
|
26
|
-
Tab.displayName = 'Tab';
|
|
27
|
-
Tab.Panel = TabPanel;
|
|
28
|
-
Tab.Item = TabItem;
|
|
29
|
-
Tab.List = TabList;
|
package/tab/tab.module.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.Tab{display:block}.TabList{-webkit-overflow-scrolling:touch;box-shadow:inset 0 -1px 0 var(--dimmed-2);display:flex;flex-wrap:nowrap;outline:none;overflow-x:auto;overscroll-behavior-x:contain;padding:0 .44rem;scroll-snap-type:x mandatory}@media (max-width:47.999em){.TabList{-ms-overflow-style:none;scrollbar-color:#0000 #0000;scrollbar-width:none}.TabList::-webkit-scrollbar{display:none}.TabList::-webkit-scrollbar-track{background:#0000}.TabList::-webkit-scrollbar-thumb{background-color:initial;border:3px solid #0000;border-radius:6px}}.TabItem{-webkit-appearance:none;appearance:none;background-color:initial;block-size:2.67rem;border:0;color:var(--dimmed-6);flex-shrink:0;font-family:inherit;font-size:inherit;outline-offset:-4px;overflow:hidden;padding:.44rem .89rem;position:relative;white-space:nowrap}.TabItem:after{background-color:var(--cta-default);block-size:4px;border-radius:2px 2px 0 0;bottom:0;content:"";left:0;position:absolute;right:0;transform:translateY(5px);transition:transform .1s cubic-bezier(0,0,.34,1)}.TabItem[aria-selected=true]{-webkit-text-stroke:.7px currentColor;color:var(--global-foreground)}.TabItem[aria-selected=true]:after{transform:none}.TabItem:not([aria-selected=true]) svg{fill:var(--dimmed-3)}.TabItem:not([aria-selected=true]):hover{cursor:pointer}.TabPanel{animation:fade-in .2s;animation-timing-function:cubic-bezier(0,0,.34,1))}a.TabItem{background-size:0}@keyframes fade-in{0%{opacity:0;transform:translate(var(--fade-from-x,0),var(--fade-from-y,0))}to{opacity:unset;transform:none}}
|
package/tab/use-constant.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useConstant<T>(fn: () => T): T;
|
package/tab/use-constant.js
DELETED
package/table/index.d.ts
DELETED
package/table/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Table } from './table';
|
package/table/table.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { TableProps as ReactTableProps } from 'react-data-table-component';
|
|
3
|
-
import { IconNames } from '../icons/types';
|
|
4
|
-
export declare type TableProps<T> = ReactTableProps<T> & {
|
|
5
|
-
/**
|
|
6
|
-
* A react component that add additional content when the row is expanded.
|
|
7
|
-
* By passing this prop, the row will be expandable.
|
|
8
|
-
*/
|
|
9
|
-
ExpandableRowsComponent?: FC<{
|
|
10
|
-
data: T;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* Set the icon to use when the expandable rows are collapsed.
|
|
14
|
-
*/
|
|
15
|
-
collapsedRowIcon?: IconNames;
|
|
16
|
-
/**
|
|
17
|
-
* Set the icon to use when the expandable rows are expanded.
|
|
18
|
-
*/
|
|
19
|
-
expandedRowIcon?: IconNames;
|
|
20
|
-
/**
|
|
21
|
-
* Set minimum height for each row.
|
|
22
|
-
*/
|
|
23
|
-
minRowHeight?: string;
|
|
24
|
-
};
|
|
25
|
-
export declare const Table: <T>({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination, responsive, fixedHeader, noHeader, paginationPerPage, striped, theme, collapsedRowIcon, expandedRowIcon, minRowHeight, ...otherProps }: TableProps<T>) => JSX.Element;
|
package/table/table.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import ReactDataTable from 'react-data-table-component';
|
|
4
|
-
import { Icon, SkeletonBlock, Checkbox } from '..';
|
|
5
|
-
import { customStyle } from './theme';
|
|
6
|
-
import { SortIcon, ExpandWrapper, ExpandContent } from './table.module.css';
|
|
7
|
-
import clsx from 'clsx';
|
|
8
|
-
export const Table = ({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination = false, responsive = true, fixedHeader = false, noHeader = true, paginationPerPage = 8, striped = false, theme = 'default', collapsedRowIcon = 'chevron-right', expandedRowIcon = 'chevron-down', minRowHeight = '48px', ...otherProps }) => {
|
|
9
|
-
const selectProps = {
|
|
10
|
-
indeterminate: (isIndeterminate) => isIndeterminate,
|
|
11
|
-
dimension: 'small'
|
|
12
|
-
};
|
|
13
|
-
const ExpandComponent = useMemo(() => ({ data: innerData }) => (_jsx("div", { className: ExpandWrapper, children: _jsx("div", { className: ExpandContent, children: ExpandableRowsComponent ? _jsx(ExpandableRowsComponent, { data: innerData }, void 0) : null }, void 0) }, void 0)), [ExpandableRowsComponent]);
|
|
14
|
-
return (_jsx(ReactDataTable, { className: clsx(className), pagination: pagination, responsive: responsive, fixedHeader: fixedHeader, paginationPerPage: paginationPerPage, expandableRows: Boolean(ExpandableRowsComponent), expandOnRowClicked: Boolean(ExpandableRowsComponent), expandableRowsComponent: ExpandComponent, theme: theme, noHeader: noHeader, progressComponent: progressComponent || _jsx("div", { style: { width: '100%' }, children: _jsx(SkeletonBlock, { height: 40, count: 8 }, void 0) }, void 0), striped: striped, customStyles: customStyles || customStyle(minRowHeight), selectableRowsComponent: Checkbox, selectableRowsComponentProps: selectProps, expandableIcon: {
|
|
15
|
-
collapsed: _jsx(Icon, { name: collapsedRowIcon, fill: "var(--global-foreground)", dimension: 16 }, void 0),
|
|
16
|
-
expanded: _jsx(Icon, { name: expandedRowIcon, fill: "var(--global-foreground)", dimension: 16 }, void 0)
|
|
17
|
-
}, paginationIconFirstPage: _jsx(Icon, { name: "backward-step", dimension: 24 }, void 0), paginationIconPrevious: _jsx(Icon, { name: "chevron-left", dimension: 24 }, void 0), paginationIconNext: _jsx(Icon, { name: "chevron-right", dimension: 24 }, void 0), paginationIconLastPage: _jsx(Icon, { name: "forward-step", dimension: 24 }, void 0), sortIcon: (_jsx("span", { className: SortIcon, children: _jsx(Icon, { name: "arrow-up" }, void 0) }, void 0)), ...otherProps }, void 0));
|
|
18
|
-
};
|
package/table/table.module.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.SortIcon{display:block;margin-left:4px;transform:scale(.7)}.ExpandWrapper{overflow:hidden}.ExpandContent{--fade-from-y:-5px;animation:fade-in .2s;animation-timing-function:cubic-bezier(0,0,.34,1)}@keyframes fade-in{0%{opacity:0;transform:translate(var(--fade-from-x,0),var(--fade-from-y,0))}to{opacity:unset;transform:none}}
|
package/table/theme.d.ts
DELETED
package/table/theme.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
2
|
-
import { createTheme } from 'react-data-table-component';
|
|
3
|
-
createTheme('default', {
|
|
4
|
-
text: {
|
|
5
|
-
primary: 'var(--foreground-color)',
|
|
6
|
-
secondary: 'var(--dimmed-6)',
|
|
7
|
-
disabled: 'var(--global-disabled-foreground)'
|
|
8
|
-
},
|
|
9
|
-
background: {
|
|
10
|
-
default: 'transparent'
|
|
11
|
-
},
|
|
12
|
-
context: {
|
|
13
|
-
background: 'var(--global-vibrancy-background)',
|
|
14
|
-
text: 'var(--global-vibrancy-foreground)'
|
|
15
|
-
},
|
|
16
|
-
divider: {
|
|
17
|
-
default: 'transparent'
|
|
18
|
-
},
|
|
19
|
-
button: {
|
|
20
|
-
default: 'transparent',
|
|
21
|
-
focus: 'var(--dimmed-1)',
|
|
22
|
-
hover: 'transparent',
|
|
23
|
-
disabled: 'var(--global-disabled-foreground)'
|
|
24
|
-
},
|
|
25
|
-
selected: {
|
|
26
|
-
default: 'var(--highlight-blue-background)',
|
|
27
|
-
text: 'var(--highlight-blue-foreground)'
|
|
28
|
-
},
|
|
29
|
-
highlightOnHover: {
|
|
30
|
-
default: 'var(--dimmed-1)',
|
|
31
|
-
text: 'var(--global-foreground)'
|
|
32
|
-
},
|
|
33
|
-
striped: {
|
|
34
|
-
default: 'var(--dimmed-0)',
|
|
35
|
-
text: 'var(--global-foreground)'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export const customStyle = (rowHeight) => ({
|
|
39
|
-
rows: {
|
|
40
|
-
style: {
|
|
41
|
-
minHeight: rowHeight
|
|
42
|
-
},
|
|
43
|
-
highlightOnHoverStyle: {
|
|
44
|
-
outline: 'none'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
headRow: {
|
|
48
|
-
style: {
|
|
49
|
-
borderBottom: '3px solid var(--dimmed-2)'
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
headCells: {
|
|
53
|
-
style: {
|
|
54
|
-
fontWeight: 800,
|
|
55
|
-
fontSize: tkns.font.size[16]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
cells: {
|
|
59
|
-
style: {
|
|
60
|
-
fontSize: tkns.font.size[16]
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
pagination: {
|
|
64
|
-
style: {
|
|
65
|
-
fontSize: tkns.font.size[16]
|
|
66
|
-
},
|
|
67
|
-
pageButtonsStyle: {
|
|
68
|
-
color: 'var(--global-foreground)'
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
contextMenu: {
|
|
72
|
-
style: {
|
|
73
|
-
backdropFilter: 'blur(32px)',
|
|
74
|
-
borderRadius: '4px'
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
package/text/index.d.ts
DELETED
package/text/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Text } from './text';
|
package/text/text.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Polymorphic } from '../';
|
|
2
|
-
import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
|
|
3
|
-
export declare type TextProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Set the dimension of the text from one of
|
|
6
|
-
* the typography system values
|
|
7
|
-
*/
|
|
8
|
-
size?: TokensTypes['font']['size'];
|
|
9
|
-
/**
|
|
10
|
-
* Set the sentiment of the text.
|
|
11
|
-
*/
|
|
12
|
-
sentiment?: 'positive' | 'informative' | 'danger' | 'warning';
|
|
13
|
-
/**
|
|
14
|
-
* Set the dimmed color of the text. To keep readability and contrast,
|
|
15
|
-
* you can only use dimmed colors `5`, `6`, and `7`.
|
|
16
|
-
*/
|
|
17
|
-
dimmed?: 5 | 6 | 7;
|
|
18
|
-
/**
|
|
19
|
-
* Set the font weight of the text. The values are
|
|
20
|
-
* consistent with the typography system.
|
|
21
|
-
*/
|
|
22
|
-
weight?: 'thin' | 'bold';
|
|
23
|
-
/**
|
|
24
|
-
* Set the maximum width of the text after which it will wrap.
|
|
25
|
-
*/
|
|
26
|
-
maxWidth?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Set the text alignment of the text. This is a logical property
|
|
29
|
-
* based on the direction of the text.
|
|
30
|
-
*/
|
|
31
|
-
textAlign?: 'start' | 'center' | 'end';
|
|
32
|
-
/**
|
|
33
|
-
* Enable or disable the responsiveness of the text. If disabled,
|
|
34
|
-
* the text will be always the same size across all breakpoints.
|
|
35
|
-
*/
|
|
36
|
-
responsive?: boolean;
|
|
37
|
-
};
|
|
38
|
-
declare type PolymorphicText = Polymorphic.ForwardRefComponent<'p', TextProps>;
|
|
39
|
-
export declare const Text: PolymorphicText;
|
|
40
|
-
export {};
|
package/text/text.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Text as TextClass } from './text.module.css';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, style, ...otherProps }, forwardedRef) => {
|
|
6
|
-
const dynamicStyle = {
|
|
7
|
-
'--maxW': maxWidth,
|
|
8
|
-
'--tAlign': textAlign
|
|
9
|
-
};
|
|
10
|
-
return (_jsx(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-responsive": responsive, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }, void 0));
|
|
11
|
-
});
|
package/text/text.module.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.Text{font-size:var(--fs-max);line-height:1.5;max-inline-size:var(--maxW,initial);min-block-size:.01vh;text-align:var(--tAlign)}.Text[data-text-dimmed="5"]{color:var(--dimmed-5)}.Text[data-text-dimmed="6"]{color:var(--dimmed-6)}.Text[data-text-dimmed="7"]{color:var(--dimmed-7)}.Text[data-text-sentiment=positive]{color:var(--highlight-green-foreground)}.Text[data-text-sentiment=informative]{color:var(--highlight-blue-foreground)}.Text[data-text-sentiment=danger]{color:var(--highlight-red-foreground)}.Text[data-text-sentiment=warning]{color:var(--highlight-yellow-foreground)}.Text[data-text-size="14"]{font-size:.78rem;line-height:1.2}.Text[data-text-size="16"]{--fs-min:0.78rem;--fs-max:0.89rem;line-height:1.2}.Text[data-text-size="18"]{--fs-min:0.89rem;--fs-max:1.00rem}.Text[data-text-size="22"]{--fs-min:1.00rem;--fs-max:1.22rem}.Text[data-text-size="28"]{--fs-min:1.22rem;--fs-max:1.56rem}.Text[data-text-weight=thin]{font-weight:100}.Text[data-text-weight=bold]{font-weight:600}.Text[data-text-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Text[data-text-responsive=true]{font-size:var(--fs-max)}}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { Polymorphic } from '../../';
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare type PrimitiveInputType = HTMLInputElement | HTMLTextAreaElement;
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare type BaseFieldProps = InputHTMLAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLTextAreaElement> & {
|
|
11
|
-
invalid?: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
declare type PolymorphicBaseField = Polymorphic.ForwardRefComponent<'input', BaseFieldProps>;
|
|
17
|
-
export declare const BaseField: PolymorphicBaseField;
|
|
18
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { BaseField as BaseFieldClass } from './base-field.module.css';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
export const BaseField = forwardRef(({ as: Wrapper = 'input', invalid, className, ...otherProps }, forwardedRef) => {
|
|
6
|
-
return (_jsx(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(BaseFieldClass, className), ...otherProps }, void 0));
|
|
7
|
-
});
|
|
8
|
-
BaseField.displayName = 'BaseField';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.BaseField{-webkit-appearance:none;appearance:none;background-color:var(--global-background);block-size:var(--field-height);border:1px solid var(--dimmed-2);border-radius:.22rem;box-sizing:border-box;caret-color:var(--cta-default);color:inherit;display:flex;font-family:inherit;font-size:var(--font-size);inline-size:100%;line-height:1;margin:0;outline-offset:2px;overflow:hidden;padding:0 var(--field-padding);text-overflow:ellipsis}[data-textfield-has-icon=true] .BaseField::-webkit-calendar-picker-indicator{opacity:0;position:absolute;right:calc(var(--field-padding)/2)}.BaseField:-moz-ui-invalid{box-shadow:none}.BaseField::placeholder{color:var(--dimmed-5)}.BaseField.focus-visible{border-color:var(--dimmed-5)}.BaseField:focus-visible{border-color:var(--dimmed-5)}.BaseField:disabled{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));border-color:#0000;color:var(--global-disabled-foreground);cursor:not-allowed}.BaseField:disabled::placeholder{color:var(--dimmed-6)}.BaseField[readonly]{border-style:dashed;box-shadow:none;cursor:default}.BaseField:-webkit-autofill,.BaseField:-webkit-autofill:active,.BaseField:-webkit-autofill:focus,.BaseField:-webkit-autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:autofill,.BaseField:autofill:active,.BaseField:autofill:focus,.BaseField:autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range).focus-visible{border-color:var(--highlight-red-foreground)}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range):focus-visible{border-color:var(--highlight-red-foreground)}.BaseField[type=number]{-webkit-appearance:textfield;appearance:textfield}.BaseField[type=number]::-webkit-inner-spin-button,.BaseField[type=number]::-webkit-outer-spin-button{display:none}.BaseField[type=search]{-webkit-appearance:none;appearance:none}.BaseField[type=search]::-webkit-search-cancel-button,.BaseField[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}textarea.BaseField{block-size:auto;line-height:1.5;min-block-size:1.78rem;padding:calc(var(--field-padding)/2) calc(var(--field-padding) + .89rem) calc(var(--field-padding)/2) var(--field-padding);resize:vertical}textarea.BaseField::-webkit-datetime-edit-text{opacity:30%}textarea.BaseField::-webkit-calendar-picker-indicator{color:var(--global-foreground)}textarea.BaseField:-moz-ui-invalid{box-shadow:none}textarea.BaseField::-webkit-calendar-picker-indicator:hover{background-color:initial}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BaseField } from './base-field';
|
package/textfield/index.d.ts
DELETED
package/textfield/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Textfield } from './textfield';
|
package/textfield/textfield.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent } from 'react';
|
|
2
|
-
import { IconNames } from '../icons/types';
|
|
3
|
-
import { BaseFieldProps, PrimitiveInputType } from './base-field';
|
|
4
|
-
export declare type TextfieldProps = BaseFieldProps & {
|
|
5
|
-
/**
|
|
6
|
-
* Set the icon to show on the left or right side of the input.
|
|
7
|
-
*/
|
|
8
|
-
icon?: IconNames;
|
|
9
|
-
/**
|
|
10
|
-
* Set in which side of the field the icon should be displayed.
|
|
11
|
-
*/
|
|
12
|
-
iconPosition?: 'left' | 'right';
|
|
13
|
-
/**
|
|
14
|
-
* Define the accessible label of the input. While this is not
|
|
15
|
-
* mandatory, an input should always have a label. If not using this property
|
|
16
|
-
* you can bind a custom label to the input by using an id.
|
|
17
|
-
*/
|
|
18
|
-
label?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Set the input type. The value can be anything that
|
|
21
|
-
* is supported by the HTML input element.
|
|
22
|
-
*
|
|
23
|
-
* Read more: https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types
|
|
24
|
-
*/
|
|
25
|
-
type?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Set the input to be a textarea instead of a single line field.
|
|
28
|
-
* This property completely changes the rendered element from an input to a textarea.
|
|
29
|
-
*/
|
|
30
|
-
textarea?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Set the size of the field
|
|
33
|
-
*/
|
|
34
|
-
dimension?: 'regular' | 'small' | 'big';
|
|
35
|
-
/**
|
|
36
|
-
* Set the field into a readonly state. When readonly, the field value
|
|
37
|
-
* cannot be edited but it can still be selected and copied.
|
|
38
|
-
*/
|
|
39
|
-
readOnly?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Set the field into a disabled state. When disabled, the field value cannot be
|
|
42
|
-
* edited, selected or copied, but it can still be focused and navigated by AT.
|
|
43
|
-
*/
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The callback function that is called when the input value changes.
|
|
47
|
-
*/
|
|
48
|
-
onChange?: (event: ChangeEvent<PrimitiveInputType>) => void;
|
|
49
|
-
};
|
|
50
|
-
export declare const Textfield: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLTextAreaElement> & {
|
|
51
|
-
invalid?: boolean | undefined;
|
|
52
|
-
} & {
|
|
53
|
-
/**
|
|
54
|
-
* Set the icon to show on the left or right side of the input.
|
|
55
|
-
*/
|
|
56
|
-
icon?: IconNames | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Set in which side of the field the icon should be displayed.
|
|
59
|
-
*/
|
|
60
|
-
iconPosition?: "left" | "right" | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* Define the accessible label of the input. While this is not
|
|
63
|
-
* mandatory, an input should always have a label. If not using this property
|
|
64
|
-
* you can bind a custom label to the input by using an id.
|
|
65
|
-
*/
|
|
66
|
-
label?: string | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Set the input type. The value can be anything that
|
|
69
|
-
* is supported by the HTML input element.
|
|
70
|
-
*
|
|
71
|
-
* Read more: https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types
|
|
72
|
-
*/
|
|
73
|
-
type?: string | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Set the input to be a textarea instead of a single line field.
|
|
76
|
-
* This property completely changes the rendered element from an input to a textarea.
|
|
77
|
-
*/
|
|
78
|
-
textarea?: boolean | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Set the size of the field
|
|
81
|
-
*/
|
|
82
|
-
dimension?: "big" | "small" | "regular" | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Set the field into a readonly state. When readonly, the field value
|
|
85
|
-
* cannot be edited but it can still be selected and copied.
|
|
86
|
-
*/
|
|
87
|
-
readOnly?: boolean | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* Set the field into a disabled state. When disabled, the field value cannot be
|
|
90
|
-
* edited, selected or copied, but it can still be focused and navigated by AT.
|
|
91
|
-
*/
|
|
92
|
-
disabled?: boolean | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* The callback function that is called when the input value changes.
|
|
95
|
-
*/
|
|
96
|
-
onChange?: ((event: ChangeEvent<PrimitiveInputType>) => void) | undefined;
|
|
97
|
-
} & import("react").RefAttributes<PrimitiveInputType>>;
|
package/textfield/textfield.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useState } from 'react';
|
|
3
|
-
import { Text, Stack, Icon, IconButton } from '../';
|
|
4
|
-
import { BaseField } from './base-field';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import { useUIDSeed } from 'react-uid';
|
|
7
|
-
import { Textfield as TextfieldClass, FieldContainer, InputField, Icon as IconClass, IconButton as IconButtonClass } from './textfield.module.css';
|
|
8
|
-
export const Textfield = forwardRef(({ children, className, disabled = false, icon, label, textarea, readOnly, invalid, iconPosition = 'right', dimension = 'regular', type, onChange, ...otherProps }, forwardedRef) => {
|
|
9
|
-
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
10
|
-
const uid = useUIDSeed();
|
|
11
|
-
const isPassword = type === 'password';
|
|
12
|
-
const handlePasswordVisibility = useCallback(() => {
|
|
13
|
-
setPasswordVisible(visibility => !visibility);
|
|
14
|
-
}, []);
|
|
15
|
-
const iconSizes = {
|
|
16
|
-
small: 14,
|
|
17
|
-
regular: 16,
|
|
18
|
-
big: 24
|
|
19
|
-
};
|
|
20
|
-
const actionSizes = {
|
|
21
|
-
small: 'small',
|
|
22
|
-
regular: 'small',
|
|
23
|
-
big: 'big'
|
|
24
|
-
};
|
|
25
|
-
const commonProps = {
|
|
26
|
-
readOnly,
|
|
27
|
-
invalid,
|
|
28
|
-
disabled,
|
|
29
|
-
onChange
|
|
30
|
-
};
|
|
31
|
-
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(TextfieldClass, className), "data-textfield-has-icon": isPassword || Boolean(icon), "data-textfield-icon-position": iconPosition, "data-textfield-dimension": dimension, "data-textfield-invalid": invalid, "aria-disabled": disabled, horizontalAlign: "stretch", verticalAlign: "start", tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('field'), children: label }, void 0), _jsxs("div", { className: FieldContainer, children: [textarea
|
|
32
|
-
? (_jsx(BaseField, { ref: forwardedRef, as: "textarea", id: uid('field'), ...commonProps, ...otherProps }, void 0))
|
|
33
|
-
: (_jsx(BaseField, { className: InputField, id: uid('field'), ref: forwardedRef, type: passwordVisible ? 'text' : type, ...commonProps, ...otherProps }, void 0)), isPassword && (_jsx(IconButton, { className: IconButtonClass, dimension: actionSizes[dimension], onClick: handlePasswordVisibility, kind: "flat", "aria-label": "Reveal password", icon: passwordVisible ? 'eye-slash' : 'eye' }, void 0)), !textarea && icon && type !== 'password' && (_jsx(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
|
|
34
|
-
});
|
|
35
|
-
Textfield.displayName = 'Textfield';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.Textfield{-webkit-appearance:none;appearance:none;padding:0;position:relative}.Textfield[data-textfield-dimension=small]{--field-height:1.33rem;--field-padding:0.33rem;--font-size:0.78rem}.Textfield[data-textfield-dimension=regular]{--field-height:2.22rem;--field-padding:0.89rem;--font-size:0.89rem}.Textfield[data-textfield-dimension=big]{--field-height:2.67rem;--field-padding:0.89rem;--font-size:1.00rem}.FieldContainer{position:relative}.InputField{--factor:4}[data-textfield-has-icon=true][data-textfield-icon-position=right] .InputField{padding:0 calc(var(--field-padding)*var(--factor)) 0 var(--field-padding)}[data-textfield-has-icon=true][data-textfield-icon-position=left] .InputField{padding:0 var(--field-padding) 0 calc(var(--field-padding)*var(--factor))}[data-textfield-dimension*=big] .InputField,[data-textfield-dimension*=regular] .InputField{--factor:3}.Icon{border-radius:.22rem;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}[data-textfield-icon-position=left] .Icon{left:var(--field-padding);right:auto}[data-textfield-icon-position=right] .Icon{left:auto;right:var(--field-padding)}.Textfield[data-textfield-invalid=true] .Icon{fill:var(--highlight-red-foreground)}.IconButton.IconButton.IconButton{--x:19%;outline-offset:-.25em;position:absolute;top:50%;transform:translateY(-50%) translateX(var(--x))}.IconButton.IconButton.IconButton[data-button-kind=flat]:is(:hover,:active,:focus,[data-button-disabled=true]){-webkit-backdrop-filter:none;backdrop-filter:none;background-color:initial}[data-textfield-icon-position=left] .IconButton.IconButton.IconButton{--x:-19%;left:var(--field-padding);right:auto}[data-textfield-icon-position=right] .IconButton.IconButton.IconButton{left:auto;right:var(--field-padding)}.Textfield[data-textfield-invalid=true] .IconButton.IconButton.IconButton{color:var(--highlight-red-foreground)}.InputField:invalid+.Icon{fill:var(--highlight-red-foreground)}
|