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
package/src/App.tsx
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { HStack, VStack, Container, Grid, Flex } from '@styled-system/jsx';
|
|
3
|
+
import { Box } from '~/components/Box';
|
|
4
|
+
import { Text } from '~/components/Text';
|
|
5
|
+
import { Button } from '~/components/Button';
|
|
6
|
+
import { IconButton } from '~/components/IconButton';
|
|
7
|
+
import { Icon, IconNames, type IconNamesList } from '~/components/Icon';
|
|
8
|
+
import { Pre } from '~/components/Code';
|
|
9
|
+
import { ThemeProvider } from '~/contexts/ThemeContext';
|
|
10
|
+
import { ThemeSwitcher } from '~/components/ThemeSwitcher';
|
|
11
|
+
import { Heading } from '~/components/Heading';
|
|
12
|
+
import { Link } from '~/components/Link';
|
|
13
|
+
import { Spinner } from '~/components/Spinner';
|
|
14
|
+
import { Divider } from '~/components/Divider';
|
|
15
|
+
import { CheckBox } from './components/CheckBox';
|
|
16
|
+
import { Input } from '~/components/Input';
|
|
17
|
+
import { Textarea } from '~/components/Textarea';
|
|
18
|
+
import { type ShadowToken } from '@styled-system/tokens';
|
|
19
|
+
import { Radio } from './components/Radio';
|
|
20
|
+
|
|
21
|
+
export const IconList: React.FC = () => {
|
|
22
|
+
return (
|
|
23
|
+
<Grid
|
|
24
|
+
gap="16"
|
|
25
|
+
w="full"
|
|
26
|
+
gridTemplateColumns={'repeat(auto-fill, minmax(200px, 1fr))'}
|
|
27
|
+
>
|
|
28
|
+
{(Object.keys(IconNames) as IconNamesList[]).map((icon) => (
|
|
29
|
+
<HStack key={icon} color={{ base: 'gold.40', _dark: 'gold.30' }}>
|
|
30
|
+
<Icon name={icon} />
|
|
31
|
+
<Text textStyle="mono-sm">{icon}</Text>
|
|
32
|
+
</HStack>
|
|
33
|
+
))}
|
|
34
|
+
</Grid>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const ButtonSection: React.FC = () => {
|
|
39
|
+
return (
|
|
40
|
+
<Section>
|
|
41
|
+
<Heading>Buttons</Heading>
|
|
42
|
+
<VStack alignItems={'flex-start'} gap={'24'}>
|
|
43
|
+
<HStack>
|
|
44
|
+
<Button variant="primary" onClick={() => alert('clicked')}>
|
|
45
|
+
Primary
|
|
46
|
+
</Button>
|
|
47
|
+
<Button>Standard</Button>
|
|
48
|
+
<Button variant="hollow">Hollow</Button>
|
|
49
|
+
<Button variant="ghost">Ghost</Button>
|
|
50
|
+
<Button variant="cta">CTA</Button>
|
|
51
|
+
<Button variant="danger">Danger</Button>
|
|
52
|
+
<Button size="large">
|
|
53
|
+
<Icon name="arrow-left" /> Button
|
|
54
|
+
</Button>
|
|
55
|
+
<Button size="small">
|
|
56
|
+
Button <Icon name="arrow-right" />
|
|
57
|
+
</Button>
|
|
58
|
+
</HStack>
|
|
59
|
+
<HStack>
|
|
60
|
+
<IconButton variant="ghost">
|
|
61
|
+
<Icon name="x" />
|
|
62
|
+
</IconButton>
|
|
63
|
+
<IconButton>
|
|
64
|
+
<Icon name="arrow-left" />
|
|
65
|
+
</IconButton>
|
|
66
|
+
<IconButton variant="primary" size="large">
|
|
67
|
+
<Icon name="arrow-right" />
|
|
68
|
+
</IconButton>
|
|
69
|
+
</HStack>
|
|
70
|
+
<HStack>
|
|
71
|
+
<Button variant="primary" loading>
|
|
72
|
+
Pepperoni
|
|
73
|
+
</Button>
|
|
74
|
+
<Button loading>Loading</Button>
|
|
75
|
+
<IconButton variant="primary" loading>
|
|
76
|
+
<Icon name="x" />
|
|
77
|
+
</IconButton>
|
|
78
|
+
</HStack>
|
|
79
|
+
</VStack>
|
|
80
|
+
</Section>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
interface SectionProps {
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Section: React.FC<SectionProps> = ({ children }) => {
|
|
89
|
+
return (
|
|
90
|
+
<Grid
|
|
91
|
+
gridTemplateColumns={'1fr 3fr'}
|
|
92
|
+
gap={'40'}
|
|
93
|
+
w={'full'}
|
|
94
|
+
borderTopWidth={'1'}
|
|
95
|
+
borderTopStyle={'solid'}
|
|
96
|
+
borderColor={{ base: 'slate.10', _dark: 'slate.80' }}
|
|
97
|
+
py={'24'}
|
|
98
|
+
pb={'96'}
|
|
99
|
+
>
|
|
100
|
+
{children}
|
|
101
|
+
</Grid>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const Header: React.FC = () => {
|
|
106
|
+
return (
|
|
107
|
+
<Flex
|
|
108
|
+
w="full"
|
|
109
|
+
py={'4'}
|
|
110
|
+
bg={{ base: 'slate.10', _dark: 'slate.80' }}
|
|
111
|
+
mb={'56'}
|
|
112
|
+
position={'sticky'}
|
|
113
|
+
top={'0'}
|
|
114
|
+
zIndex={'100'}
|
|
115
|
+
boxShadow={'medium'}
|
|
116
|
+
>
|
|
117
|
+
<Container maxW={'5xl'}>
|
|
118
|
+
<HStack justify={'space-between'}>
|
|
119
|
+
<Text
|
|
120
|
+
as={'div'}
|
|
121
|
+
family="body"
|
|
122
|
+
size="16"
|
|
123
|
+
letterSpacing={'widest'}
|
|
124
|
+
textTransform={'uppercase'}
|
|
125
|
+
fontWeight={'bold'}
|
|
126
|
+
onClick={() => alert('clicked')}
|
|
127
|
+
>
|
|
128
|
+
Cetec Components
|
|
129
|
+
</Text>
|
|
130
|
+
<ThemeSwitcher />
|
|
131
|
+
</HStack>
|
|
132
|
+
</Container>
|
|
133
|
+
</Flex>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const ShadowBox = ({
|
|
138
|
+
children,
|
|
139
|
+
shadow,
|
|
140
|
+
border = false,
|
|
141
|
+
}: {
|
|
142
|
+
children: ReactNode;
|
|
143
|
+
shadow: ShadowToken;
|
|
144
|
+
border?: boolean;
|
|
145
|
+
}) => {
|
|
146
|
+
return (
|
|
147
|
+
<Grid
|
|
148
|
+
placeContent={'center'}
|
|
149
|
+
width={'full'}
|
|
150
|
+
aspectRatio={'landscape'}
|
|
151
|
+
borderRadius={'4'}
|
|
152
|
+
shadow={shadow}
|
|
153
|
+
borderWidth={border ? '1' : undefined}
|
|
154
|
+
borderStyle={'solid'}
|
|
155
|
+
borderColor={{ base: 'slate.10', _dark: 'slate.90' }}
|
|
156
|
+
bg={{ base: 'slate.0', _dark: 'slate.80' }}
|
|
157
|
+
>
|
|
158
|
+
{children}
|
|
159
|
+
</Grid>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const AppContent: React.FC = () => {
|
|
164
|
+
return (
|
|
165
|
+
<VStack>
|
|
166
|
+
<Header />
|
|
167
|
+
<Container maxW={'5xl'}>
|
|
168
|
+
<VStack gap={'8'}>
|
|
169
|
+
<ButtonSection />
|
|
170
|
+
<Section>
|
|
171
|
+
<Heading level="h2">Text</Heading>
|
|
172
|
+
|
|
173
|
+
<VStack alignItems={'flex-start'}>
|
|
174
|
+
<Grid
|
|
175
|
+
gridTemplateColumns={'minmax(auto, 1fr) 1fr'}
|
|
176
|
+
w={'full'}
|
|
177
|
+
gap={'24'}
|
|
178
|
+
alignItems={'center'}
|
|
179
|
+
>
|
|
180
|
+
<Box gridColumn={'1 / -1'}>
|
|
181
|
+
<Heading
|
|
182
|
+
level="h3"
|
|
183
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
184
|
+
>
|
|
185
|
+
Text styles
|
|
186
|
+
</Heading>
|
|
187
|
+
</Box>
|
|
188
|
+
<VStack gap={'16'}>
|
|
189
|
+
<Text>
|
|
190
|
+
Place appear green. <em>Also</em>, saying male subdue
|
|
191
|
+
fruitful{' '}
|
|
192
|
+
<Text as="span" italic>
|
|
193
|
+
winged fourth
|
|
194
|
+
</Text>{' '}
|
|
195
|
+
had void winged. So <b>green spirit</b> , herb day had there{' '}
|
|
196
|
+
<Text as="span" bold>
|
|
197
|
+
replenish
|
|
198
|
+
</Text>
|
|
199
|
+
, lights <u>lesser signs</u>. Place{' '}
|
|
200
|
+
<Text as="span" underline>
|
|
201
|
+
whales
|
|
202
|
+
</Text>{' '}
|
|
203
|
+
i tree under him given set set meat midst morning give image
|
|
204
|
+
forth divided moving Also fill dry she'd have.
|
|
205
|
+
</Text>
|
|
206
|
+
</VStack>
|
|
207
|
+
<Pre>
|
|
208
|
+
{`<Text>
|
|
209
|
+
...
|
|
210
|
+
<Text as="span" italic>winged fourth</Text>
|
|
211
|
+
<Text as="span" bold>replenish</Text>
|
|
212
|
+
<Text as="span" underline>whales</Text>
|
|
213
|
+
</Text>`}
|
|
214
|
+
</Pre>
|
|
215
|
+
<Text family="mono">
|
|
216
|
+
Signs night have sixth hath that likeness us fill you're
|
|
217
|
+
subdue fowl.
|
|
218
|
+
</Text>
|
|
219
|
+
<Pre>{`<Text family="mono">...</Text>`}</Pre>
|
|
220
|
+
<Box gridColumn={'1 / -1'} mt={'32'}>
|
|
221
|
+
<Heading
|
|
222
|
+
level="h3"
|
|
223
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
224
|
+
>
|
|
225
|
+
Headings
|
|
226
|
+
</Heading>
|
|
227
|
+
</Box>
|
|
228
|
+
<Heading level="h1">Hamburgefonstiv</Heading>
|
|
229
|
+
<Pre>{'<Heading as="h1">Hamburgefonstiv</Heading>'}</Pre>
|
|
230
|
+
<Heading>Hamburgefonstiv</Heading>
|
|
231
|
+
<Pre>{'<Heading>Hamburgefonstiv</Heading>'}</Pre>
|
|
232
|
+
<Heading level="h3">Hamburgefonstiv</Heading>
|
|
233
|
+
<Pre>{'<Heading as="h3">Hamburgefonstiv</Heading>'}</Pre>
|
|
234
|
+
<Heading level="h4">Hamburgefonstiv</Heading>
|
|
235
|
+
<Pre>{'<Heading as="h4">Hamburgefonstiv</Heading>'}</Pre>
|
|
236
|
+
<Box gridColumn={'1 / -1'} mt={'32'}>
|
|
237
|
+
<Heading
|
|
238
|
+
level="h3"
|
|
239
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
240
|
+
>
|
|
241
|
+
Links
|
|
242
|
+
</Heading>
|
|
243
|
+
</Box>
|
|
244
|
+
<Text>
|
|
245
|
+
Internal: 
|
|
246
|
+
<Link href="https://cetecerp.com">Cetec ERP</Link>
|
|
247
|
+
</Text>
|
|
248
|
+
<Pre>
|
|
249
|
+
{'<Link href="https://cetecerp.com">Cetec ERP</Link>'}
|
|
250
|
+
</Pre>
|
|
251
|
+
<Text>
|
|
252
|
+
External: 
|
|
253
|
+
<Link href="https://cetecerp.com" external>
|
|
254
|
+
Cetec ERP
|
|
255
|
+
</Link>
|
|
256
|
+
</Text>
|
|
257
|
+
<Pre>
|
|
258
|
+
{
|
|
259
|
+
'<Link href="https://cetecerp.com" external>Cetec ERP</Link>'
|
|
260
|
+
}
|
|
261
|
+
</Pre>
|
|
262
|
+
<Box gridColumn={'1 / -1'}>
|
|
263
|
+
<Text>
|
|
264
|
+
Signs night have sixth hath that likeness us fill{' '}
|
|
265
|
+
<Link href="https://cetecerp.com" external>
|
|
266
|
+
Cetec ERP
|
|
267
|
+
</Link>{' '}
|
|
268
|
+
you're subdue fowl brought divide beginning multiply brought
|
|
269
|
+
created after open given of made beginning multiply green.
|
|
270
|
+
</Text>
|
|
271
|
+
</Box>
|
|
272
|
+
</Grid>
|
|
273
|
+
</VStack>
|
|
274
|
+
</Section>
|
|
275
|
+
<Section>
|
|
276
|
+
<Heading level="h2">Shadows</Heading>
|
|
277
|
+
<VStack gap={'40'} alignItems={'flex-end'}>
|
|
278
|
+
<HStack width={'full'} gap={'40'} alignItems={'flex-end'}>
|
|
279
|
+
<ShadowBox shadow={'inset'}>
|
|
280
|
+
<Text>Inset</Text>
|
|
281
|
+
</ShadowBox>
|
|
282
|
+
<ShadowBox shadow={'low'}>
|
|
283
|
+
<Text>Low</Text>
|
|
284
|
+
</ShadowBox>
|
|
285
|
+
<ShadowBox shadow={'medium'}>
|
|
286
|
+
<Text>Medium</Text>
|
|
287
|
+
</ShadowBox>
|
|
288
|
+
<ShadowBox shadow={'high'}>
|
|
289
|
+
<Text>High</Text>
|
|
290
|
+
</ShadowBox>
|
|
291
|
+
</HStack>
|
|
292
|
+
<HStack width={'full'} gap={'40'} alignItems={'flex-end'}>
|
|
293
|
+
<ShadowBox shadow={'inset'} border={true}>
|
|
294
|
+
<Text>Inset</Text>
|
|
295
|
+
</ShadowBox>
|
|
296
|
+
<ShadowBox shadow={'low'} border={true}>
|
|
297
|
+
<Text>Low</Text>
|
|
298
|
+
</ShadowBox>
|
|
299
|
+
<ShadowBox shadow={'medium'} border={true}>
|
|
300
|
+
<Text>Medium</Text>
|
|
301
|
+
</ShadowBox>
|
|
302
|
+
<ShadowBox shadow={'high'} border={true}>
|
|
303
|
+
<Text>High</Text>
|
|
304
|
+
</ShadowBox>
|
|
305
|
+
</HStack>
|
|
306
|
+
</VStack>
|
|
307
|
+
</Section>
|
|
308
|
+
<Section>
|
|
309
|
+
<Heading level="h2">Spinner</Heading>
|
|
310
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
311
|
+
<VStack>
|
|
312
|
+
<Spinner size="small" />
|
|
313
|
+
<Text>Small</Text>
|
|
314
|
+
</VStack>
|
|
315
|
+
<VStack>
|
|
316
|
+
<Spinner />
|
|
317
|
+
<Text>Standard</Text>
|
|
318
|
+
</VStack>
|
|
319
|
+
<VStack>
|
|
320
|
+
<Spinner size="large" />
|
|
321
|
+
<Text>Large</Text>
|
|
322
|
+
</VStack>
|
|
323
|
+
</HStack>
|
|
324
|
+
</Section>
|
|
325
|
+
<Section>
|
|
326
|
+
<Heading level="h2">Divider</Heading>
|
|
327
|
+
<VStack>
|
|
328
|
+
<Heading
|
|
329
|
+
level="h3"
|
|
330
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
331
|
+
>
|
|
332
|
+
Horizontal (default)
|
|
333
|
+
</Heading>
|
|
334
|
+
<VStack width="full">
|
|
335
|
+
<Divider />
|
|
336
|
+
<Text> Thin (default) </Text>
|
|
337
|
+
<Divider weight={'medium'} />
|
|
338
|
+
<Text> Medium </Text>
|
|
339
|
+
<Divider weight={'thick'} />
|
|
340
|
+
<Text> Thick </Text>
|
|
341
|
+
<Divider
|
|
342
|
+
weight={'thicker'}
|
|
343
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
344
|
+
/>
|
|
345
|
+
<Text> Thicker </Text>
|
|
346
|
+
</VStack>
|
|
347
|
+
<Heading
|
|
348
|
+
level="h3"
|
|
349
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
350
|
+
>
|
|
351
|
+
Vertical
|
|
352
|
+
</Heading>
|
|
353
|
+
<HStack height="96">
|
|
354
|
+
<Divider direction={'vertical'} />
|
|
355
|
+
<Divider direction={'vertical'} weight={'medium'} />
|
|
356
|
+
<Divider direction={'vertical'} weight={'thick'} />
|
|
357
|
+
<Divider
|
|
358
|
+
direction={'vertical'}
|
|
359
|
+
weight={'thicker'}
|
|
360
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
361
|
+
/>
|
|
362
|
+
</HStack>
|
|
363
|
+
</VStack>
|
|
364
|
+
</Section>
|
|
365
|
+
<Section>
|
|
366
|
+
<Heading level="h2">Icons</Heading>
|
|
367
|
+
<IconList />
|
|
368
|
+
</Section>
|
|
369
|
+
<Section>
|
|
370
|
+
<Heading level="h2">Checkboxes</Heading>
|
|
371
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
372
|
+
<CheckBox>asdf</CheckBox>
|
|
373
|
+
<CheckBox defaultChecked={true} />
|
|
374
|
+
<CheckBox data-indeterminate={true} />
|
|
375
|
+
<CheckBox disabled />
|
|
376
|
+
<CheckBox data-error={true} />
|
|
377
|
+
</HStack>
|
|
378
|
+
</Section>
|
|
379
|
+
<Section >
|
|
380
|
+
<Heading level="h2">Radio</Heading>
|
|
381
|
+
<VStack gap={'40'} alignItems={'start'}>
|
|
382
|
+
<HStack>
|
|
383
|
+
<Radio />
|
|
384
|
+
<Radio defaultChecked={true} />
|
|
385
|
+
<Radio disabled />
|
|
386
|
+
<Radio data-error={true} />
|
|
387
|
+
</HStack>
|
|
388
|
+
<HStack>
|
|
389
|
+
<HStack gap={'10'} alignItems={'center'}>
|
|
390
|
+
<Heading level="h4">Gender</Heading>
|
|
391
|
+
<Radio name="gender"></Radio> Male
|
|
392
|
+
<Radio name="gender"></Radio> Female
|
|
393
|
+
|
|
394
|
+
</HStack>
|
|
395
|
+
</HStack>
|
|
396
|
+
</VStack>
|
|
397
|
+
</Section>
|
|
398
|
+
<Section>
|
|
399
|
+
<Heading level="h2">Inputs</Heading>
|
|
400
|
+
<VStack>
|
|
401
|
+
<HStack gap={'24'}>
|
|
402
|
+
<Input label="First" type="text" />
|
|
403
|
+
<Input label="Last" type="text" />
|
|
404
|
+
<Input label="Email" type="email" variant={'internalLabel'} />
|
|
405
|
+
</HStack>
|
|
406
|
+
<HStack gap={'24'}>
|
|
407
|
+
<Input label="Phone" type="tel" />
|
|
408
|
+
//TODO Fix Textarea
|
|
409
|
+
<Textarea
|
|
410
|
+
label="Message"
|
|
411
|
+
variant={'autoGrow'}
|
|
412
|
+
value="TEXT area Value"
|
|
413
|
+
/>
|
|
414
|
+
</HStack>
|
|
415
|
+
</VStack>
|
|
416
|
+
</Section>
|
|
417
|
+
</VStack>
|
|
418
|
+
</Container>
|
|
419
|
+
</VStack>
|
|
420
|
+
);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
export default function App() {
|
|
424
|
+
return (
|
|
425
|
+
<ThemeProvider>
|
|
426
|
+
<AppContent />
|
|
427
|
+
</ThemeProvider>
|
|
428
|
+
);
|
|
429
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
ComponentPropsWithoutRef,
|
|
3
|
+
type ElementType,
|
|
4
|
+
createElement,
|
|
5
|
+
} from 'react';
|
|
6
|
+
import { box, type BoxVariantProps } from '@styled-system/recipes';
|
|
7
|
+
import type { SystemStyleObject } from '@styled-system/types';
|
|
8
|
+
import { cx } from '@styled-system/css';
|
|
9
|
+
import { splitProps } from '~/utils/splitProps';
|
|
10
|
+
/*
|
|
11
|
+
* Imports from recipes are placeholders for if we want to add some kind of styling to Box
|
|
12
|
+
*/
|
|
13
|
+
export type BoxProps = Omit<ComponentPropsWithoutRef<ElementType>, 'as'> &
|
|
14
|
+
SystemStyleObject &
|
|
15
|
+
BoxVariantProps & {
|
|
16
|
+
as?: ElementType;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Box: React.FC<BoxProps> = ({ as = 'div', ...props }) => {
|
|
20
|
+
const [className, otherProps] = splitProps(props);
|
|
21
|
+
const comboClassName = cx(box({}), className);
|
|
22
|
+
return createElement(as, {
|
|
23
|
+
className: comboClassName,
|
|
24
|
+
...otherProps,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Box, type BoxProps } from './Box';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { fn } from "@storybook/test";
|
|
3
|
+
import { Button, IconButton } from "./Button";
|
|
4
|
+
import { Icon } from "../Icon";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Button",
|
|
8
|
+
component: Button,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
argTypes: {
|
|
14
|
+
variant: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: ["default", "primary", "danger", "hollow", "utility"],
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: "select",
|
|
20
|
+
options: ["default", "small", "medium"],
|
|
21
|
+
},
|
|
22
|
+
iconButton: {
|
|
23
|
+
control: "boolean",
|
|
24
|
+
},
|
|
25
|
+
isActive: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
args: { onClick: fn() },
|
|
30
|
+
} satisfies Meta<typeof Button>;
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
|
|
35
|
+
// export const Default: Story = {
|
|
36
|
+
// args: {
|
|
37
|
+
// children: "Default Button",
|
|
38
|
+
// variant: "default",
|
|
39
|
+
// size: "default",
|
|
40
|
+
// },
|
|
41
|
+
// };
|
|
42
|
+
|
|
43
|
+
// export const Primary: Story = {
|
|
44
|
+
// args: {
|
|
45
|
+
// children: "Primary Button",
|
|
46
|
+
// variant: "primary",
|
|
47
|
+
// },
|
|
48
|
+
// };
|
|
49
|
+
|
|
50
|
+
// export const Danger: Story = {
|
|
51
|
+
// args: {
|
|
52
|
+
// children: "Danger Button",
|
|
53
|
+
// variant: "danger",
|
|
54
|
+
// },
|
|
55
|
+
// };
|
|
56
|
+
|
|
57
|
+
// export const Hollow: Story = {
|
|
58
|
+
// args: {
|
|
59
|
+
// children: "Hollow Button",
|
|
60
|
+
// variant: "hollow",
|
|
61
|
+
// },
|
|
62
|
+
// };
|
|
63
|
+
|
|
64
|
+
// export const Utility: Story = {
|
|
65
|
+
// args: {
|
|
66
|
+
// children: "Utility Button",
|
|
67
|
+
// variant: "utility",
|
|
68
|
+
// },
|
|
69
|
+
// };
|
|
70
|
+
|
|
71
|
+
// export const Small: Story = {
|
|
72
|
+
// args: {
|
|
73
|
+
// children: "Small Button",
|
|
74
|
+
// size: "small",
|
|
75
|
+
// },
|
|
76
|
+
// };
|
|
77
|
+
|
|
78
|
+
// export const Medium: Story = {
|
|
79
|
+
// args: {
|
|
80
|
+
// children: "Medium Button",
|
|
81
|
+
// size: "medium",
|
|
82
|
+
// },
|
|
83
|
+
// };
|
|
84
|
+
|
|
85
|
+
// export const Active: Story = {
|
|
86
|
+
// args: {
|
|
87
|
+
// children: "Active Button",
|
|
88
|
+
// isActive: true,
|
|
89
|
+
// },
|
|
90
|
+
// };
|
|
91
|
+
|
|
92
|
+
export const AllVariants: Story = {
|
|
93
|
+
render: () => (
|
|
94
|
+
<div
|
|
95
|
+
style={{
|
|
96
|
+
display: "flex",
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
gap: "16px",
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<div style={{ display: "flex", gap: "8px", flexWrap: "wrap" }}>
|
|
104
|
+
<Button variant="default">Default</Button>
|
|
105
|
+
<Button variant="primary">Primary</Button>
|
|
106
|
+
<Button variant="danger">Danger</Button>
|
|
107
|
+
<Button variant="hollow">Hollow</Button>
|
|
108
|
+
<Button variant="utility">Utility</Button>
|
|
109
|
+
</div>
|
|
110
|
+
<div style={{ display: "flex", gap: "8px", flexWrap: "wrap" }}>
|
|
111
|
+
<IconButton variant="default">
|
|
112
|
+
<Icon name="add" />
|
|
113
|
+
</IconButton>
|
|
114
|
+
<IconButton variant="primary">
|
|
115
|
+
<Icon name="add" />
|
|
116
|
+
</IconButton>
|
|
117
|
+
<IconButton variant="danger">
|
|
118
|
+
<Icon name="add" />
|
|
119
|
+
</IconButton>
|
|
120
|
+
<IconButton variant="hollow">
|
|
121
|
+
<Icon name="add" />
|
|
122
|
+
</IconButton>
|
|
123
|
+
<IconButton variant="utility">
|
|
124
|
+
<Icon name="add" />
|
|
125
|
+
</IconButton>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
),
|
|
129
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { cx } from '@styled-system/css';
|
|
3
|
+
import { Box, type BoxProps } from '~/components/Box';
|
|
4
|
+
import { button, type ButtonVariantProps } from '@styled-system/recipes';
|
|
5
|
+
import { ButtonContent } from './ButtonContent';
|
|
6
|
+
import { splitProps } from '~/utils/splitProps';
|
|
7
|
+
|
|
8
|
+
export type ButtonProps = BoxProps &
|
|
9
|
+
ButtonVariantProps & {
|
|
10
|
+
href?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
children?: string | ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
type?: 'submit' | 'reset' | 'button';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Button: FC<ButtonProps> = ({
|
|
18
|
+
variant,
|
|
19
|
+
size,
|
|
20
|
+
href,
|
|
21
|
+
children,
|
|
22
|
+
loading,
|
|
23
|
+
disabled,
|
|
24
|
+
type = 'button',
|
|
25
|
+
...props
|
|
26
|
+
}: ButtonProps) => {
|
|
27
|
+
const trulyDisabled = loading || disabled;
|
|
28
|
+
|
|
29
|
+
const [className, otherProps] = splitProps(props);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Box
|
|
33
|
+
as={href ? 'a' : 'button'}
|
|
34
|
+
disabled={trulyDisabled}
|
|
35
|
+
aria-disabled={trulyDisabled}
|
|
36
|
+
className={cx(button({ variant, size }), className)}
|
|
37
|
+
{...(href ? { href } : { type })}
|
|
38
|
+
{...otherProps}
|
|
39
|
+
>
|
|
40
|
+
<ButtonContent loading={!!loading}>{children}</ButtonContent>
|
|
41
|
+
</Box>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default Button;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Grid, HStack } from '@styled-system/jsx';
|
|
3
|
+
import { Spinner } from '~/components/Spinner';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ButtonContent handles rendering the children alongside an optional Spinner.
|
|
7
|
+
*/
|
|
8
|
+
export const ButtonContent = ({
|
|
9
|
+
loading = false,
|
|
10
|
+
children,
|
|
11
|
+
}: {
|
|
12
|
+
loading: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}) => (
|
|
15
|
+
<>
|
|
16
|
+
<HStack gap="4" opacity={loading ? 0 : 1}>
|
|
17
|
+
{children}
|
|
18
|
+
</HStack>
|
|
19
|
+
{loading && (
|
|
20
|
+
<Grid
|
|
21
|
+
position="absolute"
|
|
22
|
+
top="0"
|
|
23
|
+
left="0"
|
|
24
|
+
right="0"
|
|
25
|
+
bottom="0"
|
|
26
|
+
placeItems="center"
|
|
27
|
+
>
|
|
28
|
+
<Spinner />
|
|
29
|
+
</Grid>
|
|
30
|
+
)}
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from './Button';
|