@infonomic/uikit 2.0.0 → 2.1.1
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/button/index.js +1 -17
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +35 -31
- package/src/astro.d.ts +43 -0
- package/src/astro.js +2 -2
- package/src/components/@types/shared.ts +24 -0
- package/src/components/accordion/accordion.module.css +60 -0
- package/src/components/accordion/accordion.stories.tsx +117 -0
- package/src/components/accordion/accordion.tsx +105 -0
- package/src/components/animation/fade-in-lift.stories.tsx +81 -0
- package/src/components/animation/fade-in-lift.tsx +42 -0
- package/src/components/avatar/avatar.module.css +54 -0
- package/src/components/avatar/avatar.stories.tsx +28 -0
- package/src/components/avatar/avatar.tsx +19 -0
- package/src/components/button/@types/button.ts +17 -0
- package/src/components/button/button-group.module.css +17 -0
- package/src/components/button/button-group.stories.tsx +45 -0
- package/src/components/button/button-group.tsx +132 -0
- package/src/components/button/button-icon.stories.tsx +145 -0
- package/src/components/button/button-intents.stories.tsx +50 -0
- package/src/components/button/button-variants.stories.tsx +60 -0
- package/src/components/button/button.astro +86 -0
- package/src/components/button/button.module.css +533 -0
- package/src/components/button/button.tsx +81 -0
- package/src/components/button/control-buttons.module.css +144 -0
- package/src/components/button/control-buttons.stories.tsx +60 -0
- package/src/components/button/control-buttons.tsx +137 -0
- package/src/components/button/copy-button.module.css +31 -0
- package/src/components/button/copy-button.stories.tsx +50 -0
- package/src/components/button/copy-button.tsx +92 -0
- package/src/components/button/icon-button.astro +47 -0
- package/src/components/button/icon-button.tsx +44 -0
- package/src/components/button/index.ts +5 -0
- package/src/components/calendar/calendar.module.css +315 -0
- package/src/components/calendar/calendar.stories.tsx +139 -0
- package/src/components/calendar/calendar.tsx +173 -0
- package/src/components/card/card-content.astro +14 -0
- package/src/components/card/card-description.astro +14 -0
- package/src/components/card/card-footer.astro +14 -0
- package/src/components/card/card-header.astro +14 -0
- package/src/components/card/card-title.astro +14 -0
- package/src/components/card/card.astro +41 -0
- package/src/components/card/card.module.css +67 -0
- package/src/components/card/card.stories.tsx +61 -0
- package/src/components/card/card.tsx +86 -0
- package/src/components/container/container.astro +13 -0
- package/src/components/container/container.module.css +28 -0
- package/src/components/container/container.stories.tsx +42 -0
- package/src/components/container/container.tsx +23 -0
- package/src/components/dropdown/dropdown.module.css +131 -0
- package/src/components/dropdown/dropdown.stories.tsx +103 -0
- package/src/components/dropdown/dropdown.tsx +193 -0
- package/src/components/hamburger/hamburger.astro +30 -0
- package/src/components/hamburger/hamburger.tsx +66 -0
- package/src/components/input/@types/checkbox.ts +20 -0
- package/src/components/input/@types/input.ts +20 -0
- package/src/components/input/checkbox-group.tsx +78 -0
- package/src/components/input/checkbox.module.css +267 -0
- package/src/components/input/checkbox.stories.tsx +240 -0
- package/src/components/input/checkbox.tsx +95 -0
- package/src/components/input/error-text.astro +14 -0
- package/src/components/input/error-text.module.css +19 -0
- package/src/components/input/error-text.tsx +18 -0
- package/src/components/input/errors.tsx +37 -0
- package/src/components/input/help-text.astro +13 -0
- package/src/components/input/help-text.module.css +19 -0
- package/src/components/input/help-text.tsx +13 -0
- package/src/components/input/index.tsx +8 -0
- package/src/components/input/input-adornment.astro +26 -0
- package/src/components/input/input-adornment.module.css +18 -0
- package/src/components/input/input-adornment.tsx +36 -0
- package/src/components/input/input.astro +99 -0
- package/src/components/input/input.module.css +310 -0
- package/src/components/input/input.stories.tsx +174 -0
- package/src/components/input/input.tsx +103 -0
- package/src/components/input/label.astro +24 -0
- package/src/components/input/label.module.css +28 -0
- package/src/components/input/label.tsx +25 -0
- package/src/components/input/radio-group.module.css +219 -0
- package/src/components/input/radio-group.stories.tsx +73 -0
- package/src/components/input/radio-group.tsx +67 -0
- package/src/components/input/select.module.css +75 -0
- package/src/components/input/select.stories.tsx +34 -0
- package/src/components/input/select.tsx +115 -0
- package/src/components/input/text-area.module.css +9 -0
- package/src/components/input/text-area.stories.tsx +51 -0
- package/src/components/input/text-area.tsx +81 -0
- package/src/components/input/utils.ts +21 -0
- package/src/components/notifications/@types/alert.ts +12 -0
- package/src/components/notifications/@types/toast.ts +12 -0
- package/src/components/notifications/alert.module.css +114 -0
- package/src/components/notifications/alert.stories.tsx +39 -0
- package/src/components/notifications/alert.tsx +117 -0
- package/src/components/notifications/index.ts +2 -0
- package/src/components/notifications/toast.module.css +237 -0
- package/src/components/notifications/toast.stories.tsx +42 -0
- package/src/components/notifications/toast.tsx +124 -0
- package/src/components/overlay/index.stories.tsx +29 -0
- package/src/components/overlay/index.ts +2 -0
- package/src/components/overlay/overlay.module.css +41 -0
- package/src/components/overlay/overlay.tsx +61 -0
- package/src/components/pager/@types/index.ts +2 -0
- package/src/components/pager/ellipses.tsx +18 -0
- package/src/components/pager/event-pager.tsx +18 -0
- package/src/components/pager/first-button.tsx +53 -0
- package/src/components/pager/hooks/types/usePagination.ts +80 -0
- package/src/components/pager/hooks/usePagination.ts +140 -0
- package/src/components/pager/icons/first.tsx +33 -0
- package/src/components/pager/icons/index.tsx +4 -0
- package/src/components/pager/icons/last.tsx +33 -0
- package/src/components/pager/icons/next.tsx +20 -0
- package/src/components/pager/icons/previous.tsx +20 -0
- package/src/components/pager/index.ts +4 -0
- package/src/components/pager/last-button.tsx +57 -0
- package/src/components/pager/next-button.tsx +55 -0
- package/src/components/pager/number-button.tsx +83 -0
- package/src/components/pager/pagination.module.css +165 -0
- package/src/components/pager/pagination.stories.tsx +190 -0
- package/src/components/pager/pagination.tsx +266 -0
- package/src/components/pager/previous-button.tsx +51 -0
- package/src/components/scroll-area/scroll-area.module.css +80 -0
- package/src/components/scroll-area/scroll-area.stories.tsx +33 -0
- package/src/components/scroll-area/scroll-area.tsx +22 -0
- package/src/components/scroll-to-top/scroll-to-top.tsx +59 -0
- package/src/components/section/section.astro +13 -0
- package/src/components/section/section.module.css +7 -0
- package/src/components/section/section.tsx +23 -0
- package/src/components/shimmer/shimmer.module.css +53 -0
- package/src/components/shimmer/shimmer.stories.tsx +24 -0
- package/src/components/shimmer/shimmer.tsx +70 -0
- package/src/components/table/table.module.css +100 -0
- package/src/components/table/table.stories.tsx +95 -0
- package/src/components/table/table.tsx +165 -0
- package/src/components/tabs/tabs.module.css +64 -0
- package/src/components/tabs/tabs.stories.tsx +47 -0
- package/src/components/tabs/tabs.tsx +75 -0
- package/src/components/timeline/timeline.module.css +87 -0
- package/src/components/timeline/timeline.stories.tsx +50 -0
- package/src/components/timeline/timeline.tsx +177 -0
- package/src/components/tooltip/tooltip.module.css +55 -0
- package/src/components/tooltip/tooltip.stories.tsx +59 -0
- package/src/components/tooltip/tooltip.tsx +51 -0
- package/src/declarations.d.ts +4 -0
- package/src/hooks/use-media-query.ts +20 -0
- package/src/icons/activity-icon.tsx +40 -0
- package/src/icons/calendar-icon.tsx +39 -0
- package/src/icons/check-icon.tsx +33 -0
- package/src/icons/chevron-down-icon.tsx +39 -0
- package/src/icons/chevron-left-double-icon.tsx +58 -0
- package/src/icons/chevron-left-icon.tsx +58 -0
- package/src/icons/chevron-right-double-icon.tsx +58 -0
- package/src/icons/chevron-right-icon.tsx +58 -0
- package/src/icons/chevrons-up-down.tsx +37 -0
- package/src/icons/close-icon.astro +38 -0
- package/src/icons/close-icon.tsx +30 -0
- package/src/icons/copy-icon.tsx +35 -0
- package/src/icons/danger-icon.tsx +18 -0
- package/src/icons/dashboard-icon.tsx +41 -0
- package/src/icons/delete-icon.tsx +34 -0
- package/src/icons/document-icon.tsx +38 -0
- package/src/icons/download-icon.tsx +39 -0
- package/src/icons/edit-icon.tsx +35 -0
- package/src/icons/ellipsis-icon.tsx +38 -0
- package/src/icons/email-icon.tsx +33 -0
- package/src/icons/external-link-icon.tsx +39 -0
- package/src/icons/github-icon.tsx +27 -0
- package/src/icons/globe-icon.tsx +50 -0
- package/src/icons/google-icon.tsx +44 -0
- package/src/icons/gripper-vertical-icon.tsx +43 -0
- package/src/icons/history-icon.tsx +32 -0
- package/src/icons/home-icon.tsx +34 -0
- package/src/icons/icon-element.astro +27 -0
- package/src/icons/icon-element.tsx +32 -0
- package/src/icons/icon-sprite.tsx +18 -0
- package/src/icons/icons.module.css +147 -0
- package/src/icons/index.stories.tsx +25 -0
- package/src/icons/index.ts +39 -0
- package/src/icons/info-icon.tsx +18 -0
- package/src/icons/infonomic-icon.tsx +173 -0
- package/src/icons/light-icon.astro +36 -0
- package/src/icons/light-icon.tsx +29 -0
- package/src/icons/location-pin-icon.tsx +36 -0
- package/src/icons/moon-icon.astro +38 -0
- package/src/icons/moon-icon.tsx +42 -0
- package/src/icons/plus-icon.tsx +34 -0
- package/src/icons/primary-icon.tsx +22 -0
- package/src/icons/refresh-icon.tsx +33 -0
- package/src/icons/return-icon.tsx +36 -0
- package/src/icons/roles-icon.tsx +34 -0
- package/src/icons/search-icon.astro +40 -0
- package/src/icons/search-icon.tsx +29 -0
- package/src/icons/search-menu-icon.tsx +42 -0
- package/src/icons/settings-gear-icon.tsx +36 -0
- package/src/icons/settings-sliders-icon.tsx +43 -0
- package/src/icons/sign-out-icon.tsx +35 -0
- package/src/icons/source/icon-calendar.svg +1 -0
- package/src/icons/source/icon-check.svg +4 -0
- package/src/icons/source/icon-close.svg +3 -0
- package/src/icons/source/icon-coinbase.svg +9 -0
- package/src/icons/source/icon-copy.svg +4 -0
- package/src/icons/source/icon-document.svg +5 -0
- package/src/icons/source/icon-download.svg +4 -0
- package/src/icons/source/icon-edit.svg +6 -0
- package/src/icons/source/icon-eth-purple.svg +15 -0
- package/src/icons/source/icon-etherscan.svg +5 -0
- package/src/icons/source/icon-external-link.svg +4 -0
- package/src/icons/source/icon-globe.svg +7 -0
- package/src/icons/source/icon-gripper-vertical.svg +9 -0
- package/src/icons/source/icon-info.svg +4 -0
- package/src/icons/source/icon-infonomic.svg +43 -0
- package/src/icons/source/icon-ledger.svg +4 -0
- package/src/icons/source/icon-light.svg +3 -0
- package/src/icons/source/icon-location-pin.svg +8 -0
- package/src/icons/source/icon-logout.svg +6 -0
- package/src/icons/source/icon-metamask.svg +32 -0
- package/src/icons/source/icon-moon.svg +3 -0
- package/src/icons/source/icon-plus.svg +4 -0
- package/src/icons/source/icon-refresh.svg +4 -0
- package/src/icons/source/icon-return.svg +4 -0
- package/src/icons/source/icon-search-menu.svg +13 -0
- package/src/icons/source/icon-search.svg +3 -0
- package/src/icons/source/icon-settings-gear.svg +5 -0
- package/src/icons/source/icon-settings.svg +12 -0
- package/src/icons/source/icon-wallet.svg +3 -0
- package/src/icons/source/icon-walletconnect.svg +4 -0
- package/src/icons/source/icon-x.svg +4 -0
- package/src/icons/stopwatch-icon.tsx +39 -0
- package/src/icons/success-icon.tsx +18 -0
- package/src/icons/types/icon.ts +8 -0
- package/src/icons/user-icon.tsx +33 -0
- package/src/icons/users-icon.tsx +35 -0
- package/src/icons/wallet-icon.tsx +29 -0
- package/src/icons/warning-icon.tsx +18 -0
- package/src/icons/x-icon.tsx +33 -0
- package/src/loaders/ellipses.tsx +36 -0
- package/src/loaders/loaders.stories.tsx +46 -0
- package/src/loaders/ring.tsx +33 -0
- package/src/loaders/spinner.tsx +28 -0
- package/src/loaders/types/index.ts +6 -0
- package/src/react.ts +99 -0
- package/src/styles/base/animations.css +143 -0
- package/src/styles/base/base.css +5 -0
- package/src/styles/base/colors.css +163 -0
- package/src/styles/base/colors.stories.tsx +671 -0
- package/src/styles/base/reset.css +464 -0
- package/src/styles/base/typography.css +25 -0
- package/src/styles/base/vars.css +188 -0
- package/src/styles/components/card.css +20 -0
- package/src/styles/components/checkbox.css +55 -0
- package/src/styles/components/components.css +11 -0
- package/src/styles/components/directional-button.css +92 -0
- package/src/styles/components/dropdown.css +19 -0
- package/src/styles/components/fade-in-lift.css +13 -0
- package/src/styles/components/hamburger.css +107 -0
- package/src/styles/components/icon-element.css +4 -0
- package/src/styles/components/list-checkbox.css +60 -0
- package/src/styles/components/loaders.css +196 -0
- package/src/styles/components/popover.css +15 -0
- package/src/styles/components/scroll-to-top.css +89 -0
- package/src/styles/components/toast.css +18 -0
- package/src/styles/styles.css +6 -0
- package/src/styles/theme/autofill.css +58 -0
- package/src/styles/theme/scrollers.css +52 -0
- package/src/styles/theme/theme.css +130 -0
- package/src/styles/theme/theme.stories.tsx +33 -0
- package/src/styles/typography/code.stories.tsx +76 -0
- package/src/styles/typography/default.stories.tsx +51 -0
- package/src/styles/typography/fonts.css +30 -0
- package/src/styles/typography/lists.stories.tsx +50 -0
- package/src/styles/typography/prose.css +404 -0
- package/src/styles/typography/quote.stories.tsx +37 -0
- package/src/styles/typography.css +24 -0
- package/src/styles/utils/scroll-layout-shift.css +9 -0
- package/src/styles/utils/utility-classes.css +1278 -0
- package/src/styles/utils/utils.css +2 -0
- package/src/theme/theme-provider/index.ts +1 -0
- package/src/theme/theme-provider/provider.tsx +44 -0
- package/src/utils/capitalize.ts +6 -0
- package/src/utils/externalLinkProps.ts +6 -0
- package/src/utils/findMatch.ts +7 -0
- package/src/utils/getPortalRoot.ts +3 -0
- package/src/utils/isTouchDevice.ts +11 -0
- package/src/utils/objectsToArray.ts +15 -0
- package/src/utils/objectsToString.ts +5 -0
- package/src/utils/polymorphic.ts +16 -0
- package/src/utils/to-kebab-case.ts +5 -0
- package/src/widgets/datepicker/datepicker.module.css +189 -0
- package/src/widgets/datepicker/datepicker.stories.tsx +25 -0
- package/src/widgets/datepicker/datepicker.tsx +310 -0
- package/src/widgets/drawer/drawer-container.tsx +26 -0
- package/src/widgets/drawer/drawer-content.tsx +26 -0
- package/src/widgets/drawer/drawer-context.tsx +49 -0
- package/src/widgets/drawer/drawer-header.tsx +27 -0
- package/src/widgets/drawer/drawer-top-actions.tsx +27 -0
- package/src/widgets/drawer/drawer-wrapper.tsx +54 -0
- package/src/widgets/drawer/drawer.module.css +116 -0
- package/src/widgets/drawer/drawer.stories.tsx +224 -0
- package/src/widgets/drawer/drawer.tsx +115 -0
- package/src/widgets/drawer/motionDomAnimation.ts +4 -0
- package/src/widgets/drawer/motionDomMax.ts +4 -0
- package/src/widgets/modal/modal-actions.tsx +26 -0
- package/src/widgets/modal/modal-container.tsx +26 -0
- package/src/widgets/modal/modal-content.tsx +26 -0
- package/src/widgets/modal/modal-header.tsx +27 -0
- package/src/widgets/modal/modal-wrapper.tsx +50 -0
- package/src/widgets/modal/modal.module.css +85 -0
- package/src/widgets/modal/modal.stories.tsx +71 -0
- package/src/widgets/modal/modal.tsx +110 -0
- package/src/widgets/modal/motionDomAnimation.ts +4 -0
- package/src/widgets/modal/motionDomMax.ts +4 -0
- package/src/widgets/search/index.ts +1 -0
- package/src/widgets/search/search.stories.tsx +18 -0
- package/src/widgets/search/search.tsx +186 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@layer infonomic-theme {
|
|
2
|
+
/* input:-webkit-autofill, input:autofill,
|
|
3
|
+
input:-webkit-autofill:hover, input:autofill:hover,
|
|
4
|
+
input:-webkit-autofill:focus, input:autofill:focus,
|
|
5
|
+
textarea:-webkit-autofill, textarea:autofill,
|
|
6
|
+
textarea:-webkit-autofill:hover,textarea:autofill:hover,
|
|
7
|
+
textarea:-webkit-autofill:focus,textarea:autofill:focus,
|
|
8
|
+
select:-webkit-autofill, select:autofill,
|
|
9
|
+
select:-webkit-autofill:hover,select:autofill:hover,
|
|
10
|
+
select:-webkit-autofill:focus, select:autofill:focus {
|
|
11
|
+
border: none;
|
|
12
|
+
-webkit-text-fill-color: #ffb74d !important;
|
|
13
|
+
-webkit-box-shadow: none !important;
|
|
14
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
15
|
+
} */
|
|
16
|
+
|
|
17
|
+
input:autofill,
|
|
18
|
+
input:autofill:hover,
|
|
19
|
+
input:autofill:focus,
|
|
20
|
+
textarea:autofill,
|
|
21
|
+
textarea:autofill:hover,
|
|
22
|
+
textarea:autofill:focus,
|
|
23
|
+
select:autofill,
|
|
24
|
+
select:autofill:hover,
|
|
25
|
+
select:autofill:focus {
|
|
26
|
+
border: 1px solid #d89d3d !important;
|
|
27
|
+
-webkit-text-fill-color: black !important;
|
|
28
|
+
-webkit-box-shadow: 0 0 0px 1000px #fff2dc inset !important;
|
|
29
|
+
box-shadow: 0 0 0px 1000px #fff2dc inset !important;
|
|
30
|
+
transition: background-color 5000s ease-in-out 0s !important;
|
|
31
|
+
color: black !important;
|
|
32
|
+
background-color: rgb(250, 217, 167) !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 🌙 Dark via `.dark` class. We rely on the
|
|
36
|
+
* consuming application to detect a user's preferred
|
|
37
|
+
* color scheme - either by header or cookie. and set
|
|
38
|
+
* a root html class accordingly
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
.dark input:autofill,
|
|
42
|
+
.dark input:autofill:hover,
|
|
43
|
+
.dark input:autofill:focus,
|
|
44
|
+
.dark textarea:autofill,
|
|
45
|
+
.dark textarea:autofill:hover,
|
|
46
|
+
.dark textarea:autofill:focus,
|
|
47
|
+
.dark select:autofill,
|
|
48
|
+
.dark select:autofill:hover,
|
|
49
|
+
.dark select:autofill:focus {
|
|
50
|
+
border: 1px solid var(--theme-600) !important;
|
|
51
|
+
-webkit-text-fill-color: white !important;
|
|
52
|
+
-webkit-box-shadow: 0 0 0px 1000px var(--theme-600) inset !important;
|
|
53
|
+
box-shadow: 0 0 0px 1000px var(--theme-600) inset !important;
|
|
54
|
+
transition: background-color 5000s ease-in-out 0s !important;
|
|
55
|
+
color: white !important;
|
|
56
|
+
background-color: rgba(100, 100, 100, 0.5) !important;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@layer infonomic-theme {
|
|
2
|
+
:root {
|
|
3
|
+
--scroll-bar-thumb: var(--theme-400);
|
|
4
|
+
--scroll-bar-track: var(--theme-600);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* rgb(44, 47, 86) = theme secondary 900 */
|
|
8
|
+
:root.dark {
|
|
9
|
+
--scroll-bar-thumb: var(--canvas-700);
|
|
10
|
+
--scroll-bar-track: var(--canvas-900);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* For Google Chrome */
|
|
14
|
+
::-webkit-scrollbar {
|
|
15
|
+
width: 0.6em;
|
|
16
|
+
height: 0.6em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::-webkit-scrollbar-thumb {
|
|
20
|
+
background: var(--scroll-bar-thumb);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
::-webkit-scrollbar-track {
|
|
24
|
+
background: var(--scroll-bar-track);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
::-webkit-scrollbar-corner {
|
|
28
|
+
background: var(--scroll-bar-track);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Firefox */
|
|
32
|
+
html {
|
|
33
|
+
scrollbar-width: thin;
|
|
34
|
+
scrollbar-color: var(--scroll-bar-thumb) var(--scroll-bar-track);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.component--scroller {
|
|
38
|
+
--scroll-bar-thumb: var(--scroll-bar-thumb);
|
|
39
|
+
--scroll-bar-track: var(--scroll-bar-track);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dark .component--scroller {
|
|
43
|
+
--scroll-bar-thumb: var(--scroll-bar-thumb);
|
|
44
|
+
--scroll-bar-track: var(--scroll-bar-track);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.component--scroller {
|
|
48
|
+
overflow-y: auto;
|
|
49
|
+
scrollbar-width: thin;
|
|
50
|
+
scrollbar-color: var(--scroll-bar-thumb) var(--scroll-bar-track);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@import "./autofill.css";
|
|
2
|
+
@import "./scrollers.css";
|
|
3
|
+
|
|
4
|
+
@layer infonomic-theme {
|
|
5
|
+
:root {
|
|
6
|
+
--background: var(--canvas-25);
|
|
7
|
+
--foreground: var(--gray-900);
|
|
8
|
+
--text: var(--gray-900);
|
|
9
|
+
--headings: var(--primary-700);
|
|
10
|
+
--muted: oklch(from var(--foreground) calc(l * 2) c h);
|
|
11
|
+
--border-color: var(--gray-100);
|
|
12
|
+
--shadow: var(--shadow-md);
|
|
13
|
+
--loader-color: var(--primary-500);
|
|
14
|
+
|
|
15
|
+
--invert-background: var(--canvas-900);
|
|
16
|
+
--invert-foreground: var(--gray-50);
|
|
17
|
+
--invert-text: var(--gray-50);
|
|
18
|
+
--invert-headings: var(--gray-50);
|
|
19
|
+
--invert-muted: oklch(from var(--foreground) calc(l * 0.75) c h);
|
|
20
|
+
--invert-border-color: var(--canvas-700);
|
|
21
|
+
--invert-shadow: var(--shadow-lg);
|
|
22
|
+
--invert-loader-color: var(--gray-50);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* 🌙 Dark via `.dark` class. We rely on the consuming
|
|
26
|
+
* application to detect a user's preferred color scheme
|
|
27
|
+
* - either by header or cookie, and to set a root html
|
|
28
|
+
* class accordingly
|
|
29
|
+
*/
|
|
30
|
+
.dark {
|
|
31
|
+
--background: var(--invert-background);
|
|
32
|
+
--foreground: var(--invert-foreground);
|
|
33
|
+
--text: var(--invert-text);
|
|
34
|
+
--headings: var(--invert-headings);
|
|
35
|
+
--border-color: var(--invert-border-color);
|
|
36
|
+
--shadow: var(--invert-shadow);
|
|
37
|
+
--muted: var(--invert-muted);
|
|
38
|
+
--loader-color: var(--invert-loader-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Brute force our not-dark class for now until we figure out
|
|
42
|
+
* a better way to do this. Note - the following does NOT work:
|
|
43
|
+
.dark:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
44
|
+
*/
|
|
45
|
+
.not-dark {
|
|
46
|
+
--background: var(--canvas-25);
|
|
47
|
+
--foreground: var(--gray-900);
|
|
48
|
+
--text: var(--gray-900);
|
|
49
|
+
--headings: var(--primary-800);
|
|
50
|
+
--muted: oklch(from var(--foreground) calc(l * 2) c h);
|
|
51
|
+
--border-color: var(--gray-100);
|
|
52
|
+
--shadow: var(--shadow-md);
|
|
53
|
+
--loader-color: var(--primary-500);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
html {
|
|
57
|
+
font-size: 1rem;
|
|
58
|
+
color: var(--text);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Redeclared here to change the specificity and scope of --prose-body */
|
|
62
|
+
html .not-dark {
|
|
63
|
+
color: var(--text);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Default (light mode) */
|
|
67
|
+
::selection {
|
|
68
|
+
background-color: var(--theme-600);
|
|
69
|
+
color: white;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Dark mode */
|
|
73
|
+
.dark ::selection {
|
|
74
|
+
background-color: var(--theme-200);
|
|
75
|
+
color: var(--gray-900);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.background {
|
|
79
|
+
background-color: var(--background);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.foreground {
|
|
83
|
+
color: var(--foreground);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.text {
|
|
87
|
+
color: var(--text);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.headings {
|
|
91
|
+
color: var(--headings);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.muted {
|
|
95
|
+
font-size: 0.925rem;
|
|
96
|
+
color: var(--muted);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.shadow {
|
|
100
|
+
box-shadow: var(--shadow);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.border-color {
|
|
104
|
+
border-color: var(--border-color);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.border {
|
|
108
|
+
border-color: var(--border-color);
|
|
109
|
+
border-width: var(--border-width-thin);
|
|
110
|
+
border-style: var(--border-style-solid);
|
|
111
|
+
border-radius: var(--border-radius-sm);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* External link */
|
|
115
|
+
.external-link::after {
|
|
116
|
+
content: "";
|
|
117
|
+
display: inline-block;
|
|
118
|
+
background-image: url("/external-link-light.svg");
|
|
119
|
+
background-repeat: no-repeat;
|
|
120
|
+
background-position: 20% 50%;
|
|
121
|
+
background-size: 65% auto;
|
|
122
|
+
width: 1.1rem;
|
|
123
|
+
height: 1.1rem;
|
|
124
|
+
margin-right: -5px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.dark .external-link::after {
|
|
128
|
+
background-image: url("/external-link-dark.svg");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
export const Base = (): React.JSX.Element => {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<div style={{ marginBottom: '48px' }}>
|
|
7
|
+
<div style={{ maxWidth: '700px', margin: 'auto' }}>
|
|
8
|
+
<div className="shadow p-3 border rounded">
|
|
9
|
+
<h2>Heading 2</h2>
|
|
10
|
+
<span className="muted">Muted text here.</span>
|
|
11
|
+
<p>
|
|
12
|
+
This is a paragraph of text that we'll use for our theme storybook page. This is
|
|
13
|
+
a paragraph of text that we'll use for our theme storybook page. This is a
|
|
14
|
+
paragraph of text that we'll use for our theme storybook page. This is a
|
|
15
|
+
paragraph of text that we'll use for our theme storybook page.
|
|
16
|
+
</p>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const meta: Meta = {
|
|
25
|
+
/* 👇 The title prop is optional.
|
|
26
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
27
|
+
* to learn how to generate automatic titles
|
|
28
|
+
*/
|
|
29
|
+
title: 'Theme',
|
|
30
|
+
component: Base,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default meta
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import { Highlight, themes } from 'prism-react-renderer'
|
|
4
|
+
|
|
5
|
+
const code = `const x = 'foo';
|
|
6
|
+
function printFoo() {
|
|
7
|
+
console.log(x);
|
|
8
|
+
}
|
|
9
|
+
printFoo();`
|
|
10
|
+
|
|
11
|
+
type CodeIntrinsicProps = React.JSX.IntrinsicElements['pre']
|
|
12
|
+
interface CodeProps extends CodeIntrinsicProps {
|
|
13
|
+
className?: string
|
|
14
|
+
title?: string
|
|
15
|
+
code: string
|
|
16
|
+
language?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function CodeDemo({ code, className, language = 'jsx' }: CodeProps): React.JSX.Element {
|
|
20
|
+
return (
|
|
21
|
+
<Highlight theme={themes.nightOwl} code={code} language={language}>
|
|
22
|
+
{({ tokens, getLineProps, getTokenProps }) => (
|
|
23
|
+
<pre style={{ backgroundColor: 'var(--canvas-800)' }} className={className}>
|
|
24
|
+
{tokens.map((line, i) => {
|
|
25
|
+
const lineProps = getLineProps({ line, key: i })
|
|
26
|
+
return (
|
|
27
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
28
|
+
<div {...lineProps} key={i} style={{ lineHeight: 1.3 }}>
|
|
29
|
+
<span style={{ marginLeft: '-8px', marginRight: '12px' }}>{i + 1}</span>
|
|
30
|
+
{line.map((token, key) => (
|
|
31
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
32
|
+
<span key={key} {...getTokenProps({ token })} />
|
|
33
|
+
))}
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
})}
|
|
37
|
+
</pre>
|
|
38
|
+
)}
|
|
39
|
+
</Highlight>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Code = (): React.JSX.Element => {
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<div style={{ marginBottom: '48px' }}>
|
|
47
|
+
<div style={{ maxWidth: '700px', margin: 'auto' }} className="prose">
|
|
48
|
+
<h1>Heading 1</h1>
|
|
49
|
+
<p>
|
|
50
|
+
This is a <code>inline code here</code> of text that we'll use for our typography
|
|
51
|
+
and code storybook page. This is a paragraph of text that we'll use for our
|
|
52
|
+
typography and code storybook page. Here is a code block...
|
|
53
|
+
</p>
|
|
54
|
+
<CodeDemo code={code} />
|
|
55
|
+
<p>
|
|
56
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
57
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
58
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
59
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const meta: Meta = {
|
|
68
|
+
/* 👇 The title prop is optional.
|
|
69
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
70
|
+
* to learn how to generate automatic titles
|
|
71
|
+
*/
|
|
72
|
+
title: 'Typography',
|
|
73
|
+
component: Code,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default meta
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
export const Default = (): React.JSX.Element => {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<div style={{ marginBottom: '48px' }}>
|
|
7
|
+
<div style={{ maxWidth: '700px', margin: 'auto' }} className="prose">
|
|
8
|
+
<h1>Heading 1 - With Some More Text to Test on Mobile</h1>
|
|
9
|
+
<p>
|
|
10
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
11
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
12
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
13
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
14
|
+
</p>
|
|
15
|
+
<h2>Heading 2 - With Some More Text to Test on Mobile</h2>
|
|
16
|
+
<p>
|
|
17
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
18
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
19
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
20
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
21
|
+
</p>
|
|
22
|
+
<h3>Heading 3 - With Some More Text to Test on Mobile</h3>
|
|
23
|
+
<p>
|
|
24
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
25
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
26
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
27
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
28
|
+
</p>
|
|
29
|
+
<h4>Heading 4 - With Some More Text to Test on Mobile</h4>
|
|
30
|
+
<p>
|
|
31
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
32
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
33
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
34
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const meta: Meta = {
|
|
43
|
+
/* 👇 The title prop is optional.
|
|
44
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
45
|
+
* to learn how to generate automatic titles
|
|
46
|
+
*/
|
|
47
|
+
title: 'Typography',
|
|
48
|
+
component: Default,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default meta
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@layer infonomic-typography {
|
|
2
|
+
:root {
|
|
3
|
+
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
4
|
+
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
5
|
+
|
|
6
|
+
--font-display: "Roboto", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
7
|
+
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
8
|
+
|
|
9
|
+
--font-serif: "Merriweather", Georgia, Cambria, "Times New Roman", Times, serif;
|
|
10
|
+
|
|
11
|
+
--font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
12
|
+
"Liberation Mono", "Courier New", monospace;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sans {
|
|
16
|
+
font-family: var(--font-sans);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.serif {
|
|
20
|
+
font-family: var(--font-serif);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.mono {
|
|
24
|
+
font-family: var(--font-mono);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.display {
|
|
28
|
+
font-family: var(--font-display);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
export const Lists = (): React.JSX.Element => {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<div style={{ marginBottom: '48px' }}>
|
|
7
|
+
<div style={{ maxWidth: '700px', margin: 'auto' }} className="prose">
|
|
8
|
+
<h1>Lists</h1>
|
|
9
|
+
<p>
|
|
10
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
11
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
12
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
13
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
14
|
+
</p>
|
|
15
|
+
<ol>
|
|
16
|
+
<li>One - item in a list here</li>
|
|
17
|
+
<li>Two - item in a list here</li>
|
|
18
|
+
<li>Three - item in a list here</li>
|
|
19
|
+
<li>Four - item in a list here</li>
|
|
20
|
+
<li>Five - item in a list here</li>
|
|
21
|
+
</ol>
|
|
22
|
+
<p>
|
|
23
|
+
This is a paragraph of text that we'll use for our typography storybook page. This
|
|
24
|
+
is a paragraph of text that we'll use for our typography storybook page. This is a
|
|
25
|
+
paragraph of text that we'll use for our typography storybook page. This is a
|
|
26
|
+
paragraph of text that we'll use for our typography storybook page.
|
|
27
|
+
</p>
|
|
28
|
+
<ul>
|
|
29
|
+
<li>Item - item in a list here</li>
|
|
30
|
+
<li>Item - item in a list here</li>
|
|
31
|
+
<li>Item - item in a list here</li>
|
|
32
|
+
<li>Item - item in a list here</li>
|
|
33
|
+
<li>Item - item in a list here</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const meta: Meta = {
|
|
42
|
+
/* 👇 The title prop is optional.
|
|
43
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
44
|
+
* to learn how to generate automatic titles
|
|
45
|
+
*/
|
|
46
|
+
title: 'Typography',
|
|
47
|
+
component: Lists,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default meta
|