polpo 0.1.7 → 0.1.9
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/dist/components.cjs +3 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.css +2 -0
- package/dist/components.css.map +1 -0
- package/dist/components.d.cts +1866 -0
- package/dist/components.d.ts +1866 -0
- package/dist/components.js +3 -0
- package/dist/components.js.map +1 -0
- package/dist/{get-modal-position-drle0OjP.d.cts → get-modal-position-C5jQsaGx.d.cts} +1 -1
- package/dist/{get-modal-position-drle0OjP.d.ts → get-modal-position-C5jQsaGx.d.ts} +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +15 -13
- package/dist/hooks.d.ts +15 -13
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/layouts.cjs +3 -0
- package/dist/layouts.cjs.map +1 -0
- package/dist/layouts.css +2 -0
- package/dist/layouts.css.map +1 -0
- package/dist/{ui.d.cts → layouts.d.cts} +237 -2202
- package/dist/{ui.d.ts → layouts.d.ts} +237 -2202
- package/dist/layouts.js +3 -0
- package/dist/layouts.js.map +1 -0
- package/dist/types.cjs +3 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +8 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/{use-modal-transition-XQHye62R.d.cts → use-modal-transition-C0lyjvkD.d.ts} +4 -4
- package/dist/{use-modal-transition-DPZFWFFf.d.ts → use-modal-transition-C7DzbnY5.d.cts} +4 -4
- package/package.json +76 -76
- package/.eslintrc.cjs +0 -9
- package/.storybook/decorators.tsx +0 -61
- package/.storybook/main.ts +0 -47
- package/.storybook/manager-head.html +0 -2
- package/.storybook/manager.ts +0 -7
- package/.storybook/preview-head.html +0 -2
- package/.storybook/preview.ts +0 -38
- package/.storybook/theme.ts +0 -47
- package/.turbo/turbo-lint.log +0 -4
- package/README.md +0 -65
- package/dist/chunk-CF5MBMWG.js +0 -3
- package/dist/chunk-CF5MBMWG.js.map +0 -1
- package/dist/chunk-MAWW6AA7.js +0 -3
- package/dist/chunk-MAWW6AA7.js.map +0 -1
- package/dist/ui.cjs +0 -2279
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.js +0 -2279
- package/dist/ui.js.map +0 -1
- package/src/components/accordion/accordion-item.stories.tsx +0 -128
- package/src/components/accordion/accordion-item.tsx +0 -119
- package/src/components/accordion/accordion.stories.tsx +0 -74
- package/src/components/accordion/accordion.style.ts +0 -42
- package/src/components/accordion/accordion.tsx +0 -74
- package/src/components/accordion/index.ts +0 -2
- package/src/components/buttons/button/button.stories.tsx +0 -103
- package/src/components/buttons/button/button.style.ts +0 -152
- package/src/components/buttons/button/button.tsx +0 -107
- package/src/components/buttons/button/index.ts +0 -1
- package/src/components/buttons/index.ts +0 -1
- package/src/components/cards/flip-card/flip-card.stories.tsx +0 -61
- package/src/components/cards/flip-card/flip-card.style.ts +0 -45
- package/src/components/cards/flip-card/flip-card.tsx +0 -55
- package/src/components/cards/flip-card/index.ts +0 -1
- package/src/components/cards/hover-card/hover-card.stories.tsx +0 -45
- package/src/components/cards/hover-card/hover-card.style.ts +0 -13
- package/src/components/cards/hover-card/hover-card.tsx +0 -71
- package/src/components/cards/hover-card/index.ts +0 -1
- package/src/components/cards/index.ts +0 -3
- package/src/components/cards/slide-card/index.ts +0 -1
- package/src/components/cards/slide-card/slide-card.stories.tsx +0 -47
- package/src/components/cards/slide-card/slide-card.tsx +0 -42
- package/src/components/cursor/cursor.stories.tsx +0 -36
- package/src/components/cursor/cursor.style.ts +0 -73
- package/src/components/cursor/cursor.tsx +0 -49
- package/src/components/cursor/index.ts +0 -1
- package/src/components/form/checkbox/checkbox.stories.tsx +0 -85
- package/src/components/form/checkbox/checkbox.style.ts +0 -109
- package/src/components/form/checkbox/checkbox.tsx +0 -120
- package/src/components/form/checkbox/index.ts +0 -1
- package/src/components/form/controller/controller.tsx +0 -42
- package/src/components/form/controller/index.ts +0 -1
- package/src/components/form/date-picker/date-picker.stories.tsx +0 -38
- package/src/components/form/date-picker/date-picker.tsx +0 -67
- package/src/components/form/date-picker/index.ts +0 -1
- package/src/components/form/field/field.stories.tsx +0 -52
- package/src/components/form/field/field.style.ts +0 -94
- package/src/components/form/field/field.tsx +0 -86
- package/src/components/form/field/field.types.ts +0 -34
- package/src/components/form/field/index.ts +0 -2
- package/src/components/form/form.stories.types.tsx +0 -50
- package/src/components/form/form.types.ts +0 -37
- package/src/components/form/index.ts +0 -14
- package/src/components/form/input/index.ts +0 -1
- package/src/components/form/input/input.stories.tsx +0 -41
- package/src/components/form/input/input.tsx +0 -73
- package/src/components/form/input-color/index.ts +0 -1
- package/src/components/form/input-color/input-color.stories.tsx +0 -46
- package/src/components/form/input-color/input-color.style.ts +0 -94
- package/src/components/form/input-color/input-color.tsx +0 -162
- package/src/components/form/input-file/index.ts +0 -1
- package/src/components/form/input-file/input-file.stories.tsx +0 -40
- package/src/components/form/input-file/input-file.style.ts +0 -143
- package/src/components/form/input-file/input-file.tsx +0 -214
- package/src/components/form/input-password/index.ts +0 -1
- package/src/components/form/input-password/input-password.stories.tsx +0 -37
- package/src/components/form/input-password/input-password.tsx +0 -83
- package/src/components/form/radio/index.ts +0 -1
- package/src/components/form/radio/radio.stories.tsx +0 -68
- package/src/components/form/radio/radio.style.ts +0 -79
- package/src/components/form/radio/radio.tsx +0 -106
- package/src/components/form/select/data.stories.json +0 -452
- package/src/components/form/select/index.ts +0 -1
- package/src/components/form/select/option.tsx +0 -101
- package/src/components/form/select/options.tsx +0 -161
- package/src/components/form/select/select.stories.tsx +0 -369
- package/src/components/form/select/select.style.ts +0 -116
- package/src/components/form/select/select.tsx +0 -312
- package/src/components/form/select/select.types.ts +0 -97
- package/src/components/form/slider/index.ts +0 -1
- package/src/components/form/slider/slider.stories.tsx +0 -40
- package/src/components/form/slider/slider.style.ts +0 -92
- package/src/components/form/slider/slider.tsx +0 -108
- package/src/components/form/switch/index.ts +0 -1
- package/src/components/form/switch/switch.stories.tsx +0 -88
- package/src/components/form/switch/switch.style.ts +0 -137
- package/src/components/form/switch/switch.tsx +0 -177
- package/src/components/form/textarea/index.ts +0 -1
- package/src/components/form/textarea/textarea.stories.tsx +0 -43
- package/src/components/form/textarea/textarea.style.ts +0 -7
- package/src/components/form/textarea/textarea.tsx +0 -76
- package/src/components/icon/icon.stories.tsx +0 -63
- package/src/components/icon/icon.tsx +0 -64
- package/src/components/icon/icons/index.ts +0 -18
- package/src/components/icon/icons/object.tsx +0 -482
- package/src/components/icon/icons/social.tsx +0 -88
- package/src/components/icon/icons/symbol.tsx +0 -776
- package/src/components/icon/index.ts +0 -5
- package/src/components/image/image.stories.tsx +0 -25
- package/src/components/image/image.tsx +0 -7
- package/src/components/image/index.ts +0 -1
- package/src/components/index.ts +0 -17
- package/src/components/infinity-scroll/index.ts +0 -1
- package/src/components/infinity-scroll/infinity-scroll.stories.tsx +0 -118
- package/src/components/infinity-scroll/infinity-scroll.style.ts +0 -30
- package/src/components/infinity-scroll/infinity-scroll.tsx +0 -53
- package/src/components/line/index.ts +0 -1
- package/src/components/line/line.stories.tsx +0 -66
- package/src/components/line/line.style.ts +0 -57
- package/src/components/line/line.tsx +0 -76
- package/src/components/loaders/icons/box-1.tsx +0 -31
- package/src/components/loaders/icons/box-2.tsx +0 -30
- package/src/components/loaders/icons/box-3.tsx +0 -66
- package/src/components/loaders/icons/clock-1.tsx +0 -25
- package/src/components/loaders/icons/clock-2.tsx +0 -58
- package/src/components/loaders/icons/dots-1.tsx +0 -194
- package/src/components/loaders/icons/dots-2.tsx +0 -15
- package/src/components/loaders/icons/dots-3.tsx +0 -38
- package/src/components/loaders/icons/dots-4.tsx +0 -90
- package/src/components/loaders/icons/dots-5.tsx +0 -30
- package/src/components/loaders/icons/dots-6.tsx +0 -72
- package/src/components/loaders/icons/dots-7.tsx +0 -51
- package/src/components/loaders/icons/dots-8.tsx +0 -42
- package/src/components/loaders/icons/dots-9.tsx +0 -27
- package/src/components/loaders/icons/lines-1.tsx +0 -96
- package/src/components/loaders/icons/lines-2.tsx +0 -48
- package/src/components/loaders/icons/pulse-1.tsx +0 -69
- package/src/components/loaders/icons/pulse-2.tsx +0 -69
- package/src/components/loaders/icons/pulse-3.tsx +0 -105
- package/src/components/loaders/icons/pulse-4.tsx +0 -105
- package/src/components/loaders/icons/pulse-5.tsx +0 -56
- package/src/components/loaders/icons/spinner-1.tsx +0 -162
- package/src/components/loaders/icons/spinner-2.tsx +0 -147
- package/src/components/loaders/icons/spinner-3.tsx +0 -35
- package/src/components/loaders/icons/spinner-4.tsx +0 -16
- package/src/components/loaders/index.ts +0 -1
- package/src/components/loaders/simple-loader/index.ts +0 -1
- package/src/components/loaders/simple-loader/simple-loader.stories.tsx +0 -42
- package/src/components/loaders/simple-loader/simple-loader.style.ts +0 -12
- package/src/components/loaders/simple-loader/simple-loader.tsx +0 -99
- package/src/components/modals/action-modal/action-modal.stories.tsx +0 -157
- package/src/components/modals/action-modal/action-modal.style.ts +0 -117
- package/src/components/modals/action-modal/action-modal.tsx +0 -148
- package/src/components/modals/action-modal/index.ts +0 -1
- package/src/components/modals/aside-modal/aside-modal.stories.tsx +0 -81
- package/src/components/modals/aside-modal/aside-modal.style.ts +0 -88
- package/src/components/modals/aside-modal/aside-modal.tsx +0 -64
- package/src/components/modals/aside-modal/index.ts +0 -1
- package/src/components/modals/confirmation-modal/confirmation-modal.stories.tsx +0 -62
- package/src/components/modals/confirmation-modal/confirmation-modal.style.ts +0 -17
- package/src/components/modals/confirmation-modal/confirmation-modal.tsx +0 -43
- package/src/components/modals/confirmation-modal/index.ts +0 -1
- package/src/components/modals/index.ts +0 -6
- package/src/components/modals/menu/index.ts +0 -1
- package/src/components/modals/menu/menu.stories.tsx +0 -79
- package/src/components/modals/menu/menu.style.ts +0 -103
- package/src/components/modals/menu/menu.tsx +0 -186
- package/src/components/modals/modal/backdrop.tsx +0 -70
- package/src/components/modals/modal/index.ts +0 -2
- package/src/components/modals/modal/modal.stories.tsx +0 -328
- package/src/components/modals/modal/modal.style.ts +0 -70
- package/src/components/modals/modal/modal.tsx +0 -106
- package/src/components/modals/portal/index.ts +0 -1
- package/src/components/modals/portal/portal.tsx +0 -21
- package/src/components/ripple/index.ts +0 -1
- package/src/components/ripple/ripple.stories.tsx +0 -38
- package/src/components/ripple/ripple.style.ts +0 -33
- package/src/components/ripple/ripple.tsx +0 -65
- package/src/components/smart-table/index.ts +0 -1
- package/src/components/smart-table/smart-table.column.tsx +0 -63
- package/src/components/smart-table/smart-table.helpers.tsx +0 -59
- package/src/components/smart-table/smart-table.hooks.ts +0 -27
- package/src/components/smart-table/smart-table.row.tsx +0 -29
- package/src/components/smart-table/smart-table.stories.tsx +0 -301
- package/src/components/smart-table/smart-table.style.ts +0 -102
- package/src/components/smart-table/smart-table.tsx +0 -112
- package/src/components/smart-table/smart-table.types.ts +0 -41
- package/src/components/tabs/index.ts +0 -1
- package/src/components/tabs/tabs-container.stories.tsx +0 -159
- package/src/components/tabs/tabs-list.tsx +0 -134
- package/src/components/tabs/tabs.stories.tsx +0 -68
- package/src/components/tabs/tabs.style.ts +0 -137
- package/src/components/tabs/tabs.tsx +0 -117
- package/src/components/tag/index.ts +0 -1
- package/src/components/tag/tag.stories.tsx +0 -48
- package/src/components/tag/tag.style.ts +0 -29
- package/src/components/tag/tag.tsx +0 -34
- package/src/components/tooltips/click-to-copy/click-to-copy.stories.tsx +0 -39
- package/src/components/tooltips/click-to-copy/click-to-copy.tsx +0 -41
- package/src/components/tooltips/click-to-copy/index.ts +0 -1
- package/src/components/tooltips/index.ts +0 -2
- package/src/components/tooltips/tooltip/index.ts +0 -1
- package/src/components/tooltips/tooltip/tooltip.stories.tsx +0 -38
- package/src/components/tooltips/tooltip/tooltip.style.ts +0 -93
- package/src/components/tooltips/tooltip/tooltip.tsx +0 -59
- package/src/components/typography/index.ts +0 -2
- package/src/components/typography/typography.constants.ts +0 -43
- package/src/components/typography/typography.stories.tsx +0 -108
- package/src/components/typography/typography.style.ts +0 -76
- package/src/components/typography/typography.tsx +0 -100
- package/src/contexts/fetch-context/fetch-context.tsx +0 -114
- package/src/contexts/fetch-context/index.ts +0 -1
- package/src/contexts/form-context/form-context.tsx +0 -43
- package/src/contexts/form-context/index.ts +0 -1
- package/src/contexts/index.ts +0 -3
- package/src/contexts/theme-context/index.ts +0 -3
- package/src/contexts/theme-context/theme-context.tsx +0 -158
- package/src/contexts/theme-context/theme.animations.ts +0 -269
- package/src/contexts/theme-context/theme.defaults.ts +0 -209
- package/src/contexts/theme-context/theme.style.ts +0 -78
- package/src/contexts/theme-context/themes.ts +0 -98
- package/src/core/http-client.d.ts +0 -11
- package/src/core/http-client.d.ts.map +0 -1
- package/src/core/http-client.ts +0 -49
- package/src/core/index.d.ts +0 -2
- package/src/core/index.d.ts.map +0 -1
- package/src/core/index.ts +0 -1
- package/src/core/variants/color.ts +0 -9
- package/src/core/variants/index.ts +0 -3
- package/src/core/variants/radius.ts +0 -27
- package/src/core/variants/size.ts +0 -19
- package/src/helpers/format-bytes.ts +0 -11
- package/src/helpers/format-dates.ts +0 -11
- package/src/helpers/get-modal-position-relative-to-screen.ts +0 -86
- package/src/helpers/get-modal-position.ts +0 -211
- package/src/helpers/index.ts +0 -5
- package/src/helpers/text/index.ts +0 -1
- package/src/helpers/text/to-capitalize.ts +0 -17
- package/src/hooks/index.ts +0 -29
- package/src/hooks/use-async.ts +0 -88
- package/src/hooks/use-classnames.ts +0 -13
- package/src/hooks/use-click-outside.ts +0 -32
- package/src/hooks/use-constant.ts +0 -3
- package/src/hooks/use-cookie.ts +0 -124
- package/src/hooks/use-debounce.ts +0 -15
- package/src/hooks/use-dimensions.ts +0 -19
- package/src/hooks/use-dom-container.ts +0 -35
- package/src/hooks/use-event-listener.ts +0 -71
- package/src/hooks/use-file-reader.ts +0 -69
- package/src/hooks/use-geolocation.ts +0 -63
- package/src/hooks/use-hover.ts +0 -17
- package/src/hooks/use-in-view.ts +0 -18
- package/src/hooks/use-input-handlers.ts +0 -49
- package/src/hooks/use-intersection-observer.ts +0 -19
- package/src/hooks/use-media-query.ts +0 -25
- package/src/hooks/use-modal-in-container.ts +0 -85
- package/src/hooks/use-modal-transition.ts +0 -64
- package/src/hooks/use-modal.ts +0 -21
- package/src/hooks/use-mouse-position.ts +0 -64
- package/src/hooks/use-online-status.ts +0 -12
- package/src/hooks/use-render-count.ts +0 -11
- package/src/hooks/use-resize-observer.ts +0 -18
- package/src/hooks/use-safe-dispatch.ts +0 -22
- package/src/hooks/use-scroll.ts +0 -31
- package/src/hooks/use-state-history.ts +0 -22
- package/src/hooks/use-toggle-values.ts +0 -14
- package/src/hooks/use-toggle.ts +0 -11
- package/src/hooks/use-viewport.ts +0 -38
- package/src/index.ts +0 -5
- package/src/layouts/flex/flex.tsx +0 -75
- package/src/layouts/flex/index.ts +0 -1
- package/src/layouts/grid/grid.tsx +0 -86
- package/src/layouts/grid/index.ts +0 -1
- package/src/layouts/index.ts +0 -3
- package/src/layouts/section-layout/index.ts +0 -1
- package/src/layouts/section-layout/section-layout.stories.tsx +0 -55
- package/src/layouts/section-layout/section-layout.style.ts +0 -21
- package/src/layouts/section-layout/section-layout.tsx +0 -46
- package/src/stories/GettingStarted.mdx +0 -62
- package/src/types/generics.ts +0 -68
- package/src/types/index.ts +0 -1
- package/svg/Name=airplane, Category=object.svg +0 -3
- package/svg/Name=arrow-circle, Category=symbol.svg +0 -3
- package/svg/Name=arrow-down, Category=symbol.svg +0 -3
- package/svg/Name=arrow-left, Category=symbol.svg +0 -3
- package/svg/Name=arrow-right, Category=symbol.svg +0 -3
- package/svg/Name=arrow-up, Category=symbol.svg +0 -3
- package/svg/Name=bell, Category=object.svg +0 -3
- package/svg/Name=bicycle, Category=object.svg +0 -3
- package/svg/Name=book-open, Category=object.svg +0 -3
- package/svg/Name=book-solid, Category=object.svg +0 -6
- package/svg/Name=box-shadow, Category=symbol.svg +0 -5
- package/svg/Name=calendar, Category=object.svg +0 -3
- package/svg/Name=camera, Category=object.svg +0 -3
- package/svg/Name=caret-down, Category=symbol.svg +0 -3
- package/svg/Name=caret-left, Category=symbol.svg +0 -3
- package/svg/Name=caret-right, Category=symbol.svg +0 -3
- package/svg/Name=caret-up, Category=symbol.svg +0 -3
- package/svg/Name=checkmark, Category=symbol.svg +0 -3
- package/svg/Name=clean-computer, Category=object.svg +0 -10
- package/svg/Name=codepen, Category=social.svg +0 -3
- package/svg/Name=creative, Category=symbol.svg +0 -5
- package/svg/Name=cross, Category=symbol.svg +0 -4
- package/svg/Name=crossed-flags, Category=object.svg +0 -4
- package/svg/Name=cv, Category=symbol.svg +0 -5
- package/svg/Name=design-ui, Category=symbol.svg +0 -9
- package/svg/Name=document, Category=object.svg +0 -3
- package/svg/Name=door-closed, Category=object.svg +0 -3
- package/svg/Name=door-open, Category=object.svg +0 -3
- package/svg/Name=double-caret-down, Category=symbol.svg +0 -4
- package/svg/Name=double-caret-left, Category=symbol.svg +0 -4
- package/svg/Name=double-caret-righ, Category=symbol.svg +0 -4
- package/svg/Name=double-caret-up, Category=symbol.svg +0 -4
- package/svg/Name=download, Category=symbol.svg +0 -5
- package/svg/Name=dropper, Category=object.svg +0 -5
- package/svg/Name=envelope, Category=object.svg +0 -3
- package/svg/Name=exclamation-close, Category=symbol.svg +0 -4
- package/svg/Name=exclamation-open, Category=symbol.svg +0 -4
- package/svg/Name=external-link, Category=symbol.svg +0 -3
- package/svg/Name=eye, Category=object.svg +0 -4
- package/svg/Name=eye-hidden, Category=object.svg +0 -7
- package/svg/Name=facebook, Category=social.svg +0 -3
- package/svg/Name=form, Category=symbol.svg +0 -8
- package/svg/Name=game-control, Category=object.svg +0 -3
- package/svg/Name=gear, Category=object.svg +0 -3
- package/svg/Name=github, Category=social.svg +0 -3
- package/svg/Name=house, Category=object.svg +0 -3
- package/svg/Name=hyphen, Category=symbol.svg +0 -3
- package/svg/Name=info, Category=symbol.svg +0 -3
- package/svg/Name=instagram, Category=social.svg +0 -3
- package/svg/Name=link, Category=symbol.svg +0 -5
- package/svg/Name=linkedin, Category=social.svg +0 -3
- package/svg/Name=magnifying-glass, Category=object.svg +0 -3
- package/svg/Name=message, Category=symbol.svg +0 -4
- package/svg/Name=moon, Category=object.svg +0 -5
- package/svg/Name=npm, Category=social.svg +0 -3
- package/svg/Name=order-list, Category=symbol.svg +0 -7
- package/svg/Name=pencil, Category=object.svg +0 -3
- package/svg/Name=pin-location, Category=symbol.svg +0 -3
- package/svg/Name=question-mark-close, Category=symbol.svg +0 -3
- package/svg/Name=question-mark-open, Category=symbol.svg +0 -3
- package/svg/Name=share, Category=symbol.svg +0 -5
- package/svg/Name=spinner, Category=symbol.svg +0 -9
- package/svg/Name=star, Category=object.svg +0 -3
- package/svg/Name=star-empty, Category=object.svg +0 -3
- package/svg/Name=sun, Category=object.svg +0 -11
- package/svg/Name=text-shadow, Category=symbol.svg +0 -4
- package/svg/Name=thinking, Category=symbol.svg +0 -3
- package/svg/Name=trash-can, Category=object.svg +0 -4
- package/svg/Name=upload, Category=symbol.svg +0 -5
- package/svg/Name=user, Category=symbol.svg +0 -4
- package/svg/Name=warning, Category=symbol.svg +0 -5
- package/svg/Name=whatsapp, Category=social.svg +0 -3
- package/svgconfig.json +0 -4
- package/tsconfig.json +0 -15
- package/tsup.config.cjs +0 -21
- package/vite.config.ts +0 -14
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { RadiusVariants, SizeVariants } from '../../core/variants';
|
|
2
|
-
import { Flex } from '../../layouts';
|
|
3
|
-
|
|
4
|
-
import { Tag } from './tag';
|
|
5
|
-
|
|
6
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof Tag> = {
|
|
9
|
-
title: 'Tag',
|
|
10
|
-
component: Tag,
|
|
11
|
-
argTypes: {
|
|
12
|
-
isSelected: { control: 'boolean' },
|
|
13
|
-
children: { control: 'text' },
|
|
14
|
-
size: { control: 'inline-radio', options: Object.values(SizeVariants) },
|
|
15
|
-
radius: { control: 'inline-radio', options: Object.values(RadiusVariants) },
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
children: 'Tag',
|
|
19
|
-
isSelected: false,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof Tag>;
|
|
25
|
-
|
|
26
|
-
export const Single: Story = {
|
|
27
|
-
args: {},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Many: Story = {
|
|
31
|
-
args: {},
|
|
32
|
-
decorators: [
|
|
33
|
-
(Story, { args }) => (
|
|
34
|
-
<Flex wrap='wrap' gap='1em'>
|
|
35
|
-
<Story {...args} />
|
|
36
|
-
<Story {...args} />
|
|
37
|
-
<Story {...args} />
|
|
38
|
-
<Story {...args} />
|
|
39
|
-
<Story {...args} />
|
|
40
|
-
<Story {...args} />
|
|
41
|
-
<Story {...args} />
|
|
42
|
-
<Story {...args} />
|
|
43
|
-
<Story {...args} />
|
|
44
|
-
<Story {...args} />
|
|
45
|
-
</Flex>
|
|
46
|
-
),
|
|
47
|
-
],
|
|
48
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { RadiusStyles, RadiusVariants, SizeStyles, SizeVariants } from '../../core/variants';
|
|
4
|
-
|
|
5
|
-
type TagStyleProps = {
|
|
6
|
-
$size: `${SizeVariants}`;
|
|
7
|
-
$radius: `${RadiusVariants}`;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const TagStyle = styled.span<TagStyleProps>`
|
|
11
|
-
padding: 0.4em 0.8em;
|
|
12
|
-
border-radius: 0.3em;
|
|
13
|
-
border: 1px solid;
|
|
14
|
-
background: ${props => props.theme.colors.text.main}11;
|
|
15
|
-
color: ${props => props.theme.colors.text.main};
|
|
16
|
-
transition: all 300ms ease;
|
|
17
|
-
display: inline-block;
|
|
18
|
-
font-size: ${props => props.theme.constants.typography.label.fontSize};
|
|
19
|
-
user-select: none;
|
|
20
|
-
|
|
21
|
-
${props => SizeStyles[props.$size]}
|
|
22
|
-
${props => RadiusStyles[props.$radius]}
|
|
23
|
-
|
|
24
|
-
&:hover,
|
|
25
|
-
&.tag-selected {
|
|
26
|
-
background: ${props => props.theme.colors.primary.main};
|
|
27
|
-
color: ${props => props.theme.colors.primary.contrast};
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
import { RadiusVariants, SizeVariants } from '../../core/variants';
|
|
4
|
-
|
|
5
|
-
import { TagStyle } from './tag.style';
|
|
6
|
-
|
|
7
|
-
import { useClassNames } from '@polpo/hooks';
|
|
8
|
-
|
|
9
|
-
type TagProps = HTMLAttributes<HTMLElement> & {
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
isSelected?: boolean;
|
|
12
|
-
size?: `${SizeVariants}`;
|
|
13
|
-
radius?: `${RadiusVariants}`;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const Tag = ({
|
|
17
|
-
children,
|
|
18
|
-
className: customClassName = '',
|
|
19
|
-
isSelected = false,
|
|
20
|
-
size = SizeVariants.Medium,
|
|
21
|
-
radius = RadiusVariants.Medium,
|
|
22
|
-
...props
|
|
23
|
-
}: TagProps) => {
|
|
24
|
-
const className = useClassNames({
|
|
25
|
-
[customClassName]: !!customClassName,
|
|
26
|
-
'tag-selected': isSelected,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<TagStyle className={className} {...props} $size={size} $radius={radius}>
|
|
31
|
-
{children}
|
|
32
|
-
</TagStyle>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import TooltipStory from '../tooltip/tooltip.stories';
|
|
2
|
-
|
|
3
|
-
import { ClickToCopy } from './click-to-copy';
|
|
4
|
-
|
|
5
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof ClickToCopy> = {
|
|
8
|
-
title: 'Tooltips/ClickToCopy',
|
|
9
|
-
component: ClickToCopy,
|
|
10
|
-
argTypes: {
|
|
11
|
-
position: TooltipStory.argTypes?.position,
|
|
12
|
-
offset: TooltipStory.argTypes?.offset,
|
|
13
|
-
children: { control: 'text' },
|
|
14
|
-
value: { control: 'text' },
|
|
15
|
-
tooltipText: { control: 'text' },
|
|
16
|
-
tooltipCopiedText: { control: 'text' },
|
|
17
|
-
copiedTextTimeout: { control: { type: 'range', min: 100, max: 2000, step: 100 } },
|
|
18
|
-
},
|
|
19
|
-
args: {
|
|
20
|
-
tooltipText: 'Copy to clipboard',
|
|
21
|
-
tooltipCopiedText: 'Copied!',
|
|
22
|
-
value: 'Hello world',
|
|
23
|
-
},
|
|
24
|
-
render: (args, { children }) => <ClickToCopy {...args}>{children}</ClickToCopy>,
|
|
25
|
-
decorators: [
|
|
26
|
-
Story => (
|
|
27
|
-
<Story>
|
|
28
|
-
<span>Hello world</span>
|
|
29
|
-
</Story>
|
|
30
|
-
),
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default meta;
|
|
35
|
-
type Story = StoryObj<typeof ClickToCopy>;
|
|
36
|
-
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
args: {},
|
|
39
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Tooltip, TooltipProps } from '../tooltip';
|
|
4
|
-
|
|
5
|
-
type ClickToCopyProps = {
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
position?: TooltipProps['position'];
|
|
8
|
-
offset?: TooltipProps['offset'];
|
|
9
|
-
value: string;
|
|
10
|
-
tooltipText: string;
|
|
11
|
-
tooltipCopiedText?: string;
|
|
12
|
-
copiedTextTimeout?: number;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const ClickToCopy = ({
|
|
16
|
-
children,
|
|
17
|
-
value,
|
|
18
|
-
position,
|
|
19
|
-
offset,
|
|
20
|
-
tooltipText,
|
|
21
|
-
tooltipCopiedText,
|
|
22
|
-
copiedTextTimeout = 500,
|
|
23
|
-
}: ClickToCopyProps) => {
|
|
24
|
-
const [justCopied, setJustCopied] = useState(false);
|
|
25
|
-
|
|
26
|
-
const handleCopy = () => {
|
|
27
|
-
setJustCopied(true);
|
|
28
|
-
navigator.clipboard.writeText(value);
|
|
29
|
-
setTimeout(() => setJustCopied(false), copiedTextTimeout);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Tooltip
|
|
34
|
-
content={justCopied && tooltipCopiedText ? tooltipCopiedText : tooltipText}
|
|
35
|
-
position={position}
|
|
36
|
-
offset={offset}
|
|
37
|
-
>
|
|
38
|
-
<span onClick={handleCopy}>{children}</span>
|
|
39
|
-
</Tooltip>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './click-to-copy';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tooltip';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Tooltip } from './tooltip';
|
|
2
|
-
|
|
3
|
-
import { PositionContainer } from '@polpo/helpers';
|
|
4
|
-
|
|
5
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof Tooltip> = {
|
|
8
|
-
title: 'Tooltips/Tooltip',
|
|
9
|
-
component: Tooltip,
|
|
10
|
-
argTypes: {
|
|
11
|
-
position: {
|
|
12
|
-
control: 'inline-radio',
|
|
13
|
-
options: [PositionContainer.TOP, PositionContainer.LEFT, PositionContainer.RIGHT, PositionContainer.BOTTOM],
|
|
14
|
-
},
|
|
15
|
-
offset: { control: { type: 'range', min: 0, max: 200, step: 1 } },
|
|
16
|
-
disabled: { control: 'boolean' },
|
|
17
|
-
content: { control: 'text' },
|
|
18
|
-
children: { control: false },
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
content: 'Tooltip content',
|
|
22
|
-
},
|
|
23
|
-
render: (args, { children }) => <Tooltip {...args}>{children}</Tooltip>,
|
|
24
|
-
decorators: [
|
|
25
|
-
Story => (
|
|
26
|
-
<Story>
|
|
27
|
-
<span>Hello world</span>
|
|
28
|
-
</Story>
|
|
29
|
-
),
|
|
30
|
-
],
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
type Story = StoryObj<typeof Tooltip>;
|
|
35
|
-
|
|
36
|
-
export const Default: Story = {
|
|
37
|
-
args: {},
|
|
38
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { Modal } from '../../modals';
|
|
4
|
-
|
|
5
|
-
export const TooltipStyle = styled(Modal)`
|
|
6
|
-
color: ${props => props.theme.colors.text.main};
|
|
7
|
-
font-size: ${props => props.theme.constants.typography.small.fontSize};
|
|
8
|
-
line-height: 1em;
|
|
9
|
-
border-radius: 5px;
|
|
10
|
-
padding: 0.5em 1em;
|
|
11
|
-
display: block;
|
|
12
|
-
border: 1px solid;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
|
|
15
|
-
&::before {
|
|
16
|
-
content: '';
|
|
17
|
-
display: block;
|
|
18
|
-
background: ${props => props.theme.colors.background.paper};
|
|
19
|
-
position: absolute;
|
|
20
|
-
z-index: 1;
|
|
21
|
-
width: 10px;
|
|
22
|
-
height: 10px;
|
|
23
|
-
border-left: 1px solid transparent;
|
|
24
|
-
border-top: 1px solid transparent;
|
|
25
|
-
border-right: 1px solid ${props => props.theme.colors.text.main};
|
|
26
|
-
border-bottom: 1px solid ${props => props.theme.colors.text.main};
|
|
27
|
-
border-radius: 0 0 3px 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&.left {
|
|
31
|
-
animation: fadeInRight 250ms ease-out;
|
|
32
|
-
|
|
33
|
-
&.close-animation {
|
|
34
|
-
animation: fadeOutLeft 250ms ease-out;
|
|
35
|
-
transform: translateX(-10px);
|
|
36
|
-
opacity: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&::before {
|
|
40
|
-
top: 50%;
|
|
41
|
-
left: 100%;
|
|
42
|
-
transform: translate(-50%, -50%) rotate(-45deg);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.right {
|
|
47
|
-
animation: fadeInLeft 250ms ease-out;
|
|
48
|
-
|
|
49
|
-
&.close-animation {
|
|
50
|
-
animation: fadeOutRight 250ms ease-out;
|
|
51
|
-
transform: translateX(10px);
|
|
52
|
-
opacity: 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&::before {
|
|
56
|
-
top: 50%;
|
|
57
|
-
right: 100%;
|
|
58
|
-
transform: translate(50%, -50%) rotate(135deg);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&.top {
|
|
63
|
-
animation: fadeInDown 250ms ease-out;
|
|
64
|
-
|
|
65
|
-
&.close-animation {
|
|
66
|
-
animation: fadeOutUp 250ms ease-out;
|
|
67
|
-
transform: translateY(-10px);
|
|
68
|
-
opacity: 0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&::before {
|
|
72
|
-
top: 100%;
|
|
73
|
-
left: 50%;
|
|
74
|
-
transform: translate(-50%, -50%) rotate(45deg);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&.bottom {
|
|
79
|
-
animation: fadeInUp 250ms ease-out;
|
|
80
|
-
|
|
81
|
-
&.close-animation {
|
|
82
|
-
animation: fadeOutDown 250ms ease-out;
|
|
83
|
-
transform: translateY(10px);
|
|
84
|
-
opacity: 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&::before {
|
|
88
|
-
left: 50%;
|
|
89
|
-
bottom: 100%;
|
|
90
|
-
transform: translate(-50%, 50%) rotate(-135deg);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React, { cloneElement, ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { TooltipStyle } from './tooltip.style';
|
|
4
|
-
|
|
5
|
-
import { PositionContainer } from '@polpo/helpers';
|
|
6
|
-
import { useClassNames, useEventListener, useModal } from '@polpo/hooks';
|
|
7
|
-
|
|
8
|
-
export type TooltipProps = {
|
|
9
|
-
position?:
|
|
10
|
-
| `${PositionContainer.TOP}`
|
|
11
|
-
| `${PositionContainer.LEFT}`
|
|
12
|
-
| `${PositionContainer.RIGHT}`
|
|
13
|
-
| `${PositionContainer.BOTTOM}`;
|
|
14
|
-
offset?: number | `${number}`;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
children: React.ReactElement;
|
|
17
|
-
content: React.ReactNode;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const Tooltip = ({
|
|
21
|
-
position = PositionContainer.TOP,
|
|
22
|
-
children,
|
|
23
|
-
content,
|
|
24
|
-
offset = 5,
|
|
25
|
-
disabled = false,
|
|
26
|
-
}: TooltipProps) => {
|
|
27
|
-
const { containerRef, openModal, closeModal, isOpen } = useModal();
|
|
28
|
-
|
|
29
|
-
const classNames = useClassNames({
|
|
30
|
-
[position]: true,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
useEventListener('mouseenter', () => openModal(), containerRef);
|
|
34
|
-
useEventListener('mouseleave', () => closeModal(), containerRef);
|
|
35
|
-
|
|
36
|
-
if (disabled) return children;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<>
|
|
40
|
-
{cloneElement(children as ReactElement, { ref: containerRef })}
|
|
41
|
-
|
|
42
|
-
<TooltipStyle
|
|
43
|
-
backdrop='none'
|
|
44
|
-
id='tooltip'
|
|
45
|
-
isOpen={isOpen}
|
|
46
|
-
containerRef={containerRef}
|
|
47
|
-
onClose={closeModal}
|
|
48
|
-
position={position}
|
|
49
|
-
className={classNames}
|
|
50
|
-
closeOnClickOutside={false}
|
|
51
|
-
offset={6 + +offset}
|
|
52
|
-
windowOffset={10}
|
|
53
|
-
transitionDuration={250}
|
|
54
|
-
>
|
|
55
|
-
<span className='tooltip-content'>{content}</span>
|
|
56
|
-
</TooltipStyle>
|
|
57
|
-
</>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export enum TypographyVariant {
|
|
4
|
-
HERO = 'hero',
|
|
5
|
-
HEADER1 = 'header1',
|
|
6
|
-
HEADER2 = 'header2',
|
|
7
|
-
HEADER3 = 'header3',
|
|
8
|
-
HEADER4 = 'header4',
|
|
9
|
-
BODY = 'body',
|
|
10
|
-
LABEL = 'label',
|
|
11
|
-
LABEL_FORM = 'label-form',
|
|
12
|
-
SMALL = 'small',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const TypographyVariantsElements: Record<TypographyVariant, keyof React.ReactHTML> = {
|
|
16
|
-
[TypographyVariant.HERO]: 'h1',
|
|
17
|
-
[TypographyVariant.HEADER1]: 'h1',
|
|
18
|
-
[TypographyVariant.HEADER2]: 'h2',
|
|
19
|
-
[TypographyVariant.HEADER3]: 'h3',
|
|
20
|
-
[TypographyVariant.HEADER4]: 'h4',
|
|
21
|
-
[TypographyVariant.BODY]: 'p',
|
|
22
|
-
[TypographyVariant.LABEL]: 'span',
|
|
23
|
-
[TypographyVariant.LABEL_FORM]: 'label',
|
|
24
|
-
[TypographyVariant.SMALL]: 'small',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const TypographyVariantsClassNames: Record<TypographyVariant, string> = {
|
|
28
|
-
[TypographyVariant.HERO]: 'hero',
|
|
29
|
-
[TypographyVariant.HEADER1]: 'header1',
|
|
30
|
-
[TypographyVariant.HEADER2]: 'header2',
|
|
31
|
-
[TypographyVariant.HEADER3]: 'header3',
|
|
32
|
-
[TypographyVariant.HEADER4]: 'header4',
|
|
33
|
-
[TypographyVariant.BODY]: 'body',
|
|
34
|
-
[TypographyVariant.LABEL]: 'label',
|
|
35
|
-
[TypographyVariant.LABEL_FORM]: 'label',
|
|
36
|
-
[TypographyVariant.SMALL]: 'small',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export enum TypographyWeight {
|
|
40
|
-
LIGHT = 'light',
|
|
41
|
-
REGULAR = 'regular',
|
|
42
|
-
BOLD = 'bold',
|
|
43
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { ColorVariants } from '../../core/variants';
|
|
2
|
-
import { Grid } from '../../layouts';
|
|
3
|
-
|
|
4
|
-
import { Typography } from './typography';
|
|
5
|
-
import { TypographyVariant, TypographyWeight } from './typography.constants';
|
|
6
|
-
|
|
7
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof Typography> = {
|
|
10
|
-
title: 'Typography',
|
|
11
|
-
component: Typography,
|
|
12
|
-
argTypes: {
|
|
13
|
-
variant: { control: 'inline-radio', options: Object.values(TypographyVariant) },
|
|
14
|
-
weight: { control: 'inline-radio', options: Object.values(TypographyWeight) },
|
|
15
|
-
color: { control: 'inline-radio', options: [...Object.values(ColorVariants), undefined] },
|
|
16
|
-
nowrap: { control: 'boolean' },
|
|
17
|
-
recommendedWidth: { control: 'boolean' },
|
|
18
|
-
as: { control: false },
|
|
19
|
-
children: { control: 'text' },
|
|
20
|
-
noPadding: { control: 'boolean' },
|
|
21
|
-
align: { control: 'inline-radio', options: ['left', 'center', 'right'] },
|
|
22
|
-
family: { control: 'inline-radio', options: ['primary', 'code'] },
|
|
23
|
-
className: { control: false },
|
|
24
|
-
style: { control: false },
|
|
25
|
-
htmlFor: { control: false },
|
|
26
|
-
},
|
|
27
|
-
args: {
|
|
28
|
-
children: 'Hello world',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default meta;
|
|
33
|
-
type Story = StoryObj<typeof Typography>;
|
|
34
|
-
|
|
35
|
-
export const Default: Story = {
|
|
36
|
-
args: {},
|
|
37
|
-
decorators: [
|
|
38
|
-
Story => (
|
|
39
|
-
<Grid gap={16} gtc='500px'>
|
|
40
|
-
<Story />
|
|
41
|
-
<Typography>
|
|
42
|
-
Sample text to compare, lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa cumque dolores
|
|
43
|
-
doloribus, eaque earum eligendi est excepturi explicabo inventore, perferendis, quisquam recusandae ullam
|
|
44
|
-
voluptatum. Dolores?
|
|
45
|
-
</Typography>
|
|
46
|
-
</Grid>
|
|
47
|
-
),
|
|
48
|
-
],
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Paragraph: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
weight: 'light',
|
|
54
|
-
},
|
|
55
|
-
argTypes: {
|
|
56
|
-
children: { control: false },
|
|
57
|
-
variant: { control: false },
|
|
58
|
-
},
|
|
59
|
-
decorators: [],
|
|
60
|
-
render: args => (
|
|
61
|
-
<Grid gtc='500px'>
|
|
62
|
-
<Typography {...args} variant='body'>
|
|
63
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad at deserunt, dolorum eum necessitatibus, nihil
|
|
64
|
-
nobis placeat qui quidem repellat, temporibus totam voluptates. Accusamus amet aspernatur atque dolorum eligendi
|
|
65
|
-
est fugiat, illum labore, nam nobis obcaecati perferendis quod recusandae sed?
|
|
66
|
-
</Typography>
|
|
67
|
-
</Grid>
|
|
68
|
-
),
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Variants: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
weight: 'light',
|
|
74
|
-
},
|
|
75
|
-
argTypes: {
|
|
76
|
-
children: { control: false },
|
|
77
|
-
variant: { control: false },
|
|
78
|
-
},
|
|
79
|
-
decorators: [],
|
|
80
|
-
render: args => (
|
|
81
|
-
<Grid>
|
|
82
|
-
<Typography {...args} variant='hero'>
|
|
83
|
-
Hero
|
|
84
|
-
</Typography>
|
|
85
|
-
<Typography {...args} variant='header1'>
|
|
86
|
-
Header1
|
|
87
|
-
</Typography>
|
|
88
|
-
<Typography {...args} variant='header2'>
|
|
89
|
-
Header2
|
|
90
|
-
</Typography>
|
|
91
|
-
<Typography {...args} variant='header3'>
|
|
92
|
-
Header3
|
|
93
|
-
</Typography>
|
|
94
|
-
<Typography {...args} variant='header4'>
|
|
95
|
-
Header4
|
|
96
|
-
</Typography>
|
|
97
|
-
<Typography {...args} variant='body'>
|
|
98
|
-
Body
|
|
99
|
-
</Typography>
|
|
100
|
-
<Typography {...args} variant='label'>
|
|
101
|
-
Label
|
|
102
|
-
</Typography>
|
|
103
|
-
<Typography {...args} variant='small'>
|
|
104
|
-
Small
|
|
105
|
-
</Typography>
|
|
106
|
-
</Grid>
|
|
107
|
-
),
|
|
108
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { createGlobalStyle, css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const TypographyStyle = createGlobalStyle(({ theme: { constants } }) =>
|
|
4
|
-
Object.entries(constants.typography).map(
|
|
5
|
-
([key, { breakpoints, fontSize, lineHeight, defaultWeight, weights }]) => css`
|
|
6
|
-
.${key} {
|
|
7
|
-
font-size: ${fontSize};
|
|
8
|
-
line-height: ${lineHeight};
|
|
9
|
-
font-weight: ${defaultWeight};
|
|
10
|
-
margin: 0;
|
|
11
|
-
padding: 0.5em 0 0.4em;
|
|
12
|
-
|
|
13
|
-
&.recommended-width {
|
|
14
|
-
max-width: 70ch;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&.code-family {
|
|
18
|
-
font-family: monospace;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.no-padding {
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.nowrap {
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
text-overflow: ellipsis;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.nowrap-max-lines {
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
display: -webkit-box;
|
|
34
|
-
-webkit-box-orient: vertical;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.nowrap-max-lines-2 {
|
|
38
|
-
-webkit-line-clamp: 2;
|
|
39
|
-
line-clamp: 2;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.nowrap-max-lines-3 {
|
|
43
|
-
-webkit-line-clamp: 3;
|
|
44
|
-
line-clamp: 3;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.nowrap-max-lines-4 {
|
|
48
|
-
-webkit-line-clamp: 4;
|
|
49
|
-
line-clamp: 4;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&.nowrap-max-lines-5 {
|
|
53
|
-
-webkit-line-clamp: 5;
|
|
54
|
-
line-clamp: 5;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
${Object.entries(weights).map(
|
|
58
|
-
([fontWeight, weight]) => css`
|
|
59
|
-
&.${fontWeight} {
|
|
60
|
-
font-weight: ${weight};
|
|
61
|
-
}
|
|
62
|
-
`,
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
${breakpoints.map(
|
|
66
|
-
({ fontSize, lineHeight, from }) => css`
|
|
67
|
-
@media all and (min-width: ${constants.breakpoints[from as keyof typeof constants.breakpoints]}) {
|
|
68
|
-
font-size: ${fontSize};
|
|
69
|
-
line-height: ${lineHeight};
|
|
70
|
-
}
|
|
71
|
-
`,
|
|
72
|
-
)}
|
|
73
|
-
}
|
|
74
|
-
`,
|
|
75
|
-
),
|
|
76
|
-
);
|