@infonomic/uikit 2.0.0 → 2.1.0
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/card/card.d.ts.map +1 -1
- package/package.json +9 -5
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEzC,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE,IAAI,CAAA;CACf;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAE5F,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CACrB,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;AAEpB,QAAA,MAAM,IAAI;KAAI,CAAC,SAAS,KAAK,CAAC,WAAW,iEAOtC,SAAS,CAAC,CAAC,CAAC;;;uCAkB+B,UAAU;;;;uCAMX,UAAU;;;;uCASJ,UAAU;;;;uCAKd,UAAU;;;;uCAKX,UAAU;;;CAjCvD,CAAA;AAID,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;CAChC;AAsCD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@infonomic/uikit",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.1.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
|
|
8
8
|
"keywords": [
|
|
@@ -25,11 +25,15 @@
|
|
|
25
25
|
"module": "./dist/react.js",
|
|
26
26
|
"main": "./dist/react.js",
|
|
27
27
|
"files": [
|
|
28
|
-
"dist",
|
|
29
|
-
"src/
|
|
28
|
+
"dist/",
|
|
29
|
+
"src/"
|
|
30
30
|
],
|
|
31
31
|
"exports": {
|
|
32
|
-
"./astro":
|
|
32
|
+
"./astro": {
|
|
33
|
+
"types": "./src/astro.d.ts",
|
|
34
|
+
"import": "./src/astro.js",
|
|
35
|
+
"default": "./src/astro.js"
|
|
36
|
+
},
|
|
33
37
|
"./react": {
|
|
34
38
|
"types": "./dist/react.d.ts",
|
|
35
39
|
"import": "./dist/react.js",
|
|
@@ -94,7 +98,7 @@
|
|
|
94
98
|
"access": "public",
|
|
95
99
|
"files": [
|
|
96
100
|
"dist/",
|
|
97
|
-
"src/
|
|
101
|
+
"src/"
|
|
98
102
|
]
|
|
99
103
|
},
|
|
100
104
|
"scripts": {
|
package/src/astro.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type ButtonComponent from './components/button/button.astro'
|
|
2
|
+
import type IconButtonComponent from './components/button/icon-button.astro'
|
|
3
|
+
import type CardComponent from './components/card/card.astro'
|
|
4
|
+
import type CardContentComponent from './components/card/card-content.astro'
|
|
5
|
+
import type CardDescriptionComponent from './components/card/card-description.astro'
|
|
6
|
+
import type CardFooterComponent from './components/card/card-footer.astro'
|
|
7
|
+
import type CardHeaderComponent from './components/card/card-header.astro'
|
|
8
|
+
import type CardTitleComponent from './components/card/card-title.astro'
|
|
9
|
+
import type ContainerComponent from './components/container/container.astro'
|
|
10
|
+
import type HamburgerComponent from './components/hamburger/hamburger.astro'
|
|
11
|
+
import type ErrorTextComponent from './components/input/error-text.astro'
|
|
12
|
+
import type HelpTextComponent from './components/input/help-text.astro'
|
|
13
|
+
import type InputComponent from './components/input/input.astro'
|
|
14
|
+
import type InputAdornmentComponent from './components/input/input-adornment.astro'
|
|
15
|
+
import type LabelComponent from './components/input/label.astro'
|
|
16
|
+
import type SectionComponent from './components/section/section.astro'
|
|
17
|
+
import type CloseIconComponent from './icons/close-icon.astro'
|
|
18
|
+
import type IconElementComponent from './icons/icon-element.astro'
|
|
19
|
+
import type LightIconComponent from './icons/light-icon.astro'
|
|
20
|
+
import type MoonIconComponent from './icons/moon-icon.astro'
|
|
21
|
+
import type SearchIconComponent from './icons/search-icon.astro'
|
|
22
|
+
|
|
23
|
+
export declare const Button: typeof ButtonComponent
|
|
24
|
+
export declare const Card: typeof CardComponent
|
|
25
|
+
export declare const CardContent: typeof CardContentComponent
|
|
26
|
+
export declare const CardDescription: typeof CardDescriptionComponent
|
|
27
|
+
export declare const CardFooter: typeof CardFooterComponent
|
|
28
|
+
export declare const CardHeader: typeof CardHeaderComponent
|
|
29
|
+
export declare const CardTitle: typeof CardTitleComponent
|
|
30
|
+
export declare const CloseIcon: typeof CloseIconComponent
|
|
31
|
+
export declare const Container: typeof ContainerComponent
|
|
32
|
+
export declare const ErrorText: typeof ErrorTextComponent
|
|
33
|
+
export declare const Hamburger: typeof HamburgerComponent
|
|
34
|
+
export declare const HelpText: typeof HelpTextComponent
|
|
35
|
+
export declare const IconButton: typeof IconButtonComponent
|
|
36
|
+
export declare const IconElement: typeof IconElementComponent
|
|
37
|
+
export declare const Input: typeof InputComponent
|
|
38
|
+
export declare const InputAdornment: typeof InputAdornmentComponent
|
|
39
|
+
export declare const Label: typeof LabelComponent
|
|
40
|
+
export declare const LightIcon: typeof LightIconComponent
|
|
41
|
+
export declare const MoonIcon: typeof MoonIconComponent
|
|
42
|
+
export declare const SearchIcon: typeof SearchIconComponent
|
|
43
|
+
export declare const Section: typeof SectionComponent
|
package/src/astro.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import ButtonComponent from './components/button/button.astro'
|
|
2
2
|
import IconButtonComponent from './components/button/icon-button.astro'
|
|
3
|
+
import CardComponent from './components/card/card.astro'
|
|
3
4
|
import CardContentComponent from './components/card/card-content.astro'
|
|
4
5
|
import CardDescriptionComponent from './components/card/card-description.astro'
|
|
5
6
|
import CardFooterComponent from './components/card/card-footer.astro'
|
|
6
7
|
import CardHeaderComponent from './components/card/card-header.astro'
|
|
7
8
|
import CardTitleComponent from './components/card/card-title.astro'
|
|
8
|
-
import CardComponent from './components/card/card.astro'
|
|
9
9
|
import ContainerComponent from './components/container/container.astro'
|
|
10
10
|
import HamburgerComponent from './components/hamburger/hamburger.astro'
|
|
11
11
|
import ErrorTextComponent from './components/input/error-text.astro'
|
|
12
12
|
import HelpTextComponent from './components/input/help-text.astro'
|
|
13
|
-
import InputAdornmentComponent from './components/input/input-adornment.astro'
|
|
14
13
|
import InputComponent from './components/input/input.astro'
|
|
14
|
+
import InputAdornmentComponent from './components/input/input-adornment.astro'
|
|
15
15
|
import LabelComponent from './components/input/label.astro'
|
|
16
16
|
import SectionComponent from './components/section/section.astro'
|
|
17
17
|
import CloseIconComponent from './icons/close-icon.astro'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// typescript types
|
|
2
|
+
|
|
3
|
+
// Arrays make available an iterator for easy storybook layout
|
|
4
|
+
|
|
5
|
+
export const size = ['xs', 'sm', 'md', 'lg', 'xl'] as const
|
|
6
|
+
export type Size = (typeof size)[number]
|
|
7
|
+
|
|
8
|
+
export const intent = [
|
|
9
|
+
'primary',
|
|
10
|
+
'secondary',
|
|
11
|
+
'noeffect',
|
|
12
|
+
'success',
|
|
13
|
+
'info',
|
|
14
|
+
'warning',
|
|
15
|
+
'danger',
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
export type Intent = (typeof intent)[number]
|
|
19
|
+
|
|
20
|
+
export const icons = ['success', 'info', 'success', 'warning', 'danger'] as const
|
|
21
|
+
export type Icons = (typeof icons)[number]
|
|
22
|
+
|
|
23
|
+
export const position = ['top-left', 'top-right', 'bottom-left', 'bottom-right'] as const
|
|
24
|
+
export type Position = (typeof position)[number]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
|
+
|
|
3
|
+
@layer infonomic-components {
|
|
4
|
+
.root {
|
|
5
|
+
border-radius: 6px;
|
|
6
|
+
width: 300px;
|
|
7
|
+
background-color: var(--canvas-25);
|
|
8
|
+
box-shadow: var(--shadow-md);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.item {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
margin-top: 1px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.header {
|
|
17
|
+
margin: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.trigger {
|
|
22
|
+
display: flex;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
align-items: center;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.content {
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
|
|
31
|
+
&[data-state="open"] {
|
|
32
|
+
animation: accordionSlideDown 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[data-state="closed"] {
|
|
36
|
+
animation: accordionSlideUp 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@keyframes accordionSlideDown {
|
|
42
|
+
from {
|
|
43
|
+
height: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
to {
|
|
47
|
+
height: var(--radix-accordion-content-height);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes accordionSlideUp {
|
|
52
|
+
from {
|
|
53
|
+
height: var(--radix-accordion-content-height);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
to {
|
|
57
|
+
height: 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import { ChevronDownIcon } from '@radix-ui/react-icons'
|
|
4
|
+
|
|
5
|
+
import { Accordion as AccordionComponent } from './accordion.js'
|
|
6
|
+
|
|
7
|
+
const meta: Meta = {
|
|
8
|
+
/* 👇 The title prop is optional.
|
|
9
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
10
|
+
* to learn how to generate automatic titles
|
|
11
|
+
*/
|
|
12
|
+
title: 'Components',
|
|
13
|
+
component: AccordionComponent.Root,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof AccordionComponent.Root>
|
|
19
|
+
|
|
20
|
+
export const Accordion: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
type: 'single',
|
|
23
|
+
asChild: true,
|
|
24
|
+
defaultValue: 'item-1',
|
|
25
|
+
collapsible: true,
|
|
26
|
+
className: 'accordion-root border',
|
|
27
|
+
},
|
|
28
|
+
render: (args) => (
|
|
29
|
+
<>
|
|
30
|
+
<style>
|
|
31
|
+
{`
|
|
32
|
+
.accordion-root {
|
|
33
|
+
border-radius: 6px;
|
|
34
|
+
padding: 12px 6px;
|
|
35
|
+
width: 300px;
|
|
36
|
+
background-color: white;
|
|
37
|
+
box-shadow: var(--shadow-md);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.accordion-header {
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
padding: 12px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.accordion-header:hover {
|
|
46
|
+
background-color: var(--gray-25);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.accordion-chevron {
|
|
50
|
+
transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.accordion-trigger[data-state="open"] + .accordion-chevron {
|
|
54
|
+
transform: rotate(180deg);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.accordion-content {
|
|
58
|
+
padding: 0 12px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.dark .accordion-root {
|
|
62
|
+
background-color: var(--canvas-700);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dark .accordion-header:hover {
|
|
66
|
+
background-color: var(--canvas-600);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
`}
|
|
71
|
+
</style>
|
|
72
|
+
<AccordionComponent.Root {...args}>
|
|
73
|
+
<nav>
|
|
74
|
+
<AccordionComponent.Item value="item-1" className="accordion-item">
|
|
75
|
+
<AccordionComponent.Header className="accordion-header">
|
|
76
|
+
<AccordionComponent.Trigger className="accordion-trigger">
|
|
77
|
+
Is it accessible?
|
|
78
|
+
</AccordionComponent.Trigger>
|
|
79
|
+
<ChevronDownIcon className="accordion-chevron" />
|
|
80
|
+
</AccordionComponent.Header>
|
|
81
|
+
<AccordionComponent.Content className="accordion-content">
|
|
82
|
+
<p>Yes. It adheres to the WAI-ARIA design pattern.</p>
|
|
83
|
+
</AccordionComponent.Content>
|
|
84
|
+
</AccordionComponent.Item>
|
|
85
|
+
|
|
86
|
+
<AccordionComponent.Item value="item-2">
|
|
87
|
+
<AccordionComponent.Header className="accordion-header">
|
|
88
|
+
<AccordionComponent.Trigger className="accordion-trigger">
|
|
89
|
+
Is it unstyled?
|
|
90
|
+
</AccordionComponent.Trigger>
|
|
91
|
+
<ChevronDownIcon className="accordion-chevron" />
|
|
92
|
+
</AccordionComponent.Header>
|
|
93
|
+
<AccordionComponent.Content className="accordion-content">
|
|
94
|
+
<ul>
|
|
95
|
+
<li>Submenu Item One</li>
|
|
96
|
+
<li>Submenu Item Two</li>
|
|
97
|
+
<li>Submenu Item Three</li>
|
|
98
|
+
</ul>
|
|
99
|
+
</AccordionComponent.Content>
|
|
100
|
+
</AccordionComponent.Item>
|
|
101
|
+
|
|
102
|
+
<AccordionComponent.Item value="item-3">
|
|
103
|
+
<AccordionComponent.Header className="accordion-header">
|
|
104
|
+
<AccordionComponent.Trigger className="accordion-trigger">
|
|
105
|
+
Can it be animated?
|
|
106
|
+
</AccordionComponent.Trigger>
|
|
107
|
+
<ChevronDownIcon className="accordion-chevron" />
|
|
108
|
+
</AccordionComponent.Header>
|
|
109
|
+
<AccordionComponent.Content className="accordion-content">
|
|
110
|
+
<p> Yes! You can animate the Accordion with CSS or JavaScript.</p>
|
|
111
|
+
</AccordionComponent.Content>
|
|
112
|
+
</AccordionComponent.Item>
|
|
113
|
+
</nav>
|
|
114
|
+
</AccordionComponent.Root>
|
|
115
|
+
</>
|
|
116
|
+
),
|
|
117
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* NOTE: An accordion can be used in a variety of ways, including
|
|
4
|
+
* simple FAQs, complex navigation, and more. As such, we minimally
|
|
5
|
+
* style the accordion here in order to provide a base for customization.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type React from 'react'
|
|
9
|
+
|
|
10
|
+
import { Accordion as AccordionPrimitive } from 'radix-ui'
|
|
11
|
+
|
|
12
|
+
import cx from 'classnames'
|
|
13
|
+
|
|
14
|
+
import styles from './accordion.module.css'
|
|
15
|
+
|
|
16
|
+
export type AccordionRootElement = React.ComponentRef<'div'>
|
|
17
|
+
|
|
18
|
+
const Root = ({
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
ref,
|
|
22
|
+
...props
|
|
23
|
+
}: {
|
|
24
|
+
children: React.ReactNode
|
|
25
|
+
className?: string
|
|
26
|
+
ref?: React.RefObject<AccordionRootElement>
|
|
27
|
+
} & (AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps)) => {
|
|
28
|
+
return (
|
|
29
|
+
<AccordionPrimitive.Root ref={ref} className={className} {...props}>
|
|
30
|
+
{children}
|
|
31
|
+
</AccordionPrimitive.Root>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type AccordionItemElement = React.ComponentRef<'div'>
|
|
36
|
+
const Item = function AccordionItem({
|
|
37
|
+
ref,
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: AccordionPrimitive.AccordionItemProps & {
|
|
42
|
+
ref?: React.RefObject<AccordionItemElement>
|
|
43
|
+
}) {
|
|
44
|
+
return (
|
|
45
|
+
<AccordionPrimitive.Item className={className} {...props} ref={ref}>
|
|
46
|
+
{children}
|
|
47
|
+
</AccordionPrimitive.Item>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type AccordionHeaderElement = React.ComponentRef<'h2'>
|
|
52
|
+
const Header = function AccordionHeader({
|
|
53
|
+
ref,
|
|
54
|
+
children,
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: AccordionPrimitive.AccordionHeaderProps & {
|
|
58
|
+
ref?: React.RefObject<AccordionHeaderElement>
|
|
59
|
+
}) {
|
|
60
|
+
return (
|
|
61
|
+
<AccordionPrimitive.Header className={cx(styles.header, className)} {...props} ref={ref}>
|
|
62
|
+
{children}
|
|
63
|
+
</AccordionPrimitive.Header>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type AccordionTriggerElement = React.ComponentRef<'button'>
|
|
68
|
+
const Trigger = function AccordionTrigger({
|
|
69
|
+
ref,
|
|
70
|
+
children,
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: AccordionPrimitive.AccordionTriggerProps & {
|
|
74
|
+
ref?: React.RefObject<AccordionTriggerElement>
|
|
75
|
+
}) {
|
|
76
|
+
return (
|
|
77
|
+
<AccordionPrimitive.Trigger ref={ref} className={cx(styles.trigger, className)} {...props}>
|
|
78
|
+
{children}
|
|
79
|
+
</AccordionPrimitive.Trigger>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type AccordionContentElement = React.ComponentRef<'div'>
|
|
84
|
+
const Content = function AccordionContent({
|
|
85
|
+
ref,
|
|
86
|
+
children,
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: AccordionPrimitive.AccordionContentProps & {
|
|
90
|
+
ref?: React.RefObject<AccordionContentElement>
|
|
91
|
+
}) {
|
|
92
|
+
return (
|
|
93
|
+
<AccordionPrimitive.Content className={cx(styles.content, className)} {...props} ref={ref}>
|
|
94
|
+
{children}
|
|
95
|
+
</AccordionPrimitive.Content>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const Accordion = {
|
|
100
|
+
Root,
|
|
101
|
+
Item,
|
|
102
|
+
Header,
|
|
103
|
+
Trigger,
|
|
104
|
+
Content,
|
|
105
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
5
|
+
|
|
6
|
+
import { Section } from '../section/section.js'
|
|
7
|
+
import { FadeInLift } from './fade-in-lift.js'
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof FadeInLift> = {
|
|
10
|
+
/* 👇 The title prop is optional.
|
|
11
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
12
|
+
* to learn how to generate automatic titles
|
|
13
|
+
*/
|
|
14
|
+
title: 'Animation/FadeInLift',
|
|
15
|
+
component: FadeInLift,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default meta
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof FadeInLift>
|
|
21
|
+
|
|
22
|
+
const DivDemo = (): React.JSX.Element => {
|
|
23
|
+
return (
|
|
24
|
+
<div style={{ marginLeft: '4rem', marginBottom: '4rem' }}>
|
|
25
|
+
<Section style={{ height: '100vh' }}>
|
|
26
|
+
<FadeInLift
|
|
27
|
+
as="div"
|
|
28
|
+
duration={1}
|
|
29
|
+
delay={0.5}
|
|
30
|
+
style={{
|
|
31
|
+
width: '400px',
|
|
32
|
+
height: '400px',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
backgroundColor: 'var(--primary-500)',
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<p style={{ color: 'black' }}>Fade me in 1!</p>
|
|
40
|
+
</FadeInLift>
|
|
41
|
+
</Section>
|
|
42
|
+
<Section style={{ height: '100vh' }}>
|
|
43
|
+
<FadeInLift
|
|
44
|
+
as="span"
|
|
45
|
+
duration={1}
|
|
46
|
+
delay={0.2}
|
|
47
|
+
style={{
|
|
48
|
+
width: '400px',
|
|
49
|
+
height: '400px',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
backgroundColor: 'var(--secondary-500)',
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<p style={{ color: 'black' }}>Fade me in 2!</p>
|
|
57
|
+
</FadeInLift>
|
|
58
|
+
</Section>
|
|
59
|
+
<Section style={{ height: '100vh' }}>
|
|
60
|
+
<FadeInLift
|
|
61
|
+
duration={1}
|
|
62
|
+
delay={0.2}
|
|
63
|
+
style={{
|
|
64
|
+
width: '400px',
|
|
65
|
+
height: '400px',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
backgroundColor: 'var(--yellow-500)',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<p style={{ color: 'black' }}>Fade me in 3!</p>
|
|
73
|
+
</FadeInLift>
|
|
74
|
+
</Section>
|
|
75
|
+
</div>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const Default: Story = {
|
|
80
|
+
render: () => <DivDemo />,
|
|
81
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import type { ComponentPropsWithoutRef, ElementType } from 'react'
|
|
4
|
+
|
|
5
|
+
import { motion } from 'motion/react'
|
|
6
|
+
|
|
7
|
+
// Define a generic component type
|
|
8
|
+
interface FadeInLiftProps<T extends ElementType> {
|
|
9
|
+
as?: T
|
|
10
|
+
children: React.ReactNode
|
|
11
|
+
duration?: number
|
|
12
|
+
delay?: number
|
|
13
|
+
className?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Use a generic type to infer correct props
|
|
17
|
+
export const FadeInLift = <T extends ElementType = 'div'>({
|
|
18
|
+
as,
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
duration = 0.5,
|
|
22
|
+
delay = 0,
|
|
23
|
+
...rest
|
|
24
|
+
}: FadeInLiftProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof FadeInLiftProps<T>>) => {
|
|
25
|
+
const Component = as ? motion(as) : motion.div
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Component
|
|
29
|
+
className={className}
|
|
30
|
+
initial={{ opacity: 0, y: 30 }}
|
|
31
|
+
whileInView={{
|
|
32
|
+
opacity: 1,
|
|
33
|
+
y: 0,
|
|
34
|
+
transition: { duration, delay },
|
|
35
|
+
}}
|
|
36
|
+
viewport={{ once: true }}
|
|
37
|
+
{...rest}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</Component>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
|
|
2
|
+
|
|
3
|
+
@layer infonomic-components {
|
|
4
|
+
|
|
5
|
+
/* relative inline-flex h-10 w-10 rounded-full */
|
|
6
|
+
.avatar-root {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
height: 40px;
|
|
10
|
+
width: 40px;
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.avatar-image {
|
|
15
|
+
height: 100%;
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
object-fit: cover;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* flex h-full w-full items-center justify-center rounded-full bg-white dark:bg-gray-800 */
|
|
22
|
+
.avatar-fallback {
|
|
23
|
+
display: flex;
|
|
24
|
+
height: 100%;
|
|
25
|
+
width: 100%;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
background-color: var(--color-white);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
.avatar-text {
|
|
34
|
+
font-size: var(--font-size-sm);
|
|
35
|
+
font-weight: var(--font-weight-medium);
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
color: var(--gray-700);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 🌙 Dark via `.dark` class. We rely on the
|
|
41
|
+
* consuming application to detect a user's preferred
|
|
42
|
+
* color scheme - either by header or cookie, and set
|
|
43
|
+
* a root html class accordingly
|
|
44
|
+
*/
|
|
45
|
+
:global(.dark) {
|
|
46
|
+
.avatar-fallback {
|
|
47
|
+
background-color: var(--gray-800);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.avatar-text {
|
|
51
|
+
color: var(--gray-400);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Avatar as AvatarComponent } from './avatar.js'
|
|
5
|
+
|
|
6
|
+
const meta: Meta = {
|
|
7
|
+
/* 👇 The title prop is optional.
|
|
8
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
9
|
+
* to learn how to generate automatic titles
|
|
10
|
+
*/
|
|
11
|
+
title: 'Components',
|
|
12
|
+
component: AvatarComponent,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
|
|
17
|
+
export const Avatar = (): React.JSX.Element => (
|
|
18
|
+
<div
|
|
19
|
+
style={{
|
|
20
|
+
maxWidth: '300px',
|
|
21
|
+
marginBottom: '24px',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<AvatarComponent initials="AB" />
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Avatar as AvatarPrimitive } from 'radix-ui'
|
|
4
|
+
import type React from 'react'
|
|
5
|
+
|
|
6
|
+
import styles from './avatar.module.css'
|
|
7
|
+
|
|
8
|
+
const url = 'https://picsum.photos/150'
|
|
9
|
+
|
|
10
|
+
export const Avatar = ({ initials }: { initials: string }): React.JSX.Element => {
|
|
11
|
+
return (
|
|
12
|
+
<AvatarPrimitive.Root className={styles['avatar-root']}>
|
|
13
|
+
<AvatarPrimitive.Image src={url} alt="Avatar" className={styles['avatar-image']} />
|
|
14
|
+
<AvatarPrimitive.Fallback className={styles['avatar-fallback']} delayMs={600}>
|
|
15
|
+
<span className={styles['avatar-text']}>{initials}</span>
|
|
16
|
+
</AvatarPrimitive.Fallback>
|
|
17
|
+
</AvatarPrimitive.Root>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// generic types
|
|
2
|
+
import type { Intent as t } from '../../@types/shared.js'
|
|
3
|
+
|
|
4
|
+
import type { Size as s } from '../../@types/shared.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This file contains the types and prop-types for Button and IconButton component.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// typescript types
|
|
11
|
+
export const variant = ['filled', 'outlined', 'gradient', 'text'] as const
|
|
12
|
+
export type Variant = (typeof variant)[number]
|
|
13
|
+
|
|
14
|
+
export type Size = 'md' | s
|
|
15
|
+
export type Intent = 'primary' | t
|
|
16
|
+
export type FullWidth = boolean
|
|
17
|
+
export type EnableRipple = boolean
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
|
+
|
|
3
|
+
@layer infonomic-components {
|
|
4
|
+
.button-group {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-items: center;
|
|
9
|
+
gap: var(--gap-2);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media screen and (min-width: 640px) {
|
|
13
|
+
.button-group {
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|