cetec-design-system 0.0.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/.github/CODEOWNERS +1 -0
- package/.husky/task-runner.json +10 -0
- package/.nvmrc +1 -0
- package/.prettierrc +8 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/preview-body.html +0 -0
- package/.storybook/preview-head.tsx +1 -0
- package/.storybook/preview.tsx +21 -0
- package/LICENSE.md +21 -0
- package/README.md +50 -0
- package/eslint.config.js +50 -0
- package/index.html +13 -0
- package/package.json +69 -0
- package/panda.config.ts +201 -0
- package/postcss.config.cjs +5 -0
- package/public/sprite.svg +1 -0
- package/public/sprite.symbol.html +4091 -0
- package/public/svgs/Building.svg +1 -0
- package/public/svgs/aa-placeholder.svg +1 -0
- package/public/svgs/alarm.svg +1 -0
- package/public/svgs/apps.svg +1 -0
- package/public/svgs/arrow-down.svg +1 -0
- package/public/svgs/arrow-drop-down.svg +1 -0
- package/public/svgs/arrow-drop-up.svg +1 -0
- package/public/svgs/arrow-left.svg +1 -0
- package/public/svgs/arrow-line-down.svg +1 -0
- package/public/svgs/arrow-line-left.svg +1 -0
- package/public/svgs/arrow-line-right.svg +1 -0
- package/public/svgs/arrow-line-up.svg +1 -0
- package/public/svgs/arrow-prompt.svg +1 -0
- package/public/svgs/arrow-redo.svg +1 -0
- package/public/svgs/arrow-right.svg +1 -0
- package/public/svgs/arrow-square-in.svg +1 -0
- package/public/svgs/arrow-square-out.svg +1 -0
- package/public/svgs/arrow-undo.svg +1 -0
- package/public/svgs/arrow-up.svg +1 -0
- package/public/svgs/arrows-down-up.svg +1 -0
- package/public/svgs/arrows-left-right.svg +1 -0
- package/public/svgs/at.svg +1 -0
- package/public/svgs/attachment.svg +1 -0
- package/public/svgs/barcode-reader.svg +1 -0
- package/public/svgs/barcode.svg +1 -0
- package/public/svgs/basket.svg +1 -0
- package/public/svgs/bell-active.svg +1 -0
- package/public/svgs/bell-slash.svg +1 -0
- package/public/svgs/bell.svg +1 -0
- package/public/svgs/bin.svg +1 -0
- package/public/svgs/bookmark-outlined.svg +1 -0
- package/public/svgs/bookmark.svg +1 -0
- package/public/svgs/bookmarks.svg +1 -0
- package/public/svgs/calendar-add.svg +1 -0
- package/public/svgs/calendar-view-day.svg +1 -0
- package/public/svgs/calendar-view-month.svg +1 -0
- package/public/svgs/calendar-view-week.svg +1 -0
- package/public/svgs/calendar.svg +1 -0
- package/public/svgs/caret-down.svg +1 -0
- package/public/svgs/caret-left.svg +1 -0
- package/public/svgs/caret-right.svg +1 -0
- package/public/svgs/caret-up.svg +1 -0
- package/public/svgs/cart.svg +1 -0
- package/public/svgs/check-thick.svg +1 -0
- package/public/svgs/check.svg +1 -0
- package/public/svgs/checkbox-checked.svg +1 -0
- package/public/svgs/checkbox-focus.svg +1 -0
- package/public/svgs/checkbox-indeterminate.svg +1 -0
- package/public/svgs/checkbox.svg +1 -0
- package/public/svgs/circle-check.svg +1 -0
- package/public/svgs/circle.svg +1 -0
- package/public/svgs/circles-add.svg +1 -0
- package/public/svgs/clipboard.svg +1 -0
- package/public/svgs/clock-countdown.svg +1 -0
- package/public/svgs/clock.svg +1 -0
- package/public/svgs/cloud-synced.svg +1 -0
- package/public/svgs/code.svg +1 -0
- package/public/svgs/color.svg +1 -0
- package/public/svgs/copy.svg +1 -0
- package/public/svgs/credit-card.svg +1 -0
- package/public/svgs/cut.svg +1 -0
- package/public/svgs/database.svg +1 -0
- package/public/svgs/devices.svg +1 -0
- package/public/svgs/dictionary.svg +1 -0
- package/public/svgs/dots.svg +1 -0
- package/public/svgs/download-cloud.svg +1 -0
- package/public/svgs/download.svg +1 -0
- package/public/svgs/dragger.svg +1 -0
- package/public/svgs/edit.svg +1 -0
- package/public/svgs/encrypted.svg +1 -0
- package/public/svgs/envelope.svg +1 -0
- package/public/svgs/equal.svg +1 -0
- package/public/svgs/eraser.svg +1 -0
- package/public/svgs/error.svg +1 -0
- package/public/svgs/event-list.svg +1 -0
- package/public/svgs/export.svg +1 -0
- package/public/svgs/extension.svg +1 -0
- package/public/svgs/eye-slash.svg +1 -0
- package/public/svgs/eye.svg +1 -0
- package/public/svgs/file-add.svg +1 -0
- package/public/svgs/file.svg +1 -0
- package/public/svgs/files.svg +1 -0
- package/public/svgs/filter-remove.svg +1 -0
- package/public/svgs/filter.svg +1 -0
- package/public/svgs/finish.svg +1 -0
- package/public/svgs/flag.svg +1 -0
- package/public/svgs/forklift.svg +1 -0
- package/public/svgs/garage.svg +1 -0
- package/public/svgs/globe.svg +1 -0
- package/public/svgs/hash.svg +1 -0
- package/public/svgs/heart-outlined.svg +1 -0
- package/public/svgs/heart.svg +1 -0
- package/public/svgs/help.svg +1 -0
- package/public/svgs/history.svg +1 -0
- package/public/svgs/home.svg +1 -0
- package/public/svgs/image.svg +1 -0
- package/public/svgs/images.svg +1 -0
- package/public/svgs/inbox.svg +1 -0
- package/public/svgs/infinity.svg +1 -0
- package/public/svgs/info.svg +1 -0
- package/public/svgs/inventory.svg +1 -0
- package/public/svgs/invoice.svg +1 -0
- package/public/svgs/jump-back.svg +1 -0
- package/public/svgs/jump-forward.svg +1 -0
- package/public/svgs/kbd-backspace.svg +1 -0
- package/public/svgs/kbd-capslock.svg +1 -0
- package/public/svgs/kbd-command.svg +1 -0
- package/public/svgs/kbd-control.svg +1 -0
- package/public/svgs/kbd-hide.svg +1 -0
- package/public/svgs/kbd-option.svg +1 -0
- package/public/svgs/kbd-return.svg +1 -0
- package/public/svgs/kbd-shift.svg +1 -0
- package/public/svgs/kbd-space.svg +1 -0
- package/public/svgs/kbd.svg +1 -0
- package/public/svgs/link-slash.svg +1 -0
- package/public/svgs/link.svg +1 -0
- package/public/svgs/list-bullets.svg +1 -0
- package/public/svgs/list-checks.svg +1 -0
- package/public/svgs/list-numbers.svg +1 -0
- package/public/svgs/lock-open.svg +1 -0
- package/public/svgs/lock.svg +1 -0
- package/public/svgs/map-pin.svg +1 -0
- package/public/svgs/mark-unread.svg +1 -0
- package/public/svgs/menu-close.svg +1 -0
- package/public/svgs/menu.svg +1 -0
- package/public/svgs/message.svg +1 -0
- package/public/svgs/messages.svg +1 -0
- package/public/svgs/minus-thick.svg +1 -0
- package/public/svgs/minus.svg +1 -0
- package/public/svgs/money.svg +1 -0
- package/public/svgs/monitor.svg +1 -0
- package/public/svgs/moon.svg +1 -0
- package/public/svgs/note.svg +1 -0
- package/public/svgs/nut.svg +1 -0
- package/public/svgs/order.svg +1 -0
- package/public/svgs/package.svg +1 -0
- package/public/svgs/page-first.svg +1 -0
- package/public/svgs/page-last.svg +1 -0
- package/public/svgs/parts.svg +1 -0
- package/public/svgs/password.svg +1 -0
- package/public/svgs/pause.svg +1 -0
- package/public/svgs/pencil.svg +1 -0
- package/public/svgs/percent.svg +1 -0
- package/public/svgs/placeholder.svg +1 -0
- package/public/svgs/plan.svg +1 -0
- package/public/svgs/play-pause.svg +1 -0
- package/public/svgs/play.svg +1 -0
- package/public/svgs/plus.svg +1 -0
- package/public/svgs/printer.svg +1 -0
- package/public/svgs/prohibit.svg +1 -0
- package/public/svgs/question-mark.svg +1 -0
- package/public/svgs/quote.svg +1 -0
- package/public/svgs/radio-checked.svg +1 -0
- package/public/svgs/radio-focus.svg +1 -0
- package/public/svgs/radio.svg +1 -0
- package/public/svgs/receipt.svg +1 -0
- package/public/svgs/refresh.svg +1 -0
- package/public/svgs/repeat.svg +1 -0
- package/public/svgs/reply-all.svg +1 -0
- package/public/svgs/reply.svg +1 -0
- package/public/svgs/ribbon.svg +1 -0
- package/public/svgs/rows-add.svg +1 -0
- package/public/svgs/rules.svg +1 -0
- package/public/svgs/search-items.svg +1 -0
- package/public/svgs/search.svg +1 -0
- package/public/svgs/send.svg +1 -0
- package/public/svgs/settings.svg +1 -0
- package/public/svgs/share.svg +1 -0
- package/public/svgs/shuffle.svg +1 -0
- package/public/svgs/skip-back.svg +1 -0
- package/public/svgs/skip-forward.svg +1 -0
- package/public/svgs/skull.svg +1 -0
- package/public/svgs/sliders.svg +1 -0
- package/public/svgs/sort-alpha-down.svg +1 -0
- package/public/svgs/sort-alpha-up.svg +1 -0
- package/public/svgs/sort-ascending.svg +1 -0
- package/public/svgs/sort-descending.svg +1 -0
- package/public/svgs/sort-time-down.svg +1 -0
- package/public/svgs/sort-time-up.svg +1 -0
- package/public/svgs/square-add.svg +1 -0
- package/public/svgs/square.svg +1 -0
- package/public/svgs/stamp.svg +1 -0
- package/public/svgs/star-outlined.svg +1 -0
- package/public/svgs/star.svg +1 -0
- package/public/svgs/start.svg +1 -0
- package/public/svgs/stop.svg +1 -0
- package/public/svgs/success.svg +1 -0
- package/public/svgs/sun.svg +1 -0
- package/public/svgs/support.svg +1 -0
- package/public/svgs/sync.svg +1 -0
- package/public/svgs/tag.svg +1 -0
- package/public/svgs/target.svg +1 -0
- package/public/svgs/text-add.svg +1 -0
- package/public/svgs/time-add.svg +1 -0
- package/public/svgs/timer.svg +1 -0
- package/public/svgs/toolbox.svg +1 -0
- package/public/svgs/tools.svg +1 -0
- package/public/svgs/trash.svg +1 -0
- package/public/svgs/trophy.svg +1 -0
- package/public/svgs/truck-trailer.svg +1 -0
- package/public/svgs/update.svg +1 -0
- package/public/svgs/upload-cloud.svg +1 -0
- package/public/svgs/upload.svg +1 -0
- package/public/svgs/user-add.svg +1 -0
- package/public/svgs/user-details.svg +1 -0
- package/public/svgs/user-group.svg +1 -0
- package/public/svgs/user-id-badge.svg +1 -0
- package/public/svgs/user-id-card.svg +1 -0
- package/public/svgs/user.svg +1 -0
- package/public/svgs/verified.svg +1 -0
- package/public/svgs/video.svg +1 -0
- package/public/svgs/view-cards.svg +1 -0
- package/public/svgs/view-doc.svg +1 -0
- package/public/svgs/view-grid.svg +1 -0
- package/public/svgs/view-rows.svg +1 -0
- package/public/svgs/view-table.svg +1 -0
- package/public/svgs/warning.svg +1 -0
- package/public/svgs/work-order.svg +1 -0
- package/public/svgs/x.svg +1 -0
- package/public/vite.svg +1 -0
- package/src/App.tsx +429 -0
- package/src/components/Box/Box.tsx +26 -0
- package/src/components/Box/index.tsx +1 -0
- package/src/components/Button/Button.stories.tsx +129 -0
- package/src/components/Button/Button.tsx +45 -0
- package/src/components/Button/ButtonContent.tsx +32 -0
- package/src/components/Button/index.tsx +1 -0
- package/src/components/CheckBox/CheckBox.tsx +37 -0
- package/src/components/CheckBox/index.tsx +1 -0
- package/src/components/Code/Code.tsx +35 -0
- package/src/components/Code/Pre.tsx +35 -0
- package/src/components/Code/copy-to-clipboard-button.tsx +41 -0
- package/src/components/Code/index.tsx +2 -0
- package/src/components/Divider/Divider.tsx +26 -0
- package/src/components/Divider/index.tsx +1 -0
- package/src/components/Heading/Heading.tsx +33 -0
- package/src/components/Heading/index.tsx +1 -0
- package/src/components/Icon/Icon.stories.tsx +31 -0
- package/src/components/Icon/Icon.tsx +46 -0
- package/src/components/Icon/iconNames.ts +219 -0
- package/src/components/Icon/icons.d.ts +1 -0
- package/src/components/Icon/index.tsx +3 -0
- package/src/components/IconButton/IconButton.tsx +58 -0
- package/src/components/IconButton/index.tsx +1 -0
- package/src/components/Input/Input.tsx +42 -0
- package/src/components/Input/index.tsx +1 -0
- package/src/components/Label/Label.tsx +33 -0
- package/src/components/Label/index.tsx +1 -0
- package/src/components/Link/Link.tsx +54 -0
- package/src/components/Link/index.tsx +1 -0
- package/src/components/PandaPatterns.tsx +23 -0
- package/src/components/Radio/Radio.tsx +28 -0
- package/src/components/Radio/index.tsx +1 -0
- package/src/components/Slot.tsx +16 -0
- package/src/components/Spinner/Spinner.tsx +22 -0
- package/src/components/Spinner/index.tsx +1 -0
- package/src/components/Text/Text.stories.tsx +106 -0
- package/src/components/Text/Text.tsx +39 -0
- package/src/components/Text/index.tsx +1 -0
- package/src/components/Textarea/Textarea.tsx +46 -0
- package/src/components/Textarea/index.tsx +1 -0
- package/src/components/ThemeSwitcher/ThemeSwitcher.tsx +20 -0
- package/src/components/ThemeSwitcher/index.tsx +1 -0
- package/src/contexts/ThemeContext.tsx +77 -0
- package/src/index.ts +64 -0
- package/src/main.tsx +10 -0
- package/src/recipes/box.ts +16 -0
- package/src/recipes/button.ts +220 -0
- package/src/recipes/checkbox.ts +88 -0
- package/src/recipes/code.ts +37 -0
- package/src/recipes/divider.ts +40 -0
- package/src/recipes/index.ts +10 -0
- package/src/recipes/input.ts +56 -0
- package/src/recipes/radio.ts +71 -0
- package/src/recipes/spinner.ts +42 -0
- package/src/recipes/text.ts +185 -0
- package/src/recipes/textarea.ts +77 -0
- package/src/storybook/Tokens.mdx +169 -0
- package/src/storybook/components/Colors.tsx +78 -0
- package/src/storybook/doctemplate.mdx +36 -0
- package/src/storybook/intro.mdx +15 -0
- package/src/styles/conditions.ts +108 -0
- package/src/styles/font-imports.css +35 -0
- package/src/styles/globalStyle.ts +85 -0
- package/src/styles/index.css +3 -0
- package/src/styles/semanticTokens.ts +110 -0
- package/src/styles/tokens.ts +580 -0
- package/src/utils/forwardRefWithAs.ts +26 -0
- package/src/utils/generate-sprite.js +174 -0
- package/src/utils/splitProps.ts +11 -0
- package/src/utils/sprite-config.js +25 -0
- package/src/utils/svgsSource/Building.svg +3 -0
- package/src/utils/svgsSource/aa-placeholder.svg +3 -0
- package/src/utils/svgsSource/alarm.svg +3 -0
- package/src/utils/svgsSource/apps.svg +3 -0
- package/src/utils/svgsSource/arrow-down.svg +3 -0
- package/src/utils/svgsSource/arrow-drop-down.svg +3 -0
- package/src/utils/svgsSource/arrow-drop-up.svg +3 -0
- package/src/utils/svgsSource/arrow-left.svg +3 -0
- package/src/utils/svgsSource/arrow-line-down.svg +3 -0
- package/src/utils/svgsSource/arrow-line-left.svg +3 -0
- package/src/utils/svgsSource/arrow-line-right.svg +3 -0
- package/src/utils/svgsSource/arrow-line-up.svg +3 -0
- package/src/utils/svgsSource/arrow-prompt.svg +3 -0
- package/src/utils/svgsSource/arrow-redo.svg +3 -0
- package/src/utils/svgsSource/arrow-right.svg +3 -0
- package/src/utils/svgsSource/arrow-square-in.svg +4 -0
- package/src/utils/svgsSource/arrow-square-out.svg +4 -0
- package/src/utils/svgsSource/arrow-undo.svg +3 -0
- package/src/utils/svgsSource/arrow-up.svg +3 -0
- package/src/utils/svgsSource/arrows-down-up.svg +3 -0
- package/src/utils/svgsSource/arrows-left-right.svg +3 -0
- package/src/utils/svgsSource/at.svg +3 -0
- package/src/utils/svgsSource/attachment.svg +3 -0
- package/src/utils/svgsSource/barcode-reader.svg +3 -0
- package/src/utils/svgsSource/barcode.svg +10 -0
- package/src/utils/svgsSource/basket.svg +6 -0
- package/src/utils/svgsSource/bell-active.svg +3 -0
- package/src/utils/svgsSource/bell-slash.svg +3 -0
- package/src/utils/svgsSource/bell.svg +3 -0
- package/src/utils/svgsSource/bin.svg +3 -0
- package/src/utils/svgsSource/bookmark-outlined.svg +3 -0
- package/src/utils/svgsSource/bookmark.svg +3 -0
- package/src/utils/svgsSource/bookmarks.svg +3 -0
- package/src/utils/svgsSource/calendar-add.svg +3 -0
- package/src/utils/svgsSource/calendar-view-day.svg +3 -0
- package/src/utils/svgsSource/calendar-view-month.svg +3 -0
- package/src/utils/svgsSource/calendar-view-week.svg +3 -0
- package/src/utils/svgsSource/calendar.svg +3 -0
- package/src/utils/svgsSource/caret-down.svg +3 -0
- package/src/utils/svgsSource/caret-left.svg +3 -0
- package/src/utils/svgsSource/caret-right.svg +3 -0
- package/src/utils/svgsSource/caret-up.svg +3 -0
- package/src/utils/svgsSource/cart.svg +3 -0
- package/src/utils/svgsSource/check-thick.svg +3 -0
- package/src/utils/svgsSource/check.svg +3 -0
- package/src/utils/svgsSource/checkbox-checked.svg +3 -0
- package/src/utils/svgsSource/checkbox-focus.svg +3 -0
- package/src/utils/svgsSource/checkbox-indeterminate.svg +3 -0
- package/src/utils/svgsSource/checkbox.svg +3 -0
- package/src/utils/svgsSource/circle-check.svg +3 -0
- package/src/utils/svgsSource/circle.svg +3 -0
- package/src/utils/svgsSource/circles-add.svg +3 -0
- package/src/utils/svgsSource/clipboard.svg +3 -0
- package/src/utils/svgsSource/clock-countdown.svg +3 -0
- package/src/utils/svgsSource/clock.svg +3 -0
- package/src/utils/svgsSource/cloud-synced.svg +3 -0
- package/src/utils/svgsSource/code.svg +3 -0
- package/src/utils/svgsSource/color.svg +3 -0
- package/src/utils/svgsSource/copy.svg +4 -0
- package/src/utils/svgsSource/credit-card.svg +3 -0
- package/src/utils/svgsSource/cut.svg +3 -0
- package/src/utils/svgsSource/database.svg +3 -0
- package/src/utils/svgsSource/devices.svg +3 -0
- package/src/utils/svgsSource/dictionary.svg +3 -0
- package/src/utils/svgsSource/dots.svg +3 -0
- package/src/utils/svgsSource/download-cloud.svg +3 -0
- package/src/utils/svgsSource/download.svg +3 -0
- package/src/utils/svgsSource/dragger.svg +3 -0
- package/src/utils/svgsSource/edit.svg +3 -0
- package/src/utils/svgsSource/encrypted.svg +3 -0
- package/src/utils/svgsSource/envelope.svg +3 -0
- package/src/utils/svgsSource/equal.svg +3 -0
- package/src/utils/svgsSource/eraser.svg +3 -0
- package/src/utils/svgsSource/error.svg +3 -0
- package/src/utils/svgsSource/event-list.svg +3 -0
- package/src/utils/svgsSource/export.svg +4 -0
- package/src/utils/svgsSource/extension.svg +3 -0
- package/src/utils/svgsSource/eye-slash.svg +3 -0
- package/src/utils/svgsSource/eye.svg +3 -0
- package/src/utils/svgsSource/file-add.svg +3 -0
- package/src/utils/svgsSource/file.svg +3 -0
- package/src/utils/svgsSource/files.svg +3 -0
- package/src/utils/svgsSource/filter-remove.svg +6 -0
- package/src/utils/svgsSource/filter.svg +5 -0
- package/src/utils/svgsSource/finish.svg +3 -0
- package/src/utils/svgsSource/flag.svg +3 -0
- package/src/utils/svgsSource/forklift.svg +3 -0
- package/src/utils/svgsSource/garage.svg +3 -0
- package/src/utils/svgsSource/globe.svg +3 -0
- package/src/utils/svgsSource/hash.svg +3 -0
- package/src/utils/svgsSource/heart-outlined.svg +3 -0
- package/src/utils/svgsSource/heart.svg +3 -0
- package/src/utils/svgsSource/help.svg +3 -0
- package/src/utils/svgsSource/history.svg +3 -0
- package/src/utils/svgsSource/home.svg +3 -0
- package/src/utils/svgsSource/image.svg +3 -0
- package/src/utils/svgsSource/images.svg +3 -0
- package/src/utils/svgsSource/inbox.svg +3 -0
- package/src/utils/svgsSource/infinity.svg +3 -0
- package/src/utils/svgsSource/info.svg +3 -0
- package/src/utils/svgsSource/inventory.svg +5 -0
- package/src/utils/svgsSource/invoice.svg +4 -0
- package/src/utils/svgsSource/jump-back.svg +3 -0
- package/src/utils/svgsSource/jump-forward.svg +3 -0
- package/src/utils/svgsSource/kbd-backspace.svg +3 -0
- package/src/utils/svgsSource/kbd-capslock.svg +3 -0
- package/src/utils/svgsSource/kbd-command.svg +3 -0
- package/src/utils/svgsSource/kbd-control.svg +3 -0
- package/src/utils/svgsSource/kbd-hide.svg +3 -0
- package/src/utils/svgsSource/kbd-option.svg +3 -0
- package/src/utils/svgsSource/kbd-return.svg +3 -0
- package/src/utils/svgsSource/kbd-shift.svg +3 -0
- package/src/utils/svgsSource/kbd-space.svg +3 -0
- package/src/utils/svgsSource/kbd.svg +3 -0
- package/src/utils/svgsSource/link-slash.svg +3 -0
- package/src/utils/svgsSource/link.svg +3 -0
- package/src/utils/svgsSource/list-bullets.svg +8 -0
- package/src/utils/svgsSource/list-checks.svg +7 -0
- package/src/utils/svgsSource/list-numbers.svg +7 -0
- package/src/utils/svgsSource/lock-open.svg +3 -0
- package/src/utils/svgsSource/lock.svg +3 -0
- package/src/utils/svgsSource/map-pin.svg +3 -0
- package/src/utils/svgsSource/mark-unread.svg +3 -0
- package/src/utils/svgsSource/menu-close.svg +3 -0
- package/src/utils/svgsSource/menu.svg +3 -0
- package/src/utils/svgsSource/message.svg +3 -0
- package/src/utils/svgsSource/messages.svg +4 -0
- package/src/utils/svgsSource/minus-thick.svg +3 -0
- package/src/utils/svgsSource/minus.svg +3 -0
- package/src/utils/svgsSource/money.svg +3 -0
- package/src/utils/svgsSource/monitor.svg +3 -0
- package/src/utils/svgsSource/moon.svg +5 -0
- package/src/utils/svgsSource/note.svg +3 -0
- package/src/utils/svgsSource/nut.svg +3 -0
- package/src/utils/svgsSource/order.svg +3 -0
- package/src/utils/svgsSource/package.svg +3 -0
- package/src/utils/svgsSource/page-first.svg +3 -0
- package/src/utils/svgsSource/page-last.svg +3 -0
- package/src/utils/svgsSource/parts.svg +7 -0
- package/src/utils/svgsSource/password.svg +5 -0
- package/src/utils/svgsSource/pause.svg +3 -0
- package/src/utils/svgsSource/pencil.svg +4 -0
- package/src/utils/svgsSource/percent.svg +3 -0
- package/src/utils/svgsSource/play-pause.svg +3 -0
- package/src/utils/svgsSource/play.svg +3 -0
- package/src/utils/svgsSource/plus.svg +3 -0
- package/src/utils/svgsSource/printer.svg +3 -0
- package/src/utils/svgsSource/prohibit.svg +3 -0
- package/src/utils/svgsSource/question-mark.svg +3 -0
- package/src/utils/svgsSource/quote.svg +3 -0
- package/src/utils/svgsSource/radio-checked.svg +4 -0
- package/src/utils/svgsSource/radio-focus.svg +3 -0
- package/src/utils/svgsSource/radio.svg +3 -0
- package/src/utils/svgsSource/receipt.svg +3 -0
- package/src/utils/svgsSource/refresh.svg +3 -0
- package/src/utils/svgsSource/repeat.svg +3 -0
- package/src/utils/svgsSource/reply-all.svg +3 -0
- package/src/utils/svgsSource/reply.svg +3 -0
- package/src/utils/svgsSource/ribbon.svg +3 -0
- package/src/utils/svgsSource/rows-add.svg +5 -0
- package/src/utils/svgsSource/rules.svg +3 -0
- package/src/utils/svgsSource/search-items.svg +3 -0
- package/src/utils/svgsSource/search.svg +3 -0
- package/src/utils/svgsSource/send.svg +3 -0
- package/src/utils/svgsSource/settings.svg +3 -0
- package/src/utils/svgsSource/share.svg +4 -0
- package/src/utils/svgsSource/shuffle.svg +3 -0
- package/src/utils/svgsSource/skip-back.svg +3 -0
- package/src/utils/svgsSource/skip-forward.svg +3 -0
- package/src/utils/svgsSource/skull.svg +3 -0
- package/src/utils/svgsSource/sliders.svg +3 -0
- package/src/utils/svgsSource/sort-alpha-down.svg +5 -0
- package/src/utils/svgsSource/sort-alpha-up.svg +5 -0
- package/src/utils/svgsSource/sort-ascending.svg +6 -0
- package/src/utils/svgsSource/sort-descending.svg +6 -0
- package/src/utils/svgsSource/sort-time-down.svg +4 -0
- package/src/utils/svgsSource/sort-time-up.svg +4 -0
- package/src/utils/svgsSource/square-add.svg +3 -0
- package/src/utils/svgsSource/square.svg +3 -0
- package/src/utils/svgsSource/stamp.svg +3 -0
- package/src/utils/svgsSource/star-outlined.svg +3 -0
- package/src/utils/svgsSource/star.svg +3 -0
- package/src/utils/svgsSource/start.svg +3 -0
- package/src/utils/svgsSource/stop.svg +3 -0
- package/src/utils/svgsSource/success.svg +3 -0
- package/src/utils/svgsSource/sun.svg +3 -0
- package/src/utils/svgsSource/support.svg +3 -0
- package/src/utils/svgsSource/sync.svg +4 -0
- package/src/utils/svgsSource/tag.svg +3 -0
- package/src/utils/svgsSource/target.svg +3 -0
- package/src/utils/svgsSource/text-add.svg +3 -0
- package/src/utils/svgsSource/time-add.svg +3 -0
- package/src/utils/svgsSource/timer.svg +3 -0
- package/src/utils/svgsSource/toolbox.svg +3 -0
- package/src/utils/svgsSource/tools.svg +3 -0
- package/src/utils/svgsSource/trash.svg +3 -0
- package/src/utils/svgsSource/trophy.svg +3 -0
- package/src/utils/svgsSource/truck-trailer.svg +3 -0
- package/src/utils/svgsSource/update.svg +3 -0
- package/src/utils/svgsSource/upload-cloud.svg +3 -0
- package/src/utils/svgsSource/upload.svg +3 -0
- package/src/utils/svgsSource/user-add.svg +3 -0
- package/src/utils/svgsSource/user-details.svg +7 -0
- package/src/utils/svgsSource/user-group.svg +3 -0
- package/src/utils/svgsSource/user-id-badge.svg +3 -0
- package/src/utils/svgsSource/user-id-card.svg +3 -0
- package/src/utils/svgsSource/user.svg +3 -0
- package/src/utils/svgsSource/verified.svg +3 -0
- package/src/utils/svgsSource/video.svg +3 -0
- package/src/utils/svgsSource/view-cards.svg +6 -0
- package/src/utils/svgsSource/view-doc.svg +7 -0
- package/src/utils/svgsSource/view-grid.svg +3 -0
- package/src/utils/svgsSource/view-rows.svg +4 -0
- package/src/utils/svgsSource/view-table.svg +3 -0
- package/src/utils/svgsSource/warning.svg +3 -0
- package/src/utils/svgsSource/work-order.svg +3 -0
- package/src/utils/svgsSource/x.svg +3 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +39 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Box, type BoxProps } from "../Box";
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Label } from "../Label";
|
|
4
|
+
import { checkbox, type CheckboxVariantProps } from "@styled-system/recipes";
|
|
5
|
+
import { Icon } from "../Icon";
|
|
6
|
+
|
|
7
|
+
export type CheckBoxProps = Omit<BoxProps, keyof CheckboxVariantProps > & CheckboxVariantProps &
|
|
8
|
+
{
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
children?: Omit<ReactNode, keyof HTMLInputElement> | string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const CheckBox: React.FC<CheckBoxProps> = (
|
|
15
|
+
{
|
|
16
|
+
error = false,
|
|
17
|
+
indeterminate = false,
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}: CheckBoxProps,
|
|
21
|
+
) => {
|
|
22
|
+
const { container, input, indicator } = checkbox({});
|
|
23
|
+
return (
|
|
24
|
+
<Label className={container}>
|
|
25
|
+
<Box
|
|
26
|
+
as="input"
|
|
27
|
+
type="checkbox"
|
|
28
|
+
className={input}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
<Icon className={indicator} name={'checkbox'} />
|
|
32
|
+
<Icon className={indicator} name={'checkbox-checked'} />
|
|
33
|
+
<Icon className={indicator} name={'checkbox-indeterminate'} />
|
|
34
|
+
{children}
|
|
35
|
+
</Label>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckBox } from "./CheckBox";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
2
|
+
import { Text, type TextProps } from '~/components/Text';
|
|
3
|
+
import { code, type CodeVariantProps } from '@styled-system/recipes';
|
|
4
|
+
import { cx } from '@styled-system/css';
|
|
5
|
+
import { splitProps } from '~/utils/splitProps';
|
|
6
|
+
|
|
7
|
+
export type CodeProps = Omit<BoxProps, keyof CodeVariantProps | keyof TextProps> & CodeVariantProps & TextProps & {
|
|
8
|
+
children?: string | React.ReactNode;
|
|
9
|
+
lang?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Code: React.FC<CodeProps> = (
|
|
13
|
+
{
|
|
14
|
+
lang,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}: CodeProps,
|
|
18
|
+
) => {
|
|
19
|
+
const [className, otherProps] = splitProps(props);
|
|
20
|
+
return (
|
|
21
|
+
<Box
|
|
22
|
+
as="code"
|
|
23
|
+
className={cx(
|
|
24
|
+
code({}),
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
lang={lang}
|
|
28
|
+
{...otherProps}
|
|
29
|
+
>
|
|
30
|
+
<Text color="slate.0">
|
|
31
|
+
{children}
|
|
32
|
+
</Text>
|
|
33
|
+
</Box>
|
|
34
|
+
)
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
2
|
+
import { Code } from './Code';
|
|
3
|
+
import { splitProps } from '~/utils/splitProps';
|
|
4
|
+
import { cx } from '@styled-system/css';
|
|
5
|
+
import { pre } from '@styled-system/recipes';
|
|
6
|
+
|
|
7
|
+
export type PreProps = BoxProps & {
|
|
8
|
+
children: string | React.ReactNode;
|
|
9
|
+
lang?: string;
|
|
10
|
+
as?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Pre: React.FC<PreProps> = (
|
|
14
|
+
{
|
|
15
|
+
children,
|
|
16
|
+
lang,
|
|
17
|
+
...props
|
|
18
|
+
}: PreProps,
|
|
19
|
+
) => {
|
|
20
|
+
const [className, otherProps] = splitProps(props);
|
|
21
|
+
return (
|
|
22
|
+
<Box
|
|
23
|
+
as="pre"
|
|
24
|
+
className={cx(
|
|
25
|
+
pre({}),
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...otherProps}
|
|
29
|
+
>
|
|
30
|
+
<Code lang={lang} slot="react" bg="transparent" {...otherProps}>
|
|
31
|
+
{children}
|
|
32
|
+
</Code>
|
|
33
|
+
</Box>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useCopyToClipboard } from '@uidotdev/usehooks'
|
|
2
|
+
import { CheckIcon, CopyIcon } from 'lucide-react'
|
|
3
|
+
import { useEffect, useState } from 'react'
|
|
4
|
+
import { IconButton } from '~/components/ui'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
content: string
|
|
8
|
+
dark?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CopyToClipboardButton = (props: Props) => {
|
|
12
|
+
const { content, dark } = props
|
|
13
|
+
const [_, copyToClipboard] = useCopyToClipboard()
|
|
14
|
+
const [visible, setVisible] = useState(true)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (visible) return
|
|
18
|
+
const timer = setTimeout(() => setVisible(true), 1000)
|
|
19
|
+
return () => clearTimeout(timer)
|
|
20
|
+
}, [visible])
|
|
21
|
+
|
|
22
|
+
const handleClick = () => {
|
|
23
|
+
copyToClipboard(content)
|
|
24
|
+
setVisible(false)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const styles = dark ? { color: 'gray.dark.12', _hover: { bg: 'gray.dark.a3' } } : {}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<IconButton
|
|
31
|
+
variant="ghost"
|
|
32
|
+
size="sm"
|
|
33
|
+
aria-label="Copy code to clipboard"
|
|
34
|
+
display={{ base: 'none', lg: 'inline-flex' }}
|
|
35
|
+
onClick={handleClick}
|
|
36
|
+
{...styles}
|
|
37
|
+
>
|
|
38
|
+
{visible ? <CopyIcon /> : <CheckIcon />}
|
|
39
|
+
</IconButton>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Box, type BoxProps } from '../Box/Box';
|
|
2
|
+
import { divider, type DividerVariantProps } from '@styled-system/recipes';
|
|
3
|
+
|
|
4
|
+
import { cx } from '@styled-system/css';
|
|
5
|
+
import { splitProps } from '~/utils/splitProps';
|
|
6
|
+
|
|
7
|
+
export type DividerProps = Omit<BoxProps, keyof DividerVariantProps> &
|
|
8
|
+
DividerVariantProps & {
|
|
9
|
+
direction?: string;
|
|
10
|
+
weight?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Divider: React.FC<DividerProps> = ({
|
|
14
|
+
direction,
|
|
15
|
+
weight,
|
|
16
|
+
...props
|
|
17
|
+
}: DividerProps) => {
|
|
18
|
+
const [className, otherProps] = splitProps(props);
|
|
19
|
+
return (
|
|
20
|
+
<Box
|
|
21
|
+
as="div"
|
|
22
|
+
className={cx(divider({ direction, weight }), className)}
|
|
23
|
+
{...otherProps}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider, type DividerProps } from './Divider';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Text, type TextProps } from '~/components/Text';
|
|
2
|
+
import { heading, type HeadingVariantProps } from '@styled-system/recipes';
|
|
3
|
+
import { cx } from '@styled-system/css';
|
|
4
|
+
import { splitProps } from '~/utils/splitProps';
|
|
5
|
+
|
|
6
|
+
export type HeadingProps = Omit<TextProps, keyof HeadingVariantProps> & HeadingVariantProps & {
|
|
7
|
+
children?: string | React.ReactNode;
|
|
8
|
+
level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Heading: React.FC<HeadingProps> = (
|
|
12
|
+
{
|
|
13
|
+
level='h2',
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}: HeadingProps,
|
|
17
|
+
) => {
|
|
18
|
+
|
|
19
|
+
const [ className, otherProps ] = splitProps(props);
|
|
20
|
+
return (
|
|
21
|
+
<Text
|
|
22
|
+
as={level}
|
|
23
|
+
className={cx(
|
|
24
|
+
heading({ level }),
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
{...otherProps}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Text>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Heading, type HeadingProps } from './Heading';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Icon, IconNames } from ".";
|
|
4
|
+
import { IconGallery, IconItem } from "@storybook/blocks";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Icon",
|
|
8
|
+
component: Icon,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
} satisfies Meta<typeof Icon>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
name: "add", // or any default icon name
|
|
21
|
+
},
|
|
22
|
+
render: () => (
|
|
23
|
+
<IconGallery>
|
|
24
|
+
{Object.entries(IconNames).map(([key, name]) => (
|
|
25
|
+
<IconItem key={key} name={name}>
|
|
26
|
+
<Icon name={name} />
|
|
27
|
+
</IconItem>
|
|
28
|
+
))}
|
|
29
|
+
</IconGallery>
|
|
30
|
+
),
|
|
31
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SVGAttributes } from 'react';
|
|
2
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
3
|
+
import { cx } from '@styled-system/css';
|
|
4
|
+
import { IconNamesList } from './icons';
|
|
5
|
+
import { icon } from '@styled-system/patterns';
|
|
6
|
+
import { numericSizes } from '~/styles/tokens';
|
|
7
|
+
import { splitProps } from '~/utils/splitProps';
|
|
8
|
+
import { ConditionalValue } from '@styled-system/types';
|
|
9
|
+
import { WithEscapeHatch } from '@styled-system/types/prop-type';
|
|
10
|
+
import { ColorToken } from '@styled-system/tokens';
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Using the size prop in this way cannot handle non-numeric sizes,
|
|
14
|
+
* so importing this list of keys directly from the tokens to ensure
|
|
15
|
+
* that only valid sizes are allowed.
|
|
16
|
+
*/
|
|
17
|
+
export type AllowedIconSizes = keyof typeof numericSizes;
|
|
18
|
+
|
|
19
|
+
export type IconProps = Omit<BoxProps, 'size'> &
|
|
20
|
+
SVGAttributes<SVGElement> & {
|
|
21
|
+
name: IconNamesList;
|
|
22
|
+
size?: AllowedIconSizes;
|
|
23
|
+
fill?: ConditionalValue<WithEscapeHatch<ColorToken | `var(--${string})`>>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Icon: React.FC<IconProps> = ({
|
|
27
|
+
name,
|
|
28
|
+
size = '24',
|
|
29
|
+
fill = 'current',
|
|
30
|
+
...props
|
|
31
|
+
}: IconProps) => {
|
|
32
|
+
const [className, otherProps] = splitProps(props);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Box
|
|
36
|
+
as="svg"
|
|
37
|
+
name={name}
|
|
38
|
+
viewBox="0 0 24 24"
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
className={cx(icon({ size: size, fill }), className)}
|
|
41
|
+
{...otherProps}
|
|
42
|
+
>
|
|
43
|
+
<use xlinkHref={`/sprite.svg#${name}`} />
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
export const IconNames = {
|
|
2
|
+
'aa-placeholder': 'aa-placeholder',
|
|
3
|
+
'alarm': 'alarm',
|
|
4
|
+
'apps': 'apps',
|
|
5
|
+
'arrow-down': 'arrow-down',
|
|
6
|
+
'arrow-drop-down': 'arrow-drop-down',
|
|
7
|
+
'arrow-drop-up': 'arrow-drop-up',
|
|
8
|
+
'arrow-left': 'arrow-left',
|
|
9
|
+
'arrow-line-down': 'arrow-line-down',
|
|
10
|
+
'arrow-line-left': 'arrow-line-left',
|
|
11
|
+
'arrow-line-right': 'arrow-line-right',
|
|
12
|
+
'arrow-line-up': 'arrow-line-up',
|
|
13
|
+
'arrow-prompt': 'arrow-prompt',
|
|
14
|
+
'arrow-redo': 'arrow-redo',
|
|
15
|
+
'arrow-right': 'arrow-right',
|
|
16
|
+
'arrow-square-in': 'arrow-square-in',
|
|
17
|
+
'arrow-square-out': 'arrow-square-out',
|
|
18
|
+
'arrow-undo': 'arrow-undo',
|
|
19
|
+
'arrow-up': 'arrow-up',
|
|
20
|
+
'arrows-down-up': 'arrows-down-up',
|
|
21
|
+
'arrows-left-right': 'arrows-left-right',
|
|
22
|
+
'at': 'at',
|
|
23
|
+
'attachment': 'attachment',
|
|
24
|
+
'barcode-reader': 'barcode-reader',
|
|
25
|
+
'barcode': 'barcode',
|
|
26
|
+
'basket': 'basket',
|
|
27
|
+
'bell-active': 'bell-active',
|
|
28
|
+
'bell-slash': 'bell-slash',
|
|
29
|
+
'bell': 'bell',
|
|
30
|
+
'bin': 'bin',
|
|
31
|
+
'bookmark-outlined': 'bookmark-outlined',
|
|
32
|
+
'bookmark': 'bookmark',
|
|
33
|
+
'bookmarks': 'bookmarks',
|
|
34
|
+
'Building': 'Building',
|
|
35
|
+
'calendar-add': 'calendar-add',
|
|
36
|
+
'calendar-view-day': 'calendar-view-day',
|
|
37
|
+
'calendar-view-month': 'calendar-view-month',
|
|
38
|
+
'calendar-view-week': 'calendar-view-week',
|
|
39
|
+
'calendar': 'calendar',
|
|
40
|
+
'caret-down': 'caret-down',
|
|
41
|
+
'caret-left': 'caret-left',
|
|
42
|
+
'caret-right': 'caret-right',
|
|
43
|
+
'caret-up': 'caret-up',
|
|
44
|
+
'cart': 'cart',
|
|
45
|
+
'check-thick': 'check-thick',
|
|
46
|
+
'check': 'check',
|
|
47
|
+
'checkbox-checked': 'checkbox-checked',
|
|
48
|
+
'checkbox-focus': 'checkbox-focus',
|
|
49
|
+
'checkbox-indeterminate': 'checkbox-indeterminate',
|
|
50
|
+
'checkbox': 'checkbox',
|
|
51
|
+
'circle-check': 'circle-check',
|
|
52
|
+
'circle': 'circle',
|
|
53
|
+
'circles-add': 'circles-add',
|
|
54
|
+
'clipboard': 'clipboard',
|
|
55
|
+
'clock-countdown': 'clock-countdown',
|
|
56
|
+
'clock': 'clock',
|
|
57
|
+
'cloud-synced': 'cloud-synced',
|
|
58
|
+
'code': 'code',
|
|
59
|
+
'color': 'color',
|
|
60
|
+
'copy': 'copy',
|
|
61
|
+
'credit-card': 'credit-card',
|
|
62
|
+
'cut': 'cut',
|
|
63
|
+
'database': 'database',
|
|
64
|
+
'devices': 'devices',
|
|
65
|
+
'dictionary': 'dictionary',
|
|
66
|
+
'dots': 'dots',
|
|
67
|
+
'download-cloud': 'download-cloud',
|
|
68
|
+
'download': 'download',
|
|
69
|
+
'dragger': 'dragger',
|
|
70
|
+
'edit': 'edit',
|
|
71
|
+
'encrypted': 'encrypted',
|
|
72
|
+
'envelope': 'envelope',
|
|
73
|
+
'equal': 'equal',
|
|
74
|
+
'eraser': 'eraser',
|
|
75
|
+
'error': 'error',
|
|
76
|
+
'event-list': 'event-list',
|
|
77
|
+
'export': 'export',
|
|
78
|
+
'extension': 'extension',
|
|
79
|
+
'eye-slash': 'eye-slash',
|
|
80
|
+
'eye': 'eye',
|
|
81
|
+
'file-add': 'file-add',
|
|
82
|
+
'file': 'file',
|
|
83
|
+
'files': 'files',
|
|
84
|
+
'filter-remove': 'filter-remove',
|
|
85
|
+
'filter': 'filter',
|
|
86
|
+
'finish': 'finish',
|
|
87
|
+
'flag': 'flag',
|
|
88
|
+
'forklift': 'forklift',
|
|
89
|
+
'garage': 'garage',
|
|
90
|
+
'globe': 'globe',
|
|
91
|
+
'hash': 'hash',
|
|
92
|
+
'heart-outlined': 'heart-outlined',
|
|
93
|
+
'heart': 'heart',
|
|
94
|
+
'help': 'help',
|
|
95
|
+
'history': 'history',
|
|
96
|
+
'home': 'home',
|
|
97
|
+
'image': 'image',
|
|
98
|
+
'images': 'images',
|
|
99
|
+
'inbox': 'inbox',
|
|
100
|
+
'infinity': 'infinity',
|
|
101
|
+
'info': 'info',
|
|
102
|
+
'inventory': 'inventory',
|
|
103
|
+
'invoice': 'invoice',
|
|
104
|
+
'jump-back': 'jump-back',
|
|
105
|
+
'jump-forward': 'jump-forward',
|
|
106
|
+
'kbd-backspace': 'kbd-backspace',
|
|
107
|
+
'kbd-capslock': 'kbd-capslock',
|
|
108
|
+
'kbd-command': 'kbd-command',
|
|
109
|
+
'kbd-control': 'kbd-control',
|
|
110
|
+
'kbd-hide': 'kbd-hide',
|
|
111
|
+
'kbd-option': 'kbd-option',
|
|
112
|
+
'kbd-return': 'kbd-return',
|
|
113
|
+
'kbd-shift': 'kbd-shift',
|
|
114
|
+
'kbd-space': 'kbd-space',
|
|
115
|
+
'kbd': 'kbd',
|
|
116
|
+
'link-slash': 'link-slash',
|
|
117
|
+
'link': 'link',
|
|
118
|
+
'list-bullets': 'list-bullets',
|
|
119
|
+
'list-checks': 'list-checks',
|
|
120
|
+
'list-numbers': 'list-numbers',
|
|
121
|
+
'lock-open': 'lock-open',
|
|
122
|
+
'lock': 'lock',
|
|
123
|
+
'map-pin': 'map-pin',
|
|
124
|
+
'mark-unread': 'mark-unread',
|
|
125
|
+
'menu-close': 'menu-close',
|
|
126
|
+
'menu': 'menu',
|
|
127
|
+
'message': 'message',
|
|
128
|
+
'messages': 'messages',
|
|
129
|
+
'minus-thick': 'minus-thick',
|
|
130
|
+
'minus': 'minus',
|
|
131
|
+
'money': 'money',
|
|
132
|
+
'monitor': 'monitor',
|
|
133
|
+
'moon': 'moon',
|
|
134
|
+
'note': 'note',
|
|
135
|
+
'nut': 'nut',
|
|
136
|
+
'order': 'order',
|
|
137
|
+
'package': 'package',
|
|
138
|
+
'page-first': 'page-first',
|
|
139
|
+
'page-last': 'page-last',
|
|
140
|
+
'parts': 'parts',
|
|
141
|
+
'password': 'password',
|
|
142
|
+
'pause': 'pause',
|
|
143
|
+
'pencil': 'pencil',
|
|
144
|
+
'percent': 'percent',
|
|
145
|
+
'play-pause': 'play-pause',
|
|
146
|
+
'play': 'play',
|
|
147
|
+
'plus': 'plus',
|
|
148
|
+
'printer': 'printer',
|
|
149
|
+
'prohibit': 'prohibit',
|
|
150
|
+
'question-mark': 'question-mark',
|
|
151
|
+
'quote': 'quote',
|
|
152
|
+
'radio-checked': 'radio-checked',
|
|
153
|
+
'radio-focus': 'radio-focus',
|
|
154
|
+
'radio': 'radio',
|
|
155
|
+
'receipt': 'receipt',
|
|
156
|
+
'refresh': 'refresh',
|
|
157
|
+
'repeat': 'repeat',
|
|
158
|
+
'reply-all': 'reply-all',
|
|
159
|
+
'reply': 'reply',
|
|
160
|
+
'ribbon': 'ribbon',
|
|
161
|
+
'rows-add': 'rows-add',
|
|
162
|
+
'rules': 'rules',
|
|
163
|
+
'search-items': 'search-items',
|
|
164
|
+
'search': 'search',
|
|
165
|
+
'send': 'send',
|
|
166
|
+
'settings': 'settings',
|
|
167
|
+
'share': 'share',
|
|
168
|
+
'shuffle': 'shuffle',
|
|
169
|
+
'skip-back': 'skip-back',
|
|
170
|
+
'skip-forward': 'skip-forward',
|
|
171
|
+
'skull': 'skull',
|
|
172
|
+
'sliders': 'sliders',
|
|
173
|
+
'sort-alpha-down': 'sort-alpha-down',
|
|
174
|
+
'sort-alpha-up': 'sort-alpha-up',
|
|
175
|
+
'sort-ascending': 'sort-ascending',
|
|
176
|
+
'sort-descending': 'sort-descending',
|
|
177
|
+
'sort-time-down': 'sort-time-down',
|
|
178
|
+
'sort-time-up': 'sort-time-up',
|
|
179
|
+
'square-add': 'square-add',
|
|
180
|
+
'square': 'square',
|
|
181
|
+
'stamp': 'stamp',
|
|
182
|
+
'star-outlined': 'star-outlined',
|
|
183
|
+
'star': 'star',
|
|
184
|
+
'start': 'start',
|
|
185
|
+
'stop': 'stop',
|
|
186
|
+
'success': 'success',
|
|
187
|
+
'sun': 'sun',
|
|
188
|
+
'support': 'support',
|
|
189
|
+
'sync': 'sync',
|
|
190
|
+
'tag': 'tag',
|
|
191
|
+
'target': 'target',
|
|
192
|
+
'text-add': 'text-add',
|
|
193
|
+
'time-add': 'time-add',
|
|
194
|
+
'timer': 'timer',
|
|
195
|
+
'toolbox': 'toolbox',
|
|
196
|
+
'tools': 'tools',
|
|
197
|
+
'trash': 'trash',
|
|
198
|
+
'trophy': 'trophy',
|
|
199
|
+
'truck-trailer': 'truck-trailer',
|
|
200
|
+
'update': 'update',
|
|
201
|
+
'upload-cloud': 'upload-cloud',
|
|
202
|
+
'upload': 'upload',
|
|
203
|
+
'user-add': 'user-add',
|
|
204
|
+
'user-details': 'user-details',
|
|
205
|
+
'user-group': 'user-group',
|
|
206
|
+
'user-id-badge': 'user-id-badge',
|
|
207
|
+
'user-id-card': 'user-id-card',
|
|
208
|
+
'user': 'user',
|
|
209
|
+
'verified': 'verified',
|
|
210
|
+
'video': 'video',
|
|
211
|
+
'view-cards': 'view-cards',
|
|
212
|
+
'view-doc': 'view-doc',
|
|
213
|
+
'view-grid': 'view-grid',
|
|
214
|
+
'view-rows': 'view-rows',
|
|
215
|
+
'view-table': 'view-table',
|
|
216
|
+
'warning': 'warning',
|
|
217
|
+
'work-order': 'work-order',
|
|
218
|
+
'x': 'x'
|
|
219
|
+
} as const;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IconNamesList = 'aa-placeholder' | 'alarm' | 'apps' | 'arrow-down' | 'arrow-drop-down' | 'arrow-drop-up' | 'arrow-left' | 'arrow-line-down' | 'arrow-line-left' | 'arrow-line-right' | 'arrow-line-up' | 'arrow-prompt' | 'arrow-redo' | 'arrow-right' | 'arrow-square-in' | 'arrow-square-out' | 'arrow-undo' | 'arrow-up' | 'arrows-down-up' | 'arrows-left-right' | 'at' | 'attachment' | 'barcode-reader' | 'barcode' | 'basket' | 'bell-active' | 'bell-slash' | 'bell' | 'bin' | 'bookmark-outlined' | 'bookmark' | 'bookmarks' | 'Building' | 'calendar-add' | 'calendar-view-day' | 'calendar-view-month' | 'calendar-view-week' | 'calendar' | 'caret-down' | 'caret-left' | 'caret-right' | 'caret-up' | 'cart' | 'check-thick' | 'check' | 'checkbox-checked' | 'checkbox-focus' | 'checkbox-indeterminate' | 'checkbox' | 'circle-check' | 'circle' | 'circles-add' | 'clipboard' | 'clock-countdown' | 'clock' | 'cloud-synced' | 'code' | 'color' | 'copy' | 'credit-card' | 'cut' | 'database' | 'devices' | 'dictionary' | 'dots' | 'download-cloud' | 'download' | 'dragger' | 'edit' | 'encrypted' | 'envelope' | 'equal' | 'eraser' | 'error' | 'event-list' | 'export' | 'extension' | 'eye-slash' | 'eye' | 'file-add' | 'file' | 'files' | 'filter-remove' | 'filter' | 'finish' | 'flag' | 'forklift' | 'garage' | 'globe' | 'hash' | 'heart-outlined' | 'heart' | 'help' | 'history' | 'home' | 'image' | 'images' | 'inbox' | 'infinity' | 'info' | 'inventory' | 'invoice' | 'jump-back' | 'jump-forward' | 'kbd-backspace' | 'kbd-capslock' | 'kbd-command' | 'kbd-control' | 'kbd-hide' | 'kbd-option' | 'kbd-return' | 'kbd-shift' | 'kbd-space' | 'kbd' | 'link-slash' | 'link' | 'list-bullets' | 'list-checks' | 'list-numbers' | 'lock-open' | 'lock' | 'map-pin' | 'mark-unread' | 'menu-close' | 'menu' | 'message' | 'messages' | 'minus-thick' | 'minus' | 'money' | 'monitor' | 'moon' | 'note' | 'nut' | 'order' | 'package' | 'page-first' | 'page-last' | 'parts' | 'password' | 'pause' | 'pencil' | 'percent' | 'play-pause' | 'play' | 'plus' | 'printer' | 'prohibit' | 'question-mark' | 'quote' | 'radio-checked' | 'radio-focus' | 'radio' | 'receipt' | 'refresh' | 'repeat' | 'reply-all' | 'reply' | 'ribbon' | 'rows-add' | 'rules' | 'search-items' | 'search' | 'send' | 'settings' | 'share' | 'shuffle' | 'skip-back' | 'skip-forward' | 'skull' | 'sliders' | 'sort-alpha-down' | 'sort-alpha-up' | 'sort-ascending' | 'sort-descending' | 'sort-time-down' | 'sort-time-up' | 'square-add' | 'square' | 'stamp' | 'star-outlined' | 'star' | 'start' | 'stop' | 'success' | 'sun' | 'support' | 'sync' | 'tag' | 'target' | 'text-add' | 'time-add' | 'timer' | 'toolbox' | 'tools' | 'trash' | 'trophy' | 'truck-trailer' | 'update' | 'upload-cloud' | 'upload' | 'user-add' | 'user-details' | 'user-group' | 'user-id-badge' | 'user-id-card' | 'user' | 'verified' | 'video' | 'view-cards' | 'view-doc' | 'view-grid' | 'view-rows' | 'view-table' | 'warning' | 'work-order' | 'x'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { FC, ReactElement } from 'react';
|
|
2
|
+
import { cx } from '@styled-system/css';
|
|
3
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
4
|
+
import {
|
|
5
|
+
iconButton,
|
|
6
|
+
type IconButtonVariantProps,
|
|
7
|
+
} from '@styled-system/recipes';
|
|
8
|
+
import { ButtonContent } from '~/components/Button/ButtonContent';
|
|
9
|
+
import { Icon } from '~/components/Icon';
|
|
10
|
+
import { splitProps } from '~/utils/splitProps';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The IconButton component builds on Box.
|
|
14
|
+
* It automatically renders as a "button" (or an "a" if an href is provided)
|
|
15
|
+
* and applies the iconButton recipe styles.
|
|
16
|
+
*
|
|
17
|
+
* It requires exactly one child which must be an <Icon /> element.
|
|
18
|
+
*/
|
|
19
|
+
export type IconButtonProps = BoxProps &
|
|
20
|
+
IconButtonVariantProps & {
|
|
21
|
+
href?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
children: ReactElement<typeof Icon>;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
type?: 'submit' | 'reset' | 'button';
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const IconButton: FC<IconButtonProps> = ({
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
href,
|
|
32
|
+
children,
|
|
33
|
+
loading,
|
|
34
|
+
disabled,
|
|
35
|
+
type = 'button',
|
|
36
|
+
...props
|
|
37
|
+
}: IconButtonProps) => {
|
|
38
|
+
const isDisabled = loading || disabled;
|
|
39
|
+
const [className, otherProps] = splitProps(props);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Box
|
|
43
|
+
as={href ? 'a' : 'button'}
|
|
44
|
+
disabled={isDisabled}
|
|
45
|
+
aria-disabled={isDisabled}
|
|
46
|
+
className={cx(iconButton({ variant, size }), className)}
|
|
47
|
+
{...(href ? { href } : { type })}
|
|
48
|
+
{...otherProps}
|
|
49
|
+
{...(isDisabled &&
|
|
50
|
+
href && {
|
|
51
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>) =>
|
|
52
|
+
e.preventDefault(),
|
|
53
|
+
})}
|
|
54
|
+
>
|
|
55
|
+
<ButtonContent loading={!!loading}>{children}</ButtonContent>
|
|
56
|
+
</Box>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconButton, type IconButtonProps } from './IconButton';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Text, type TextProps } from '~/components/Text';
|
|
2
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
3
|
+
import { Label } from '~/components/Label';
|
|
4
|
+
import { input, type InputVariantProps } from '@styled-system/recipes';
|
|
5
|
+
import { cx } from '@styled-system/css';
|
|
6
|
+
import { splitProps } from '~/utils/splitProps';
|
|
7
|
+
|
|
8
|
+
export type InputProps = Omit<BoxProps, keyof InputVariantProps | keyof TextProps> & TextProps & InputVariantProps & {
|
|
9
|
+
label?: string;
|
|
10
|
+
type?: string | HTMLInputElement;
|
|
11
|
+
variant?: 'stacked' | 'internalLabel';
|
|
12
|
+
children?: string | React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Input: React.FC<InputProps> = (
|
|
16
|
+
{
|
|
17
|
+
label,
|
|
18
|
+
variant,
|
|
19
|
+
type,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}: InputProps,
|
|
23
|
+
) => {
|
|
24
|
+
|
|
25
|
+
const [ className, otherProps ] = splitProps(props);
|
|
26
|
+
return (
|
|
27
|
+
<Label>
|
|
28
|
+
<Text as='span'>{label}</Text>
|
|
29
|
+
<Box
|
|
30
|
+
as="input"
|
|
31
|
+
type={type}
|
|
32
|
+
className={cx(
|
|
33
|
+
input({ variant }),
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
htmlFor={props.id || ''}
|
|
37
|
+
{...otherProps}
|
|
38
|
+
/>
|
|
39
|
+
</Label>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input, type InputProps } from './Input';
|