@infonomic/uikit 1.5.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/button/button-group.d.ts +1 -1
- package/dist/components/button/button-group.d.ts.map +1 -1
- package/dist/components/button/button-group.js +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/control-buttons.d.ts.map +1 -1
- package/dist/components/button/control-buttons.js +3 -3
- package/dist/components/button/copy-button.d.ts.map +1 -1
- package/dist/components/button/copy-button.js +2 -2
- package/dist/components/button/icon-button.d.ts.map +1 -1
- package/dist/components/button/icon-button.js +1 -1
- package/dist/components/button/index.js +17 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/input/checkbox.d.ts.map +1 -1
- package/dist/components/input/checkbox.js +4 -4
- package/dist/components/input/error-text.d.ts.map +1 -1
- package/dist/components/input/error-text.js +1 -1
- package/dist/components/input/help-text.d.ts.map +1 -1
- package/dist/components/input/help-text.js +1 -1
- package/dist/components/input/input-adornment.d.ts.map +1 -1
- package/dist/components/input/input-adornment.js +1 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +3 -3
- package/dist/components/input/label.d.ts.map +1 -1
- package/dist/components/input/label.js +1 -1
- package/dist/components/input/radio-group.js +1 -1
- package/dist/components/input/select.d.ts +1 -1
- package/dist/components/input/select.d.ts.map +1 -1
- package/dist/components/input/select.js +3 -3
- package/dist/components/input/text-area.d.ts.map +1 -1
- package/dist/components/input/text-area.js +3 -3
- package/dist/components/notifications/alert.d.ts.map +1 -1
- package/dist/components/notifications/alert.js +2 -2
- package/dist/components/notifications/toast.js +4 -4
- package/dist/components/pager/ellipses.d.ts.map +1 -1
- package/dist/components/pager/ellipses.js +1 -1
- package/dist/components/pager/first-button.d.ts.map +1 -1
- package/dist/components/pager/first-button.js +2 -2
- package/dist/components/pager/last-button.d.ts.map +1 -1
- package/dist/components/pager/last-button.js +2 -2
- package/dist/components/pager/next-button.d.ts.map +1 -1
- package/dist/components/pager/next-button.js +2 -2
- package/dist/components/pager/number-button.d.ts.map +1 -1
- package/dist/components/pager/number-button.js +2 -2
- package/dist/components/pager/pagination.d.ts +1 -1
- package/dist/components/pager/pagination.d.ts.map +1 -1
- package/dist/components/pager/pagination.js +5 -5
- package/dist/components/pager/previous-button.d.ts.map +1 -1
- package/dist/components/pager/previous-button.js +2 -2
- package/dist/components/scroll-area/scroll-area.js +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +2 -2
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/icons/index.js +1 -17
- 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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import cx from 'classnames'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import styles from './shimmer.module.css'
|
|
4
|
+
|
|
5
|
+
interface ShimmerProps {
|
|
6
|
+
className?: string
|
|
7
|
+
width?: string | number
|
|
8
|
+
height?: string | number
|
|
9
|
+
borderRadius?: string
|
|
10
|
+
variant?: 'text' | 'rectangular' | 'circular'
|
|
11
|
+
lines?: number
|
|
12
|
+
children?: React.ReactNode
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function Shimmer({
|
|
16
|
+
className,
|
|
17
|
+
width = '100%',
|
|
18
|
+
height = '1rem',
|
|
19
|
+
borderRadius,
|
|
20
|
+
variant = 'rectangular',
|
|
21
|
+
lines = 1,
|
|
22
|
+
children,
|
|
23
|
+
...other
|
|
24
|
+
}: ShimmerProps): React.JSX.Element {
|
|
25
|
+
const shimmerStyle = {
|
|
26
|
+
width: typeof width === 'number' ? `${width}px` : width,
|
|
27
|
+
height: typeof height === 'number' ? `${height}px` : height,
|
|
28
|
+
borderRadius: borderRadius,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const getVariantClass = () => {
|
|
32
|
+
switch (variant) {
|
|
33
|
+
case 'text':
|
|
34
|
+
return styles.text
|
|
35
|
+
case 'circular':
|
|
36
|
+
return styles.circular
|
|
37
|
+
case 'rectangular':
|
|
38
|
+
default:
|
|
39
|
+
return styles.rectangular
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (variant === 'text' && lines > 1) {
|
|
44
|
+
return (
|
|
45
|
+
<div className={cx(styles.shimmerContainer, className)} {...other}>
|
|
46
|
+
{Array.from({ length: lines }, (_, index) => (
|
|
47
|
+
<div
|
|
48
|
+
key={`shimmer-line-${index}`}
|
|
49
|
+
className={cx(styles.shimmer, styles.text)}
|
|
50
|
+
style={{
|
|
51
|
+
...shimmerStyle,
|
|
52
|
+
width: index === lines - 1 ? '75%' : '100%',
|
|
53
|
+
marginBottom: index === lines - 1 ? 0 : '0.5rem',
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
className={cx(styles.shimmer, getVariantClass(), className)}
|
|
64
|
+
style={shimmerStyle}
|
|
65
|
+
{...other}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
|
|
2
|
+
|
|
3
|
+
/* 'border-collapse w-full text-sm text-left text-gray-700 dark:text-gray-400 m-0', */
|
|
4
|
+
@layer infonomic-components {
|
|
5
|
+
|
|
6
|
+
/* 'table--container break-normal overflow-hidden relative shadow-md rounded-md my-[16px] dark:border dark:border-canvas-700', */
|
|
7
|
+
.table-container {
|
|
8
|
+
display: block;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
word-break: normal;
|
|
11
|
+
position: relative;
|
|
12
|
+
box-shadow: var(--shadow-sm);
|
|
13
|
+
border-radius: var(--border-radius-sm);
|
|
14
|
+
border: 1px solid var(--border-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.table-scroller {
|
|
18
|
+
overflow-x: auto;
|
|
19
|
+
max-width: calc(100vw - 32px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.table {
|
|
23
|
+
width: 100%;
|
|
24
|
+
border-collapse: collapse;
|
|
25
|
+
margin: 0;
|
|
26
|
+
font-size: var(--font-size-sm);
|
|
27
|
+
text-align: left;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* 'text-xs text-gray-700 uppercase bg-canvas-100 dark:bg-canvas-700 dark:text-gray-400', */
|
|
31
|
+
.table-header {
|
|
32
|
+
font-size: var(--font-size-xs);
|
|
33
|
+
text-transform: uppercase;
|
|
34
|
+
background-color: var(--canvas-50);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 'border-b border-solid border-canvas-200 bg-white hover:bg-canvas-100/50 dark:border-canvas-700/60 dark:bg-canvas-800/50 dark:hover:bg-canvas-700/50', */
|
|
38
|
+
.table-row {
|
|
39
|
+
border-bottom: 1px solid var(--canvas-50);
|
|
40
|
+
background-color: white;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.table-row:hover {
|
|
44
|
+
background-color: var(--canvas-50);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* 'whitespace-nowrap px-2 py-4 text-sm text-gray-700 uppercase bg-canvas-100/50 dark:bg-canvas-800/50 dark:text-gray-200', */
|
|
48
|
+
.table-heading-cell {
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
padding: var(--spacing-2) var(--spacing-2);
|
|
51
|
+
font-size: var(--font-size-sm);
|
|
52
|
+
text-transform: uppercase;
|
|
53
|
+
background-color: var(--canvas-50);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* not-prose px-2 py-2 text-sm [&_a]:underline */
|
|
57
|
+
.table-cell {
|
|
58
|
+
padding: var(--spacing-2);
|
|
59
|
+
font-size: var(--font-size-sm);
|
|
60
|
+
|
|
61
|
+
& a {
|
|
62
|
+
text-decoration: underline;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 'text-xs text-gray-700 uppercase bg-canvas-100 dark:bg-canvas-700 dark:text-gray-400', */
|
|
67
|
+
.table-footer {
|
|
68
|
+
font-size: var(--font-size-xs);
|
|
69
|
+
text-transform: uppercase;
|
|
70
|
+
background-color: var(--canvas-100);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 🌙 Dark via `.dark` class. We rely on the
|
|
74
|
+
* consuming application to detect a user's preferred
|
|
75
|
+
* color scheme - either by header or cookie, and set
|
|
76
|
+
* a root html class accordingly
|
|
77
|
+
*/
|
|
78
|
+
:global(.dark) {
|
|
79
|
+
.table-header {
|
|
80
|
+
background-color: var(--canvas-700);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.table-row:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
84
|
+
border-bottom: 1px solid var(--canvas-700);
|
|
85
|
+
background-color: var(--canvas-800);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.table-row:hover:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
89
|
+
background-color: oklch(from var(--canvas-800) calc(l * 1.1) c h)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.table-heading-cell:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
93
|
+
background-color: oklch(from var(--canvas-800) calc(l * 1.1) c h);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.table-footer:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
97
|
+
background-color: var(--canvas-800);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
import type { Meta } from '@storybook/react-vite'
|
|
5
|
+
|
|
6
|
+
import { Table as TableComponent } from './table.js'
|
|
7
|
+
|
|
8
|
+
const meta: Meta = {
|
|
9
|
+
/* 👇 The title prop is optional.
|
|
10
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
11
|
+
* to learn how to generate automatic titles
|
|
12
|
+
*/
|
|
13
|
+
title: 'Components',
|
|
14
|
+
component: TableComponent,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
|
|
19
|
+
export const Table = (): React.JSX.Element => {
|
|
20
|
+
return (
|
|
21
|
+
<div style={{ maxWidth: '960px', margin: '0 auto' }}>
|
|
22
|
+
<TableComponent.Container>
|
|
23
|
+
<TableComponent>
|
|
24
|
+
<TableComponent.Header>
|
|
25
|
+
<TableComponent.Row>
|
|
26
|
+
<TableComponent.HeadingCell scope="col">
|
|
27
|
+
<span>Check</span>
|
|
28
|
+
</TableComponent.HeadingCell>
|
|
29
|
+
<TableComponent.HeadingCell scope="col">
|
|
30
|
+
<p>Heading 1</p>
|
|
31
|
+
</TableComponent.HeadingCell>
|
|
32
|
+
<TableComponent.HeadingCell scope="col">
|
|
33
|
+
<p>Heading 2</p>
|
|
34
|
+
</TableComponent.HeadingCell>
|
|
35
|
+
<TableComponent.HeadingCell scope="col">
|
|
36
|
+
<p>Heading 3</p>
|
|
37
|
+
</TableComponent.HeadingCell>
|
|
38
|
+
</TableComponent.Row>
|
|
39
|
+
</TableComponent.Header>
|
|
40
|
+
|
|
41
|
+
<TableComponent.Body>
|
|
42
|
+
<TableComponent.Row>
|
|
43
|
+
<TableComponent.Cell>
|
|
44
|
+
<span>Check</span>
|
|
45
|
+
</TableComponent.Cell>
|
|
46
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
47
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
48
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
49
|
+
</TableComponent.Row>
|
|
50
|
+
<TableComponent.Row>
|
|
51
|
+
<TableComponent.Cell>
|
|
52
|
+
<span>Check</span>
|
|
53
|
+
</TableComponent.Cell>
|
|
54
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
55
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
56
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
57
|
+
</TableComponent.Row>
|
|
58
|
+
<TableComponent.Row>
|
|
59
|
+
<TableComponent.Cell>
|
|
60
|
+
<span>Check</span>
|
|
61
|
+
</TableComponent.Cell>
|
|
62
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
63
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
64
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
65
|
+
</TableComponent.Row>
|
|
66
|
+
<TableComponent.Row>
|
|
67
|
+
<TableComponent.Cell>
|
|
68
|
+
<span>Check</span>
|
|
69
|
+
</TableComponent.Cell>
|
|
70
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
71
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
72
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
73
|
+
</TableComponent.Row>
|
|
74
|
+
</TableComponent.Body>
|
|
75
|
+
<TableComponent.Footer>
|
|
76
|
+
<TableComponent.Row>
|
|
77
|
+
<TableComponent.HeadingCell scope="col">
|
|
78
|
+
<span>Check</span>
|
|
79
|
+
</TableComponent.HeadingCell>
|
|
80
|
+
<TableComponent.HeadingCell scope="col">
|
|
81
|
+
<p>Heading 1</p>
|
|
82
|
+
</TableComponent.HeadingCell>
|
|
83
|
+
<TableComponent.HeadingCell scope="col">
|
|
84
|
+
<p>Heading 2</p>
|
|
85
|
+
</TableComponent.HeadingCell>
|
|
86
|
+
<TableComponent.HeadingCell scope="col">
|
|
87
|
+
<p>Heading 3</p>
|
|
88
|
+
</TableComponent.HeadingCell>
|
|
89
|
+
</TableComponent.Row>
|
|
90
|
+
</TableComponent.Footer>
|
|
91
|
+
</TableComponent>
|
|
92
|
+
</TableComponent.Container>
|
|
93
|
+
</div>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import cx from 'classnames'
|
|
2
|
+
import type * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import styles from './table.module.css'
|
|
5
|
+
|
|
6
|
+
export type TableProps = React.JSX.IntrinsicElements['table']
|
|
7
|
+
|
|
8
|
+
function Table({
|
|
9
|
+
ref,
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
...rest
|
|
13
|
+
}: TableProps & {
|
|
14
|
+
ref?: React.RefObject<HTMLTableElement>
|
|
15
|
+
}): React.JSX.Element {
|
|
16
|
+
const classes = cx(styles.table, 'table', className)
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<table ref={ref} className={classes} {...rest}>
|
|
20
|
+
{children}
|
|
21
|
+
</table>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type TableContainerProps = React.JSX.IntrinsicElements['div']
|
|
26
|
+
|
|
27
|
+
function Container({
|
|
28
|
+
ref,
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
...rest
|
|
32
|
+
}: TableContainerProps & {
|
|
33
|
+
ref?: React.RefObject<HTMLDivElement>
|
|
34
|
+
}) {
|
|
35
|
+
const classes = cx(styles['table-container'], 'table-container', className)
|
|
36
|
+
return (
|
|
37
|
+
<div ref={ref} className={classes} {...rest}>
|
|
38
|
+
<div className={cx('table-scroller', styles['table-scroller'])}>{children}</div>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type TableBodyProps = React.JSX.IntrinsicElements['tbody']
|
|
44
|
+
|
|
45
|
+
function Body({
|
|
46
|
+
ref,
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
...rest
|
|
50
|
+
}: TableBodyProps & {
|
|
51
|
+
ref?: React.RefObject<HTMLTableSectionElement>
|
|
52
|
+
}): React.JSX.Element {
|
|
53
|
+
return (
|
|
54
|
+
<tbody ref={ref} className={cx('table-body', className)} {...rest}>
|
|
55
|
+
{children}
|
|
56
|
+
</tbody>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type TableHeaderProps = React.JSX.IntrinsicElements['thead']
|
|
61
|
+
|
|
62
|
+
function Header({
|
|
63
|
+
ref,
|
|
64
|
+
className,
|
|
65
|
+
children,
|
|
66
|
+
...rest
|
|
67
|
+
}: TableHeaderProps & {
|
|
68
|
+
ref?: React.RefObject<HTMLTableSectionElement>
|
|
69
|
+
}): React.JSX.Element {
|
|
70
|
+
const classes = cx(styles['table-header'], 'table-header', className)
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<thead ref={ref} className={classes} {...rest}>
|
|
74
|
+
{children}
|
|
75
|
+
</thead>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type TableRowProps = React.JSX.IntrinsicElements['tr']
|
|
80
|
+
|
|
81
|
+
function Row({
|
|
82
|
+
ref,
|
|
83
|
+
className,
|
|
84
|
+
children,
|
|
85
|
+
...rest
|
|
86
|
+
}: TableRowProps & {
|
|
87
|
+
ref?: React.RefObject<HTMLTableRowElement>
|
|
88
|
+
}): React.JSX.Element {
|
|
89
|
+
const classes = cx(styles['table-row'], 'table-row', className)
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<tr ref={ref} className={classes} {...rest}>
|
|
93
|
+
{children}
|
|
94
|
+
</tr>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type TableHeadingCellProps = React.JSX.IntrinsicElements['th']
|
|
99
|
+
|
|
100
|
+
function HeadingCell({
|
|
101
|
+
ref,
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
...rest
|
|
105
|
+
}: TableHeadingCellProps & {
|
|
106
|
+
ref?: React.RefObject<HTMLTableCellElement>
|
|
107
|
+
}): React.JSX.Element {
|
|
108
|
+
const classes = cx(styles['table-heading-cell'], 'table-heading-cell', 'not-prose', className)
|
|
109
|
+
return (
|
|
110
|
+
<th ref={ref} className={classes} {...rest}>
|
|
111
|
+
{children}
|
|
112
|
+
</th>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type TableCellProps = React.JSX.IntrinsicElements['td']
|
|
117
|
+
|
|
118
|
+
function Cell({
|
|
119
|
+
ref,
|
|
120
|
+
className,
|
|
121
|
+
children,
|
|
122
|
+
...rest
|
|
123
|
+
}: TableCellProps & {
|
|
124
|
+
ref?: React.RefObject<HTMLTableCellElement>
|
|
125
|
+
}): React.JSX.Element {
|
|
126
|
+
const classes = cx(styles['table-cell'], 'table-cell', className)
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<td ref={ref} className={classes} {...rest}>
|
|
130
|
+
{children}
|
|
131
|
+
</td>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export type TableFooterProps = React.JSX.IntrinsicElements['tfoot']
|
|
136
|
+
|
|
137
|
+
function Footer({
|
|
138
|
+
ref,
|
|
139
|
+
className,
|
|
140
|
+
children,
|
|
141
|
+
...rest
|
|
142
|
+
}: TableFooterProps & {
|
|
143
|
+
ref?: React.RefObject<HTMLTableSectionElement>
|
|
144
|
+
}): React.JSX.Element {
|
|
145
|
+
const classes = cx(
|
|
146
|
+
'text-xs text-gray-700 uppercase bg-canvas-100 dark:bg-canvas-700 dark:text-gray-400',
|
|
147
|
+
className
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<tfoot ref={ref} className={classes} {...rest}>
|
|
152
|
+
{children}
|
|
153
|
+
</tfoot>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
Table.Container = Container
|
|
158
|
+
Table.Body = Body
|
|
159
|
+
Table.Header = Header
|
|
160
|
+
Table.Row = Row
|
|
161
|
+
Table.HeadingCell = HeadingCell
|
|
162
|
+
Table.Cell = Cell
|
|
163
|
+
Table.Footer = Footer
|
|
164
|
+
|
|
165
|
+
export { Table }
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
|
|
2
|
+
|
|
3
|
+
@layer infonomic-components {
|
|
4
|
+
|
|
5
|
+
.tabs-root {
|
|
6
|
+
display: flex;
|
|
7
|
+
padding: var(--spacing-2);
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--spacing-1);
|
|
10
|
+
border-radius: var(--border-radius-md);
|
|
11
|
+
border: 1px solid var(--border-color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tabs-list {
|
|
15
|
+
display: flex;
|
|
16
|
+
width: 100%;
|
|
17
|
+
gap: var(--gap-2);
|
|
18
|
+
align-items: center;
|
|
19
|
+
border-radius: var(--border-radius-md);
|
|
20
|
+
padding: var(--spacing-1);
|
|
21
|
+
border: 1px solid var(--border-color);
|
|
22
|
+
|
|
23
|
+
&:focus-visible {
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tabs-trigger {
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
width: 100%;
|
|
33
|
+
|
|
34
|
+
/* &[data-state="active"] {
|
|
35
|
+
color: var(----primary-600);
|
|
36
|
+
box-shadow:
|
|
37
|
+
inset 0 -1px 0 0 currentColor,
|
|
38
|
+
0 1px 0 0 currentColor;
|
|
39
|
+
} */
|
|
40
|
+
|
|
41
|
+
&:focus {
|
|
42
|
+
position: relative;
|
|
43
|
+
box-shadow: 0 0 0 2px black;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tabs-content {
|
|
48
|
+
margin-top: var(--spacing-2);
|
|
49
|
+
padding: 6px;
|
|
50
|
+
outline: none;
|
|
51
|
+
|
|
52
|
+
&[data-state="inactive"] {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:focus {
|
|
57
|
+
outline: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:focus-visible {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { Button } from '../button/button.js'
|
|
6
|
+
import { Tabs as TabsComponent } from './tabs.js'
|
|
7
|
+
|
|
8
|
+
const meta: Meta = {
|
|
9
|
+
/* 👇 The title prop is optional.
|
|
10
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
11
|
+
* to learn how to generate automatic titles
|
|
12
|
+
*/
|
|
13
|
+
title: 'Components',
|
|
14
|
+
component: TabsComponent,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
|
|
19
|
+
export const Tabs = (): React.JSX.Element => (
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
maxWidth: '700px',
|
|
23
|
+
marginBottom: '24px',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<TabsComponent style={{ width: '400px', minHeight: '235px' }} defaultValue="detailsTab">
|
|
29
|
+
<TabsComponent.List>
|
|
30
|
+
<TabsComponent.Trigger asChild value="detailsTab">
|
|
31
|
+
<Button size="sm">Details</Button>
|
|
32
|
+
</TabsComponent.Trigger>
|
|
33
|
+
<TabsComponent.Trigger asChild value="rolesTab">
|
|
34
|
+
<Button size="sm">Roles</Button>
|
|
35
|
+
</TabsComponent.Trigger>
|
|
36
|
+
</TabsComponent.List>
|
|
37
|
+
<TabsComponent.Content value="detailsTab" forceMount={true}>
|
|
38
|
+
<p>Details tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
39
|
+
<p>Details tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
40
|
+
</TabsComponent.Content>
|
|
41
|
+
<TabsComponent.Content value="rolesTab">
|
|
42
|
+
<p>Roles tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
43
|
+
<p>Roles tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
44
|
+
</TabsComponent.Content>
|
|
45
|
+
</TabsComponent>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import cx from 'classnames'
|
|
4
|
+
|
|
5
|
+
import { Tabs as TabsPrimitive } from 'radix-ui'
|
|
6
|
+
import type * as React from 'react'
|
|
7
|
+
|
|
8
|
+
import styles from './tabs.module.css'
|
|
9
|
+
|
|
10
|
+
const Tabs = ({
|
|
11
|
+
ref,
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
|
|
15
|
+
ref?: React.RefObject<React.ComponentRef<typeof TabsPrimitive.Root>>
|
|
16
|
+
}) => (
|
|
17
|
+
<TabsPrimitive.Root
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cx(styles['tabs-root'], 'tabs-root', className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
Tabs.displayName = TabsPrimitive.Root.displayName
|
|
24
|
+
|
|
25
|
+
const TabsList = ({
|
|
26
|
+
ref,
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
|
|
30
|
+
ref?: React.RefObject<React.ComponentRef<typeof TabsPrimitive.List>>
|
|
31
|
+
}) => (
|
|
32
|
+
<TabsPrimitive.List
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cx(styles['tabs-list'], 'tabs-list', className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
TabsList.displayName = TabsPrimitive.List.displayName
|
|
39
|
+
|
|
40
|
+
const TabsTrigger = ({
|
|
41
|
+
ref,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
|
|
45
|
+
ref?: React.RefObject<React.ComponentRef<typeof TabsPrimitive.Trigger>>
|
|
46
|
+
}) => (
|
|
47
|
+
<TabsPrimitive.Trigger
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cx(styles['tabs-trigger'], 'tabs-trigger', className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
54
|
+
|
|
55
|
+
const TabsContent = ({
|
|
56
|
+
ref,
|
|
57
|
+
className,
|
|
58
|
+
...props
|
|
59
|
+
}: React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> & {
|
|
60
|
+
ref?: React.RefObject<React.ComponentRef<typeof TabsPrimitive.Content>>
|
|
61
|
+
}) => (
|
|
62
|
+
<TabsPrimitive.Content
|
|
63
|
+
ref={ref}
|
|
64
|
+
forceMount={true}
|
|
65
|
+
className={cx(styles['tabs-content'], 'tabs-content', className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
70
|
+
|
|
71
|
+
Tabs.List = TabsList
|
|
72
|
+
Tabs.Trigger = TabsTrigger
|
|
73
|
+
Tabs.Content = TabsContent
|
|
74
|
+
|
|
75
|
+
export { Tabs }
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
|
|
2
|
+
|
|
3
|
+
@layer infonomic-components {
|
|
4
|
+
.timeline {
|
|
5
|
+
margin-left: var(--spacing-2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.timeline-root {
|
|
9
|
+
position: relative;
|
|
10
|
+
list-style: none;
|
|
11
|
+
margin-left: var(--spacing-2);
|
|
12
|
+
padding-left: var(--spacing-8);
|
|
13
|
+
border-left-width: var(--border-width-thin);
|
|
14
|
+
border-left-color: var(--border-color);
|
|
15
|
+
border-left-style: var(--border-style-solid);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.timeline-item {
|
|
19
|
+
margin: 0 0 var(--spacing-6) 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* 'absolute block flex items-center justify-center w-[36px] h-[36px] rounded-full -mt-[3px] sm:mt-0 -left-[18px] border-[6px] bg-secondary-600 dark:bg-secondary-900 border-gray-50 dark:border-canvas-600', */
|
|
23
|
+
.timeline-icon {
|
|
24
|
+
position: absolute;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
width: 36px;
|
|
29
|
+
height: 36px;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
margin-top: -3px;
|
|
32
|
+
left: -18px;
|
|
33
|
+
border-width: 6px;
|
|
34
|
+
color: white;
|
|
35
|
+
background-color: var(--primary-600);
|
|
36
|
+
border-color: var(--gray-50);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.timeline-icon svg {
|
|
40
|
+
display: block;
|
|
41
|
+
width: 60%;
|
|
42
|
+
color: white;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* 'text-[1.5rem] sm:text-[1.57rem] leading-[1.2] !m-0 font-semibold' */
|
|
46
|
+
.timeline-heading {
|
|
47
|
+
font-size: 1.5rem;
|
|
48
|
+
line-height: 1.2;
|
|
49
|
+
margin: 0;
|
|
50
|
+
font-weight: var(--font-weight-semibold);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* 'block mt-2 mb-2 text-[0.9em] font-medium leading-none text-gray-900 dark:text-gray-100' */
|
|
54
|
+
.timeline-date {
|
|
55
|
+
display: block;
|
|
56
|
+
margin-top: var(--spacing-2);
|
|
57
|
+
margin-bottom: var(--spacing-2);
|
|
58
|
+
font-size: 0.9em;
|
|
59
|
+
font-weight: var(--font-weight-medium);
|
|
60
|
+
line-height: 0;
|
|
61
|
+
color: var(--gray-600);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* '[&_p]:m-0 [&_p]:mb-4 [&_p]:sm:m-0 [&_p]:sm:mb-4 text-lg font-normal text-gray-900 dark:text-gray-300' */
|
|
65
|
+
.timeline-content {
|
|
66
|
+
margin: 0;
|
|
67
|
+
margin-bottom: var(--spacing-4);
|
|
68
|
+
font-size: 1.125rem;
|
|
69
|
+
font-weight: var(--font-weight-normal);
|
|
70
|
+
|
|
71
|
+
& p {
|
|
72
|
+
margin: 0;
|
|
73
|
+
margin-bottom: var(--spacing-4);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 🌙 Dark via `.dark` class. We rely on the
|
|
78
|
+
* consuming application to detect a user's preferred
|
|
79
|
+
* color scheme - either by header or cookie, and set
|
|
80
|
+
* a root html class accordingly
|
|
81
|
+
*/
|
|
82
|
+
:global(.dark) {
|
|
83
|
+
.timeline-icon:not(:where([class~="not-dark"], [class~="not-dark"] *)) {
|
|
84
|
+
border-color: var(--canvas-600);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|