@spark-ui/components 10.0.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/CHANGELOG.md +15 -0
- package/LICENSE.md +21 -0
- package/README.md +19 -0
- package/dist/DialogTrigger-5SI4dvpK.d.mts +142 -0
- package/dist/DialogTrigger-5SI4dvpK.d.ts +142 -0
- package/dist/Input-g0LpWuv0.d.mts +17 -0
- package/dist/Input-g0LpWuv0.d.ts +17 -0
- package/dist/InputGroup-aoaZxCLk.d.mts +28 -0
- package/dist/InputGroup-aoaZxCLk.d.ts +28 -0
- package/dist/InputTrailingIcon-BBp7sE6D.d.mts +20 -0
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.mts +19 -0
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
- package/dist/accordion/index.d.mts +85 -0
- package/dist/accordion/index.d.ts +85 -0
- package/dist/accordion/index.js +461 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/index.mjs +249 -0
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/alert-dialog/index.d.mts +119 -0
- package/dist/alert-dialog/index.d.ts +119 -0
- package/dist/alert-dialog/index.js +1451 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/alert-dialog/index.mjs +177 -0
- package/dist/alert-dialog/index.mjs.map +1 -0
- package/dist/badge/index.d.mts +47 -0
- package/dist/badge/index.d.ts +47 -0
- package/dist/badge/index.js +122 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/badge/index.mjs +95 -0
- package/dist/badge/index.mjs.map +1 -0
- package/dist/breadcrumb/index.d.mts +64 -0
- package/dist/breadcrumb/index.d.ts +64 -0
- package/dist/breadcrumb/index.js +326 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/breadcrumb/index.mjs +149 -0
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/button/index.d.mts +40 -0
- package/dist/button/index.d.ts +40 -0
- package/dist/button/index.js +877 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/index.mjs +10 -0
- package/dist/button/index.mjs.map +1 -0
- package/dist/carousel/index.d.mts +253 -0
- package/dist/carousel/index.d.ts +253 -0
- package/dist/carousel/index.js +1678 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/carousel/index.mjs +716 -0
- package/dist/carousel/index.mjs.map +1 -0
- package/dist/checkbox/index.d.mts +120 -0
- package/dist/checkbox/index.d.ts +120 -0
- package/dist/checkbox/index.js +873 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/checkbox/index.mjs +349 -0
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/chip/index.d.mts +97 -0
- package/dist/chip/index.d.ts +97 -0
- package/dist/chip/index.js +905 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/chip/index.mjs +793 -0
- package/dist/chip/index.mjs.map +1 -0
- package/dist/chunk-2KPFQEAA.mjs +52 -0
- package/dist/chunk-2KPFQEAA.mjs.map +1 -0
- package/dist/chunk-4F5DOL57.mjs +26 -0
- package/dist/chunk-4F5DOL57.mjs.map +1 -0
- package/dist/chunk-6JOA37TZ.mjs +742 -0
- package/dist/chunk-6JOA37TZ.mjs.map +1 -0
- package/dist/chunk-7PMPYEHJ.mjs +379 -0
- package/dist/chunk-7PMPYEHJ.mjs.map +1 -0
- package/dist/chunk-AESXFMCC.mjs +68 -0
- package/dist/chunk-AESXFMCC.mjs.map +1 -0
- package/dist/chunk-B42LOFIZ.mjs +308 -0
- package/dist/chunk-B42LOFIZ.mjs.map +1 -0
- package/dist/chunk-FGOZHKBT.mjs +97 -0
- package/dist/chunk-FGOZHKBT.mjs.map +1 -0
- package/dist/chunk-HLXYG643.mjs +52 -0
- package/dist/chunk-HLXYG643.mjs.map +1 -0
- package/dist/chunk-JKNBJHD5.mjs +601 -0
- package/dist/chunk-JKNBJHD5.mjs.map +1 -0
- package/dist/chunk-K7VP7DH3.mjs +66 -0
- package/dist/chunk-K7VP7DH3.mjs.map +1 -0
- package/dist/chunk-MUNDKRAE.mjs +80 -0
- package/dist/chunk-MUNDKRAE.mjs.map +1 -0
- package/dist/chunk-NBZKMCHF.mjs +36 -0
- package/dist/chunk-NBZKMCHF.mjs.map +1 -0
- package/dist/chunk-PZWESKAR.mjs +314 -0
- package/dist/chunk-PZWESKAR.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +60 -0
- package/dist/collapsible/index.d.ts +60 -0
- package/dist/collapsible/index.js +140 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/collapsible/index.mjs +8 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/combobox/index.d.mts +285 -0
- package/dist/combobox/index.d.ts +285 -0
- package/dist/combobox/index.js +2920 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/combobox/index.mjs +1267 -0
- package/dist/combobox/index.mjs.map +1 -0
- package/dist/dialog/index.d.mts +33 -0
- package/dist/dialog/index.d.ts +33 -0
- package/dist/dialog/index.js +1286 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/dialog/index.mjs +13 -0
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/divider/index.d.mts +61 -0
- package/dist/divider/index.d.ts +61 -0
- package/dist/divider/index.js +223 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/divider/index.mjs +196 -0
- package/dist/divider/index.mjs.map +1 -0
- package/dist/drawer/index.d.mts +148 -0
- package/dist/drawer/index.d.ts +148 -0
- package/dist/drawer/index.js +1266 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/drawer/index.mjs +299 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/dropdown/index.d.mts +233 -0
- package/dist/dropdown/index.d.ts +233 -0
- package/dist/dropdown/index.js +2402 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/dropdown/index.mjs +741 -0
- package/dist/dropdown/index.mjs.map +1 -0
- package/dist/form-field/index.d.mts +176 -0
- package/dist/form-field/index.d.ts +176 -0
- package/dist/form-field/index.js +540 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/form-field/index.mjs +13 -0
- package/dist/form-field/index.mjs.map +1 -0
- package/dist/icon/index.d.mts +28 -0
- package/dist/icon/index.d.ts +28 -0
- package/dist/icon/index.js +127 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon/index.mjs +9 -0
- package/dist/icon/index.mjs.map +1 -0
- package/dist/icon-button/index.d.mts +16 -0
- package/dist/icon-button/index.d.ts +16 -0
- package/dist/icon-button/index.js +921 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/icon-button/index.mjs +11 -0
- package/dist/icon-button/index.mjs.map +1 -0
- package/dist/input/index.d.mts +78 -0
- package/dist/input/index.d.ts +78 -0
- package/dist/input/index.js +1119 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/index.mjs +16 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/kbd/index.d.mts +9 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +46 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/kbd/index.mjs +19 -0
- package/dist/kbd/index.mjs.map +1 -0
- package/dist/label/index.d.mts +11 -0
- package/dist/label/index.d.ts +11 -0
- package/dist/label/index.js +78 -0
- package/dist/label/index.js.map +1 -0
- package/dist/label/index.mjs +7 -0
- package/dist/label/index.mjs.map +1 -0
- package/dist/link-box/index.d.mts +34 -0
- package/dist/link-box/index.d.ts +34 -0
- package/dist/link-box/index.js +92 -0
- package/dist/link-box/index.js.map +1 -0
- package/dist/link-box/index.mjs +58 -0
- package/dist/link-box/index.mjs.map +1 -0
- package/dist/pagination/index.d.mts +143 -0
- package/dist/pagination/index.d.ts +143 -0
- package/dist/pagination/index.js +1303 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/index.mjs +326 -0
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/popover/index.d.mts +93 -0
- package/dist/popover/index.d.ts +93 -0
- package/dist/popover/index.js +1280 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/index.mjs +13 -0
- package/dist/popover/index.mjs.map +1 -0
- package/dist/portal/index.d.mts +13 -0
- package/dist/portal/index.d.ts +13 -0
- package/dist/portal/index.js +37 -0
- package/dist/portal/index.js.map +1 -0
- package/dist/portal/index.mjs +10 -0
- package/dist/portal/index.mjs.map +1 -0
- package/dist/progress/index.d.mts +48 -0
- package/dist/progress/index.d.ts +48 -0
- package/dist/progress/index.js +201 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress/index.mjs +174 -0
- package/dist/progress/index.mjs.map +1 -0
- package/dist/progress-tracker/index.d.mts +81 -0
- package/dist/progress-tracker/index.d.ts +81 -0
- package/dist/progress-tracker/index.js +834 -0
- package/dist/progress-tracker/index.js.map +1 -0
- package/dist/progress-tracker/index.mjs +716 -0
- package/dist/progress-tracker/index.mjs.map +1 -0
- package/dist/radio-group/index.d.mts +100 -0
- package/dist/radio-group/index.d.ts +100 -0
- package/dist/radio-group/index.js +824 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/radio-group/index.mjs +297 -0
- package/dist/radio-group/index.mjs.map +1 -0
- package/dist/rating/index.d.mts +78 -0
- package/dist/rating/index.d.ts +78 -0
- package/dist/rating/index.js +362 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/rating/index.mjs +247 -0
- package/dist/rating/index.mjs.map +1 -0
- package/dist/scrolling-list/index.d.mts +105 -0
- package/dist/scrolling-list/index.d.ts +105 -0
- package/dist/scrolling-list/index.js +1367 -0
- package/dist/scrolling-list/index.js.map +1 -0
- package/dist/scrolling-list/index.mjs +407 -0
- package/dist/scrolling-list/index.mjs.map +1 -0
- package/dist/select/index.d.mts +167 -0
- package/dist/select/index.d.ts +167 -0
- package/dist/select/index.js +991 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/index.mjs +470 -0
- package/dist/select/index.mjs.map +1 -0
- package/dist/skeleton/index.d.mts +67 -0
- package/dist/skeleton/index.d.ts +67 -0
- package/dist/skeleton/index.js +206 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/index.mjs +147 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/slider/index.d.mts +97 -0
- package/dist/slider/index.d.ts +97 -0
- package/dist/slider/index.js +209 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/index.mjs +182 -0
- package/dist/slider/index.mjs.map +1 -0
- package/dist/slot/index.d.mts +17 -0
- package/dist/slot/index.d.ts +17 -0
- package/dist/slot/index.js +51 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/slot/index.mjs +11 -0
- package/dist/slot/index.mjs.map +1 -0
- package/dist/snackbar/index.d.mts +158 -0
- package/dist/snackbar/index.d.ts +158 -0
- package/dist/snackbar/index.js +1693 -0
- package/dist/snackbar/index.js.map +1 -0
- package/dist/snackbar/index.mjs +733 -0
- package/dist/snackbar/index.mjs.map +1 -0
- package/dist/spinner/index.d.mts +21 -0
- package/dist/spinner/index.d.ts +21 -0
- package/dist/spinner/index.js +139 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/index.mjs +9 -0
- package/dist/spinner/index.mjs.map +1 -0
- package/dist/stepper/index.d.mts +82 -0
- package/dist/stepper/index.d.ts +82 -0
- package/dist/stepper/index.js +2178 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/index.mjs +229 -0
- package/dist/stepper/index.mjs.map +1 -0
- package/dist/switch/index.d.mts +64 -0
- package/dist/switch/index.d.ts +64 -0
- package/dist/switch/index.js +768 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/index.mjs +245 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/tabs/index.d.mts +103 -0
- package/dist/tabs/index.d.ts +103 -0
- package/dist/tabs/index.js +1315 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/index.mjs +391 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/tag/index.d.mts +27 -0
- package/dist/tag/index.d.ts +27 -0
- package/dist/tag/index.js +269 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/tag/index.mjs +237 -0
- package/dist/tag/index.mjs.map +1 -0
- package/dist/text-link/index.d.mts +20 -0
- package/dist/text-link/index.d.ts +20 -0
- package/dist/text-link/index.js +99 -0
- package/dist/text-link/index.js.map +1 -0
- package/dist/text-link/index.mjs +8 -0
- package/dist/text-link/index.mjs.map +1 -0
- package/dist/textarea/index.d.mts +47 -0
- package/dist/textarea/index.d.ts +47 -0
- package/dist/textarea/index.js +1180 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/textarea/index.mjs +77 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/visually-hidden/index.d.mts +16 -0
- package/dist/visually-hidden/index.d.ts +16 -0
- package/dist/visually-hidden/index.js +67 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/dist/visually-hidden/index.mjs +8 -0
- package/dist/visually-hidden/index.mjs.map +1 -0
- package/global.d.ts +12 -0
- package/package.json +75 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/badge/index.ts","../../src/badge/BadgeItem.styles.tsx","../../src/badge/BadgeItem.tsx","../../src/badge/Badge.tsx"],"sourcesContent":["export * from './Badge'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n ['inline-flex h-fit', 'empty:p-0', 'text-center font-bold', 'rounded-full box-content'],\n {\n variants: {\n /**\n * Visual color appearance of the component.\n * @default 'danger'\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'basic',\n ]\n >({\n main: ['bg-main', 'text-on-main', 'border-surface'],\n support: ['bg-support', 'text-on-support', 'border-surface'],\n accent: ['bg-accent', 'text-on-accent', 'border-surface'],\n success: ['bg-success', 'text-on-success', 'border-surface'],\n alert: ['bg-alert', 'text-on-alert', 'border-surface'],\n danger: ['bg-error', 'text-on-error', 'border-surface'],\n info: ['bg-info', 'text-on-info', 'border-surface'],\n neutral: ['bg-neutral', 'text-on-neutral', 'border-surface'],\n surface: ['bg-surface', 'text-on-surface', 'border-surface'],\n basic: ['bg-basic', 'text-on-basic', 'border-surface'],\n }),\n /**\n * Size of the component.\n * @default 'md'\n */\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['text-small', 'px-[var(--spacing-sz-6)] py-[var(--spacing-sz-2)]', 'empty:size-sz-8'],\n md: ['text-caption', 'px-md py-sm', 'empty:size-sz-16'],\n }),\n /**\n * Type of the component.\n * @default 'relative'\n */\n type: {\n relative: ['absolute right-0 border-md', 'translate-x-1/2 -translate-y-1/2'],\n standalone: [],\n },\n },\n defaultVariants: {\n intent: 'danger',\n size: 'md',\n type: 'relative',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { HTMLAttributes, Ref } from 'react'\n\nimport { styles, type StylesProps } from './BadgeItem.styles'\n\nexport interface BadgeItemProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label'>,\n StylesProps {\n /**\n * Numeric value used as indicator inside the component.\n */\n count?: number\n /**\n * Maximum numeric value to be dispayed as a count value.\n * @default 99\n */\n overflowCount?: number\n /**\n * A custom label for accessibility purposes. It can also be defined as a builder function\n * to handle dynamic inner data to create a custom label.\n */\n 'aria-label'?:\n | string\n | (({ count, overflowCount }: { count?: number; overflowCount?: number }) => string)\n /**\n * Describes the way the component is displayed: relative to another element or just standalone.\n * @default 'relative'\n */\n type?: 'relative' | 'standalone'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const BadgeItem = ({\n intent = 'danger',\n size = 'md',\n type = 'relative',\n count,\n overflowCount = 99,\n 'aria-label': label,\n className,\n ...others\n}: BadgeItemProps) => {\n const hasOverflow = count && count > overflowCount\n const ariaLabel = typeof label === 'function' ? label({ count, overflowCount }) : label\n const props = { ...others, 'aria-label': ariaLabel }\n\n return (\n <span\n data-spark-component=\"badge\"\n role=\"status\"\n className={styles({\n intent,\n size,\n type,\n className,\n })}\n {...props}\n >\n {hasOverflow ? `${overflowCount}+` : count}\n </span>\n )\n}\n\nBadgeItem.displayName = 'BadgeItem'\n","import { PropsWithChildren, Ref } from 'react'\n\nimport { BadgeItem, BadgeItemProps } from './BadgeItem'\n\nexport type BadgeProps = PropsWithChildren<Omit<BadgeItemProps, 'type'>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Badge = ({ children, ...props }: BadgeProps) => {\n const isStandalone = !children\n\n return isStandalone ? (\n <BadgeItem type=\"standalone\" {...props} />\n ) : (\n <div className=\"relative inline-flex\">\n {children}\n <BadgeItem {...props} />\n </div>\n )\n}\n\nBadge.displayName = 'Badge'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAA6B;AAC7B,sCAAuC;AAEhC,IAAM,aAAS;AAAA,EACpB,CAAC,qBAAqB,aAAa,yBAAyB,0BAA0B;AAAA,EACtF;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,MAKR,YAAQ,oCAcN;AAAA,QACA,MAAM,CAAC,WAAW,gBAAgB,gBAAgB;AAAA,QAClD,SAAS,CAAC,cAAc,mBAAmB,gBAAgB;AAAA,QAC3D,QAAQ,CAAC,aAAa,kBAAkB,gBAAgB;AAAA,QACxD,SAAS,CAAC,cAAc,mBAAmB,gBAAgB;AAAA,QAC3D,OAAO,CAAC,YAAY,iBAAiB,gBAAgB;AAAA,QACrD,QAAQ,CAAC,YAAY,iBAAiB,gBAAgB;AAAA,QACtD,MAAM,CAAC,WAAW,gBAAgB,gBAAgB;AAAA,QAClD,SAAS,CAAC,cAAc,mBAAmB,gBAAgB;AAAA,QAC3D,SAAS,CAAC,cAAc,mBAAmB,gBAAgB;AAAA,QAC3D,OAAO,CAAC,YAAY,iBAAiB,gBAAgB;AAAA,MACvD,CAAC;AAAA;AAA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["import_jsx_runtime"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// src/badge/BadgeItem.styles.tsx
|
|
2
|
+
import { makeVariants } from "@spark-ui/internal-utils";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
var styles = cva(
|
|
5
|
+
["inline-flex h-fit", "empty:p-0", "text-center font-bold", "rounded-full box-content"],
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
/**
|
|
9
|
+
* Visual color appearance of the component.
|
|
10
|
+
* @default 'danger'
|
|
11
|
+
*/
|
|
12
|
+
intent: makeVariants({
|
|
13
|
+
main: ["bg-main", "text-on-main", "border-surface"],
|
|
14
|
+
support: ["bg-support", "text-on-support", "border-surface"],
|
|
15
|
+
accent: ["bg-accent", "text-on-accent", "border-surface"],
|
|
16
|
+
success: ["bg-success", "text-on-success", "border-surface"],
|
|
17
|
+
alert: ["bg-alert", "text-on-alert", "border-surface"],
|
|
18
|
+
danger: ["bg-error", "text-on-error", "border-surface"],
|
|
19
|
+
info: ["bg-info", "text-on-info", "border-surface"],
|
|
20
|
+
neutral: ["bg-neutral", "text-on-neutral", "border-surface"],
|
|
21
|
+
surface: ["bg-surface", "text-on-surface", "border-surface"],
|
|
22
|
+
basic: ["bg-basic", "text-on-basic", "border-surface"]
|
|
23
|
+
}),
|
|
24
|
+
/**
|
|
25
|
+
* Size of the component.
|
|
26
|
+
* @default 'md'
|
|
27
|
+
*/
|
|
28
|
+
size: makeVariants({
|
|
29
|
+
sm: ["text-small", "px-[var(--spacing-sz-6)] py-[var(--spacing-sz-2)]", "empty:size-sz-8"],
|
|
30
|
+
md: ["text-caption", "px-md py-sm", "empty:size-sz-16"]
|
|
31
|
+
}),
|
|
32
|
+
/**
|
|
33
|
+
* Type of the component.
|
|
34
|
+
* @default 'relative'
|
|
35
|
+
*/
|
|
36
|
+
type: {
|
|
37
|
+
relative: ["absolute right-0 border-md", "translate-x-1/2 -translate-y-1/2"],
|
|
38
|
+
standalone: []
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
intent: "danger",
|
|
43
|
+
size: "md",
|
|
44
|
+
type: "relative"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// src/badge/BadgeItem.tsx
|
|
50
|
+
import { jsx } from "react/jsx-runtime";
|
|
51
|
+
var BadgeItem = ({
|
|
52
|
+
intent = "danger",
|
|
53
|
+
size = "md",
|
|
54
|
+
type = "relative",
|
|
55
|
+
count,
|
|
56
|
+
overflowCount = 99,
|
|
57
|
+
"aria-label": label,
|
|
58
|
+
className,
|
|
59
|
+
...others
|
|
60
|
+
}) => {
|
|
61
|
+
const hasOverflow = count && count > overflowCount;
|
|
62
|
+
const ariaLabel = typeof label === "function" ? label({ count, overflowCount }) : label;
|
|
63
|
+
const props = { ...others, "aria-label": ariaLabel };
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
"data-spark-component": "badge",
|
|
68
|
+
role: "status",
|
|
69
|
+
className: styles({
|
|
70
|
+
intent,
|
|
71
|
+
size,
|
|
72
|
+
type,
|
|
73
|
+
className
|
|
74
|
+
}),
|
|
75
|
+
...props,
|
|
76
|
+
children: hasOverflow ? `${overflowCount}+` : count
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
BadgeItem.displayName = "BadgeItem";
|
|
81
|
+
|
|
82
|
+
// src/badge/Badge.tsx
|
|
83
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
84
|
+
var Badge = ({ children, ...props }) => {
|
|
85
|
+
const isStandalone = !children;
|
|
86
|
+
return isStandalone ? /* @__PURE__ */ jsx2(BadgeItem, { type: "standalone", ...props }) : /* @__PURE__ */ jsxs("div", { className: "relative inline-flex", children: [
|
|
87
|
+
children,
|
|
88
|
+
/* @__PURE__ */ jsx2(BadgeItem, { ...props })
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
Badge.displayName = "Badge";
|
|
92
|
+
export {
|
|
93
|
+
Badge
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/badge/BadgeItem.styles.tsx","../../src/badge/BadgeItem.tsx","../../src/badge/Badge.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n ['inline-flex h-fit', 'empty:p-0', 'text-center font-bold', 'rounded-full box-content'],\n {\n variants: {\n /**\n * Visual color appearance of the component.\n * @default 'danger'\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'basic',\n ]\n >({\n main: ['bg-main', 'text-on-main', 'border-surface'],\n support: ['bg-support', 'text-on-support', 'border-surface'],\n accent: ['bg-accent', 'text-on-accent', 'border-surface'],\n success: ['bg-success', 'text-on-success', 'border-surface'],\n alert: ['bg-alert', 'text-on-alert', 'border-surface'],\n danger: ['bg-error', 'text-on-error', 'border-surface'],\n info: ['bg-info', 'text-on-info', 'border-surface'],\n neutral: ['bg-neutral', 'text-on-neutral', 'border-surface'],\n surface: ['bg-surface', 'text-on-surface', 'border-surface'],\n basic: ['bg-basic', 'text-on-basic', 'border-surface'],\n }),\n /**\n * Size of the component.\n * @default 'md'\n */\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['text-small', 'px-[var(--spacing-sz-6)] py-[var(--spacing-sz-2)]', 'empty:size-sz-8'],\n md: ['text-caption', 'px-md py-sm', 'empty:size-sz-16'],\n }),\n /**\n * Type of the component.\n * @default 'relative'\n */\n type: {\n relative: ['absolute right-0 border-md', 'translate-x-1/2 -translate-y-1/2'],\n standalone: [],\n },\n },\n defaultVariants: {\n intent: 'danger',\n size: 'md',\n type: 'relative',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { HTMLAttributes, Ref } from 'react'\n\nimport { styles, type StylesProps } from './BadgeItem.styles'\n\nexport interface BadgeItemProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label'>,\n StylesProps {\n /**\n * Numeric value used as indicator inside the component.\n */\n count?: number\n /**\n * Maximum numeric value to be dispayed as a count value.\n * @default 99\n */\n overflowCount?: number\n /**\n * A custom label for accessibility purposes. It can also be defined as a builder function\n * to handle dynamic inner data to create a custom label.\n */\n 'aria-label'?:\n | string\n | (({ count, overflowCount }: { count?: number; overflowCount?: number }) => string)\n /**\n * Describes the way the component is displayed: relative to another element or just standalone.\n * @default 'relative'\n */\n type?: 'relative' | 'standalone'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const BadgeItem = ({\n intent = 'danger',\n size = 'md',\n type = 'relative',\n count,\n overflowCount = 99,\n 'aria-label': label,\n className,\n ...others\n}: BadgeItemProps) => {\n const hasOverflow = count && count > overflowCount\n const ariaLabel = typeof label === 'function' ? label({ count, overflowCount }) : label\n const props = { ...others, 'aria-label': ariaLabel }\n\n return (\n <span\n data-spark-component=\"badge\"\n role=\"status\"\n className={styles({\n intent,\n size,\n type,\n className,\n })}\n {...props}\n >\n {hasOverflow ? `${overflowCount}+` : count}\n </span>\n )\n}\n\nBadgeItem.displayName = 'BadgeItem'\n","import { PropsWithChildren, Ref } from 'react'\n\nimport { BadgeItem, BadgeItemProps } from './BadgeItem'\n\nexport type BadgeProps = PropsWithChildren<Omit<BadgeItemProps, 'type'>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Badge = ({ children, ...props }: BadgeProps) => {\n const isStandalone = !children\n\n return isStandalone ? (\n <BadgeItem type=\"standalone\" {...props} />\n ) : (\n <div className=\"relative inline-flex\">\n {children}\n <BadgeItem {...props} />\n </div>\n )\n}\n\nBadge.displayName = 'Badge'\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAA8B;AAEhC,IAAM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YAAY,OAAO,UAAU,aAAa,MAAM,EAAE,OAAO,cAAc,CAAC,IAAI;AAClF,QAAM,QAAQ,EAAE,GAAG,QAAQ,cAAc,UAAU;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB,MAAK;AAAA,MACL,WAAW,OAAO;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA,MAEH,wBAAc,GAAG,aAAa,MAAM;AAAA;AAAA,EACvC;AAEJ;AAEA,UAAU,cAAc;;;AClDpB,gBAAAA,MAEA,YAFA;AAJG,IAAM,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,MAAkB;AAC3D,QAAM,eAAe,CAAC;AAEtB,SAAO,eACL,gBAAAA,KAAC,aAAU,MAAK,cAAc,GAAG,OAAO,IAExC,qBAAC,SAAI,WAAU,wBACZ;AAAA;AAAA,IACD,gBAAAA,KAAC,aAAW,GAAG,OAAO;AAAA,KACxB;AAEJ;AAEA,MAAM,cAAc;","names":["jsx"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentPropsWithoutRef, Ref } from 'react';
|
|
3
|
+
import { TextLink } from '../text-link/index.mjs';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {
|
|
8
|
+
className?: string;
|
|
9
|
+
['aria-label']: string;
|
|
10
|
+
ref?: Ref<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
declare const Breadcrumb$1: {
|
|
13
|
+
({ className, "aria-label": ariaLabel, ref, ...rest }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface CurrentPageProps extends ComponentPropsWithoutRef<typeof TextLink> {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
21
|
+
}
|
|
22
|
+
declare const CurrentPage: {
|
|
23
|
+
({ asChild, className, children, ...rest }: CurrentPageProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface ItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
28
|
+
className?: string;
|
|
29
|
+
ref?: Ref<HTMLLIElement>;
|
|
30
|
+
}
|
|
31
|
+
declare const Item: {
|
|
32
|
+
({ className, ...rest }: ItemProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
interface LinkProps extends ComponentPropsWithoutRef<typeof TextLink> {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
href?: string;
|
|
40
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
41
|
+
}
|
|
42
|
+
declare const Link: {
|
|
43
|
+
({ asChild, className, bold, intent, underline, href, ref, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
interface SeparatorProps extends ComponentPropsWithoutRef<'li'> {
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
ref?: Ref<HTMLLIElement>;
|
|
51
|
+
}
|
|
52
|
+
declare const Separator: {
|
|
53
|
+
({ asChild, className, children, ref, ...rest }: SeparatorProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
displayName: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare const Breadcrumb: typeof Breadcrumb$1 & {
|
|
58
|
+
Item: typeof Item;
|
|
59
|
+
Link: typeof Link;
|
|
60
|
+
CurrentPage: typeof CurrentPage;
|
|
61
|
+
Separator: typeof Separator;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { Breadcrumb, type BreadcrumbProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentPropsWithoutRef, Ref } from 'react';
|
|
3
|
+
import { TextLink } from '../text-link/index.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {
|
|
8
|
+
className?: string;
|
|
9
|
+
['aria-label']: string;
|
|
10
|
+
ref?: Ref<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
declare const Breadcrumb$1: {
|
|
13
|
+
({ className, "aria-label": ariaLabel, ref, ...rest }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface CurrentPageProps extends ComponentPropsWithoutRef<typeof TextLink> {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
21
|
+
}
|
|
22
|
+
declare const CurrentPage: {
|
|
23
|
+
({ asChild, className, children, ...rest }: CurrentPageProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface ItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
28
|
+
className?: string;
|
|
29
|
+
ref?: Ref<HTMLLIElement>;
|
|
30
|
+
}
|
|
31
|
+
declare const Item: {
|
|
32
|
+
({ className, ...rest }: ItemProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
interface LinkProps extends ComponentPropsWithoutRef<typeof TextLink> {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
href?: string;
|
|
40
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
41
|
+
}
|
|
42
|
+
declare const Link: {
|
|
43
|
+
({ asChild, className, bold, intent, underline, href, ref, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
interface SeparatorProps extends ComponentPropsWithoutRef<'li'> {
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
ref?: Ref<HTMLLIElement>;
|
|
51
|
+
}
|
|
52
|
+
declare const Separator: {
|
|
53
|
+
({ asChild, className, children, ref, ...rest }: SeparatorProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
displayName: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare const Breadcrumb: typeof Breadcrumb$1 & {
|
|
58
|
+
Item: typeof Item;
|
|
59
|
+
Link: typeof Link;
|
|
60
|
+
CurrentPage: typeof CurrentPage;
|
|
61
|
+
Separator: typeof Separator;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { Breadcrumb, type BreadcrumbProps };
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/breadcrumb/index.ts
|
|
21
|
+
var breadcrumb_exports = {};
|
|
22
|
+
__export(breadcrumb_exports, {
|
|
23
|
+
Breadcrumb: () => Breadcrumb2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(breadcrumb_exports);
|
|
26
|
+
|
|
27
|
+
// src/breadcrumb/Breadcrumb.tsx
|
|
28
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var Breadcrumb = ({
|
|
31
|
+
className,
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
ref,
|
|
34
|
+
...rest
|
|
35
|
+
}) => {
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
37
|
+
"nav",
|
|
38
|
+
{
|
|
39
|
+
"data-spark-component": "breadcrumb",
|
|
40
|
+
ref,
|
|
41
|
+
"aria-label": ariaLabel,
|
|
42
|
+
className: (0, import_class_variance_authority.cx)("text-caption text-neutral", className),
|
|
43
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: (0, import_class_variance_authority.cx)("gap-sm flex flex-wrap items-center break-words"), ...rest })
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
Breadcrumb.displayName = "Breadcrumb.Breadcrumb";
|
|
48
|
+
|
|
49
|
+
// src/breadcrumb/BreadcrumbCurrentPage.tsx
|
|
50
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
51
|
+
|
|
52
|
+
// src/slot/Slot.tsx
|
|
53
|
+
var import_radix_ui = require("radix-ui");
|
|
54
|
+
var import_react = require("react");
|
|
55
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
56
|
+
var Slottable = import_radix_ui.Slot.Slottable;
|
|
57
|
+
var Slot = ({ ref, ...props }) => {
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/breadcrumb/BreadcrumbCurrentPage.tsx
|
|
62
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
63
|
+
var CurrentPage = ({
|
|
64
|
+
asChild = false,
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
...rest
|
|
68
|
+
}) => {
|
|
69
|
+
const Component = asChild ? Slot : "span";
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
71
|
+
Component,
|
|
72
|
+
{
|
|
73
|
+
"data-spark-component": "breadcrumb-current-page",
|
|
74
|
+
role: "link",
|
|
75
|
+
"aria-disabled": true,
|
|
76
|
+
"aria-current": "page",
|
|
77
|
+
className: (0, import_class_variance_authority2.cx)(
|
|
78
|
+
"inline! overflow-hidden font-bold text-ellipsis whitespace-nowrap text-current",
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
...rest,
|
|
82
|
+
children
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
CurrentPage.displayName = "Breadcrumb.CurrentPage";
|
|
87
|
+
|
|
88
|
+
// src/breadcrumb/BreadcrumbItem.tsx
|
|
89
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
90
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
91
|
+
var Item = ({ className, ...rest }) => {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
93
|
+
"li",
|
|
94
|
+
{
|
|
95
|
+
"data-spark-component": "breadcrumb-item",
|
|
96
|
+
className: (0, import_class_variance_authority3.cx)("min-w-none gap-sm inline-flex items-center", className),
|
|
97
|
+
...rest
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
Item.displayName = "Breadcrumb.Item";
|
|
102
|
+
|
|
103
|
+
// src/breadcrumb/BreadcrumbLink.tsx
|
|
104
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
105
|
+
|
|
106
|
+
// src/text-link/TextLink.tsx
|
|
107
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
108
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
109
|
+
var textLinkStyles = (0, import_class_variance_authority4.cva)(["inline-flex items-center focus-visible:u-outline"], {
|
|
110
|
+
variants: {
|
|
111
|
+
intent: {
|
|
112
|
+
current: "text-current hover:opacity-dim-1",
|
|
113
|
+
main: "text-main hover:text-main-hovered",
|
|
114
|
+
support: "text-support hover:text-support-hovered",
|
|
115
|
+
accent: "text-accent hover:text-accent-hovered",
|
|
116
|
+
basic: "text-basic hover:text-basic-hovered",
|
|
117
|
+
success: "text-success hover:text-success-hovered",
|
|
118
|
+
alert: "text-alert hover:text-alert-hovered",
|
|
119
|
+
danger: "text-error hover:text-error-hovered",
|
|
120
|
+
info: "text-info hover:text-info-hovered",
|
|
121
|
+
neutral: "text-neutral hover:text-neutral-hovered"
|
|
122
|
+
},
|
|
123
|
+
/** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */
|
|
124
|
+
bold: {
|
|
125
|
+
true: "font-bold"
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Underline is enabled by default.
|
|
129
|
+
* You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.
|
|
130
|
+
*/
|
|
131
|
+
underline: {
|
|
132
|
+
true: "underline",
|
|
133
|
+
false: "hover:underline focus:underline"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
defaultVariants: {
|
|
137
|
+
intent: "current",
|
|
138
|
+
bold: false,
|
|
139
|
+
underline: true
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var TextLink = ({
|
|
143
|
+
asChild = false,
|
|
144
|
+
bold = false,
|
|
145
|
+
children,
|
|
146
|
+
className,
|
|
147
|
+
intent = "current",
|
|
148
|
+
underline = true,
|
|
149
|
+
ref,
|
|
150
|
+
...props
|
|
151
|
+
}) => {
|
|
152
|
+
const Component = asChild ? Slot : "a";
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
154
|
+
Component,
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: textLinkStyles({ className, bold, intent, underline }),
|
|
158
|
+
...props,
|
|
159
|
+
children
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// src/breadcrumb/BreadcrumbLink.tsx
|
|
165
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
166
|
+
var Link = ({
|
|
167
|
+
asChild = false,
|
|
168
|
+
className,
|
|
169
|
+
bold = true,
|
|
170
|
+
intent = "current",
|
|
171
|
+
underline = true,
|
|
172
|
+
href,
|
|
173
|
+
ref,
|
|
174
|
+
...rest
|
|
175
|
+
}) => {
|
|
176
|
+
const Component = asChild ? Slot : TextLink;
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
178
|
+
Component,
|
|
179
|
+
{
|
|
180
|
+
"data-spark-component": "breadcrumb-link",
|
|
181
|
+
href,
|
|
182
|
+
ref,
|
|
183
|
+
className: (0, import_class_variance_authority5.cx)("inline! overflow-hidden text-ellipsis whitespace-nowrap", className),
|
|
184
|
+
bold,
|
|
185
|
+
intent,
|
|
186
|
+
underline,
|
|
187
|
+
...rest
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
Link.displayName = "Breadcrumb.Link";
|
|
192
|
+
|
|
193
|
+
// src/breadcrumb/BreadcrumbSeparator.tsx
|
|
194
|
+
var import_ArrowVerticalRight = require("@spark-ui/icons/ArrowVerticalRight");
|
|
195
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
196
|
+
|
|
197
|
+
// src/icon/Icon.tsx
|
|
198
|
+
var import_react2 = require("react");
|
|
199
|
+
|
|
200
|
+
// src/visually-hidden/VisuallyHidden.tsx
|
|
201
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
202
|
+
var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
|
|
203
|
+
const Component = asChild ? Slot : "span";
|
|
204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
205
|
+
Component,
|
|
206
|
+
{
|
|
207
|
+
...props,
|
|
208
|
+
ref,
|
|
209
|
+
style: {
|
|
210
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
211
|
+
position: "absolute",
|
|
212
|
+
border: 0,
|
|
213
|
+
width: 1,
|
|
214
|
+
height: 1,
|
|
215
|
+
padding: 0,
|
|
216
|
+
margin: -1,
|
|
217
|
+
overflow: "hidden",
|
|
218
|
+
clip: "rect(0, 0, 0, 0)",
|
|
219
|
+
whiteSpace: "nowrap",
|
|
220
|
+
wordWrap: "normal",
|
|
221
|
+
...props.style
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
227
|
+
|
|
228
|
+
// src/icon/Icon.styles.tsx
|
|
229
|
+
var import_internal_utils = require("@spark-ui/internal-utils");
|
|
230
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
231
|
+
var iconStyles = (0, import_class_variance_authority6.cva)(["fill-current shrink-0"], {
|
|
232
|
+
variants: {
|
|
233
|
+
/**
|
|
234
|
+
* Color scheme of the icon.
|
|
235
|
+
*/
|
|
236
|
+
intent: (0, import_internal_utils.makeVariants)({
|
|
237
|
+
current: ["text-current"],
|
|
238
|
+
main: ["text-main"],
|
|
239
|
+
support: ["text-support"],
|
|
240
|
+
accent: ["text-accent"],
|
|
241
|
+
basic: ["text-basic"],
|
|
242
|
+
success: ["text-success"],
|
|
243
|
+
alert: ["text-alert"],
|
|
244
|
+
error: ["text-error"],
|
|
245
|
+
info: ["text-info"],
|
|
246
|
+
neutral: ["text-neutral"]
|
|
247
|
+
}),
|
|
248
|
+
/**
|
|
249
|
+
* Sets the size of the icon.
|
|
250
|
+
*/
|
|
251
|
+
size: (0, import_internal_utils.makeVariants)({
|
|
252
|
+
current: ["u-current-font-size"],
|
|
253
|
+
sm: ["w-sz-16", "h-sz-16"],
|
|
254
|
+
md: ["w-sz-24", "h-sz-24"],
|
|
255
|
+
lg: ["w-sz-32", "h-sz-32"],
|
|
256
|
+
xl: ["w-sz-40", "h-sz-40"]
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// src/icon/Icon.tsx
|
|
262
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
263
|
+
var Icon = ({
|
|
264
|
+
label,
|
|
265
|
+
className,
|
|
266
|
+
size = "current",
|
|
267
|
+
intent = "current",
|
|
268
|
+
children,
|
|
269
|
+
...others
|
|
270
|
+
}) => {
|
|
271
|
+
const child = import_react2.Children.only(children);
|
|
272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
273
|
+
(0, import_react2.cloneElement)(child, {
|
|
274
|
+
className: iconStyles({ className, size, intent }),
|
|
275
|
+
"data-spark-component": "icon",
|
|
276
|
+
"aria-hidden": "true",
|
|
277
|
+
focusable: "false",
|
|
278
|
+
...others
|
|
279
|
+
}),
|
|
280
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(VisuallyHidden, { children: label })
|
|
281
|
+
] });
|
|
282
|
+
};
|
|
283
|
+
Icon.displayName = "Icon";
|
|
284
|
+
|
|
285
|
+
// src/breadcrumb/BreadcrumbSeparator.tsx
|
|
286
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
287
|
+
var Separator = ({
|
|
288
|
+
asChild = false,
|
|
289
|
+
className,
|
|
290
|
+
children,
|
|
291
|
+
ref,
|
|
292
|
+
...rest
|
|
293
|
+
}) => {
|
|
294
|
+
const Component = asChild ? Slot : "li";
|
|
295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
296
|
+
Component,
|
|
297
|
+
{
|
|
298
|
+
role: "presentation",
|
|
299
|
+
"aria-hidden": true,
|
|
300
|
+
"data-spark-component": "breadcrumb-separator",
|
|
301
|
+
ref,
|
|
302
|
+
className: (0, import_class_variance_authority7.cx)("gap-sm inline-flex items-center", className),
|
|
303
|
+
...rest,
|
|
304
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ArrowVerticalRight.ArrowVerticalRight, {}) })
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
};
|
|
308
|
+
Separator.displayName = "Breadcrumb.Separator";
|
|
309
|
+
|
|
310
|
+
// src/breadcrumb/index.ts
|
|
311
|
+
var Breadcrumb2 = Object.assign(Breadcrumb, {
|
|
312
|
+
Item,
|
|
313
|
+
Link,
|
|
314
|
+
CurrentPage,
|
|
315
|
+
Separator
|
|
316
|
+
});
|
|
317
|
+
Breadcrumb2.displayName = "Breadcrumb";
|
|
318
|
+
Item.displayName = "Breadcrumb.Item";
|
|
319
|
+
Link.displayName = "Breadcrumb.Link";
|
|
320
|
+
CurrentPage.displayName = "Breadcrumb.CurrentPage";
|
|
321
|
+
Separator.displayName = "Breadcrumb.Separator";
|
|
322
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
323
|
+
0 && (module.exports = {
|
|
324
|
+
Breadcrumb
|
|
325
|
+
});
|
|
326
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/breadcrumb/index.ts","../../src/breadcrumb/Breadcrumb.tsx","../../src/breadcrumb/BreadcrumbCurrentPage.tsx","../../src/slot/Slot.tsx","../../src/breadcrumb/BreadcrumbItem.tsx","../../src/breadcrumb/BreadcrumbLink.tsx","../../src/text-link/TextLink.tsx","../../src/breadcrumb/BreadcrumbSeparator.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx"],"sourcesContent":["import { Breadcrumb as Root } from './Breadcrumb'\nimport { CurrentPage } from './BreadcrumbCurrentPage'\nimport { Item } from './BreadcrumbItem'\nimport { Link } from './BreadcrumbLink'\nimport { Separator } from './BreadcrumbSeparator'\n\nexport const Breadcrumb: typeof Root & {\n Item: typeof Item\n Link: typeof Link\n CurrentPage: typeof CurrentPage\n Separator: typeof Separator\n} = Object.assign(Root, {\n Item,\n Link,\n CurrentPage,\n Separator,\n})\n\nBreadcrumb.displayName = 'Breadcrumb'\nItem.displayName = 'Breadcrumb.Item'\nLink.displayName = 'Breadcrumb.Link'\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\nSeparator.displayName = 'Breadcrumb.Separator'\n\nexport type { BreadcrumbProps } from './Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface BreadcrumbProps extends ComponentPropsWithoutRef<'nav'> {\n className?: string\n ['aria-label']: string\n ref?: Ref<HTMLElement>\n}\n\nexport const Breadcrumb = ({\n className,\n 'aria-label': ariaLabel,\n ref,\n ...rest\n}: BreadcrumbProps) => {\n return (\n <nav\n data-spark-component=\"breadcrumb\"\n ref={ref}\n aria-label={ariaLabel}\n className={cx('text-caption text-neutral', className)}\n >\n <ol className={cx('gap-sm flex flex-wrap items-center break-words')} {...rest} />\n </nav>\n )\n}\n\nBreadcrumb.displayName = 'Breadcrumb.Breadcrumb'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface CurrentPageProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const CurrentPage = ({\n asChild = false,\n className,\n children,\n ...rest\n}: CurrentPageProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"breadcrumb-current-page\"\n role=\"link\"\n aria-disabled\n aria-current=\"page\"\n className={cx(\n 'inline! overflow-hidden font-bold text-ellipsis whitespace-nowrap text-current',\n className\n )}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\nCurrentPage.displayName = 'Breadcrumb.CurrentPage'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nexport interface ItemProps extends ComponentPropsWithoutRef<'li'> {\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Item = ({ className, ...rest }: ItemProps) => {\n return (\n <li\n data-spark-component=\"breadcrumb-item\"\n className={cx('min-w-none gap-sm inline-flex items-center', className)}\n {...rest}\n />\n )\n}\n\nItem.displayName = 'Breadcrumb.Item'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { TextLink } from '../text-link'\n\nexport interface LinkProps extends ComponentPropsWithoutRef<typeof TextLink> {\n asChild?: boolean\n className?: string\n href?: string\n ref?: Ref<HTMLAnchorElement>\n}\n\nexport const Link = ({\n asChild = false,\n className,\n bold = true,\n intent = 'current',\n underline = true,\n href,\n ref,\n ...rest\n}: LinkProps) => {\n const Component = asChild ? Slot : TextLink\n\n return (\n <Component\n data-spark-component=\"breadcrumb-link\"\n href={href}\n ref={ref}\n className={cx('inline! overflow-hidden text-ellipsis whitespace-nowrap', className)}\n bold={bold}\n intent={intent}\n underline={underline}\n {...rest}\n />\n )\n}\n\nLink.displayName = 'Breadcrumb.Link'\n","import { cva, type VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n basic: 'text-basic hover:text-basic-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-bold',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { Slot } from '../slot'\n\nexport interface SeparatorProps extends ComponentPropsWithoutRef<'li'> {\n asChild?: boolean\n className?: string\n ref?: Ref<HTMLLIElement>\n}\n\nexport const Separator = ({\n asChild = false,\n className,\n children,\n ref,\n ...rest\n}: SeparatorProps) => {\n const Component = asChild ? Slot : 'li'\n\n return (\n <Component\n role=\"presentation\"\n aria-hidden\n data-spark-component=\"breadcrumb-separator\"\n ref={ref}\n className={cx('gap-sm inline-flex items-center', className)}\n {...rest}\n >\n {children ?? (\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n )}\n </Component>\n )\n}\n\nSeparator.displayName = 'Breadcrumb.Separator'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oBAAAA;AAAA;AAAA;;;ACAA,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AC,WAAW,SAAS;AAAA,MACzB,IAAI,CAAC,WAAW,SAAS;AAAA,IAC3B,CAAC;AAAA,EACH;AACF,CAAC;;;AFjBG,IAAAC,sBAAA;AAXG,IAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAiB;AACf,QAAM,QAAQ,uBAAS,KAAK,QAAQ;AAEpC,SACE,8EACG;AAAA,oCAAa,OAA4C;AAAA,MACxD,WAAW,WAAW,EAAE,WAAW,MAAM,OAAO,CAAC;AAAA,MACjD,wBAAwB;AAAA,MACxB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,GAAG;AAAA,IACL,CAAC;AAAA,IAEA,SAAS,6CAAC,kBAAgB,iBAAM;AAAA,KACnC;AAEJ;AAEA,KAAK,cAAc;;;ADTT,IAAAC,sBAAA;AApBH,IAAM,YAAY,CAAC;AAAA,EACxB,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsB;AACpB,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,eAAW;AAAA,MACX,wBAAqB;AAAA,MACrB;AAAA,MACA,eAAW,qCAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA,MAEH,sBACC,6CAAC,QACC,uDAAC,gDAAmB,GACtB;AAAA;AAAA,EAEJ;AAEJ;AAEA,UAAU,cAAc;;;APlCjB,IAAMC,cAKT,OAAO,OAAO,YAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,YAAW,cAAc;AACzB,KAAK,cAAc;AACnB,KAAK,cAAc;AACnB,YAAY,cAAc;AAC1B,UAAU,cAAc;","names":["Breadcrumb","import_class_variance_authority","import_jsx_runtime","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","Breadcrumb"]}
|