@jesusgm/react-components 0.0.0-stage → 0.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/Readme.md +158 -0
- package/dist/components/atoms/avatar/index.d.ts +19 -0
- package/dist/components/atoms/avatar/index.js +44 -0
- package/dist/components/atoms/avatar/index.js.map +1 -0
- package/dist/components/atoms/avatar/styles.css +50 -0
- package/dist/components/atoms/badge/index.d.ts +17 -0
- package/dist/components/atoms/badge/index.js +37 -0
- package/dist/components/atoms/badge/index.js.map +1 -0
- package/dist/components/atoms/badge/styles.css +83 -0
- package/dist/components/atoms/button/index.d.ts +16 -0
- package/dist/components/atoms/button/index.js +22 -0
- package/dist/components/atoms/button/index.js.map +1 -0
- package/dist/components/atoms/button/styles.css +77 -0
- package/dist/components/atoms/checkbox/index.d.ts +13 -0
- package/dist/components/atoms/checkbox/index.js +63 -0
- package/dist/components/atoms/checkbox/index.js.map +1 -0
- package/dist/components/atoms/checkbox/styles.css +87 -0
- package/dist/components/atoms/code-highlighter/index.d.ts +8 -0
- package/dist/components/atoms/code-highlighter/index.js +24 -0
- package/dist/components/atoms/code-highlighter/index.js.map +1 -0
- package/dist/components/atoms/code-highlighter/railscasts.css +1 -0
- package/dist/components/atoms/code-highlighter/styles.css +17 -0
- package/dist/components/atoms/divider/index.d.ts +10 -0
- package/dist/components/atoms/divider/index.js +25 -0
- package/dist/components/atoms/divider/index.js.map +1 -0
- package/dist/components/atoms/divider/styles.css +56 -0
- package/dist/components/atoms/icon/index.d.ts +23 -0
- package/dist/components/atoms/icon/index.js +20 -0
- package/dist/components/atoms/icon/index.js.map +1 -0
- package/dist/components/atoms/icon/styles.css +13 -0
- package/dist/components/atoms/kbd/index.d.ts +7 -0
- package/dist/components/atoms/kbd/index.js +26 -0
- package/dist/components/atoms/kbd/index.js.map +1 -0
- package/dist/components/atoms/kbd/styles.css +29 -0
- package/dist/components/atoms/label/index.d.ts +9 -0
- package/dist/components/atoms/label/index.js +18 -0
- package/dist/components/atoms/label/index.js.map +1 -0
- package/dist/components/atoms/label/styles.css +19 -0
- package/dist/components/atoms/link/index.d.ts +12 -0
- package/dist/components/atoms/link/index.js +32 -0
- package/dist/components/atoms/link/index.js.map +1 -0
- package/dist/components/atoms/link/styles.css +54 -0
- package/dist/components/atoms/progress-bar/index.d.ts +23 -0
- package/dist/components/atoms/progress-bar/index.js +45 -0
- package/dist/components/atoms/progress-bar/index.js.map +1 -0
- package/dist/components/atoms/progress-bar/styles.css +75 -0
- package/dist/components/atoms/radio/context.d.ts +9 -0
- package/dist/components/atoms/radio/context.js +9 -0
- package/dist/components/atoms/radio/context.js.map +1 -0
- package/dist/components/atoms/radio/index.d.ts +15 -0
- package/dist/components/atoms/radio/index.js +44 -0
- package/dist/components/atoms/radio/index.js.map +1 -0
- package/dist/components/atoms/radio/radio-group.d.ts +25 -0
- package/dist/components/atoms/radio/radio-group.js +49 -0
- package/dist/components/atoms/radio/radio-group.js.map +1 -0
- package/dist/components/atoms/radio/styles.css +110 -0
- package/dist/components/atoms/skeleton/index.d.ts +15 -0
- package/dist/components/atoms/skeleton/index.js +38 -0
- package/dist/components/atoms/skeleton/index.js.map +1 -0
- package/dist/components/atoms/skeleton/styles.css +57 -0
- package/dist/components/atoms/spinner/index.d.ts +11 -0
- package/dist/components/atoms/spinner/index.js +22 -0
- package/dist/components/atoms/spinner/index.js.map +1 -0
- package/dist/components/atoms/spinner/styles.css +51 -0
- package/dist/components/atoms/switch/index.d.ts +14 -0
- package/dist/components/atoms/switch/index.js +33 -0
- package/dist/components/atoms/switch/index.js.map +1 -0
- package/dist/components/atoms/switch/styles.css +99 -0
- package/dist/components/atoms/text-input/index.d.ts +20 -0
- package/dist/components/atoms/text-input/index.js +33 -0
- package/dist/components/atoms/text-input/index.js.map +1 -0
- package/dist/components/atoms/text-input/styles.css +80 -0
- package/dist/components/atoms/textarea/index.d.ts +14 -0
- package/dist/components/atoms/textarea/index.js +43 -0
- package/dist/components/atoms/textarea/index.js.map +1 -0
- package/dist/components/atoms/textarea/styles.css +49 -0
- package/dist/components/atoms/typography/index.d.ts +30 -0
- package/dist/components/atoms/typography/index.js +30 -0
- package/dist/components/atoms/typography/index.js.map +1 -0
- package/dist/components/atoms/typography/styles.css +50 -0
- package/dist/components/atoms/video-player/index.d.ts +9 -0
- package/dist/components/atoms/video-player/index.js +17 -0
- package/dist/components/atoms/video-player/index.js.map +1 -0
- package/dist/components/atoms/video-player/styles.css +18 -0
- package/dist/components/atoms/visually-hidden/index.d.ts +7 -0
- package/dist/components/atoms/visually-hidden/index.js +13 -0
- package/dist/components/atoms/visually-hidden/index.js.map +1 -0
- package/dist/components/atoms/visually-hidden/styles.css +12 -0
- package/dist/components/hooks/index.d.ts +3 -0
- package/dist/components/hooks/index.js +4 -0
- package/dist/components/hooks/use-click-outside.d.ts +6 -0
- package/dist/components/hooks/use-click-outside.js +30 -0
- package/dist/components/hooks/use-click-outside.js.map +1 -0
- package/dist/components/hooks/use-controllable-state.d.ts +5 -0
- package/dist/components/hooks/use-controllable-state.js +22 -0
- package/dist/components/hooks/use-controllable-state.js.map +1 -0
- package/dist/components/hooks/use-focus-trap.d.ts +8 -0
- package/dist/components/hooks/use-focus-trap.js +57 -0
- package/dist/components/hooks/use-focus-trap.js.map +1 -0
- package/dist/components/index.d.ts +122 -0
- package/dist/components/index.js +74 -0
- package/dist/components/molecules/accordion/index.d.ts +27 -0
- package/dist/components/molecules/accordion/index.js +98 -0
- package/dist/components/molecules/accordion/index.js.map +1 -0
- package/dist/components/molecules/accordion/styles.css +75 -0
- package/dist/components/molecules/alert/index.d.ts +18 -0
- package/dist/components/molecules/alert/index.js +91 -0
- package/dist/components/molecules/alert/index.js.map +1 -0
- package/dist/components/molecules/alert/styles.css +97 -0
- package/dist/components/molecules/binary-clock/index.d.ts +16 -0
- package/dist/components/molecules/binary-clock/index.js +66 -0
- package/dist/components/molecules/binary-clock/index.js.map +1 -0
- package/dist/components/molecules/binary-clock/styles.css +46 -0
- package/dist/components/molecules/breadcrumb/index.d.ts +23 -0
- package/dist/components/molecules/breadcrumb/index.js +79 -0
- package/dist/components/molecules/breadcrumb/index.js.map +1 -0
- package/dist/components/molecules/breadcrumb/styles.css +61 -0
- package/dist/components/molecules/card/index.d.ts +39 -0
- package/dist/components/molecules/card/index.js +60 -0
- package/dist/components/molecules/card/index.js.map +1 -0
- package/dist/components/molecules/card/styles.css +105 -0
- package/dist/components/molecules/chart/index.d.ts +14 -0
- package/dist/components/molecules/chart/index.js +104 -0
- package/dist/components/molecules/chart/index.js.map +1 -0
- package/dist/components/molecules/conflict-resolver/components/conflictItem.d.ts +8 -0
- package/dist/components/molecules/conflict-resolver/components/conflictItem.js +58 -0
- package/dist/components/molecules/conflict-resolver/components/conflictItem.js.map +1 -0
- package/dist/components/molecules/conflict-resolver/components/styles.css +64 -0
- package/dist/components/molecules/conflict-resolver/index.d.ts +10 -0
- package/dist/components/molecules/conflict-resolver/index.js +35 -0
- package/dist/components/molecules/conflict-resolver/index.js.map +1 -0
- package/dist/components/molecules/conflict-resolver/types.d.ts +10 -0
- package/dist/components/molecules/dropable-list/draggable.d.ts +9 -0
- package/dist/components/molecules/dropable-list/draggable.js +18 -0
- package/dist/components/molecules/dropable-list/draggable.js.map +1 -0
- package/dist/components/molecules/dropable-list/index.d.ts +20 -0
- package/dist/components/molecules/dropable-list/index.js +52 -0
- package/dist/components/molecules/dropable-list/index.js.map +1 -0
- package/dist/components/molecules/dropable-list/styles.css +63 -0
- package/dist/components/molecules/dropdown-menu/index.d.ts +43 -0
- package/dist/components/molecules/dropdown-menu/index.js +226 -0
- package/dist/components/molecules/dropdown-menu/index.js.map +1 -0
- package/dist/components/molecules/dropdown-menu/styles.css +94 -0
- package/dist/components/molecules/empty-state/index.d.ts +16 -0
- package/dist/components/molecules/empty-state/index.js +32 -0
- package/dist/components/molecules/empty-state/index.js.map +1 -0
- package/dist/components/molecules/empty-state/styles.css +64 -0
- package/dist/components/molecules/file-input/index.d.ts +39 -0
- package/dist/components/molecules/file-input/index.js +121 -0
- package/dist/components/molecules/file-input/index.js.map +1 -0
- package/dist/components/molecules/file-input/styles.css +86 -0
- package/dist/components/molecules/form-field/index.d.ts +38 -0
- package/dist/components/molecules/form-field/index.js +71 -0
- package/dist/components/molecules/form-field/index.js.map +1 -0
- package/dist/components/molecules/form-field/styles.css +43 -0
- package/dist/components/molecules/list/index.d.ts +25 -0
- package/dist/components/molecules/list/index.js +30 -0
- package/dist/components/molecules/list/index.js.map +1 -0
- package/dist/components/molecules/list/styles.css +28 -0
- package/dist/components/molecules/number-stepper/index.d.ts +31 -0
- package/dist/components/molecules/number-stepper/index.js +163 -0
- package/dist/components/molecules/number-stepper/index.js.map +1 -0
- package/dist/components/molecules/number-stepper/styles.css +69 -0
- package/dist/components/molecules/pagination/index.d.ts +39 -0
- package/dist/components/molecules/pagination/index.js +111 -0
- package/dist/components/molecules/pagination/index.js.map +1 -0
- package/dist/components/molecules/pagination/styles.css +41 -0
- package/dist/components/molecules/popover/index.d.ts +22 -0
- package/dist/components/molecules/popover/index.js +76 -0
- package/dist/components/molecules/popover/index.js.map +1 -0
- package/dist/components/molecules/popover/positioning.d.ts +40 -0
- package/dist/components/molecules/popover/positioning.js +115 -0
- package/dist/components/molecules/popover/positioning.js.map +1 -0
- package/dist/components/molecules/popover/styles.css +36 -0
- package/dist/components/molecules/rating/index.d.ts +33 -0
- package/dist/components/molecules/rating/index.js +117 -0
- package/dist/components/molecules/rating/index.js.map +1 -0
- package/dist/components/molecules/rating/styles.css +94 -0
- package/dist/components/molecules/search-input/index.d.ts +23 -0
- package/dist/components/molecules/search-input/index.js +118 -0
- package/dist/components/molecules/search-input/index.js.map +1 -0
- package/dist/components/molecules/search-input/styles.css +69 -0
- package/dist/components/molecules/segmented-control/button-group.d.ts +10 -0
- package/dist/components/molecules/segmented-control/button-group.js +15 -0
- package/dist/components/molecules/segmented-control/button-group.js.map +1 -0
- package/dist/components/molecules/segmented-control/index.d.ts +38 -0
- package/dist/components/molecules/segmented-control/index.js +80 -0
- package/dist/components/molecules/segmented-control/index.js.map +1 -0
- package/dist/components/molecules/segmented-control/styles.css +130 -0
- package/dist/components/molecules/select/index.d.ts +30 -0
- package/dist/components/molecules/select/index.js +48 -0
- package/dist/components/molecules/select/index.js.map +1 -0
- package/dist/components/molecules/select/styles.css +102 -0
- package/dist/components/molecules/tabs/index.d.ts +31 -0
- package/dist/components/molecules/tabs/index.js +87 -0
- package/dist/components/molecules/tabs/index.js.map +1 -0
- package/dist/components/molecules/tabs/styles.css +87 -0
- package/dist/components/molecules/tag-cloud/index.d.ts +16 -0
- package/dist/components/molecules/tag-cloud/index.js +133 -0
- package/dist/components/molecules/tag-cloud/index.js.map +1 -0
- package/dist/components/molecules/tag-cloud/styles.css +29 -0
- package/dist/components/molecules/tooltip/index.d.ts +22 -0
- package/dist/components/molecules/tooltip/index.js +83 -0
- package/dist/components/molecules/tooltip/index.js.map +1 -0
- package/dist/components/molecules/tooltip/styles.css +30 -0
- package/dist/components/molecules/virtualized-list/index.d.ts +5 -0
- package/dist/components/molecules/virtualized-list/index.js +3 -0
- package/dist/components/molecules/virtualized-list/lista/index.d.ts +11 -0
- package/dist/components/molecules/virtualized-list/lista/index.js +30 -0
- package/dist/components/molecules/virtualized-list/lista/index.js.map +1 -0
- package/dist/components/molecules/virtualized-list/lista/styles.css +27 -0
- package/dist/components/molecules/virtualized-list/lista-slow/index.d.ts +10 -0
- package/dist/components/molecules/virtualized-list/lista-slow/index.js +17 -0
- package/dist/components/molecules/virtualized-list/lista-slow/index.js.map +1 -0
- package/dist/components/molecules/virtualized-list/row/index.d.ts +9 -0
- package/dist/components/molecules/virtualized-list/row/index.js +30 -0
- package/dist/components/molecules/virtualized-list/row/index.js.map +1 -0
- package/dist/components/molecules/virtualized-list/types.d.ts +4 -0
- package/dist/components/organisms/combobox/index.d.ts +82 -0
- package/dist/components/organisms/combobox/index.js +386 -0
- package/dist/components/organisms/combobox/index.js.map +1 -0
- package/dist/components/organisms/combobox/styles.css +269 -0
- package/dist/components/organisms/command-palette/index.d.ts +49 -0
- package/dist/components/organisms/command-palette/index.js +239 -0
- package/dist/components/organisms/command-palette/index.js.map +1 -0
- package/dist/components/organisms/command-palette/score.d.ts +12 -0
- package/dist/components/organisms/command-palette/score.js +43 -0
- package/dist/components/organisms/command-palette/score.js.map +1 -0
- package/dist/components/organisms/command-palette/styles.css +212 -0
- package/dist/components/organisms/date-picker/calendar.d.ts +29 -0
- package/dist/components/organisms/date-picker/calendar.js +178 -0
- package/dist/components/organisms/date-picker/calendar.js.map +1 -0
- package/dist/components/organisms/date-picker/date-utils.d.ts +52 -0
- package/dist/components/organisms/date-picker/date-utils.js +139 -0
- package/dist/components/organisms/date-picker/date-utils.js.map +1 -0
- package/dist/components/organisms/date-picker/index.d.ts +54 -0
- package/dist/components/organisms/date-picker/index.js +173 -0
- package/dist/components/organisms/date-picker/index.js.map +1 -0
- package/dist/components/organisms/date-picker/styles.css +179 -0
- package/dist/components/organisms/drawer/index.d.ts +16 -0
- package/dist/components/organisms/drawer/index.js +15 -0
- package/dist/components/organisms/drawer/index.js.map +1 -0
- package/dist/components/organisms/drawer/styles.css +163 -0
- package/dist/components/organisms/editor/index.d.ts +13 -0
- package/dist/components/organisms/editor/index.js +56 -0
- package/dist/components/organisms/editor/index.js.map +1 -0
- package/dist/components/organisms/editor/styles.css +61 -0
- package/dist/components/organisms/form/context.d.ts +7 -0
- package/dist/components/organisms/form/context.js +11 -0
- package/dist/components/organisms/form/context.js.map +1 -0
- package/dist/components/organisms/form/field.d.ts +18 -0
- package/dist/components/organisms/form/field.js +98 -0
- package/dist/components/organisms/form/field.js.map +1 -0
- package/dist/components/organisms/form/form-actions.d.ts +8 -0
- package/dist/components/organisms/form/form-actions.js +13 -0
- package/dist/components/organisms/form/form-actions.js.map +1 -0
- package/dist/components/organisms/form/index.d.ts +24 -0
- package/dist/components/organisms/form/index.js +215 -0
- package/dist/components/organisms/form/index.js.map +1 -0
- package/dist/components/organisms/form/styles.css +29 -0
- package/dist/components/organisms/form/types.d.ts +95 -0
- package/dist/components/organisms/form/validation.d.ts +5 -0
- package/dist/components/organisms/form/validation.js +35 -0
- package/dist/components/organisms/form/validation.js.map +1 -0
- package/dist/components/organisms/header/index.d.ts +40 -0
- package/dist/components/organisms/header/index.js +186 -0
- package/dist/components/organisms/header/index.js.map +1 -0
- package/dist/components/organisms/header/styles.css +126 -0
- package/dist/components/organisms/modal/dialog-base.d.ts +31 -0
- package/dist/components/organisms/modal/dialog-base.js +123 -0
- package/dist/components/organisms/modal/dialog-base.js.map +1 -0
- package/dist/components/organisms/modal/index.d.ts +13 -0
- package/dist/components/organisms/modal/index.js +15 -0
- package/dist/components/organisms/modal/index.js.map +1 -0
- package/dist/components/organisms/modal/styles.css +143 -0
- package/dist/components/organisms/presenter/components/slides/simple/index.d.ts +13 -0
- package/dist/components/organisms/presenter/components/slides/simple/index.js +16 -0
- package/dist/components/organisms/presenter/components/slides/simple/index.js.map +1 -0
- package/dist/components/organisms/presenter/components/slides/simple/styles.css +6 -0
- package/dist/components/organisms/presenter/index.d.ts +17 -0
- package/dist/components/organisms/presenter/index.js +63 -0
- package/dist/components/organisms/presenter/index.js.map +1 -0
- package/dist/components/organisms/presenter/styles.css +75 -0
- package/dist/components/organisms/sidebar/index.d.ts +50 -0
- package/dist/components/organisms/sidebar/index.js +157 -0
- package/dist/components/organisms/sidebar/index.js.map +1 -0
- package/dist/components/organisms/sidebar/styles.css +197 -0
- package/dist/components/organisms/slider/index.d.ts +47 -0
- package/dist/components/organisms/slider/index.js +214 -0
- package/dist/components/organisms/slider/index.js.map +1 -0
- package/dist/components/organisms/slider/styles.css +110 -0
- package/dist/components/organisms/table/components/cell/index.d.ts +8 -0
- package/dist/components/organisms/table/components/cell/index.js +11 -0
- package/dist/components/organisms/table/components/cell/index.js.map +1 -0
- package/dist/components/organisms/table/index.d.ts +29 -0
- package/dist/components/organisms/table/index.js +105 -0
- package/dist/components/organisms/table/index.js.map +1 -0
- package/dist/components/organisms/table/styles.css +66 -0
- package/dist/components/organisms/terminal/index.d.ts +15 -0
- package/dist/components/organisms/terminal/index.js +111 -0
- package/dist/components/organisms/terminal/index.js.map +1 -0
- package/dist/components/organisms/terminal/styles.css +123 -0
- package/dist/components/organisms/toast/index.d.ts +66 -0
- package/dist/components/organisms/toast/index.js +142 -0
- package/dist/components/organisms/toast/index.js.map +1 -0
- package/dist/components/organisms/toast/styles.css +138 -0
- package/dist/components/organisms/wizard/index.d.ts +44 -0
- package/dist/components/organisms/wizard/index.js +171 -0
- package/dist/components/organisms/wizard/index.js.map +1 -0
- package/dist/components/organisms/wizard/styles.css +160 -0
- package/dist/components/utils/cx.d.ts +2 -0
- package/dist/components/utils/cx.js +8 -0
- package/dist/components/utils/cx.js.map +1 -0
- package/dist/components/utils/portal/index.d.ts +9 -0
- package/dist/components/utils/portal/index.js +13 -0
- package/dist/components/utils/portal/index.js.map +1 -0
- package/dist/components/utils/theme-provider/index.d.ts +22 -0
- package/dist/components/utils/theme-provider/index.js +36 -0
- package/dist/components/utils/theme-provider/index.js.map +1 -0
- package/dist/styles.css +743 -0
- package/dist/tokens.css +299 -0
- package/package.json +390 -4
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_jsxs","_jsx"],"sources":["../../../../src/components/molecules/alert/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport \"./styles.css\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Tone of the message. \"warning\" and \"danger\" use role=\"alert\", the rest role=\"status\". Default \"info\" */\n variant?: AlertVariant;\n /** Bold heading of the message */\n title?: ReactNode;\n /** Icon shown on the left. Default: a built-in icon per variant. Pass `null` to hide it */\n icon?: ReactNode;\n /** Renders a close button that calls this handler */\n onClose?: () => void;\n /** Accessible label of the close button. Default \"Close\" */\n closeLabel?: string;\n /** Slot for actions, e.g. a Button, shown under the message */\n action?: ReactNode;\n}\n\nconst svgProps = {\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 1.6,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n \"aria-hidden\": true,\n focusable: false,\n};\n\nconst icons: Record<AlertVariant, ReactNode> = {\n info: (\n <svg {...svgProps}>\n <circle cx=\"10\" cy=\"10\" r=\"7.5\" />\n <path d=\"M10 9v5M10 6.5v.01\" />\n </svg>\n ),\n success: (\n <svg {...svgProps}>\n <circle cx=\"10\" cy=\"10\" r=\"7.5\" />\n <path d=\"M6.5 10.25l2.25 2.25 4.75-4.75\" />\n </svg>\n ),\n warning: (\n <svg {...svgProps}>\n <path d=\"M10 2.75l7.5 13.5h-15z\" />\n <path d=\"M10 8v3.5M10 14v.01\" />\n </svg>\n ),\n danger: (\n <svg {...svgProps}>\n <circle cx=\"10\" cy=\"10\" r=\"7.5\" />\n <path d=\"M7.5 7.5l5 5M12.5 7.5l-5 5\" />\n </svg>\n ),\n};\n\nfunction Alert({\n variant = \"info\",\n title,\n icon,\n onClose,\n closeLabel = \"Close\",\n action,\n className,\n children,\n ...rest\n}: AlertProps) {\n const role = variant === \"danger\" || variant === \"warning\" ? \"alert\" : \"status\";\n const shownIcon = icon === undefined ? icons[variant] : icon;\n\n return (\n <div role={role} className={cx(\"ds-alert\", `ds-alert--${variant}`, className)} {...rest}>\n {shownIcon != null && shownIcon !== false && (\n <span className=\"ds-alert__icon\" aria-hidden=\"true\">\n {shownIcon}\n </span>\n )}\n <div className=\"ds-alert__body\">\n {title != null && <div className=\"ds-alert__title\">{title}</div>}\n {children != null && <div className=\"ds-alert__message\">{children}</div>}\n {action != null && <div className=\"ds-alert__action\">{action}</div>}\n </div>\n {onClose && (\n <button type=\"button\" className=\"ds-alert__close\" aria-label={closeLabel} onClick={onClose}>\n <svg {...svgProps} viewBox=\"0 0 16 16\">\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n </button>\n )}\n </div>\n );\n}\n\nexport default Alert;\n"],"mappings":";;;;AAqBA,IAAM,WAAW;CACf,SAAS;CACT,MAAM;CACN,QAAQ;CACR,aAAa;CACb,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,WAAW;AACb;AAEA,IAAM,QAAyC;CAC7C,MACEA,qBAAC,OAAD;EAAK,GAAI;EAAT,UAAA,CACEC,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;EAAO,CAAA,GACjCA,oBAAC,QAAD,EAAM,GAAE,qBAAsB,CAAA,CAC3B;;CAEP,SACED,qBAAC,OAAD;EAAK,GAAI;EAAT,UAAA,CACEC,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;EAAO,CAAA,GACjCA,oBAAC,QAAD,EAAM,GAAE,iCAAkC,CAAA,CACvC;;CAEP,SACED,qBAAC,OAAD;EAAK,GAAI;EAAT,UAAA,CACEC,oBAAC,QAAD,EAAM,GAAE,yBAA0B,CAAA,GAClCA,oBAAC,QAAD,EAAM,GAAE,sBAAuB,CAAA,CAC5B;;CAEP,QACED,qBAAC,OAAD;EAAK,GAAI;EAAT,UAAA,CACEC,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;EAAO,CAAA,GACjCA,oBAAC,QAAD,EAAM,GAAE,6BAA8B,CAAA,CACnC;;AAET;AAEA,SAAS,MAAM,EACb,UAAU,QACV,OACA,MACA,SACA,aAAa,SACb,QACA,WACA,UACA,GAAG,QACU;CACb,MAAM,OAAO,YAAY,YAAY,YAAY,YAAY,UAAU;CACvE,MAAM,YAAY,SAAS,KAAA,IAAY,MAAM,WAAW;CAExD,OACED,qBAAC,OAAD;EAAW;EAAM,WAAW,GAAG,YAAY,aAAa,WAAW,SAAS;EAAG,GAAI;EAAnF,UAAA;GACG,aAAa,QAAQ,cAAc,SAClCC,oBAAC,QAAD;IAAM,WAAU;IAAiB,eAAY;IAC1C,UAAA;GACG,CAAA;GAERD,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACG,SAAS,QAAQC,oBAAC,OAAD;MAAK,WAAU;MAAmB,UAAA;KAAW,CAAA;KAC9D,YAAY,QAAQA,oBAAC,OAAD;MAAK,WAAU;MAAqB;KAAc,CAAA;KACtE,UAAU,QAAQA,oBAAC,OAAD;MAAK,WAAU;MAAoB,UAAA;KAAY,CAAA;IAC/D;;GACJ,WACCA,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAAkB,cAAY;IAAY,SAAS;IACjF,UAAAA,oBAAC,OAAD;KAAK,GAAI;KAAU,SAAQ;KACzB,UAAAA,oBAAC,QAAD,EAAM,GAAE,qBAAsB,CAAA;IAC3B,CAAA;GACC,CAAA;EAEP;;AAET"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.ds-alert {
|
|
2
|
+
--ds-alert-accent: var(--color-info);
|
|
3
|
+
--ds-alert-text: var(--color-info-text);
|
|
4
|
+
--ds-alert-bg: var(--color-info-subtle);
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: var(--space-3);
|
|
8
|
+
padding: var(--space-3) var(--space-4);
|
|
9
|
+
border: var(--border-width-1) solid var(--ds-alert-accent);
|
|
10
|
+
border-radius: var(--radius-md);
|
|
11
|
+
background: var(--ds-alert-bg);
|
|
12
|
+
color: var(--color-text);
|
|
13
|
+
font-family: var(--font-sans);
|
|
14
|
+
font-size: var(--font-size-sm);
|
|
15
|
+
line-height: var(--line-height-normal);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-alert--success {
|
|
19
|
+
--ds-alert-accent: var(--color-success);
|
|
20
|
+
--ds-alert-text: var(--color-success-text);
|
|
21
|
+
--ds-alert-bg: var(--color-success-subtle);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-alert--warning {
|
|
25
|
+
--ds-alert-accent: var(--color-warning);
|
|
26
|
+
--ds-alert-text: var(--color-warning-text);
|
|
27
|
+
--ds-alert-bg: var(--color-warning-subtle);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ds-alert--danger {
|
|
31
|
+
--ds-alert-accent: var(--color-danger);
|
|
32
|
+
--ds-alert-text: var(--color-danger-text);
|
|
33
|
+
--ds-alert-bg: var(--color-danger-subtle);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ds-alert__icon {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
color: var(--ds-alert-text);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-alert__icon svg {
|
|
43
|
+
width: var(--icon-size-md);
|
|
44
|
+
height: var(--icon-size-md);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ds-alert__body {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex: 1;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: var(--space-1);
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ds-alert__title {
|
|
56
|
+
color: var(--ds-alert-text);
|
|
57
|
+
font-weight: var(--font-weight-semibold);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ds-alert__action {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
gap: var(--space-2);
|
|
64
|
+
margin-top: var(--space-2);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ds-alert__close {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
width: var(--control-height-sm);
|
|
73
|
+
height: var(--control-height-sm);
|
|
74
|
+
margin: calc(var(--space-1) * -1) calc(var(--space-2) * -1) 0 0;
|
|
75
|
+
padding: 0;
|
|
76
|
+
border: 0;
|
|
77
|
+
border-radius: var(--radius-sm);
|
|
78
|
+
background: transparent;
|
|
79
|
+
color: var(--color-text-muted);
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
transition: background-color var(--duration-fast) var(--easing-standard);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ds-alert__close svg {
|
|
85
|
+
width: var(--icon-size-sm);
|
|
86
|
+
height: var(--icon-size-sm);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ds-alert__close:hover {
|
|
90
|
+
background: var(--color-neutral);
|
|
91
|
+
color: var(--color-text);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ds-alert__close:focus-visible {
|
|
95
|
+
outline: var(--border-width-2) solid var(--color-focus-ring);
|
|
96
|
+
outline-offset: 2px;
|
|
97
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
interface BinaryClockState {
|
|
3
|
+
hours: number;
|
|
4
|
+
minutes: number;
|
|
5
|
+
seconds: number;
|
|
6
|
+
}
|
|
7
|
+
declare class BinaryClock extends Component<Record<string, never>, BinaryClockState> {
|
|
8
|
+
private timer;
|
|
9
|
+
constructor(props: Record<string, never>);
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
componentWillUnmount(): void;
|
|
12
|
+
updateTime(): void;
|
|
13
|
+
renderBinary(label: string, value: number): import("react").JSX.Element;
|
|
14
|
+
render(): import("react").JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export default BinaryClock;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
import './styles.css';/* empty css */
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/molecules/binary-clock/index.tsx
|
|
5
|
+
var pad = (n) => n < 10 ? `0${n}` : `${n}`;
|
|
6
|
+
var BinaryClock = class extends Component {
|
|
7
|
+
timer;
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
const d = /* @__PURE__ */ new Date();
|
|
11
|
+
this.state = {
|
|
12
|
+
hours: d.getHours(),
|
|
13
|
+
minutes: d.getMinutes(),
|
|
14
|
+
seconds: d.getSeconds()
|
|
15
|
+
};
|
|
16
|
+
this.updateTime = this.updateTime.bind(this);
|
|
17
|
+
}
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
this.timer = setInterval(this.updateTime, 1e3);
|
|
20
|
+
}
|
|
21
|
+
componentWillUnmount() {
|
|
22
|
+
clearInterval(this.timer);
|
|
23
|
+
}
|
|
24
|
+
updateTime() {
|
|
25
|
+
const d = /* @__PURE__ */ new Date();
|
|
26
|
+
this.setState({
|
|
27
|
+
hours: d.getHours(),
|
|
28
|
+
minutes: d.getMinutes(),
|
|
29
|
+
seconds: d.getSeconds()
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
renderBinary(label, value) {
|
|
33
|
+
const bits = value.toString(2).padStart(6, "0").split("");
|
|
34
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "ds-binary-clock__unit",
|
|
36
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
37
|
+
className: "ds-binary-clock__label",
|
|
38
|
+
children: [
|
|
39
|
+
label,
|
|
40
|
+
": ",
|
|
41
|
+
/* @__PURE__ */ jsx("strong", { children: pad(value) })
|
|
42
|
+
]
|
|
43
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: "ds-binary-clock__bits",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
children: bits.map((b, i) => /* @__PURE__ */ jsx("span", { className: `ds-binary-clock__bit ${b === "1" ? "ds-binary-clock__bit--on" : ""}` }, i))
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const { hours, minutes, seconds } = this.state;
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: "ds-binary-clock",
|
|
54
|
+
role: "timer",
|
|
55
|
+
"aria-label": `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`,
|
|
56
|
+
children: [
|
|
57
|
+
this.renderBinary("Hours", hours),
|
|
58
|
+
this.renderBinary("Minutes", minutes),
|
|
59
|
+
this.renderBinary("Seconds", seconds)
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export { BinaryClock as default };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_jsxs","_jsx"],"sources":["../../../../src/components/molecules/binary-clock/index.tsx"],"sourcesContent":["import { Component } from \"react\";\nimport \"./styles.css\";\n\nconst pad = (n: number) => (n < 10 ? `0${n}` : `${n}`);\n\ninterface BinaryClockState {\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nclass BinaryClock extends Component<Record<string, never>, BinaryClockState> {\n private timer: ReturnType<typeof setInterval> | undefined;\n\n constructor(props: Record<string, never>) {\n super(props);\n\n const d = new Date();\n this.state = {\n hours: d.getHours(),\n minutes: d.getMinutes(),\n seconds: d.getSeconds(),\n };\n\n this.updateTime = this.updateTime.bind(this);\n }\n\n componentDidMount() {\n this.timer = setInterval(this.updateTime, 1000);\n }\n\n componentWillUnmount() {\n clearInterval(this.timer);\n }\n\n updateTime() {\n const d = new Date();\n this.setState({\n hours: d.getHours(),\n minutes: d.getMinutes(),\n seconds: d.getSeconds(),\n });\n }\n\n renderBinary(label: string, value: number) {\n const bits = value.toString(2).padStart(6, \"0\").split(\"\");\n return (\n <div className=\"ds-binary-clock__unit\">\n <span className=\"ds-binary-clock__label\">\n {label}: <strong>{pad(value)}</strong>\n </span>\n <div className=\"ds-binary-clock__bits\" aria-hidden=\"true\">\n {bits.map((b, i) => (\n <span\n key={i}\n className={`ds-binary-clock__bit ${b === \"1\" ? \"ds-binary-clock__bit--on\" : \"\"}`}\n />\n ))}\n </div>\n </div>\n );\n }\n\n render() {\n const { hours, minutes, seconds } = this.state;\n return (\n <div className=\"ds-binary-clock\" role=\"timer\" aria-label={`${pad(hours)}:${pad(minutes)}:${pad(seconds)}`}>\n {this.renderBinary(\"Hours\", hours)}\n {this.renderBinary(\"Minutes\", minutes)}\n {this.renderBinary(\"Seconds\", seconds)}\n </div>\n );\n }\n}\n\nexport default BinaryClock;\n"],"mappings":";;;;AAGA,IAAM,OAAO,MAAe,IAAI,KAAK,IAAI,MAAM,GAAG;AAQlD,IAAM,cAAN,cAA0B,UAAmD;CACnE;CAER,YAAY,OAA8B;EACxC,MAAM,KAAK;EAEX,MAAM,oBAAI,IAAI,KAAK;EACnB,KAAK,QAAQ;GACX,OAAO,EAAE,SAAS;GAClB,SAAS,EAAE,WAAW;GACtB,SAAS,EAAE,WAAW;EACxB;EAEA,KAAK,aAAa,KAAK,WAAW,KAAK,IAAI;CAC7C;CAEA,oBAAoB;EAClB,KAAK,QAAQ,YAAY,KAAK,YAAY,GAAI;CAChD;CAEA,uBAAuB;EACrB,cAAc,KAAK,KAAK;CAC1B;CAEA,aAAa;EACX,MAAM,oBAAI,IAAI,KAAK;EACnB,KAAK,SAAS;GACZ,OAAO,EAAE,SAAS;GAClB,SAAS,EAAE,WAAW;GACtB,SAAS,EAAE,WAAW;EACxB,CAAC;CACH;CAEA,aAAa,OAAe,OAAe;EACzC,MAAM,OAAO,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE;EACxD,OACEA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACEA,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA;KACG;KAAM;KAAEC,oBAAC,UAAD,EAAA,UAAS,IAAI,KAAK,EAAU,CAAA;IACjC;GACN,CAAA,GAAAA,oBAAC,OAAD;IAAK,WAAU;IAAwB,eAAY;IAChD,UAAA,KAAK,KAAK,GAAG,MACZA,oBAAC,QAAD,EAEE,WAAW,wBAAwB,MAAM,MAAM,6BAA6B,KAC7E,GAFM,CAEN,CACF;GACE,CAAA,CACF;;CAET;CAEA,SAAS;EACP,MAAM,EAAE,OAAO,SAAS,YAAY,KAAK;EACzC,OACED,qBAAC,OAAD;GAAK,WAAU;GAAkB,MAAK;GAAQ,cAAY,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,IAAI,OAAO;GAAtG,UAAA;IACG,KAAK,aAAa,SAAS,KAAK;IAChC,KAAK,aAAa,WAAW,OAAO;IACpC,KAAK,aAAa,WAAW,OAAO;GAClC;;CAET;AACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.ds-binary-clock {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--space-4);
|
|
5
|
+
padding: var(--space-6);
|
|
6
|
+
border: var(--border-width-1) solid var(--color-border);
|
|
7
|
+
border-radius: var(--radius-lg);
|
|
8
|
+
background: var(--color-surface);
|
|
9
|
+
color: var(--color-text);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ds-binary-clock__unit {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--space-2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-binary-clock__label {
|
|
19
|
+
font-size: var(--font-size-sm);
|
|
20
|
+
color: var(--color-text-muted);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ds-binary-clock__label strong {
|
|
24
|
+
font-family: var(--font-mono);
|
|
25
|
+
color: var(--color-text);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ds-binary-clock__bits {
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: var(--space-2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-binary-clock__bit {
|
|
34
|
+
width: var(--icon-size-lg);
|
|
35
|
+
height: var(--icon-size-lg);
|
|
36
|
+
border-radius: var(--radius-full);
|
|
37
|
+
border: var(--border-width-2) solid var(--color-border-strong);
|
|
38
|
+
background: transparent;
|
|
39
|
+
transition: background-color var(--duration-normal) var(--easing-standard),
|
|
40
|
+
border-color var(--duration-normal) var(--easing-standard);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ds-binary-clock__bit--on {
|
|
44
|
+
background: var(--color-primary);
|
|
45
|
+
border-color: var(--color-primary);
|
|
46
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
/** Text or content of the item */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Link target. Without it (and without `onClick`) the item is plain text */
|
|
6
|
+
href?: string;
|
|
7
|
+
/** Click handler; renders a button when there is no `href` */
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
11
|
+
/** Path from the root to the current page; the last item is the current page */
|
|
12
|
+
items: BreadcrumbItem[];
|
|
13
|
+
/** Separator between items. Default "/" */
|
|
14
|
+
separator?: ReactNode;
|
|
15
|
+
/** Collapse the middle items into an "…" button when there are more items than this */
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
/** Accessible label of the `<nav>`. Default "Breadcrumb" */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
/** Accessible label of the "…" button. Default "Show full path" */
|
|
20
|
+
expandLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
declare function Breadcrumb({ items, separator, maxItems, "aria-label": ariaLabel, expandLabel, className, ...rest }: BreadcrumbProps): import("react").JSX.Element;
|
|
23
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { cx } from "../../utils/cx.js";
|
|
3
|
+
import './styles.css';/* empty css */
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/molecules/breadcrumb/index.tsx
|
|
6
|
+
function Breadcrumb({ items, separator = "/", maxItems, "aria-label": ariaLabel = "Breadcrumb", expandLabel = "Show full path", className, ...rest }) {
|
|
7
|
+
const [expanded, setExpanded] = useState(false);
|
|
8
|
+
const lastIndex = items.length - 1;
|
|
9
|
+
const collapse = !expanded && maxItems != null && maxItems >= 2 && items.length > maxItems;
|
|
10
|
+
const tailCount = collapse ? Math.max(1, maxItems - 1) : 0;
|
|
11
|
+
const entries = collapse ? [
|
|
12
|
+
{
|
|
13
|
+
kind: "item",
|
|
14
|
+
item: items[0],
|
|
15
|
+
index: 0
|
|
16
|
+
},
|
|
17
|
+
{ kind: "ellipsis" },
|
|
18
|
+
...items.slice(items.length - tailCount).map((item, i) => ({
|
|
19
|
+
kind: "item",
|
|
20
|
+
item,
|
|
21
|
+
index: items.length - tailCount + i
|
|
22
|
+
}))
|
|
23
|
+
] : items.map((item, index) => ({
|
|
24
|
+
kind: "item",
|
|
25
|
+
item,
|
|
26
|
+
index
|
|
27
|
+
}));
|
|
28
|
+
const renderItem = (item, index) => {
|
|
29
|
+
if (index === lastIndex) return /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "ds-breadcrumb__current",
|
|
31
|
+
"aria-current": "page",
|
|
32
|
+
children: item.label
|
|
33
|
+
});
|
|
34
|
+
if (item.href != null) return /* @__PURE__ */ jsx("a", {
|
|
35
|
+
className: "ds-breadcrumb__link",
|
|
36
|
+
href: item.href,
|
|
37
|
+
onClick: item.onClick,
|
|
38
|
+
children: item.label
|
|
39
|
+
});
|
|
40
|
+
if (item.onClick) return /* @__PURE__ */ jsx("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
className: "ds-breadcrumb__link ds-breadcrumb__button",
|
|
43
|
+
onClick: item.onClick,
|
|
44
|
+
children: item.label
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "ds-breadcrumb__text",
|
|
48
|
+
children: item.label
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
52
|
+
"aria-label": ariaLabel,
|
|
53
|
+
className: cx("ds-breadcrumb", className),
|
|
54
|
+
...rest,
|
|
55
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
56
|
+
className: "ds-breadcrumb__list",
|
|
57
|
+
children: entries.map((entry, i) => {
|
|
58
|
+
const isLast = i === entries.length - 1;
|
|
59
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
60
|
+
className: "ds-breadcrumb__item",
|
|
61
|
+
children: [entry.kind === "ellipsis" ? /* @__PURE__ */ jsx("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
className: "ds-breadcrumb__link ds-breadcrumb__button ds-breadcrumb__ellipsis",
|
|
64
|
+
"aria-label": expandLabel,
|
|
65
|
+
onClick: () => setExpanded(true),
|
|
66
|
+
children: "…"
|
|
67
|
+
}) : renderItem(entry.item, entry.index), !isLast && /* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "ds-breadcrumb__separator",
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
children: separator
|
|
71
|
+
})]
|
|
72
|
+
}, entry.kind === "item" ? entry.index : "ellipsis");
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export { Breadcrumb as default };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_jsx","_jsxs"],"sources":["../../../../src/components/molecules/breadcrumb/index.tsx"],"sourcesContent":["import { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport \"./styles.css\";\n\nexport interface BreadcrumbItem {\n /** Text or content of the item */\n label: ReactNode;\n /** Link target. Without it (and without `onClick`) the item is plain text */\n href?: string;\n /** Click handler; renders a button when there is no `href` */\n onClick?: () => void;\n}\n\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n /** Path from the root to the current page; the last item is the current page */\n items: BreadcrumbItem[];\n /** Separator between items. Default \"/\" */\n separator?: ReactNode;\n /** Collapse the middle items into an \"…\" button when there are more items than this */\n maxItems?: number;\n /** Accessible label of the `<nav>`. Default \"Breadcrumb\" */\n \"aria-label\"?: string;\n /** Accessible label of the \"…\" button. Default \"Show full path\" */\n expandLabel?: string;\n}\n\nfunction Breadcrumb({\n items,\n separator = \"/\",\n maxItems,\n \"aria-label\": ariaLabel = \"Breadcrumb\",\n expandLabel = \"Show full path\",\n className,\n ...rest\n}: BreadcrumbProps) {\n const [expanded, setExpanded] = useState(false);\n const lastIndex = items.length - 1;\n const collapse = !expanded && maxItems != null && maxItems >= 2 && items.length > maxItems;\n const tailCount = collapse ? Math.max(1, (maxItems as number) - 1) : 0;\n\n type Entry = { kind: \"item\"; item: BreadcrumbItem; index: number } | { kind: \"ellipsis\" };\n const entries: Entry[] = collapse\n ? [\n { kind: \"item\", item: items[0], index: 0 },\n { kind: \"ellipsis\" },\n ...items.slice(items.length - tailCount).map((item, i) => ({\n kind: \"item\" as const,\n item,\n index: items.length - tailCount + i,\n })),\n ]\n : items.map((item, index) => ({ kind: \"item\" as const, item, index }));\n\n const renderItem = (item: BreadcrumbItem, index: number) => {\n if (index === lastIndex) {\n return (\n <span className=\"ds-breadcrumb__current\" aria-current=\"page\">\n {item.label}\n </span>\n );\n }\n if (item.href != null) {\n return (\n <a className=\"ds-breadcrumb__link\" href={item.href} onClick={item.onClick}>\n {item.label}\n </a>\n );\n }\n if (item.onClick) {\n return (\n <button type=\"button\" className=\"ds-breadcrumb__link ds-breadcrumb__button\" onClick={item.onClick}>\n {item.label}\n </button>\n );\n }\n return <span className=\"ds-breadcrumb__text\">{item.label}</span>;\n };\n\n return (\n <nav aria-label={ariaLabel} className={cx(\"ds-breadcrumb\", className)} {...rest}>\n <ol className=\"ds-breadcrumb__list\">\n {entries.map((entry, i) => {\n const isLast = i === entries.length - 1;\n return (\n <li key={entry.kind === \"item\" ? entry.index : \"ellipsis\"} className=\"ds-breadcrumb__item\">\n {entry.kind === \"ellipsis\" ? (\n <button\n type=\"button\"\n className=\"ds-breadcrumb__link ds-breadcrumb__button ds-breadcrumb__ellipsis\"\n aria-label={expandLabel}\n onClick={() => setExpanded(true)}\n >\n …\n </button>\n ) : (\n renderItem(entry.item, entry.index)\n )}\n {!isLast && (\n <span className=\"ds-breadcrumb__separator\" aria-hidden=\"true\">\n {separator}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n\nexport default Breadcrumb;\n"],"mappings":";;;;;AA0BA,SAAS,WAAW,EAClB,OACA,YAAY,KACZ,UACA,cAAc,YAAY,cAC1B,cAAc,kBACd,WACA,GAAG,QACe;CAClB,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,YAAY,MAAM,SAAS;CACjC,MAAM,WAAW,CAAC,YAAY,YAAY,QAAQ,YAAY,KAAK,MAAM,SAAS;CAClF,MAAM,YAAY,WAAW,KAAK,IAAI,GAAI,WAAsB,CAAC,IAAI;CAGrE,MAAM,UAAmB,WACrB;EACE;GAAE,MAAM;GAAQ,MAAM,MAAM;GAAI,OAAO;EAAE;EACzC,EAAE,MAAM,WAAW;EACnB,GAAG,MAAM,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC,KAAK,MAAM,OAAO;GACzD,MAAM;GACN;GACA,OAAO,MAAM,SAAS,YAAY;EACpC,EAAE;CACJ,IACA,MAAM,KAAK,MAAM,WAAW;EAAE,MAAM;EAAiB;EAAM;CAAM,EAAE;CAEvE,MAAM,cAAc,MAAsB,UAAkB;EAC1D,IAAI,UAAU,WACZ,OACEA,oBAAC,QAAD;GAAM,WAAU;GAAyB,gBAAa;GACnD,UAAA,KAAK;EACF,CAAA;EAGV,IAAI,KAAK,QAAQ,MACf,OACEA,oBAAC,KAAD;GAAG,WAAU;GAAsB,MAAM,KAAK;GAAM,SAAS,KAAK;GAC/D,UAAA,KAAK;EACL,CAAA;EAGP,IAAI,KAAK,SACP,OACEA,oBAAC,UAAD;GAAQ,MAAK;GAAS,WAAU;GAA4C,SAAS,KAAK;GACvF,UAAA,KAAK;EACA,CAAA;EAGZ,OAAOA,oBAAC,QAAD;GAAM,WAAU;GAAuB,UAAA,KAAK;EAAY,CAAA;CACjE;CAEA,OACEA,oBAAC,OAAD;EAAK,cAAY;EAAW,WAAW,GAAG,iBAAiB,SAAS;EAAG,GAAI;EACzE,UAAAA,oBAAC,MAAD;GAAI,WAAU;GACX,UAAA,QAAQ,KAAK,OAAO,MAAM;IACzB,MAAM,SAAS,MAAM,QAAQ,SAAS;IACtC,OACEC,qBAAC,MAAD;KAA2D,WAAU;KAArE,UAAA,CACG,MAAM,SAAS,aACdD,oBAAC,UAAD;MACE,MAAK;MACL,WAAU;MACV,cAAY;MACZ,eAAe,YAAY,IAAI;MAChC,UAAA;KAEO,CAAA,IAER,WAAW,MAAM,MAAM,MAAM,KAAK,GAEnC,CAAC,UACAA,oBAAC,QAAD;MAAM,WAAU;MAA2B,eAAY;MACpD,UAAA;KACG,CAAA,CAEN;IAlBK,GAAA,MAAM,SAAS,SAAS,MAAM,QAAQ,UAkB3C;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.ds-breadcrumb {
|
|
2
|
+
font-family: var(--font-sans);
|
|
3
|
+
font-size: var(--font-size-sm);
|
|
4
|
+
color: var(--color-text-muted);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ds-breadcrumb__list {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: var(--space-2);
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ds-breadcrumb__item {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--space-2);
|
|
21
|
+
min-width: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-breadcrumb__link {
|
|
25
|
+
border-radius: var(--radius-sm);
|
|
26
|
+
color: var(--color-text-muted);
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
transition: color var(--duration-fast) var(--easing-standard);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ds-breadcrumb__link:hover {
|
|
32
|
+
color: var(--color-primary-text);
|
|
33
|
+
text-decoration: underline;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ds-breadcrumb__button {
|
|
37
|
+
padding: 0;
|
|
38
|
+
border: 0;
|
|
39
|
+
background: transparent;
|
|
40
|
+
font: inherit;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ds-breadcrumb__ellipsis {
|
|
45
|
+
padding: 0 var(--space-1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ds-breadcrumb__link:focus-visible {
|
|
49
|
+
outline: var(--border-width-2) solid var(--color-focus-ring);
|
|
50
|
+
outline-offset: 2px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ds-breadcrumb__current {
|
|
54
|
+
color: var(--color-text);
|
|
55
|
+
font-weight: var(--font-weight-medium);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ds-breadcrumb__separator {
|
|
59
|
+
color: var(--color-text-subtle);
|
|
60
|
+
user-select: none;
|
|
61
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HTMLAttributes, ImgHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type CardVariant = "outlined" | "elevated" | "filled";
|
|
3
|
+
export type CardPadding = "none" | "sm" | "md" | "lg";
|
|
4
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Root element. Use "article" for self-contained content. Default "div" */
|
|
6
|
+
as?: "div" | "article" | "section";
|
|
7
|
+
/** Visual style. Default "outlined" */
|
|
8
|
+
variant?: CardVariant;
|
|
9
|
+
/** Inner spacing of the header, body and footer. Default "md" */
|
|
10
|
+
padding?: CardPadding;
|
|
11
|
+
/** Hover and focus styles for clickable cards (put a link or button inside, or pass `onClick` + `tabIndex`) */
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function Card({ as: Tag, variant, padding, interactive, className, children, ...rest }: CardProps): import("react").JSX.Element;
|
|
15
|
+
export interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
16
|
+
/** Main heading of the card */
|
|
17
|
+
title?: ReactNode;
|
|
18
|
+
/** Secondary text under the title */
|
|
19
|
+
subtitle?: ReactNode;
|
|
20
|
+
/** Slot on the right, e.g. a menu or icon button */
|
|
21
|
+
actions?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Header with a title, subtitle and an actions slot */
|
|
24
|
+
export declare function CardHeader({ title, subtitle, actions, className, children, ...rest }: CardHeaderProps): import("react").JSX.Element;
|
|
25
|
+
export type CardBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
26
|
+
/** Main content of the card */
|
|
27
|
+
export declare function CardBody({ className, ...rest }: CardBodyProps): import("react").JSX.Element;
|
|
28
|
+
export type CardFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
29
|
+
/** Bottom area, usually for actions */
|
|
30
|
+
export declare function CardFooter({ className, ...rest }: CardFooterProps): import("react").JSX.Element;
|
|
31
|
+
export interface CardMediaProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
32
|
+
/** Image URL */
|
|
33
|
+
src: string;
|
|
34
|
+
/** Alternative text. Use "" for decorative images */
|
|
35
|
+
alt: string;
|
|
36
|
+
}
|
|
37
|
+
/** Full-bleed image */
|
|
38
|
+
export declare function CardMedia({ className, alt, ...rest }: CardMediaProps): import("react").JSX.Element;
|
|
39
|
+
export default Card;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import './styles.css';/* empty css */
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/molecules/card/index.tsx
|
|
5
|
+
function Card({ as: Tag = "div", variant = "outlined", padding = "md", interactive = false, className, children, ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
7
|
+
className: cx("ds-card", `ds-card--${variant}`, `ds-card--padding-${padding}`, interactive && "ds-card--interactive", className),
|
|
8
|
+
...rest,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** Header with a title, subtitle and an actions slot */
|
|
13
|
+
function CardHeader({ title, subtitle, actions, className, children, ...rest }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: cx("ds-card__header", className),
|
|
16
|
+
...rest,
|
|
17
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: "ds-card__heading",
|
|
19
|
+
children: [
|
|
20
|
+
title != null && /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "ds-card__title",
|
|
22
|
+
children: title
|
|
23
|
+
}),
|
|
24
|
+
subtitle != null && /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: "ds-card__subtitle",
|
|
26
|
+
children: subtitle
|
|
27
|
+
}),
|
|
28
|
+
children
|
|
29
|
+
]
|
|
30
|
+
}), actions != null && /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "ds-card__actions",
|
|
32
|
+
children: actions
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Main content of the card */
|
|
37
|
+
function CardBody({ className, ...rest }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: cx("ds-card__body", className),
|
|
40
|
+
...rest
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Bottom area, usually for actions */
|
|
44
|
+
function CardFooter({ className, ...rest }) {
|
|
45
|
+
return /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: cx("ds-card__footer", className),
|
|
47
|
+
...rest
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** Full-bleed image */
|
|
51
|
+
function CardMedia({ className, alt, ...rest }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("img", {
|
|
53
|
+
className: cx("ds-card__media", className),
|
|
54
|
+
alt,
|
|
55
|
+
...rest
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export { CardBody, CardFooter, CardHeader, CardMedia, Card as default };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_jsx","_jsxs"],"sources":["../../../../src/components/molecules/card/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ImgHTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport \"./styles.css\";\n\nexport type CardVariant = \"outlined\" | \"elevated\" | \"filled\";\nexport type CardPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n /** Root element. Use \"article\" for self-contained content. Default \"div\" */\n as?: \"div\" | \"article\" | \"section\";\n /** Visual style. Default \"outlined\" */\n variant?: CardVariant;\n /** Inner spacing of the header, body and footer. Default \"md\" */\n padding?: CardPadding;\n /** Hover and focus styles for clickable cards (put a link or button inside, or pass `onClick` + `tabIndex`) */\n interactive?: boolean;\n}\n\nfunction Card({\n as: Tag = \"div\",\n variant = \"outlined\",\n padding = \"md\",\n interactive = false,\n className,\n children,\n ...rest\n}: CardProps) {\n return (\n <Tag\n className={cx(\n \"ds-card\",\n `ds-card--${variant}`,\n `ds-card--padding-${padding}`,\n interactive && \"ds-card--interactive\",\n className\n )}\n {...rest}\n >\n {children}\n </Tag>\n );\n}\n\nexport interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Main heading of the card */\n title?: ReactNode;\n /** Secondary text under the title */\n subtitle?: ReactNode;\n /** Slot on the right, e.g. a menu or icon button */\n actions?: ReactNode;\n}\n\n/** Header with a title, subtitle and an actions slot */\nexport function CardHeader({ title, subtitle, actions, className, children, ...rest }: CardHeaderProps) {\n return (\n <div className={cx(\"ds-card__header\", className)} {...rest}>\n <div className=\"ds-card__heading\">\n {title != null && <div className=\"ds-card__title\">{title}</div>}\n {subtitle != null && <div className=\"ds-card__subtitle\">{subtitle}</div>}\n {children}\n </div>\n {actions != null && <div className=\"ds-card__actions\">{actions}</div>}\n </div>\n );\n}\n\nexport type CardBodyProps = HTMLAttributes<HTMLDivElement>;\n\n/** Main content of the card */\nexport function CardBody({ className, ...rest }: CardBodyProps) {\n return <div className={cx(\"ds-card__body\", className)} {...rest} />;\n}\n\nexport type CardFooterProps = HTMLAttributes<HTMLDivElement>;\n\n/** Bottom area, usually for actions */\nexport function CardFooter({ className, ...rest }: CardFooterProps) {\n return <div className={cx(\"ds-card__footer\", className)} {...rest} />;\n}\n\nexport interface CardMediaProps extends ImgHTMLAttributes<HTMLImageElement> {\n /** Image URL */\n src: string;\n /** Alternative text. Use \"\" for decorative images */\n alt: string;\n}\n\n/** Full-bleed image */\nexport function CardMedia({ className, alt, ...rest }: CardMediaProps) {\n return <img className={cx(\"ds-card__media\", className)} alt={alt} {...rest} />;\n}\n\nexport default Card;\n"],"mappings":";;;;AAkBA,SAAS,KAAK,EACZ,IAAI,MAAM,OACV,UAAU,YACV,UAAU,MACV,cAAc,OACd,WACA,UACA,GAAG,QACS;CACZ,OACEA,oBAAC,KAAD;EACE,WAAW,GACT,WACA,YAAY,WACZ,oBAAoB,WACpB,eAAe,wBACf,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET;;AAYA,SAAgB,WAAW,EAAE,OAAO,UAAU,SAAS,WAAW,UAAU,GAAG,QAAyB;CACtG,OACEC,qBAAC,OAAD;EAAK,WAAW,GAAG,mBAAmB,SAAS;EAAG,GAAI;EAAtD,UAAA,CACEA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG,SAAS,QAAQD,oBAAC,OAAD;KAAK,WAAU;KAAkB,UAAA;IAAW,CAAA;IAC7D,YAAY,QAAQA,oBAAC,OAAD;KAAK,WAAU;KAAqB,UAAA;IAAc,CAAA;IACtE;GACE;EACJ,CAAA,GAAA,WAAW,QAAQA,oBAAC,OAAD;GAAK,WAAU;GAAoB,UAAA;EAAa,CAAA,CACjE;;AAET;;AAKA,SAAgB,SAAS,EAAE,WAAW,GAAG,QAAuB;CAC9D,OAAOA,oBAAC,OAAD;EAAK,WAAW,GAAG,iBAAiB,SAAS;EAAG,GAAI;CAAO,CAAA;AACpE;;AAKA,SAAgB,WAAW,EAAE,WAAW,GAAG,QAAyB;CAClE,OAAOA,oBAAC,OAAD;EAAK,WAAW,GAAG,mBAAmB,SAAS;EAAG,GAAI;CAAO,CAAA;AACtE;;AAUA,SAAgB,UAAU,EAAE,WAAW,KAAK,GAAG,QAAwB;CACrE,OAAOA,oBAAC,OAAD;EAAK,WAAW,GAAG,kBAAkB,SAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC/E"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.ds-card {
|
|
2
|
+
--ds-card-padding: var(--space-4);
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
border: var(--border-width-1) solid transparent;
|
|
7
|
+
border-radius: var(--radius-lg);
|
|
8
|
+
background: var(--color-surface);
|
|
9
|
+
color: var(--color-text);
|
|
10
|
+
font-family: var(--font-sans);
|
|
11
|
+
font-size: var(--font-size-sm);
|
|
12
|
+
line-height: var(--line-height-normal);
|
|
13
|
+
transition:
|
|
14
|
+
box-shadow var(--duration-fast) var(--easing-standard),
|
|
15
|
+
border-color var(--duration-fast) var(--easing-standard),
|
|
16
|
+
background-color var(--duration-fast) var(--easing-standard);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Variants */
|
|
20
|
+
.ds-card--outlined {
|
|
21
|
+
border-color: var(--color-border);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-card--elevated {
|
|
25
|
+
background: var(--color-surface-raised);
|
|
26
|
+
box-shadow: var(--shadow-md);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ds-card--filled {
|
|
30
|
+
background: var(--color-bg-subtle);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Padding */
|
|
34
|
+
.ds-card--padding-none { --ds-card-padding: var(--space-0); }
|
|
35
|
+
.ds-card--padding-sm { --ds-card-padding: var(--space-3); }
|
|
36
|
+
.ds-card--padding-md { --ds-card-padding: var(--space-4); }
|
|
37
|
+
.ds-card--padding-lg { --ds-card-padding: var(--space-6); }
|
|
38
|
+
|
|
39
|
+
/* Interactive */
|
|
40
|
+
.ds-card--interactive {
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ds-card--interactive:hover {
|
|
45
|
+
border-color: var(--color-border-strong);
|
|
46
|
+
box-shadow: var(--shadow-lg);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-card--interactive:focus-visible,
|
|
50
|
+
.ds-card--interactive:has(:focus-visible) {
|
|
51
|
+
outline: var(--border-width-2) solid var(--color-focus-ring);
|
|
52
|
+
outline-offset: 2px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Parts */
|
|
56
|
+
.ds-card__header {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
gap: var(--space-3);
|
|
61
|
+
padding: var(--ds-card-padding) var(--ds-card-padding) 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ds-card__heading {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: var(--space-1);
|
|
68
|
+
min-width: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ds-card__title {
|
|
72
|
+
font-size: var(--font-size-md);
|
|
73
|
+
font-weight: var(--font-weight-semibold);
|
|
74
|
+
line-height: var(--line-height-tight);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-card__subtitle {
|
|
78
|
+
color: var(--color-text-muted);
|
|
79
|
+
font-size: var(--font-size-sm);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-card__actions {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
gap: var(--space-1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ds-card__body {
|
|
89
|
+
flex: 1;
|
|
90
|
+
padding: var(--ds-card-padding);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ds-card__footer {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: flex-end;
|
|
97
|
+
gap: var(--space-2);
|
|
98
|
+
padding: 0 var(--ds-card-padding) var(--ds-card-padding);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ds-card__media {
|
|
102
|
+
display: block;
|
|
103
|
+
width: 100%;
|
|
104
|
+
object-fit: cover;
|
|
105
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ChartDataset {
|
|
2
|
+
/** Series name shown in the legend */
|
|
3
|
+
label: string;
|
|
4
|
+
/** One value per label */
|
|
5
|
+
data: number[];
|
|
6
|
+
}
|
|
7
|
+
export interface ChartProps {
|
|
8
|
+
/** Category labels */
|
|
9
|
+
labels?: string[];
|
|
10
|
+
/** Datasets (colors are assigned from the design system) */
|
|
11
|
+
datasets?: ChartDataset[];
|
|
12
|
+
}
|
|
13
|
+
declare function Chart({ labels, datasets }: ChartProps): import("react").JSX.Element;
|
|
14
|
+
export default Chart;
|