@linyao.tw/ui 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/date-time/calendar.js +1 -0
- package/dist/components/date-time/calendar.js.map +1 -1
- package/dist/components/date-time/date-field.js +1 -0
- package/dist/components/date-time/date-field.js.map +1 -1
- package/dist/components/date-time/date-picker.js +1 -0
- package/dist/components/date-time/date-picker.js.map +1 -1
- package/dist/components/date-time/date-range-picker.js +1 -0
- package/dist/components/date-time/date-range-picker.js.map +1 -1
- package/dist/components/date-time/index.js +1 -0
- package/dist/components/date-time/shared.js +1 -0
- package/dist/components/date-time/shared.js.map +1 -1
- package/dist/components/date-time/time-field.js +1 -0
- package/dist/components/date-time/time-field.js.map +1 -1
- package/dist/components/feedback/alert.js +1 -0
- package/dist/components/feedback/alert.js.map +1 -1
- package/dist/components/feedback/banner.js +1 -0
- package/dist/components/feedback/banner.js.map +1 -1
- package/dist/components/feedback/empty-state.js +1 -0
- package/dist/components/feedback/empty-state.js.map +1 -1
- package/dist/components/feedback/feedback.types.js +1 -0
- package/dist/components/feedback/feedback.types.js.map +1 -1
- package/dist/components/feedback/meter.js +1 -0
- package/dist/components/feedback/meter.js.map +1 -1
- package/dist/components/feedback/progress.js +1 -0
- package/dist/components/feedback/progress.js.map +1 -1
- package/dist/components/feedback/skeleton.js +1 -0
- package/dist/components/feedback/skeleton.js.map +1 -1
- package/dist/components/feedback/spinner.js +1 -0
- package/dist/components/feedback/spinner.js.map +1 -1
- package/dist/components/feedback/toast.js +1 -0
- package/dist/components/feedback/toast.js.map +1 -1
- package/dist/components/forms/code-field.js +1 -0
- package/dist/components/forms/code-field.js.map +1 -1
- package/dist/components/forms/file-upload.js +1 -0
- package/dist/components/forms/file-upload.js.map +1 -1
- package/dist/components/forms/input.js +1 -0
- package/dist/components/forms/input.js.map +1 -1
- package/dist/components/forms/internal.js +12 -10
- package/dist/components/forms/internal.js.map +1 -1
- package/dist/components/forms/number-field.js +1 -0
- package/dist/components/forms/number-field.js.map +1 -1
- package/dist/components/forms/otp-field.js +1 -0
- package/dist/components/forms/otp-field.js.map +1 -1
- package/dist/components/forms/text-field.js +1 -0
- package/dist/components/forms/text-field.js.map +1 -1
- package/dist/components/foundations/avatar.js +10 -7
- package/dist/components/foundations/avatar.js.map +1 -1
- package/dist/components/foundations/badge.js +1 -0
- package/dist/components/foundations/badge.js.map +1 -1
- package/dist/components/foundations/button.js +1 -0
- package/dist/components/foundations/button.js.map +1 -1
- package/dist/components/foundations/card.js +1 -0
- package/dist/components/foundations/card.js.map +1 -1
- package/dist/components/foundations/icon-button.js +1 -0
- package/dist/components/foundations/icon-button.js.map +1 -1
- package/dist/components/foundations/link.js +1 -0
- package/dist/components/foundations/link.js.map +1 -1
- package/dist/components/foundations/list-cell.js +1 -0
- package/dist/components/foundations/list-cell.js.map +1 -1
- package/dist/components/foundations/section-heading.js +1 -0
- package/dist/components/foundations/section-heading.js.map +1 -1
- package/dist/components/foundations/separator.js +1 -0
- package/dist/components/foundations/separator.js.map +1 -1
- package/dist/components/navigation-data/breadcrumb-pagination.js +1 -0
- package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -1
- package/dist/components/navigation-data/command-palette.js +1 -0
- package/dist/components/navigation-data/command-palette.js.map +1 -1
- package/dist/components/navigation-data/header-tab-bar.js +1 -0
- package/dist/components/navigation-data/header-tab-bar.js.map +1 -1
- package/dist/components/navigation-data/menubar-toolbar.js +1 -0
- package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
- package/dist/components/navigation-data/navigation-menu.js +1 -0
- package/dist/components/navigation-data/navigation-menu.js.map +1 -1
- package/dist/components/navigation-data/scroll-area.js +1 -0
- package/dist/components/navigation-data/scroll-area.js.map +1 -1
- package/dist/components/navigation-data/table-collection.js +1 -0
- package/dist/components/navigation-data/table-collection.js.map +1 -1
- package/dist/components/overlays/dialog.d.ts +10 -1
- package/dist/components/overlays/dialog.js +11 -8
- package/dist/components/overlays/dialog.js.map +1 -1
- package/dist/components/overlays/disclosure.js +1 -0
- package/dist/components/overlays/disclosure.js.map +1 -1
- package/dist/components/overlays/drawer.d.ts +4 -1
- package/dist/components/overlays/drawer.js +11 -8
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/floating.js +1 -0
- package/dist/components/overlays/floating.js.map +1 -1
- package/dist/components/overlays/index.d.ts +1 -1
- package/dist/components/selection/combobox.js +1 -0
- package/dist/components/selection/combobox.js.map +1 -1
- package/dist/components/selection/controls.js +1 -0
- package/dist/components/selection/controls.js.map +1 -1
- package/dist/components/selection/menu.js +1 -0
- package/dist/components/selection/menu.js.map +1 -1
- package/dist/components/selection/select.js +1 -0
- package/dist/components/selection/select.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +34 -32
- package/dist/internal/class-names.js +1 -0
- package/dist/internal/class-names.js.map +1 -1
- package/dist/intl/index.d.ts +1 -0
- package/dist/intl/linyao-provider.d.ts +38 -0
- package/dist/intl/linyao-provider.js +27 -0
- package/dist/intl/linyao-provider.js.map +1 -0
- package/dist/intl/messages.js +1 -0
- package/dist/intl/messages.js.map +1 -1
- package/dist/intl/provider.js +17 -8
- package/dist/intl/provider.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-cell.js","names":[],"sources":["../../../src/components/foundations/list-cell.tsx"],"sourcesContent":["import { type AccessibleName, type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nexport type ListCellVariant = \"default\" | \"inset\";\nexport type ListCellSize = \"sm\" | \"md\" | \"lg\";\nexport type ListCellCurrentSemantics = \"page\" | \"step\" | \"location\" | \"date\" | \"time\";\n\nexport interface ListCellState extends Record<string, unknown> {\n\tdisabled: boolean;\n\tinteractive: boolean;\n\tselected: boolean;\n\tsize: ListCellSize;\n\tvariant: ListCellVariant;\n}\n\ntype ListCellSelectionProps =\n\t| {\n\t\t\tselected?: never;\n\t\t\tselectionSemantics?: never;\n\t }\n\t| {\n\t\t\tselected: boolean;\n\t\t\tselectionSemantics: ListCellCurrentSemantics;\n\t }\n\t| {\n\t\t\tselected: boolean;\n\t\t\tselectionSemantics: \"selected\";\n\t\t\trole: \"gridcell\" | \"option\" | \"row\" | \"tab\" | \"treeitem\";\n\t };\n\nexport type ListCellProps = Omit<ElementProps<\"div\">, \"children\" | \"title\"> &\n\tListCellSelectionProps & {\n\t\tchildren?: React.ReactNode;\n\t\tleading?: React.ReactNode;\n\t\ttitle?: React.ReactNode;\n\t\tdescription?: React.ReactNode;\n\t\tmetadata?: React.ReactNode;\n\t\ttrailing?: React.ReactNode;\n\t\taction?: ListCellActionProps;\n\t\tactionRef?: React.Ref<HTMLElement>;\n\t\tvariant?: ListCellVariant;\n\t\tsize?: ListCellSize;\n\t\tdisabled?: boolean;\n\t\trender?: ComponentRenderProp<ListCellState>;\n\t};\n\ninterface ListCellContextValue {\n\tcurrent: ListCellCurrentSemantics | false | undefined;\n\tdisabled: boolean;\n}\n\nconst ListCellContext = React.createContext<ListCellContextValue>({ current: undefined, disabled: false });\n\ntype ListCellLinkActionProps = Omit<ElementProps<\"a\">, \"aria-label\" | \"aria-labelledby\" | \"children\" | \"className\"> & {\n\thref: string;\n\tclassName?: string;\n\tdisabled?: boolean;\n};\n\ntype ListCellButtonActionProps = Omit<ElementProps<\"button\">, \"aria-label\" | \"aria-labelledby\" | \"children\" | \"className\" | \"href\"> & {\n\thref?: never;\n\tclassName?: string;\n\tdisabled?: boolean;\n};\n\nexport type ListCellActionProps = AccessibleName & (ListCellLinkActionProps | ListCellButtonActionProps);\n\nexport const ListCellAction = React.forwardRef<HTMLElement, ListCellActionProps>(function ListCellAction(props, ref) {\n\tconst context = React.useContext(ListCellContext);\n\tconst disabled = context.disabled || props.disabled === true;\n\n\tif (\"href\" in props && props.href !== undefined) {\n\t\tconst { className, href, onClick, rel, target, ...linkProps } = props;\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...linkProps}\n\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\thref={disabled ? undefined : href}\n\t\t\t\ttarget={target}\n\t\t\t\trel={target === \"_blank\" && !rel ? \"noopener noreferrer\" : rel}\n\t\t\t\taria-current={props[\"aria-current\"] ?? context.current}\n\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t\ttabIndex={disabled ? -1 : linkProps.tabIndex}\n\t\t\t\tclassName={cx(\"lyds-list-cell__action\", className)}\n\t\t\t\tonClick={event => {\n\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<span className=\"lyds-sr-only\">{props[\"aria-label\"] ?? \"\"}</span>\n\t\t\t</a>\n\t\t);\n\t}\n\n\tconst { className, onClick, type, ...buttonProps } = props;\n\treturn (\n\t\t<button\n\t\t\t{...buttonProps}\n\t\t\tref={ref as React.Ref<HTMLButtonElement>}\n\t\t\ttype={type ?? \"button\"}\n\t\t\tdisabled={disabled}\n\t\t\taria-current={props[\"aria-current\"] ?? context.current}\n\t\t\tclassName={cx(\"lyds-list-cell__action\", className)}\n\t\t\tonClick={onClick}\n\t\t/>\n\t);\n});\n\nListCellAction.displayName = \"ListCellAction\";\n\nexport const ListCell = React.forwardRef<HTMLElement, ListCellProps>(function ListCell(\n\t{\n\t\tchildren,\n\t\tleading,\n\t\ttitle,\n\t\tdescription,\n\t\tmetadata,\n\t\ttrailing,\n\t\taction,\n\t\tactionRef,\n\t\tvariant = \"default\",\n\t\tsize = \"md\",\n\t\tselected = false,\n\t\tselectionSemantics,\n\t\tdisabled = false,\n\t\trender,\n\t\tclassName,\n\t\t...props\n\t},\n\tref\n) {\n\tconst interactive = action != null;\n\tconst state: ListCellState = { disabled, interactive, selected, size, variant };\n\tconst slotContent = children ?? (\n\t\t<>\n\t\t\t{leading != null ? <ListCellLeading>{leading}</ListCellLeading> : null}\n\t\t\t<ListCellContent>\n\t\t\t\t{title != null ? <ListCellTitle>{title}</ListCellTitle> : null}\n\t\t\t\t{description != null ? <ListCellDescription>{description}</ListCellDescription> : null}\n\t\t\t</ListCellContent>\n\t\t\t{metadata != null ? <ListCellMetadata>{metadata}</ListCellMetadata> : null}\n\t\t\t{trailing != null ? <ListCellTrailing>{trailing}</ListCellTrailing> : null}\n\t\t</>\n\t);\n\tconst currentSemantics = selectionSemantics && selectionSemantics !== \"selected\" ? selectionSemantics : undefined;\n\tconst current = currentSemantics ? (selected ? currentSemantics : false) : undefined;\n\n\treturn useRender<ListCellState, HTMLElement>({\n\t\tdefaultTagName: \"div\",\n\t\tref,\n\t\trender,\n\t\tstate,\n\t\tprops: {\n\t\t\t...props,\n\t\t\tclassName: cx(\"lyds-list-cell\", className),\n\t\t\t\"aria-current\": !action && current !== undefined ? current : props[\"aria-current\"],\n\t\t\t\"aria-disabled\": !action && disabled ? true : props[\"aria-disabled\"],\n\t\t\t\"aria-selected\": selectionSemantics === \"selected\" ? selected : props[\"aria-selected\"],\n\t\t\tchildren: (\n\t\t\t\t<ListCellContext.Provider value={{ current, disabled }}>\n\t\t\t\t\t{action ? <ListCellAction ref={actionRef} {...action} /> : null}\n\t\t\t\t\t{slotContent}\n\t\t\t\t</ListCellContext.Provider>\n\t\t\t)\n\t\t}\n\t});\n});\n\nListCell.displayName = \"ListCell\";\n\ntype ListCellSlotName = \"leading\" | \"content\" | \"title\" | \"description\" | \"metadata\" | \"trailing\";\n\ninterface ListCellSlotProps extends Omit<ElementProps<\"span\">, \"children\"> {\n\tchildren: React.ReactNode;\n\trender?: ComponentRenderProp<Record<string, unknown>>;\n}\n\nfunction createListCellSlot(slotName: ListCellSlotName) {\n\tconst Slot = React.forwardRef<HTMLElement, ListCellSlotProps>(function ListCellSlot({ children, render, className, ...props }, ref) {\n\t\treturn useRender<Record<string, unknown>, HTMLElement>({\n\t\t\tdefaultTagName: \"span\",\n\t\t\tref,\n\t\t\trender,\n\t\t\tprops: {\n\t\t\t\t...props,\n\t\t\t\tchildren,\n\t\t\t\tclassName: cx(`lyds-list-cell__${slotName}`, className)\n\t\t\t}\n\t\t});\n\t});\n\n\tSlot.displayName = `ListCell${slotName[0]?.toUpperCase() ?? \"\"}${slotName.slice(1)}`;\n\treturn Slot;\n}\n\nexport const ListCellLeading = createListCellSlot(\"leading\");\nexport const ListCellContent = createListCellSlot(\"content\");\nexport const ListCellTitle = createListCellSlot(\"title\");\nexport const ListCellDescription = createListCellSlot(\"description\");\nexport const ListCellMetadata = createListCellSlot(\"metadata\");\nexport const ListCellTrailing = createListCellSlot(\"trailing\");\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-cell.js","names":[],"sources":["../../../src/components/foundations/list-cell.tsx"],"sourcesContent":["import { type AccessibleName, type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nexport type ListCellVariant = \"default\" | \"inset\";\nexport type ListCellSize = \"sm\" | \"md\" | \"lg\";\nexport type ListCellCurrentSemantics = \"page\" | \"step\" | \"location\" | \"date\" | \"time\";\n\nexport interface ListCellState extends Record<string, unknown> {\n\tdisabled: boolean;\n\tinteractive: boolean;\n\tselected: boolean;\n\tsize: ListCellSize;\n\tvariant: ListCellVariant;\n}\n\ntype ListCellSelectionProps =\n\t| {\n\t\t\tselected?: never;\n\t\t\tselectionSemantics?: never;\n\t }\n\t| {\n\t\t\tselected: boolean;\n\t\t\tselectionSemantics: ListCellCurrentSemantics;\n\t }\n\t| {\n\t\t\tselected: boolean;\n\t\t\tselectionSemantics: \"selected\";\n\t\t\trole: \"gridcell\" | \"option\" | \"row\" | \"tab\" | \"treeitem\";\n\t };\n\nexport type ListCellProps = Omit<ElementProps<\"div\">, \"children\" | \"title\"> &\n\tListCellSelectionProps & {\n\t\tchildren?: React.ReactNode;\n\t\tleading?: React.ReactNode;\n\t\ttitle?: React.ReactNode;\n\t\tdescription?: React.ReactNode;\n\t\tmetadata?: React.ReactNode;\n\t\ttrailing?: React.ReactNode;\n\t\taction?: ListCellActionProps;\n\t\tactionRef?: React.Ref<HTMLElement>;\n\t\tvariant?: ListCellVariant;\n\t\tsize?: ListCellSize;\n\t\tdisabled?: boolean;\n\t\trender?: ComponentRenderProp<ListCellState>;\n\t};\n\ninterface ListCellContextValue {\n\tcurrent: ListCellCurrentSemantics | false | undefined;\n\tdisabled: boolean;\n}\n\nconst ListCellContext = React.createContext<ListCellContextValue>({ current: undefined, disabled: false });\n\ntype ListCellLinkActionProps = Omit<ElementProps<\"a\">, \"aria-label\" | \"aria-labelledby\" | \"children\" | \"className\"> & {\n\thref: string;\n\tclassName?: string;\n\tdisabled?: boolean;\n};\n\ntype ListCellButtonActionProps = Omit<ElementProps<\"button\">, \"aria-label\" | \"aria-labelledby\" | \"children\" | \"className\" | \"href\"> & {\n\thref?: never;\n\tclassName?: string;\n\tdisabled?: boolean;\n};\n\nexport type ListCellActionProps = AccessibleName & (ListCellLinkActionProps | ListCellButtonActionProps);\n\nexport const ListCellAction = React.forwardRef<HTMLElement, ListCellActionProps>(function ListCellAction(props, ref) {\n\tconst context = React.useContext(ListCellContext);\n\tconst disabled = context.disabled || props.disabled === true;\n\n\tif (\"href\" in props && props.href !== undefined) {\n\t\tconst { className, href, onClick, rel, target, ...linkProps } = props;\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...linkProps}\n\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\thref={disabled ? undefined : href}\n\t\t\t\ttarget={target}\n\t\t\t\trel={target === \"_blank\" && !rel ? \"noopener noreferrer\" : rel}\n\t\t\t\taria-current={props[\"aria-current\"] ?? context.current}\n\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t\ttabIndex={disabled ? -1 : linkProps.tabIndex}\n\t\t\t\tclassName={cx(\"lyds-list-cell__action\", className)}\n\t\t\t\tonClick={event => {\n\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<span className=\"lyds-sr-only\">{props[\"aria-label\"] ?? \"\"}</span>\n\t\t\t</a>\n\t\t);\n\t}\n\n\tconst { className, onClick, type, ...buttonProps } = props;\n\treturn (\n\t\t<button\n\t\t\t{...buttonProps}\n\t\t\tref={ref as React.Ref<HTMLButtonElement>}\n\t\t\ttype={type ?? \"button\"}\n\t\t\tdisabled={disabled}\n\t\t\taria-current={props[\"aria-current\"] ?? context.current}\n\t\t\tclassName={cx(\"lyds-list-cell__action\", className)}\n\t\t\tonClick={onClick}\n\t\t/>\n\t);\n});\n\nListCellAction.displayName = \"ListCellAction\";\n\nexport const ListCell = React.forwardRef<HTMLElement, ListCellProps>(function ListCell(\n\t{\n\t\tchildren,\n\t\tleading,\n\t\ttitle,\n\t\tdescription,\n\t\tmetadata,\n\t\ttrailing,\n\t\taction,\n\t\tactionRef,\n\t\tvariant = \"default\",\n\t\tsize = \"md\",\n\t\tselected = false,\n\t\tselectionSemantics,\n\t\tdisabled = false,\n\t\trender,\n\t\tclassName,\n\t\t...props\n\t},\n\tref\n) {\n\tconst interactive = action != null;\n\tconst state: ListCellState = { disabled, interactive, selected, size, variant };\n\tconst slotContent = children ?? (\n\t\t<>\n\t\t\t{leading != null ? <ListCellLeading>{leading}</ListCellLeading> : null}\n\t\t\t<ListCellContent>\n\t\t\t\t{title != null ? <ListCellTitle>{title}</ListCellTitle> : null}\n\t\t\t\t{description != null ? <ListCellDescription>{description}</ListCellDescription> : null}\n\t\t\t</ListCellContent>\n\t\t\t{metadata != null ? <ListCellMetadata>{metadata}</ListCellMetadata> : null}\n\t\t\t{trailing != null ? <ListCellTrailing>{trailing}</ListCellTrailing> : null}\n\t\t</>\n\t);\n\tconst currentSemantics = selectionSemantics && selectionSemantics !== \"selected\" ? selectionSemantics : undefined;\n\tconst current = currentSemantics ? (selected ? currentSemantics : false) : undefined;\n\n\treturn useRender<ListCellState, HTMLElement>({\n\t\tdefaultTagName: \"div\",\n\t\tref,\n\t\trender,\n\t\tstate,\n\t\tprops: {\n\t\t\t...props,\n\t\t\tclassName: cx(\"lyds-list-cell\", className),\n\t\t\t\"aria-current\": !action && current !== undefined ? current : props[\"aria-current\"],\n\t\t\t\"aria-disabled\": !action && disabled ? true : props[\"aria-disabled\"],\n\t\t\t\"aria-selected\": selectionSemantics === \"selected\" ? selected : props[\"aria-selected\"],\n\t\t\tchildren: (\n\t\t\t\t<ListCellContext.Provider value={{ current, disabled }}>\n\t\t\t\t\t{action ? <ListCellAction ref={actionRef} {...action} /> : null}\n\t\t\t\t\t{slotContent}\n\t\t\t\t</ListCellContext.Provider>\n\t\t\t)\n\t\t}\n\t});\n});\n\nListCell.displayName = \"ListCell\";\n\ntype ListCellSlotName = \"leading\" | \"content\" | \"title\" | \"description\" | \"metadata\" | \"trailing\";\n\ninterface ListCellSlotProps extends Omit<ElementProps<\"span\">, \"children\"> {\n\tchildren: React.ReactNode;\n\trender?: ComponentRenderProp<Record<string, unknown>>;\n}\n\nfunction createListCellSlot(slotName: ListCellSlotName) {\n\tconst Slot = React.forwardRef<HTMLElement, ListCellSlotProps>(function ListCellSlot({ children, render, className, ...props }, ref) {\n\t\treturn useRender<Record<string, unknown>, HTMLElement>({\n\t\t\tdefaultTagName: \"span\",\n\t\t\tref,\n\t\t\trender,\n\t\t\tprops: {\n\t\t\t\t...props,\n\t\t\t\tchildren,\n\t\t\t\tclassName: cx(`lyds-list-cell__${slotName}`, className)\n\t\t\t}\n\t\t});\n\t});\n\n\tSlot.displayName = `ListCell${slotName[0]?.toUpperCase() ?? \"\"}${slotName.slice(1)}`;\n\treturn Slot;\n}\n\nexport const ListCellLeading = createListCellSlot(\"leading\");\nexport const ListCellContent = createListCellSlot(\"content\");\nexport const ListCellTitle = createListCellSlot(\"title\");\nexport const ListCellDescription = createListCellSlot(\"description\");\nexport const ListCellMetadata = createListCellSlot(\"metadata\");\nexport const ListCellTrailing = createListCellSlot(\"trailing\");\n"],"mappings":";;;;;;AAmDA,IAAM,IAAkB,EAAM,cAAoC;CAAE,SAAS,KAAA;CAAW,UAAU;AAAM,CAAC,GAgB5F,IAAiB,EAAM,WAA6C,SAAwB,GAAO,GAAK;CACpH,IAAM,IAAU,EAAM,WAAW,CAAe,GAC1C,IAAW,EAAQ,YAAY,EAAM,aAAa;CAExD,IAAI,UAAU,KAAS,EAAM,SAAS,KAAA,GAAW;EAChD,IAAM,EAAE,cAAW,SAAM,YAAS,QAAK,WAAQ,GAAG,MAAc;EAChE,OACC,kBAAC,KAAD;GACC,GAAI;GACC;GACL,MAAM,IAAW,KAAA,IAAY;GACrB;GACR,KAAK,MAAW,YAAY,CAAC,IAAM,wBAAwB;GAC3D,gBAAc,EAAM,mBAAmB,EAAQ;GAC/C,iBAAe,KAAY,KAAA;GAC3B,UAAU,IAAW,KAAK,EAAU;GACpC,WAAW,EAAG,0BAA0B,CAAS;GACjD,UAAS,MAAS;IACjB,IAAI,GAAU;KACb,EAAM,eAAe;KACrB;IACD;IACA,IAAU,CAAK;GAChB;GAEA,UAAA,kBAAC,QAAD;IAAM,WAAU;IAAgB,UAAA,EAAM,iBAAiB;GAAS,CAAA;EAC9D,CAAA;CAEL;CAEA,IAAM,EAAE,cAAW,YAAS,SAAM,GAAG,MAAgB;CACrD,OACC,kBAAC,UAAD;EACC,GAAI;EACC;EACL,MAAM,KAAQ;EACJ;EACV,gBAAc,EAAM,mBAAmB,EAAQ;EAC/C,WAAW,EAAG,0BAA0B,CAAS;EACxC;CACT,CAAA;AAEH,CAAC;AAED,EAAe,cAAc;AAE7B,IAAa,IAAW,EAAM,WAAuC,SACpE,EACC,aACA,YACA,UACA,gBACA,aACA,aACA,WACA,cACA,aAAU,WACV,UAAO,MACP,cAAW,IACX,uBACA,cAAW,IACX,WACA,cACA,GAAG,KAEJ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H;IACA,WAAW,EAAG,mBAAmB,KAAY,CAAS;GACvD;EACD,CAAC;CACF,CAAC;CAGD,OADA,EAAK,cAAc,WAAW,EAAS,EAAE,EAAE,YAAY,KAAK,KAAK,EAAS,MAAM,CAAC,KAC1E;AACR;AAEA,IAAa,IAAkB,EAAmB,SAAS,GAC9C,IAAkB,EAAmB,SAAS,GAC9C,IAAgB,EAAmB,OAAO,GAC1C,IAAsB,EAAmB,aAAa,GACtD,IAAmB,EAAmB,UAAU,GAChD,IAAmB,EAAmB,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-heading.js","names":[],"sources":["../../../src/components/foundations/section-heading.tsx"],"sourcesContent":["import { type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nexport type SectionHeadingSize = \"sm\" | \"md\" | \"lg\";\n\n/** Heading levels a component may render. h1 is the page's, so components never take it. */\nexport type HeadingLevel = 2 | 3 | 4 | 5 | 6;\n\n/** @deprecated Use `HeadingLevel`, which every component that renders a heading now shares. */\nexport type SectionHeadingLevel = HeadingLevel;\n\nexport interface SectionHeadingState extends Record<string, unknown> {\n\tsize: SectionHeadingSize;\n}\n\nexport interface SectionHeadingProps extends Omit<ElementProps<\"header\">, \"children\" | \"title\"> {\n\tchildren: React.ReactNode;\n\tannotation?: React.ReactNode;\n\tdescription?: React.ReactNode;\n\taction?: React.ReactNode;\n\tlevel?: SectionHeadingLevel;\n\tsize?: SectionHeadingSize;\n\trender?: ComponentRenderProp<SectionHeadingState>;\n}\n\nexport const SectionHeading = React.forwardRef<HTMLElement, SectionHeadingProps>(function SectionHeading(\n\t{ children, annotation, description, action, level = 2, size = \"md\", render, className, ...props },\n\tref\n) {\n\tconst HeadingTag = `h${level}` as const;\n\n\treturn useRender<SectionHeadingState, HTMLElement>({\n\t\tdefaultTagName: \"header\",\n\t\tref,\n\t\trender,\n\t\tstate: { size },\n\t\tprops: {\n\t\t\t...props,\n\t\t\tclassName: cx(\"lyds-section-heading\", className),\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"lyds-section-heading__rail\" aria-hidden=\"true\" />\n\t\t\t\t\t<span className=\"lyds-section-heading__content\">\n\t\t\t\t\t\t{annotation != null ? <span className=\"lyds-section-heading__annotation\">{annotation}</span> : null}\n\t\t\t\t\t\t<HeadingTag className=\"lyds-section-heading__title\">{children}</HeadingTag>\n\t\t\t\t\t\t{description != null ? <span className=\"lyds-section-heading__description\">{description}</span> : null}\n\t\t\t\t\t</span>\n\t\t\t\t\t{action != null ? <span className=\"lyds-section-heading__action\">{action}</span> : null}\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t});\n});\n\nSectionHeading.displayName = \"SectionHeading\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"section-heading.js","names":[],"sources":["../../../src/components/foundations/section-heading.tsx"],"sourcesContent":["import { type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nexport type SectionHeadingSize = \"sm\" | \"md\" | \"lg\";\n\n/** Heading levels a component may render. h1 is the page's, so components never take it. */\nexport type HeadingLevel = 2 | 3 | 4 | 5 | 6;\n\n/** @deprecated Use `HeadingLevel`, which every component that renders a heading now shares. */\nexport type SectionHeadingLevel = HeadingLevel;\n\nexport interface SectionHeadingState extends Record<string, unknown> {\n\tsize: SectionHeadingSize;\n}\n\nexport interface SectionHeadingProps extends Omit<ElementProps<\"header\">, \"children\" | \"title\"> {\n\tchildren: React.ReactNode;\n\tannotation?: React.ReactNode;\n\tdescription?: React.ReactNode;\n\taction?: React.ReactNode;\n\tlevel?: SectionHeadingLevel;\n\tsize?: SectionHeadingSize;\n\trender?: ComponentRenderProp<SectionHeadingState>;\n}\n\nexport const SectionHeading = React.forwardRef<HTMLElement, SectionHeadingProps>(function SectionHeading(\n\t{ children, annotation, description, action, level = 2, size = \"md\", render, className, ...props },\n\tref\n) {\n\tconst HeadingTag = `h${level}` as const;\n\n\treturn useRender<SectionHeadingState, HTMLElement>({\n\t\tdefaultTagName: \"header\",\n\t\tref,\n\t\trender,\n\t\tstate: { size },\n\t\tprops: {\n\t\t\t...props,\n\t\t\tclassName: cx(\"lyds-section-heading\", className),\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"lyds-section-heading__rail\" aria-hidden=\"true\" />\n\t\t\t\t\t<span className=\"lyds-section-heading__content\">\n\t\t\t\t\t\t{annotation != null ? <span className=\"lyds-section-heading__annotation\">{annotation}</span> : null}\n\t\t\t\t\t\t<HeadingTag className=\"lyds-section-heading__title\">{children}</HeadingTag>\n\t\t\t\t\t\t{description != null ? <span className=\"lyds-section-heading__description\">{description}</span> : null}\n\t\t\t\t\t</span>\n\t\t\t\t\t{action != null ? <span className=\"lyds-section-heading__action\">{action}</span> : null}\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t});\n});\n\nSectionHeading.displayName = \"SectionHeading\";\n"],"mappings":";;;;;;AAyBA,IAAa,IAAiB,EAAM,WAA6C,SAChF,EAAE,aAAU,eAAY,gBAAa,WAAQ,WAAQ,GAAG,UAAO,MAAM,WAAQ,cAAW,GAAG,KAC3F,GACC;CACD,IAAM,IAAa,IAAI;CAEvB,OAAO,EAA4C;EAClD,gBAAgB;EAChB;EACA;EACA,OAAO,EAAE,QAAK;EACd,OAAO;GACN,GAAG;GACH,WAAW,EAAG,wBAAwB,CAAS;GAC/C,UACC,kBAAA,GAAA,EAAA,UAAA;IACC,kBAAC,QAAD;KAAM,WAAU;KAA6B,eAAY;IAAQ,CAAA;IACjE,kBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA;MACE,KAAc,OAAgF,OAAzE,kBAAC,QAAD;OAAM,WAAU;OAAoC,UAAA;MAAiB,CAAA;MAC3F,kBAAC,GAAD;OAAY,WAAU;OAA+B;MAAqB,CAAA;MACzE,KAAe,OAAkF,OAA3E,kBAAC,QAAD;OAAM,WAAU;OAAqC,UAAA;MAAkB,CAAA;KACzF;;IACL,KAAU,OAAwE,OAAjE,kBAAC,QAAD;KAAM,WAAU;KAAgC,UAAA;IAAa,CAAA;GAC9E,EAAA,CAAA;EAEJ;CACD,CAAC;AACF,CAAC;AAED,EAAe,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/foundations/separator.tsx"],"sourcesContent":["import { cx } from \"@/internal\";\nimport { Separator as BaseSeparator, type SeparatorProps as BaseSeparatorProps } from \"@base-ui/react/separator\";\nimport * as React from \"react\";\nexport type SeparatorVariant = \"solid\" | \"technical\";\nexport type SeparatorSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface SeparatorProps extends Omit<BaseSeparatorProps, \"className\" | \"style\"> {\n\tvariant?: SeparatorVariant;\n\tspacing?: SeparatorSpacing;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n}\n\nexport const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(function Separator({ variant = \"solid\", spacing = \"md\", orientation = \"horizontal\", className, style, ...props }, ref) {\n\treturn <BaseSeparator {...props} ref={ref} orientation={orientation} data-variant={variant} data-spacing={spacing} className={cx(\"lyds-separator\", className)} style={style} />;\n});\n\nSeparator.displayName = \"Separator\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/foundations/separator.tsx"],"sourcesContent":["import { cx } from \"@/internal\";\nimport { Separator as BaseSeparator, type SeparatorProps as BaseSeparatorProps } from \"@base-ui/react/separator\";\nimport * as React from \"react\";\nexport type SeparatorVariant = \"solid\" | \"technical\";\nexport type SeparatorSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface SeparatorProps extends Omit<BaseSeparatorProps, \"className\" | \"style\"> {\n\tvariant?: SeparatorVariant;\n\tspacing?: SeparatorSpacing;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n}\n\nexport const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(function Separator({ variant = \"solid\", spacing = \"md\", orientation = \"horizontal\", className, style, ...props }, ref) {\n\treturn <BaseSeparator {...props} ref={ref} orientation={orientation} data-variant={variant} data-spacing={spacing} className={cx(\"lyds-separator\", className)} style={style} />;\n});\n\nSeparator.displayName = \"Separator\";\n"],"mappings":";;;;;;AAaA,IAAa,IAAY,EAAM,WAA2C,SAAmB,EAAE,aAAU,SAAS,aAAU,MAAM,iBAAc,cAAc,cAAW,UAAO,GAAG,KAAS,GAAK;CAChM,OAAO,kBAAC,GAAD;EAAe,GAAI;EAAY;EAAkB;EAAa,gBAAc;EAAS,gBAAc;EAAS,WAAW,EAAG,kBAAkB,CAAS;EAAU;CAAQ,CAAA;AAC/K,CAAC;AAED,EAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb-pagination.js","names":[],"sources":["../../../src/components/navigation-data/breadcrumb-pagination.tsx"],"sourcesContent":["import { ArrowLeftIcon } from \"@phosphor-icons/react/dist/csr/ArrowLeft\";\nimport { ArrowRightIcon } from \"@phosphor-icons/react/dist/csr/ArrowRight\";\nimport { CaretRightIcon } from \"@phosphor-icons/react/dist/csr/CaretRight\";\nimport { DotsThreeIcon } from \"@phosphor-icons/react/dist/csr/DotsThree\";\nimport { forwardRef, type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type LiHTMLAttributes, type MouseEvent, type ReactNode } from \"react\";\n\nimport { cx } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n\t/** 麵包屑導覽區域的無障礙名稱。 */\n\tlabel?: string;\n}\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(function Breadcrumb({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.breadcrumbLabel} className={cx(\"lyds-breadcrumb\", className)} {...props} />;\n});\n\nexport const BreadcrumbList = forwardRef<HTMLOListElement, HTMLAttributes<HTMLOListElement>>(function BreadcrumbList({ className, ...props }, ref) {\n\treturn <ol ref={ref} className={cx(\"lyds-breadcrumb__list\", className)} {...props} />;\n});\n\nexport const BreadcrumbItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function BreadcrumbItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-breadcrumb__item\", className)} {...props} />;\n});\n\nexport const BreadcrumbLink = forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>(function BreadcrumbLink({ children, className, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} className={cx(\"lyds-breadcrumb__link\", className)} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport const BreadcrumbPage = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function BreadcrumbPage({ className, ...props }, ref) {\n\treturn <span ref={ref} aria-current=\"page\" className={cx(\"lyds-breadcrumb__page\", className)} {...props} />;\n});\n\nexport interface BreadcrumbSeparatorProps extends HTMLAttributes<HTMLSpanElement> {\n\tchildren?: ReactNode;\n}\n\nexport const BreadcrumbSeparator = forwardRef<HTMLSpanElement, BreadcrumbSeparatorProps>(function BreadcrumbSeparator({ children, className, ...props }, ref) {\n\treturn (\n\t\t<span ref={ref} aria-hidden=\"true\" className={cx(\"lyds-breadcrumb__separator\", className)} {...props}>\n\t\t\t{children ?? <CaretRightIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</span>\n\t);\n});\n\nexport const BreadcrumbEllipsis = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function BreadcrumbEllipsis({ \"aria-label\": ariaLabel, className, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<span ref={ref} className={cx(\"lyds-breadcrumb__ellipsis\", className)} {...props}>\n\t\t\t{children ? <span aria-hidden=\"true\">{children}</span> : <DotsThreeIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t\t<span className=\"lyds-sr-only\">{ariaLabel ?? messages.breadcrumbMore}</span>\n\t\t</span>\n\t);\n});\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n\t/** 分頁導覽區域的無障礙名稱。 */\n\tlabel?: string;\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.paginationLabel} className={cx(\"lyds-pagination\", className)} {...props} />;\n});\n\nexport const PaginationList = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(function PaginationList({ className, ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-pagination__list\", className)} {...props} />;\n});\n\nexport const PaginationItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function PaginationItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-pagination__item\", className)} {...props} />;\n});\n\nexport interface PaginationLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tcurrent?: boolean;\n\tdisabled?: boolean;\n}\n\nexport const PaginationLink = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationLink(\n\t{ children, className, current = false, disabled = false, href, onClick, tabIndex, ...props },\n\tref\n) {\n\tconst interactionProps = {\n\t\tonClick: (event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\ttabIndex: disabled ? -1 : tabIndex\n\t};\n\n\treturn (\n\t\t<a\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-current={current ? \"page\" : undefined}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tclassName={cx(\"lyds-pagination__control\", className)}\n\t\t\tdata-current={current ? \"\" : undefined}\n\t\t\tdata-disabled={disabled ? \"\" : undefined}\n\t\t\thref={disabled ? undefined : href}\n\t\t\trole={disabled ? \"link\" : undefined}\n\t\t\t{...interactionProps}\n\t\t>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface PaginationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tcurrent?: boolean;\n}\n\nexport const PaginationButton = forwardRef<HTMLButtonElement, PaginationButtonProps>(function PaginationButton({ className, current = false, type = \"button\", ...props }, ref) {\n\treturn <button ref={ref} aria-current={current ? \"page\" : undefined} className={cx(\"lyds-pagination__control\", className)} data-current={current ? \"\" : undefined} type={type} {...props} />;\n});\n\nexport const PaginationPrevious = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationPrevious({ \"aria-label\": ariaLabel, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel ?? messages.paginationPrevious} {...props}>\n\t\t\t{children ?? <ArrowLeftIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</PaginationLink>\n\t);\n});\n\nexport const PaginationNext = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationNext({ \"aria-label\": ariaLabel, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel ?? messages.paginationNext} {...props}>\n\t\t\t{children ?? <ArrowRightIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</PaginationLink>\n\t);\n});\n\nexport const PaginationEllipsis = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function PaginationEllipsis({ \"aria-label\": ariaLabel, children, className, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<span ref={ref} className={cx(\"lyds-pagination__ellipsis\", className)} {...props}>\n\t\t\t{children ? <span aria-hidden=\"true\">{children}</span> : <DotsThreeIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t\t<span className=\"lyds-sr-only\">{ariaLabel ?? messages.paginationMore}</span>\n\t\t</span>\n\t);\n});\n"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kBAAC,QAAD;GAAM,WAAU;GAAgB,UAAA,KAAa,EAAS;EAAqB,CAAA,CACtE;;AAER,CAAC"}
|
|
1
|
+
{"version":3,"file":"breadcrumb-pagination.js","names":[],"sources":["../../../src/components/navigation-data/breadcrumb-pagination.tsx"],"sourcesContent":["import { ArrowLeftIcon } from \"@phosphor-icons/react/dist/csr/ArrowLeft\";\nimport { ArrowRightIcon } from \"@phosphor-icons/react/dist/csr/ArrowRight\";\nimport { CaretRightIcon } from \"@phosphor-icons/react/dist/csr/CaretRight\";\nimport { DotsThreeIcon } from \"@phosphor-icons/react/dist/csr/DotsThree\";\nimport { forwardRef, type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type LiHTMLAttributes, type MouseEvent, type ReactNode } from \"react\";\n\nimport { cx } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n\t/** 麵包屑導覽區域的無障礙名稱。 */\n\tlabel?: string;\n}\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(function Breadcrumb({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.breadcrumbLabel} className={cx(\"lyds-breadcrumb\", className)} {...props} />;\n});\n\nexport const BreadcrumbList = forwardRef<HTMLOListElement, HTMLAttributes<HTMLOListElement>>(function BreadcrumbList({ className, ...props }, ref) {\n\treturn <ol ref={ref} className={cx(\"lyds-breadcrumb__list\", className)} {...props} />;\n});\n\nexport const BreadcrumbItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function BreadcrumbItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-breadcrumb__item\", className)} {...props} />;\n});\n\nexport const BreadcrumbLink = forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>(function BreadcrumbLink({ children, className, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} className={cx(\"lyds-breadcrumb__link\", className)} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport const BreadcrumbPage = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function BreadcrumbPage({ className, ...props }, ref) {\n\treturn <span ref={ref} aria-current=\"page\" className={cx(\"lyds-breadcrumb__page\", className)} {...props} />;\n});\n\nexport interface BreadcrumbSeparatorProps extends HTMLAttributes<HTMLSpanElement> {\n\tchildren?: ReactNode;\n}\n\nexport const BreadcrumbSeparator = forwardRef<HTMLSpanElement, BreadcrumbSeparatorProps>(function BreadcrumbSeparator({ children, className, ...props }, ref) {\n\treturn (\n\t\t<span ref={ref} aria-hidden=\"true\" className={cx(\"lyds-breadcrumb__separator\", className)} {...props}>\n\t\t\t{children ?? <CaretRightIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</span>\n\t);\n});\n\nexport const BreadcrumbEllipsis = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function BreadcrumbEllipsis({ \"aria-label\": ariaLabel, className, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<span ref={ref} className={cx(\"lyds-breadcrumb__ellipsis\", className)} {...props}>\n\t\t\t{children ? <span aria-hidden=\"true\">{children}</span> : <DotsThreeIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t\t<span className=\"lyds-sr-only\">{ariaLabel ?? messages.breadcrumbMore}</span>\n\t\t</span>\n\t);\n});\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n\t/** 分頁導覽區域的無障礙名稱。 */\n\tlabel?: string;\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.paginationLabel} className={cx(\"lyds-pagination\", className)} {...props} />;\n});\n\nexport const PaginationList = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(function PaginationList({ className, ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-pagination__list\", className)} {...props} />;\n});\n\nexport const PaginationItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function PaginationItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-pagination__item\", className)} {...props} />;\n});\n\nexport interface PaginationLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tcurrent?: boolean;\n\tdisabled?: boolean;\n}\n\nexport const PaginationLink = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationLink(\n\t{ children, className, current = false, disabled = false, href, onClick, tabIndex, ...props },\n\tref\n) {\n\tconst interactionProps = {\n\t\tonClick: (event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\ttabIndex: disabled ? -1 : tabIndex\n\t};\n\n\treturn (\n\t\t<a\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-current={current ? \"page\" : undefined}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tclassName={cx(\"lyds-pagination__control\", className)}\n\t\t\tdata-current={current ? \"\" : undefined}\n\t\t\tdata-disabled={disabled ? \"\" : undefined}\n\t\t\thref={disabled ? undefined : href}\n\t\t\trole={disabled ? \"link\" : undefined}\n\t\t\t{...interactionProps}\n\t\t>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface PaginationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tcurrent?: boolean;\n}\n\nexport const PaginationButton = forwardRef<HTMLButtonElement, PaginationButtonProps>(function PaginationButton({ className, current = false, type = \"button\", ...props }, ref) {\n\treturn <button ref={ref} aria-current={current ? \"page\" : undefined} className={cx(\"lyds-pagination__control\", className)} data-current={current ? \"\" : undefined} type={type} {...props} />;\n});\n\nexport const PaginationPrevious = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationPrevious({ \"aria-label\": ariaLabel, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel ?? messages.paginationPrevious} {...props}>\n\t\t\t{children ?? <ArrowLeftIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</PaginationLink>\n\t);\n});\n\nexport const PaginationNext = forwardRef<HTMLAnchorElement, PaginationLinkProps>(function PaginationNext({ \"aria-label\": ariaLabel, children, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel ?? messages.paginationNext} {...props}>\n\t\t\t{children ?? <ArrowRightIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</PaginationLink>\n\t);\n});\n\nexport const PaginationEllipsis = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function PaginationEllipsis({ \"aria-label\": ariaLabel, children, className, ...props }, ref) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<span ref={ref} className={cx(\"lyds-pagination__ellipsis\", className)} {...props}>\n\t\t\t{children ? <span aria-hidden=\"true\">{children}</span> : <DotsThreeIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t\t<span className=\"lyds-sr-only\">{ariaLabel ?? messages.paginationMore}</span>\n\t\t</span>\n\t);\n});\n"],"mappings":";;;;;;;;;;AAaA,IAAa,IAAa,EAAyC,SAAoB,EAAE,cAAW,UAAO,GAAG,KAAS,GAAK;CAC3H,IAAM,IAAW,EAAY;CAC7B,OAAO,kBAAC,OAAD;EAAU;EAAK,cAAY,KAAS,EAAS;EAAiB,WAAW,EAAG,mBAAmB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/H,CAAC,GAEY,IAAiB,EAA+D,SAAwB,EAAE,cAAW,GAAG,KAAS,GAAK;CAClJ,OAAO,kBAAC,MAAD;EAAS;EAAK,WAAW,EAAG,yBAAyB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACrF,CAAC,GAEY,IAAiB,EAA2D,SAAwB,E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4B,EAAE,cAAc,GAAW,aAAU,GAAG,KAAS,GAAK;CACtK,IAAM,IAAW,EAAY;CAE7B,OACC,kBAAC,GAAD;EAAqB;EAAK,cAAY,KAAa,EAAS;EAAoB,GAAI;EAClF,UAAA,KAAY,kBAAC,GAAD;GAAe,eAAY;GAAO,QAAO;EAAQ,CAAA;CAC/C,CAAA;AAElB,CAAC,GAEY,IAAiB,EAAmD,SAAwB,EAAE,cAAc,GAAW,aAAU,GAAG,KAAS,GAAK;CAC9J,IAAM,IAAW,EAAY;CAE7B,OACC,kBAAC,GAAD;EAAqB;EAAK,cAAY,KAAa,EAAS;EAAgB,GAAI;EAC9E,UAAA,KAAY,kBAAC,GAAD;GAAgB,eAAY;GAAO,QAAO;EAAQ,CAAA;CAChD,CAAA;AAElB,CAAC,GAEY,IAAqB,EAA6D,SAA4B,EAAE,cAAc,GAAW,aAAU,cAAW,GAAG,KAAS,GAAK;CAC3L,IAAM,IAAW,EAAY;CAE7B,OACC,kBAAC,QAAD;EAAW;EAAK,WAAW,EAAG,6BAA6B,CAAS;EAAG,GAAI;EAA3E,UAAA,CACE,IAAW,kBAAC,QAAD;GAAM,eAAY;GAAQ;EAAe,CAAA,IAAI,kBAAC,GAAD;GAAe,eAAY;GAAO,QAAO;EAAQ,CAAA,GAC1G,kBAAC,QAAD;GAAM,WAAU;GAAgB,UAAA,KAAa,EAAS;EAAqB,CAAA,CACtE;;AAER,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cx as e, withStateClassName as t } from "../../internal/class-names.js";
|
|
2
3
|
import { useMessages as n } from "../../intl/provider.js";
|
|
3
4
|
import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useRef as s, useState as c } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.js","names":[],"sources":["../../../src/components/navigation-data/command-palette.tsx"],"sourcesContent":["import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { createContext, forwardRef, useCallback, useContext, useRef, useState, type ComponentRef, type HTMLAttributes, type ReactNode, type RefObject } from \"react\";\n\nimport { cx, withStateClassName } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\n/**\n * The popup moves focus to the search input when the palette opens. Sharing a ref beats looking the\n * input up by class name: a consumer can render a different input, and a class name that focus\n * management depends on becomes public API by accident.\n */\nconst CommandPaletteInputContext = createContext<RefObject<HTMLInputElement | null> | null>(null);\n\nexport interface CommandPaletteProps<Value> extends Omit<BaseCombobox.Root.Props<Value, false>, \"autoComplete\" | \"children\" | \"defaultOpen\" | \"inline\" | \"modal\" | \"onOpenChange\" | \"open\"> {\n\tchildren: ReactNode;\n\tdefaultOpen?: boolean;\n\tmodal?: BaseDialog.Root.Props[\"modal\"];\n\tonOpenChange?: (open: boolean, eventDetails: CommandPaletteOpenChangeDetails) => void;\n\topen?: boolean;\n}\n\nexport type CommandPaletteOpenChangeDetails = BaseDialog.Root.ChangeEventDetails | BaseCombobox.Root.ChangeEventDetails;\n\n/**\n * 用於指令介面的 Dialog 與行內 Combobox 組合。\n * Linyao Design System 僅管理焦點與開啟狀態;指令資料、篩選及執行由使用端負責。\n */\nexport function CommandPalette<Value>({ children, defaultOpen = false, modal = true, onOpenChange, open, ...comboboxProps }: CommandPaletteProps<Value>) {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\tconst isControlled = open !== undefined;\n\tconst resolvedOpen = isControlled ? open : uncontrolledOpen;\n\tconst changeOpen = useCallback(\n\t\t(nextOpen: boolean, eventDetails: CommandPaletteOpenChangeDetails) => {\n\t\t\tonOpenChange?.(nextOpen, eventDetails);\n\t\t\tif (eventDetails.isCanceled) return;\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\t\t},\n\t\t[isControlled, onOpenChange]\n\t);\n\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\n\treturn (\n\t\t<CommandPaletteInputContext value={inputRef}>\n\t\t\t<BaseDialog.Root modal={modal} open={resolvedOpen} onOpenChange={changeOpen}>\n\t\t\t\t<BaseCombobox.Root\n\t\t\t\t\t{...comboboxProps}\n\t\t\t\t\tautoComplete=\"none\"\n\t\t\t\t\tinline\n\t\t\t\t\topen={resolvedOpen}\n\t\t\t\t\tonOpenChange={(nextOpen, eventDetails) => {\n\t\t\t\t\t\tif (nextOpen !== resolvedOpen) {\n\t\t\t\t\t\t\tchangeOpen(nextOpen, eventDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</BaseCombobox.Root>\n\t\t\t</BaseDialog.Root>\n\t\t</CommandPaletteInputContext>\n\t);\n}\n\nexport const CommandPaletteTrigger = forwardRef<HTMLButtonElement, BaseDialog.Trigger.Props>(function CommandPaletteTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseDialog.Trigger ref={ref} className={withStateClassName<BaseDialog.Trigger.State>(\"lyds-command-palette__trigger\", className)} {...triggerProps} />;\n});\n\nexport const CommandPalettePortal = BaseDialog.Portal;\n\nexport const CommandPaletteBackdrop = forwardRef<ComponentRef<typeof BaseDialog.Backdrop>, BaseDialog.Backdrop.Props>(function CommandPaletteBackdrop(props, ref) {\n\tconst { className, ...backdropProps } = props;\n\treturn <BaseDialog.Backdrop ref={ref} className={withStateClassName<BaseDialog.Backdrop.State>(\"lyds-command-palette__backdrop\", className)} {...backdropProps} />;\n});\n\nexport const CommandPaletteViewport = forwardRef<ComponentRef<typeof BaseDialog.Viewport>, BaseDialog.Viewport.Props>(function CommandPaletteViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseDialog.Viewport ref={ref} className={withStateClassName<BaseDialog.Viewport.State>(\"lyds-command-palette__viewport\", className)} {...viewportProps} />;\n});\n\nexport const CommandPalettePopup = forwardRef<ComponentRef<typeof BaseDialog.Popup>, BaseDialog.Popup.Props>(function CommandPalettePopup(props, ref) {\n\tconst { className, initialFocus, ...popupProps } = props;\n\tconst inputRef = useContext(CommandPaletteInputContext);\n\tconst focusSearchInput = useCallback((openType: string) => (openType === \"touch\" ? true : (inputRef?.current ?? true)), [inputRef]);\n\n\treturn (\n\t\t<BaseDialog.Popup ref={ref} className={withStateClassName<BaseDialog.Popup.State>(\"lyds-command-palette__popup\", className)} initialFocus={initialFocus ?? focusSearchInput} {...popupProps} />\n\t);\n});\n\nexport const CommandPaletteTitle = forwardRef<ComponentRef<typeof BaseDialog.Title>, BaseDialog.Title.Props>(function CommandPaletteTitle(props, ref) {\n\tconst { className, ...titleProps } = props;\n\treturn <BaseDialog.Title ref={ref} className={withStateClassName<BaseDialog.Title.State>(\"lyds-command-palette__title\", className)} {...titleProps} />;\n});\n\nexport const CommandPaletteDescription = forwardRef<ComponentRef<typeof BaseDialog.Description>, BaseDialog.Description.Props>(function CommandPaletteDescription(props, ref) {\n\tconst { className, ...descriptionProps } = props;\n\treturn <BaseDialog.Description ref={ref} className={withStateClassName<BaseDialog.Description.State>(\"lyds-command-palette__description\", className)} {...descriptionProps} />;\n});\n\nexport const CommandPaletteClose = forwardRef<ComponentRef<typeof BaseDialog.Close>, BaseDialog.Close.Props>(function CommandPaletteClose(props, ref) {\n\tconst messages = useMessages();\n\tconst { className, children = messages.commandPaletteClose, ...closeProps } = props;\n\treturn (\n\t\t<BaseDialog.Close ref={ref} className={withStateClassName<BaseDialog.Close.State>(\"lyds-command-palette__close\", className)} {...closeProps}>\n\t\t\t{children}\n\t\t</BaseDialog.Close>\n\t);\n});\n\nexport const CommandPaletteLabel = forwardRef<ComponentRef<typeof BaseCombobox.Label>, BaseCombobox.Label.Props>(function CommandPaletteLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseCombobox.Label ref={ref} className={withStateClassName<BaseCombobox.Label.State>(\"lyds-command-palette__label\", className)} {...labelProps} />;\n});\n\nexport const CommandPaletteInput = forwardRef<ComponentRef<typeof BaseCombobox.Input>, BaseCombobox.Input.Props>(function CommandPaletteInput(props, ref) {\n\tconst messages = useMessages();\n\tconst paletteInputRef = useContext(CommandPaletteInputContext);\n\tconst { className, placeholder = messages.commandPalettePlaceholder, ...inputProps } = props;\n\tconst setInput = useCallback(\n\t\t(node: HTMLInputElement | null) => {\n\t\t\tif (paletteInputRef) paletteInputRef.current = node;\n\t\t\tif (typeof ref === \"function\") ref(node);\n\t\t\telse if (ref) ref.current = node;\n\t\t},\n\t\t[paletteInputRef, ref]\n\t);\n\n\treturn <BaseCombobox.Input ref={setInput} className={withStateClassName<BaseCombobox.Input.State>(\"lyds-command-palette__input\", className)} placeholder={placeholder} {...inputProps} />;\n});\n\nexport const CommandPaletteList = forwardRef<ComponentRef<typeof BaseCombobox.List>, BaseCombobox.List.Props>(function CommandPaletteList(props, ref) {\n\tconst { className, ...listProps } = props;\n\treturn <BaseCombobox.List ref={ref} className={withStateClassName<BaseCombobox.List.State>(\"lyds-command-palette__list\", className)} {...listProps} />;\n});\n\nexport const CommandPaletteItem = forwardRef<ComponentRef<typeof BaseCombobox.Item>, BaseCombobox.Item.Props>(function CommandPaletteItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseCombobox.Item ref={ref} className={withStateClassName<BaseCombobox.Item.State>(\"lyds-command-palette__item\", className)} {...itemProps} />;\n});\n\nexport const CommandPaletteItemIndicator = forwardRef<ComponentRef<typeof BaseCombobox.ItemIndicator>, BaseCombobox.ItemIndicator.Props>(function CommandPaletteItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseCombobox.ItemIndicator ref={ref} className={withStateClassName<BaseCombobox.ItemIndicator.State>(\"lyds-command-palette__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseCombobox.ItemIndicator>\n\t);\n});\n\nexport const CommandPaletteGroup = BaseCombobox.Group;\n\nexport const CommandPaletteGroupLabel = forwardRef<ComponentRef<typeof BaseCombobox.GroupLabel>, BaseCombobox.GroupLabel.Props>(function CommandPaletteGroupLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseCombobox.GroupLabel ref={ref} className={withStateClassName<BaseCombobox.GroupLabel.State>(\"lyds-command-palette__group-label\", className)} {...labelProps} />;\n});\n\nexport const CommandPaletteEmpty = forwardRef<ComponentRef<typeof BaseCombobox.Empty>, BaseCombobox.Empty.Props>(function CommandPaletteEmpty(props, ref) {\n\tconst { className, ...emptyProps } = props;\n\treturn <BaseCombobox.Empty ref={ref} className={withStateClassName<BaseCombobox.Empty.State>(\"lyds-command-palette__empty\", className)} {...emptyProps} />;\n});\n\nexport const CommandPaletteSeparator = forwardRef<ComponentRef<typeof BaseCombobox.Separator>, BaseCombobox.Separator.Props>(function CommandPaletteSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseCombobox.Separator ref={ref} className={withStateClassName<BaseCombobox.Separator.State>(\"lyds-command-palette__separator\", className)} {...separatorProps} />;\n});\n\nexport const CommandPaletteStatus = BaseCombobox.Status;\n\nexport const CommandPaletteShortcut = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function CommandPaletteShortcut(props, ref) {\n\tconst { className, ...shortcutProps } = props;\n\treturn <kbd ref={ref} className={cx(\"lyds-command-palette__shortcut\", className)} {...shortcutProps} />;\n});\n\n/**\n * Every component built on a context root also exposes its parts as a namespace, so composing one\n * reads the same way as composing a Dialog or a Select.\n */\nexport const CommandPaletteNamespace = Object.assign(CommandPalette, {\n\tBackdrop: CommandPaletteBackdrop,\n\tClose: CommandPaletteClose,\n\tDescription: CommandPaletteDescription,\n\tEmpty: CommandPaletteEmpty,\n\tGroup: CommandPaletteGroup,\n\tGroupLabel: CommandPaletteGroupLabel,\n\tInput: CommandPaletteInput,\n\tItem: CommandPaletteItem,\n\tItemIndicator: CommandPaletteItemIndicator,\n\tLabel: CommandPaletteLabel,\n\tList: CommandPaletteList,\n\tPopup: CommandPalettePopup,\n\tPortal: CommandPalettePortal,\n\tRoot: CommandPalette,\n\tSeparator: CommandPaletteSeparator,\n\tShortcut: CommandPaletteShortcut,\n\tStatus: CommandPaletteStatus,\n\tTitle: CommandPaletteTitle,\n\tTrigger: CommandPaletteTrigger,\n\tViewport: CommandPaletteViewport\n});\n"],"mappings":";;;;;;;;AAYA,IAAM,IAA6B,EAAyD,IAAI;AAgBhG,SAAgB,EAAsB,EAAE,aAAU,iBAAc,IAAO,WAAQ,IAAM,iBAAc,SAAM,GAAG,KAA6C;CACxJ,IAAM,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,IAAe,MAAS,KAAA,GACxB,IAAe,IAAe,IAAO,GACrC,IAAa,GACjB,GAAmB,MAAkD;EACrE,IAAe,GAAU,CAAY,GACjC,GAAa,eACZ,KACJ,EAAoB,CAAQ;CAE9B,GACA,CAAC,GAAc,CAAY,CAC5B,GAEM,IAAW,EAAgC,IAAI;CAErD,OACC,kBAAC,GAAD;EAA4B,OAAO;EAClC,UAAA,kBAAC,EAAW,MAAZ;GAAwB;GAAO,MAAM;GAAc,cAAc;GAChE,UAAA,kBAAC,EAAa,MAAd;IACC,GAAI;IACJ,cAAa;IACb,QAAA;IACA,MAAM;IACN,eAAe,GAAU,MAAiB;KACzC,AAAI,MAAa,KAChB,EAAW,GAAU,CAAY;IAEnC;IAEC;GACiB,CAAA;EACH,CAAA;CACU,CAAA;AAE9B;AAEA,IAAa,IAAwB,EAAwD,SAA+B,GAAO,GAAK;CACvI,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAW,SAAZ;EAAyB;EAAK,WAAW,EAA6C,iCAAiC,CAAS;EAAG,GAAI;CAAe,CAAA;AAC9J,CAAC,GAEY,IAAuB,EAAW,QAElC,IAAyB,EAAgF,SAAgC,GAAO,GAAK;CACjK,IAAM,EAAE,cAAW,GAAG,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B,CAAA;AAE9B,CAAC,GAEY,IAAsB,EAAa,OAEnC,IAA2B,EAAwF,SAAkC,GAAO,GAAK;CAC7K,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAa,YAAd;EAA8B;EAAK,WAAW,EAAkD,qCAAqC,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1K,CAAC,GAEY,IAAsB,EAA8E,SAA6B,GAAO,GAAK;CACzJ,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAa,OAAd;EAAyB;EAAK,WAAW,EAA6C,+BAA+B,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1J,CAAC,GAEY,IAA0B,EAAsF,SAAiC,GAAO,GAAK;CACzK,IAAM,EAAE,cAAW,GAAG,MAAmB;CACzC,OAAO,kBAAC,EAAa,WAAd;EAA6B;EAAK,WAAW,EAAiD,mCAAmC,CAAS;EAAG,GAAI;CAAiB,CAAA;AAC1K,CAAC,GAEY,IAAuB,EAAa,QAEpC,IAAyB,EAAqD,SAAgC,GAAO,GAAK;CACtI,IAAM,EAAE,cAAW,GAAG,MAAkB;CACxC,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,kCAAkC,CAAS;EAAG,GAAI;CAAgB,CAAA;AACvG,CAAC,GAMY,IAA0B,OAAO,OAAO,GAAgB;CACpE,UAAU;CACV,OAAO;CACP,aAAa;CACb,OAAO;CACP,OAAO;CACP,YAAY;CACZ,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,WAAW;CACX,UAAU;CACV,QAAQ;CACR,OAAO;CACP,SAAS;CACT,UAAU;AACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"command-palette.js","names":[],"sources":["../../../src/components/navigation-data/command-palette.tsx"],"sourcesContent":["import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { createContext, forwardRef, useCallback, useContext, useRef, useState, type ComponentRef, type HTMLAttributes, type ReactNode, type RefObject } from \"react\";\n\nimport { cx, withStateClassName } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\n/**\n * The popup moves focus to the search input when the palette opens. Sharing a ref beats looking the\n * input up by class name: a consumer can render a different input, and a class name that focus\n * management depends on becomes public API by accident.\n */\nconst CommandPaletteInputContext = createContext<RefObject<HTMLInputElement | null> | null>(null);\n\nexport interface CommandPaletteProps<Value> extends Omit<BaseCombobox.Root.Props<Value, false>, \"autoComplete\" | \"children\" | \"defaultOpen\" | \"inline\" | \"modal\" | \"onOpenChange\" | \"open\"> {\n\tchildren: ReactNode;\n\tdefaultOpen?: boolean;\n\tmodal?: BaseDialog.Root.Props[\"modal\"];\n\tonOpenChange?: (open: boolean, eventDetails: CommandPaletteOpenChangeDetails) => void;\n\topen?: boolean;\n}\n\nexport type CommandPaletteOpenChangeDetails = BaseDialog.Root.ChangeEventDetails | BaseCombobox.Root.ChangeEventDetails;\n\n/**\n * 用於指令介面的 Dialog 與行內 Combobox 組合。\n * Linyao Design System 僅管理焦點與開啟狀態;指令資料、篩選及執行由使用端負責。\n */\nexport function CommandPalette<Value>({ children, defaultOpen = false, modal = true, onOpenChange, open, ...comboboxProps }: CommandPaletteProps<Value>) {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\tconst isControlled = open !== undefined;\n\tconst resolvedOpen = isControlled ? open : uncontrolledOpen;\n\tconst changeOpen = useCallback(\n\t\t(nextOpen: boolean, eventDetails: CommandPaletteOpenChangeDetails) => {\n\t\t\tonOpenChange?.(nextOpen, eventDetails);\n\t\t\tif (eventDetails.isCanceled) return;\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\t\t},\n\t\t[isControlled, onOpenChange]\n\t);\n\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\n\treturn (\n\t\t<CommandPaletteInputContext value={inputRef}>\n\t\t\t<BaseDialog.Root modal={modal} open={resolvedOpen} onOpenChange={changeOpen}>\n\t\t\t\t<BaseCombobox.Root\n\t\t\t\t\t{...comboboxProps}\n\t\t\t\t\tautoComplete=\"none\"\n\t\t\t\t\tinline\n\t\t\t\t\topen={resolvedOpen}\n\t\t\t\t\tonOpenChange={(nextOpen, eventDetails) => {\n\t\t\t\t\t\tif (nextOpen !== resolvedOpen) {\n\t\t\t\t\t\t\tchangeOpen(nextOpen, eventDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</BaseCombobox.Root>\n\t\t\t</BaseDialog.Root>\n\t\t</CommandPaletteInputContext>\n\t);\n}\n\nexport const CommandPaletteTrigger = forwardRef<HTMLButtonElement, BaseDialog.Trigger.Props>(function CommandPaletteTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseDialog.Trigger ref={ref} className={withStateClassName<BaseDialog.Trigger.State>(\"lyds-command-palette__trigger\", className)} {...triggerProps} />;\n});\n\nexport const CommandPalettePortal = BaseDialog.Portal;\n\nexport const CommandPaletteBackdrop = forwardRef<ComponentRef<typeof BaseDialog.Backdrop>, BaseDialog.Backdrop.Props>(function CommandPaletteBackdrop(props, ref) {\n\tconst { className, ...backdropProps } = props;\n\treturn <BaseDialog.Backdrop ref={ref} className={withStateClassName<BaseDialog.Backdrop.State>(\"lyds-command-palette__backdrop\", className)} {...backdropProps} />;\n});\n\nexport const CommandPaletteViewport = forwardRef<ComponentRef<typeof BaseDialog.Viewport>, BaseDialog.Viewport.Props>(function CommandPaletteViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseDialog.Viewport ref={ref} className={withStateClassName<BaseDialog.Viewport.State>(\"lyds-command-palette__viewport\", className)} {...viewportProps} />;\n});\n\nexport const CommandPalettePopup = forwardRef<ComponentRef<typeof BaseDialog.Popup>, BaseDialog.Popup.Props>(function CommandPalettePopup(props, ref) {\n\tconst { className, initialFocus, ...popupProps } = props;\n\tconst inputRef = useContext(CommandPaletteInputContext);\n\tconst focusSearchInput = useCallback((openType: string) => (openType === \"touch\" ? true : (inputRef?.current ?? true)), [inputRef]);\n\n\treturn (\n\t\t<BaseDialog.Popup ref={ref} className={withStateClassName<BaseDialog.Popup.State>(\"lyds-command-palette__popup\", className)} initialFocus={initialFocus ?? focusSearchInput} {...popupProps} />\n\t);\n});\n\nexport const CommandPaletteTitle = forwardRef<ComponentRef<typeof BaseDialog.Title>, BaseDialog.Title.Props>(function CommandPaletteTitle(props, ref) {\n\tconst { className, ...titleProps } = props;\n\treturn <BaseDialog.Title ref={ref} className={withStateClassName<BaseDialog.Title.State>(\"lyds-command-palette__title\", className)} {...titleProps} />;\n});\n\nexport const CommandPaletteDescription = forwardRef<ComponentRef<typeof BaseDialog.Description>, BaseDialog.Description.Props>(function CommandPaletteDescription(props, ref) {\n\tconst { className, ...descriptionProps } = props;\n\treturn <BaseDialog.Description ref={ref} className={withStateClassName<BaseDialog.Description.State>(\"lyds-command-palette__description\", className)} {...descriptionProps} />;\n});\n\nexport const CommandPaletteClose = forwardRef<ComponentRef<typeof BaseDialog.Close>, BaseDialog.Close.Props>(function CommandPaletteClose(props, ref) {\n\tconst messages = useMessages();\n\tconst { className, children = messages.commandPaletteClose, ...closeProps } = props;\n\treturn (\n\t\t<BaseDialog.Close ref={ref} className={withStateClassName<BaseDialog.Close.State>(\"lyds-command-palette__close\", className)} {...closeProps}>\n\t\t\t{children}\n\t\t</BaseDialog.Close>\n\t);\n});\n\nexport const CommandPaletteLabel = forwardRef<ComponentRef<typeof BaseCombobox.Label>, BaseCombobox.Label.Props>(function CommandPaletteLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseCombobox.Label ref={ref} className={withStateClassName<BaseCombobox.Label.State>(\"lyds-command-palette__label\", className)} {...labelProps} />;\n});\n\nexport const CommandPaletteInput = forwardRef<ComponentRef<typeof BaseCombobox.Input>, BaseCombobox.Input.Props>(function CommandPaletteInput(props, ref) {\n\tconst messages = useMessages();\n\tconst paletteInputRef = useContext(CommandPaletteInputContext);\n\tconst { className, placeholder = messages.commandPalettePlaceholder, ...inputProps } = props;\n\tconst setInput = useCallback(\n\t\t(node: HTMLInputElement | null) => {\n\t\t\tif (paletteInputRef) paletteInputRef.current = node;\n\t\t\tif (typeof ref === \"function\") ref(node);\n\t\t\telse if (ref) ref.current = node;\n\t\t},\n\t\t[paletteInputRef, ref]\n\t);\n\n\treturn <BaseCombobox.Input ref={setInput} className={withStateClassName<BaseCombobox.Input.State>(\"lyds-command-palette__input\", className)} placeholder={placeholder} {...inputProps} />;\n});\n\nexport const CommandPaletteList = forwardRef<ComponentRef<typeof BaseCombobox.List>, BaseCombobox.List.Props>(function CommandPaletteList(props, ref) {\n\tconst { className, ...listProps } = props;\n\treturn <BaseCombobox.List ref={ref} className={withStateClassName<BaseCombobox.List.State>(\"lyds-command-palette__list\", className)} {...listProps} />;\n});\n\nexport const CommandPaletteItem = forwardRef<ComponentRef<typeof BaseCombobox.Item>, BaseCombobox.Item.Props>(function CommandPaletteItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseCombobox.Item ref={ref} className={withStateClassName<BaseCombobox.Item.State>(\"lyds-command-palette__item\", className)} {...itemProps} />;\n});\n\nexport const CommandPaletteItemIndicator = forwardRef<ComponentRef<typeof BaseCombobox.ItemIndicator>, BaseCombobox.ItemIndicator.Props>(function CommandPaletteItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseCombobox.ItemIndicator ref={ref} className={withStateClassName<BaseCombobox.ItemIndicator.State>(\"lyds-command-palette__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseCombobox.ItemIndicator>\n\t);\n});\n\nexport const CommandPaletteGroup = BaseCombobox.Group;\n\nexport const CommandPaletteGroupLabel = forwardRef<ComponentRef<typeof BaseCombobox.GroupLabel>, BaseCombobox.GroupLabel.Props>(function CommandPaletteGroupLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseCombobox.GroupLabel ref={ref} className={withStateClassName<BaseCombobox.GroupLabel.State>(\"lyds-command-palette__group-label\", className)} {...labelProps} />;\n});\n\nexport const CommandPaletteEmpty = forwardRef<ComponentRef<typeof BaseCombobox.Empty>, BaseCombobox.Empty.Props>(function CommandPaletteEmpty(props, ref) {\n\tconst { className, ...emptyProps } = props;\n\treturn <BaseCombobox.Empty ref={ref} className={withStateClassName<BaseCombobox.Empty.State>(\"lyds-command-palette__empty\", className)} {...emptyProps} />;\n});\n\nexport const CommandPaletteSeparator = forwardRef<ComponentRef<typeof BaseCombobox.Separator>, BaseCombobox.Separator.Props>(function CommandPaletteSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseCombobox.Separator ref={ref} className={withStateClassName<BaseCombobox.Separator.State>(\"lyds-command-palette__separator\", className)} {...separatorProps} />;\n});\n\nexport const CommandPaletteStatus = BaseCombobox.Status;\n\nexport const CommandPaletteShortcut = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function CommandPaletteShortcut(props, ref) {\n\tconst { className, ...shortcutProps } = props;\n\treturn <kbd ref={ref} className={cx(\"lyds-command-palette__shortcut\", className)} {...shortcutProps} />;\n});\n\n/**\n * Every component built on a context root also exposes its parts as a namespace, so composing one\n * reads the same way as composing a Dialog or a Select.\n */\nexport const CommandPaletteNamespace = Object.assign(CommandPalette, {\n\tBackdrop: CommandPaletteBackdrop,\n\tClose: CommandPaletteClose,\n\tDescription: CommandPaletteDescription,\n\tEmpty: CommandPaletteEmpty,\n\tGroup: CommandPaletteGroup,\n\tGroupLabel: CommandPaletteGroupLabel,\n\tInput: CommandPaletteInput,\n\tItem: CommandPaletteItem,\n\tItemIndicator: CommandPaletteItemIndicator,\n\tLabel: CommandPaletteLabel,\n\tList: CommandPaletteList,\n\tPopup: CommandPalettePopup,\n\tPortal: CommandPalettePortal,\n\tRoot: CommandPalette,\n\tSeparator: CommandPaletteSeparator,\n\tShortcut: CommandPaletteShortcut,\n\tStatus: CommandPaletteStatus,\n\tTitle: CommandPaletteTitle,\n\tTrigger: CommandPaletteTrigger,\n\tViewport: CommandPaletteViewport\n});\n"],"mappings":";;;;;;;;;AAYA,IAAM,IAA6B,EAAyD,IAAI;AAgBhG,SAAgB,EAAsB,EAAE,aAAU,iBAAc,IAAO,WAAQ,IAAM,iBAAc,SAAM,GAAG,KAA6C;CACxJ,IAAM,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,IAAe,MAAS,KAAA,GACxB,IAAe,IAAe,IAAO,GACrC,IAAa,GACjB,GAAmB,MAAkD;EACrE,IAAe,GAAU,CAAY,GACjC,GAAa,eACZ,KACJ,EAAoB,CAAQ;CAE9B,GACA,CAAC,GAAc,CAAY,CAC5B,GAEM,IAAW,EAAgC,IAAI;CAErD,OACC,kBAAC,GAAD;EAA4B,OAAO;EAClC,UAAA,kBAAC,EAAW,MAAZ;GAAwB;GAAO,MAAM;GAAc,cAAc;GAChE,UAAA,kBAAC,EAAa,MAAd;IACC,GAAI;IACJ,cAAa;IACb,QAAA;IACA,MAAM;IACN,eAAe,GAAU,MAAiB;KACzC,AAAI,MAAa,KAChB,EAAW,GAAU,CAAY;IAEnC;IAEC;GACiB,CAAA;EACH,CAAA;CACU,CAAA;AAE9B;AAEA,IAAa,IAAwB,EAAwD,SAA+B,GAAO,GAAK;CACvI,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAW,SAAZ;EAAyB;EAAK,WAAW,EAA6C,iCAAiC,CAAS;EAAG,GAAI;CAAe,CAAA;AAC9J,CAAC,GAEY,IAAuB,EAAW,QAElC,IAAyB,EAAgF,SAAgC,GAAO,GAAK;CACjK,IAAM,EAAE,cAAW,GAAG,MAAkB;CACxC,OAAO,kBAAC,EAAW,UAA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AAa,OAEnC,IAA2B,EAAwF,SAAkC,GAAO,GAAK;CAC7K,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAa,YAAd;EAA8B;EAAK,WAAW,EAAkD,qCAAqC,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1K,CAAC,GAEY,IAAsB,EAA8E,SAA6B,GAAO,GAAK;CACzJ,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAa,OAAd;EAAyB;EAAK,WAAW,EAA6C,+BAA+B,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1J,CAAC,GAEY,IAA0B,EAAsF,SAAiC,GAAO,GAAK;CACzK,IAAM,EAAE,cAAW,GAAG,MAAmB;CACzC,OAAO,kBAAC,EAAa,WAAd;EAA6B;EAAK,WAAW,EAAiD,mCAAmC,CAAS;EAAG,GAAI;CAAiB,CAAA;AAC1K,CAAC,GAEY,IAAuB,EAAa,QAEpC,IAAyB,EAAqD,SAAgC,GAAO,GAAK;CACtI,IAAM,EAAE,cAAW,GAAG,MAAkB;CACxC,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,kCAAkC,CAAS;EAAG,GAAI;CAAgB,CAAA;AACvG,CAAC,GAMY,IAA0B,OAAO,OAAO,GAAgB;CACpE,UAAU;CACV,OAAO;CACP,aAAa;CACb,OAAO;CACP,OAAO;CACP,YAAY;CACZ,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,WAAW;CACX,UAAU;CACV,QAAQ;CACR,OAAO;CACP,SAAS;CACT,UAAU;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-tab-bar.js","names":[],"sources":["../../../src/components/navigation-data/header-tab-bar.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type LiHTMLAttributes, type MouseEvent } from \"react\";\n\nimport { cx } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\nexport const Header = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function Header({ className, ...props }, ref) {\n\treturn <header ref={ref} className={cx(\"lyds-header\", className)} {...props} />;\n});\n\nexport const HeaderRail = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderRail({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__rail\", className)} {...props} />;\n});\n\nexport const HeaderBrand = forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>(function HeaderBrand({ children, className, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} className={cx(\"lyds-header__brand\", className)} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface HeaderNavProps extends HTMLAttributes<HTMLElement> {\n\tlabel?: string;\n}\n\nexport const HeaderNav = forwardRef<HTMLElement, HeaderNavProps>(function HeaderNav({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.headerNavLabel} className={cx(\"lyds-header__nav\", className)} {...props} />;\n});\n\nexport const HeaderActions = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderActions({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__actions\", className)} {...props} />;\n});\n\nexport const HeaderStatus = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderStatus({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__status\", className)} {...props} />;\n});\n\nexport interface TabBarProps extends HTMLAttributes<HTMLElement> {\n\tlabel?: string;\n}\n\nexport const TabBar = forwardRef<HTMLElement, TabBarProps>(function TabBar({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.tabBarLabel} className={cx(\"lyds-tab-bar\", className)} {...props} />;\n});\n\nexport const TabBarList = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(function TabBarList({ className, ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-tab-bar__list\", className)} {...props} />;\n});\n\nexport const TabBarItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function TabBarItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-tab-bar__item\", className)} {...props} />;\n});\n\nexport interface TabBarLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tselected?: boolean;\n\tdisabled?: boolean;\n}\n\nexport const TabBarLink = forwardRef<HTMLAnchorElement, TabBarLinkProps>(function TabBarLink({ children, className, selected = false, disabled = false, href, onClick, tabIndex, ...props }, ref) {\n\tconst interactionProps = {\n\t\tonClick: (event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\ttabIndex: disabled ? -1 : tabIndex\n\t};\n\n\treturn (\n\t\t<a\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-current={selected ? \"page\" : undefined}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tclassName={cx(\"lyds-tab-bar__link\", className)}\n\t\t\tdata-disabled={disabled ? \"\" : undefined}\n\t\t\tdata-selected={selected ? \"\" : undefined}\n\t\t\thref={disabled ? undefined : href}\n\t\t\t{...interactionProps}\n\t\t>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport const TabBarIcon = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function TabBarIcon({ className, ...props }, ref) {\n\treturn <span ref={ref} aria-hidden=\"true\" className={cx(\"lyds-tab-bar__icon\", className)} {...props} />;\n});\n\nexport const TabBarLabel = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function TabBarLabel({ className, ...props }, ref) {\n\treturn <span ref={ref} className={cx(\"lyds-tab-bar__label\", className)} {...props} />;\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"header-tab-bar.js","names":[],"sources":["../../../src/components/navigation-data/header-tab-bar.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type LiHTMLAttributes, type MouseEvent } from \"react\";\n\nimport { cx } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\nexport const Header = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function Header({ className, ...props }, ref) {\n\treturn <header ref={ref} className={cx(\"lyds-header\", className)} {...props} />;\n});\n\nexport const HeaderRail = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderRail({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__rail\", className)} {...props} />;\n});\n\nexport const HeaderBrand = forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>(function HeaderBrand({ children, className, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} className={cx(\"lyds-header__brand\", className)} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface HeaderNavProps extends HTMLAttributes<HTMLElement> {\n\tlabel?: string;\n}\n\nexport const HeaderNav = forwardRef<HTMLElement, HeaderNavProps>(function HeaderNav({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.headerNavLabel} className={cx(\"lyds-header__nav\", className)} {...props} />;\n});\n\nexport const HeaderActions = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderActions({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__actions\", className)} {...props} />;\n});\n\nexport const HeaderStatus = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function HeaderStatus({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-header__status\", className)} {...props} />;\n});\n\nexport interface TabBarProps extends HTMLAttributes<HTMLElement> {\n\tlabel?: string;\n}\n\nexport const TabBar = forwardRef<HTMLElement, TabBarProps>(function TabBar({ className, label, ...props }, ref) {\n\tconst messages = useMessages();\n\treturn <nav ref={ref} aria-label={label ?? messages.tabBarLabel} className={cx(\"lyds-tab-bar\", className)} {...props} />;\n});\n\nexport const TabBarList = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(function TabBarList({ className, ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-tab-bar__list\", className)} {...props} />;\n});\n\nexport const TabBarItem = forwardRef<HTMLLIElement, LiHTMLAttributes<HTMLLIElement>>(function TabBarItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-tab-bar__item\", className)} {...props} />;\n});\n\nexport interface TabBarLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tselected?: boolean;\n\tdisabled?: boolean;\n}\n\nexport const TabBarLink = forwardRef<HTMLAnchorElement, TabBarLinkProps>(function TabBarLink({ children, className, selected = false, disabled = false, href, onClick, tabIndex, ...props }, ref) {\n\tconst interactionProps = {\n\t\tonClick: (event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\ttabIndex: disabled ? -1 : tabIndex\n\t};\n\n\treturn (\n\t\t<a\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-current={selected ? \"page\" : undefined}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tclassName={cx(\"lyds-tab-bar__link\", className)}\n\t\t\tdata-disabled={disabled ? \"\" : undefined}\n\t\t\tdata-selected={selected ? \"\" : undefined}\n\t\t\thref={disabled ? undefined : href}\n\t\t\t{...interactionProps}\n\t\t>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport const TabBarIcon = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function TabBarIcon({ className, ...props }, ref) {\n\treturn <span ref={ref} aria-hidden=\"true\" className={cx(\"lyds-tab-bar__icon\", className)} {...props} />;\n});\n\nexport const TabBarLabel = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function TabBarLabel({ className, ...props }, ref) {\n\treturn <span ref={ref} className={cx(\"lyds-tab-bar__label\", className)} {...props} />;\n});\n"],"mappings":";;;;;;AAIA,IAAa,IAAS,EAAqD,SAAgB,EAAE,cAAW,GAAG,KAAS,GAAK;CACxH,OAAO,kBAAC,UAAD;EAAa;EAAK,WAAW,EAAG,eAAe,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/E,CAAC,GAEY,IAAa,EAA2D,SAAoB,EAAE,cAAW,GAAG,KAAS,GAAK;CACtI,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,qBAAqB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAClF,CAAC,GAEY,IAAc,EAAuE,SAAqB,EAAE,aAAU,cAAW,GAAG,KAAS,GAAK;CAC9J,OACC,kBAAC,KAAD;EAAQ;EAAK,WAAW,EAAG,sBAAsB,CAAS;EAAG,GAAI;EAC/D;CACC,CAAA;AAEL,CAAC,GAMY,IAAY,EAAwC,SAAmB,EAAE,cAAW,UAAO,GAAG,KAAS,GAAK;CACxH,IAAM,IAAW,EAAY;CAC7B,OAAO,kBAAC,OAAD;EAAU;EAAK,cAAY,KAAS,EAAS;EAAgB,WAAW,EAAG,oBAAoB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/H,CAAC,GAEY,IAAgB,EAA2D,SAAuB,EAAE,cAAW,GAAG,KAAS,GAAK;CAC5I,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,wBAAwB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACrF,CAAC,GAEY,IAAe,EAA2D,SAAsB,EAAE,cAAW,GAAG,KAAS,GAAK;CAC1I,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,uBAAuB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACpF,CAAC,GAMY,IAAS,EAAqC,SAAgB,EAAE,cAAW,UAAO,GAAG,KAAS,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AD;EAAW;EAAK,WAAW,EAAG,uBAAuB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar-toolbar.js","names":[],"sources":["../../../src/components/navigation-data/menubar-toolbar.tsx"],"sourcesContent":["import { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { CircleIcon } from \"@phosphor-icons/react/dist/csr/Circle\";\nimport { forwardRef, type ComponentRef, type ForwardedRef, type ReactElement, type RefAttributes } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nexport const Menubar = forwardRef<ComponentRef<typeof BaseMenubar>, BaseMenubar.Props>(function Menubar(props, ref) {\n\tconst { className, ...menubarProps } = props;\n\treturn <BaseMenubar ref={ref} className={withStateClassName<BaseMenubar.State>(\"lyds-menubar\", className)} {...menubarProps} />;\n});\n\nexport function MenubarMenu<Payload = unknown>(props: BaseMenu.Root.Props<Payload>) {\n\treturn <BaseMenu.Root {...props} />;\n}\n\nfunction MenubarTriggerInner<Payload = unknown>(props: BaseMenu.Trigger.Props<Payload>, ref: ForwardedRef<HTMLButtonElement>) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseMenu.Trigger ref={ref} className={withStateClassName<BaseMenu.Trigger.State>(\"lyds-menubar__trigger\", className)} {...triggerProps} />;\n}\n\nexport const MenubarTrigger = forwardRef(MenubarTriggerInner) as <Payload = unknown>(props: BaseMenu.Trigger.Props<Payload> & RefAttributes<HTMLButtonElement>) => ReactElement;\n\nexport const MenubarPortal = BaseMenu.Portal;\n\nexport const MenubarPositioner = forwardRef<ComponentRef<typeof BaseMenu.Positioner>, BaseMenu.Positioner.Props>(function MenubarPositioner(props, ref) {\n\tconst { className, sideOffset = 6, ...positionerProps } = props;\n\treturn <BaseMenu.Positioner ref={ref} className={withStateClassName<BaseMenu.Positioner.State>(\"lyds-menubar__positioner\", className)} sideOffset={sideOffset} {...positionerProps} />;\n});\n\nexport const MenubarPopup = forwardRef<ComponentRef<typeof BaseMenu.Popup>, BaseMenu.Popup.Props>(function MenubarPopup(props, ref) {\n\tconst { className, ...popupProps } = props;\n\treturn <BaseMenu.Popup ref={ref} className={withStateClassName<BaseMenu.Popup.State>(\"lyds-menubar__popup\", className)} {...popupProps} />;\n});\n\nexport const MenubarItem = forwardRef<ComponentRef<typeof BaseMenu.Item>, BaseMenu.Item.Props>(function MenubarItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.Item ref={ref} className={withStateClassName<BaseMenu.Item.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarLinkItem = forwardRef<ComponentRef<typeof BaseMenu.LinkItem>, BaseMenu.LinkItem.Props>(function MenubarLinkItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.LinkItem ref={ref} className={withStateClassName<BaseMenu.LinkItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarCheckboxItem = forwardRef<ComponentRef<typeof BaseMenu.CheckboxItem>, BaseMenu.CheckboxItem.Props>(function MenubarCheckboxItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.CheckboxItem ref={ref} className={withStateClassName<BaseMenu.CheckboxItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarCheckboxItemIndicator = forwardRef<ComponentRef<typeof BaseMenu.CheckboxItemIndicator>, BaseMenu.CheckboxItemIndicator.Props>(function MenubarCheckboxItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseMenu.CheckboxItemIndicator ref={ref} className={withStateClassName<BaseMenu.CheckboxItemIndicator.State>(\"lyds-menubar__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseMenu.CheckboxItemIndicator>\n\t);\n});\n\nexport const MenubarRadioGroup = BaseMenu.RadioGroup;\n\nexport const MenubarRadioItem = forwardRef<ComponentRef<typeof BaseMenu.RadioItem>, BaseMenu.RadioItem.Props>(function MenubarRadioItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.RadioItem ref={ref} className={withStateClassName<BaseMenu.RadioItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarRadioItemIndicator = forwardRef<ComponentRef<typeof BaseMenu.RadioItemIndicator>, BaseMenu.RadioItemIndicator.Props>(function MenubarRadioItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseMenu.RadioItemIndicator ref={ref} className={withStateClassName<BaseMenu.RadioItemIndicator.State>(\"lyds-menubar__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CircleIcon aria-hidden=\"true\" weight=\"fill\" />}\n\t\t</BaseMenu.RadioItemIndicator>\n\t);\n});\n\nexport const MenubarGroup = BaseMenu.Group;\n\nexport const MenubarGroupLabel = forwardRef<ComponentRef<typeof BaseMenu.GroupLabel>, BaseMenu.GroupLabel.Props>(function MenubarGroupLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseMenu.GroupLabel ref={ref} className={withStateClassName<BaseMenu.GroupLabel.State>(\"lyds-menubar__group-label\", className)} {...labelProps} />;\n});\n\nexport const MenubarSeparator = forwardRef<ComponentRef<typeof BaseMenu.Separator>, BaseMenu.Separator.Props>(function MenubarSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseMenu.Separator ref={ref} className={withStateClassName<BaseMenu.Separator.State>(\"lyds-menubar__separator\", className)} {...separatorProps} />;\n});\n\nexport const MenubarSubmenu = BaseMenu.SubmenuRoot;\n\nexport const MenubarSubmenuTrigger = forwardRef<ComponentRef<typeof BaseMenu.SubmenuTrigger>, BaseMenu.SubmenuTrigger.Props>(function MenubarSubmenuTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseMenu.SubmenuTrigger ref={ref} className={withStateClassName<BaseMenu.SubmenuTrigger.State>(\"lyds-menubar__item\", className)} {...triggerProps} />;\n});\n\nexport const Toolbar = forwardRef<ComponentRef<typeof BaseToolbar.Root>, BaseToolbar.Root.Props>(function Toolbar(props, ref) {\n\tconst { className, ...toolbarProps } = props;\n\treturn <BaseToolbar.Root ref={ref} className={withStateClassName<BaseToolbar.Root.State>(\"lyds-toolbar\", className)} {...toolbarProps} />;\n});\n\nexport const ToolbarGroup = forwardRef<ComponentRef<typeof BaseToolbar.Group>, BaseToolbar.Group.Props>(function ToolbarGroup(props, ref) {\n\tconst { className, ...groupProps } = props;\n\treturn <BaseToolbar.Group ref={ref} className={withStateClassName<BaseToolbar.Group.State>(\"lyds-toolbar__group\", className)} {...groupProps} />;\n});\n\nexport const ToolbarButton = forwardRef<ComponentRef<typeof BaseToolbar.Button>, BaseToolbar.Button.Props>(function ToolbarButton(props, ref) {\n\tconst { className, ...buttonProps } = props;\n\treturn <BaseToolbar.Button ref={ref} className={withStateClassName<BaseToolbar.Button.State>(\"lyds-toolbar__button\", className)} {...buttonProps} />;\n});\n\nexport const ToolbarLink = forwardRef<ComponentRef<typeof BaseToolbar.Link>, BaseToolbar.Link.Props>(function ToolbarLink(props, ref) {\n\tconst { className, ...linkProps } = props;\n\treturn <BaseToolbar.Link ref={ref} className={withStateClassName<BaseToolbar.Link.State>(\"lyds-toolbar__button\", className)} {...linkProps} />;\n});\n\nexport const ToolbarInput = forwardRef<ComponentRef<typeof BaseToolbar.Input>, BaseToolbar.Input.Props>(function ToolbarInput(props, ref) {\n\tconst { className, ...inputProps } = props;\n\treturn <BaseToolbar.Input ref={ref} className={withStateClassName<BaseToolbar.Input.State>(\"lyds-toolbar__input\", className)} {...inputProps} />;\n});\n\nexport const ToolbarSeparator = forwardRef<ComponentRef<typeof BaseToolbar.Separator>, BaseToolbar.Separator.Props>(function ToolbarSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseToolbar.Separator ref={ref} className={withStateClassName<BaseToolbar.Separator.State>(\"lyds-toolbar__separator\", className)} {...separatorProps} />;\n});\n"],"mappings":";;;;;;;;;AAQA,IAAa,IAAU,EAAgE,SAAiB,GAAO,GAAK;CACnH,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,GAAD;EAAkB;EAAK,WAAW,EAAsC,gBAAgB,CAAS;EAAG,GAAI;CAAe,CAAA;AAC/H,CAAC;AAED,SAAgB,EAA+B,GAAqC;CACnF,OAAO,kBAAC,EAAS,MAAV,EAAe,GAAI,EAAQ,CAAA;AACnC;AAEA,SAAS,EAAuC,GAAwC,GAAsC;CAC7H,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAS,SAAV;EAAuB;EAAK,WAAW,EAA2C,yBAAyB,CAAS;EAAG,GAAI;CAAe,CAAA;AAClJ;AAEA,IAAa,IAAiB,EAAW,CAAmB,GAE/C,IAAgB,EAAS,QAEzB,IAAoB,EAAgF,SAA2B,GAAO,GAAK;CACvJ,IAAM,EAAE,cAAW,gBAAa,GAAG,GAAG,MAAoB;CAC1D,OAAO,kBAAC,EAAS,YAAV;EAA0B;EAAK,WAAW,EAA8C,4BAA4B,CAAS;EAAe;EAAY,GAAI;CAAkB,CAAA;AACtL,CAAC,GAEY,IAAe,EAAsE,SAAsB,GAAO,GAAK;CACnI,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAS,OAAV;EAAqB;EAAK,WAAW,EAAyC,uBAAuB,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1I,CAAC,GAEY,IAAc,EAAoE,SAAqB,GAAO,GAAK;CAC/H,IAAM,EAAE,cAAW,GAAG,MAAc;CACpC,OAAO,kBAAC,EAAS,MAAV;EAAoB;EAAK,WAAW,EAAwC,sBAAsB,CAAS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Y,CAAA;AAC9I,CAAC,GAEY,IAAe,EAA4E,SAAsB,GAAO,GAAK;CACzI,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAY,OAAb;EAAwB;EAAK,WAAW,EAA4C,uBAAuB,CAAS;EAAG,GAAI;CAAa,CAAA;AAChJ,CAAC,GAEY,IAAmB,EAAoF,SAA0B,GAAO,GAAK;CACzJ,IAAM,EAAE,cAAW,GAAG,MAAmB;CACzC,OAAO,kBAAC,EAAY,WAAb;EAA4B;EAAK,WAAW,EAAgD,2BAA2B,CAAS;EAAG,GAAI;CAAiB,CAAA;AAChK,CAAC"}
|
|
1
|
+
{"version":3,"file":"menubar-toolbar.js","names":[],"sources":["../../../src/components/navigation-data/menubar-toolbar.tsx"],"sourcesContent":["import { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { CircleIcon } from \"@phosphor-icons/react/dist/csr/Circle\";\nimport { forwardRef, type ComponentRef, type ForwardedRef, type ReactElement, type RefAttributes } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nexport const Menubar = forwardRef<ComponentRef<typeof BaseMenubar>, BaseMenubar.Props>(function Menubar(props, ref) {\n\tconst { className, ...menubarProps } = props;\n\treturn <BaseMenubar ref={ref} className={withStateClassName<BaseMenubar.State>(\"lyds-menubar\", className)} {...menubarProps} />;\n});\n\nexport function MenubarMenu<Payload = unknown>(props: BaseMenu.Root.Props<Payload>) {\n\treturn <BaseMenu.Root {...props} />;\n}\n\nfunction MenubarTriggerInner<Payload = unknown>(props: BaseMenu.Trigger.Props<Payload>, ref: ForwardedRef<HTMLButtonElement>) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseMenu.Trigger ref={ref} className={withStateClassName<BaseMenu.Trigger.State>(\"lyds-menubar__trigger\", className)} {...triggerProps} />;\n}\n\nexport const MenubarTrigger = forwardRef(MenubarTriggerInner) as <Payload = unknown>(props: BaseMenu.Trigger.Props<Payload> & RefAttributes<HTMLButtonElement>) => ReactElement;\n\nexport const MenubarPortal = BaseMenu.Portal;\n\nexport const MenubarPositioner = forwardRef<ComponentRef<typeof BaseMenu.Positioner>, BaseMenu.Positioner.Props>(function MenubarPositioner(props, ref) {\n\tconst { className, sideOffset = 6, ...positionerProps } = props;\n\treturn <BaseMenu.Positioner ref={ref} className={withStateClassName<BaseMenu.Positioner.State>(\"lyds-menubar__positioner\", className)} sideOffset={sideOffset} {...positionerProps} />;\n});\n\nexport const MenubarPopup = forwardRef<ComponentRef<typeof BaseMenu.Popup>, BaseMenu.Popup.Props>(function MenubarPopup(props, ref) {\n\tconst { className, ...popupProps } = props;\n\treturn <BaseMenu.Popup ref={ref} className={withStateClassName<BaseMenu.Popup.State>(\"lyds-menubar__popup\", className)} {...popupProps} />;\n});\n\nexport const MenubarItem = forwardRef<ComponentRef<typeof BaseMenu.Item>, BaseMenu.Item.Props>(function MenubarItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.Item ref={ref} className={withStateClassName<BaseMenu.Item.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarLinkItem = forwardRef<ComponentRef<typeof BaseMenu.LinkItem>, BaseMenu.LinkItem.Props>(function MenubarLinkItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.LinkItem ref={ref} className={withStateClassName<BaseMenu.LinkItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarCheckboxItem = forwardRef<ComponentRef<typeof BaseMenu.CheckboxItem>, BaseMenu.CheckboxItem.Props>(function MenubarCheckboxItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.CheckboxItem ref={ref} className={withStateClassName<BaseMenu.CheckboxItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarCheckboxItemIndicator = forwardRef<ComponentRef<typeof BaseMenu.CheckboxItemIndicator>, BaseMenu.CheckboxItemIndicator.Props>(function MenubarCheckboxItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseMenu.CheckboxItemIndicator ref={ref} className={withStateClassName<BaseMenu.CheckboxItemIndicator.State>(\"lyds-menubar__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseMenu.CheckboxItemIndicator>\n\t);\n});\n\nexport const MenubarRadioGroup = BaseMenu.RadioGroup;\n\nexport const MenubarRadioItem = forwardRef<ComponentRef<typeof BaseMenu.RadioItem>, BaseMenu.RadioItem.Props>(function MenubarRadioItem(props, ref) {\n\tconst { className, ...itemProps } = props;\n\treturn <BaseMenu.RadioItem ref={ref} className={withStateClassName<BaseMenu.RadioItem.State>(\"lyds-menubar__item\", className)} {...itemProps} />;\n});\n\nexport const MenubarRadioItemIndicator = forwardRef<ComponentRef<typeof BaseMenu.RadioItemIndicator>, BaseMenu.RadioItemIndicator.Props>(function MenubarRadioItemIndicator(props, ref) {\n\tconst { className, children, ...indicatorProps } = props;\n\treturn (\n\t\t<BaseMenu.RadioItemIndicator ref={ref} className={withStateClassName<BaseMenu.RadioItemIndicator.State>(\"lyds-menubar__indicator\", className)} {...indicatorProps}>\n\t\t\t{children ?? <CircleIcon aria-hidden=\"true\" weight=\"fill\" />}\n\t\t</BaseMenu.RadioItemIndicator>\n\t);\n});\n\nexport const MenubarGroup = BaseMenu.Group;\n\nexport const MenubarGroupLabel = forwardRef<ComponentRef<typeof BaseMenu.GroupLabel>, BaseMenu.GroupLabel.Props>(function MenubarGroupLabel(props, ref) {\n\tconst { className, ...labelProps } = props;\n\treturn <BaseMenu.GroupLabel ref={ref} className={withStateClassName<BaseMenu.GroupLabel.State>(\"lyds-menubar__group-label\", className)} {...labelProps} />;\n});\n\nexport const MenubarSeparator = forwardRef<ComponentRef<typeof BaseMenu.Separator>, BaseMenu.Separator.Props>(function MenubarSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseMenu.Separator ref={ref} className={withStateClassName<BaseMenu.Separator.State>(\"lyds-menubar__separator\", className)} {...separatorProps} />;\n});\n\nexport const MenubarSubmenu = BaseMenu.SubmenuRoot;\n\nexport const MenubarSubmenuTrigger = forwardRef<ComponentRef<typeof BaseMenu.SubmenuTrigger>, BaseMenu.SubmenuTrigger.Props>(function MenubarSubmenuTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseMenu.SubmenuTrigger ref={ref} className={withStateClassName<BaseMenu.SubmenuTrigger.State>(\"lyds-menubar__item\", className)} {...triggerProps} />;\n});\n\nexport const Toolbar = forwardRef<ComponentRef<typeof BaseToolbar.Root>, BaseToolbar.Root.Props>(function Toolbar(props, ref) {\n\tconst { className, ...toolbarProps } = props;\n\treturn <BaseToolbar.Root ref={ref} className={withStateClassName<BaseToolbar.Root.State>(\"lyds-toolbar\", className)} {...toolbarProps} />;\n});\n\nexport const ToolbarGroup = forwardRef<ComponentRef<typeof BaseToolbar.Group>, BaseToolbar.Group.Props>(function ToolbarGroup(props, ref) {\n\tconst { className, ...groupProps } = props;\n\treturn <BaseToolbar.Group ref={ref} className={withStateClassName<BaseToolbar.Group.State>(\"lyds-toolbar__group\", className)} {...groupProps} />;\n});\n\nexport const ToolbarButton = forwardRef<ComponentRef<typeof BaseToolbar.Button>, BaseToolbar.Button.Props>(function ToolbarButton(props, ref) {\n\tconst { className, ...buttonProps } = props;\n\treturn <BaseToolbar.Button ref={ref} className={withStateClassName<BaseToolbar.Button.State>(\"lyds-toolbar__button\", className)} {...buttonProps} />;\n});\n\nexport const ToolbarLink = forwardRef<ComponentRef<typeof BaseToolbar.Link>, BaseToolbar.Link.Props>(function ToolbarLink(props, ref) {\n\tconst { className, ...linkProps } = props;\n\treturn <BaseToolbar.Link ref={ref} className={withStateClassName<BaseToolbar.Link.State>(\"lyds-toolbar__button\", className)} {...linkProps} />;\n});\n\nexport const ToolbarInput = forwardRef<ComponentRef<typeof BaseToolbar.Input>, BaseToolbar.Input.Props>(function ToolbarInput(props, ref) {\n\tconst { className, ...inputProps } = props;\n\treturn <BaseToolbar.Input ref={ref} className={withStateClassName<BaseToolbar.Input.State>(\"lyds-toolbar__input\", className)} {...inputProps} />;\n});\n\nexport const ToolbarSeparator = forwardRef<ComponentRef<typeof BaseToolbar.Separator>, BaseToolbar.Separator.Props>(function ToolbarSeparator(props, ref) {\n\tconst { className, ...separatorProps } = props;\n\treturn <BaseToolbar.Separator ref={ref} className={withStateClassName<BaseToolbar.Separator.State>(\"lyds-toolbar__separator\", className)} {...separatorProps} />;\n});\n"],"mappings":";;;;;;;;;;AAQA,IAAa,IAAU,EAAgE,SAAiB,GAAO,GAAK;CACnH,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,GAAD;EAAkB;EAAK,WAAW,EAAsC,gBAAgB,CAAS;EAAG,GAAI;CAAe,CAAA;AAC/H,CAAC;AAED,SAAgB,EAA+B,GAAqC;CACnF,OAAO,kBAAC,EAAS,MAAV,EAAe,GAAI,EAAQ,CAAA;AACnC;AAEA,SAAS,EAAuC,GAAwC,GAAsC;CAC7H,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAS,SAAV;EAAuB;EAAK,WAAW,EAA2C,yBAAyB,CAAS;EAAG,GAAI;CAAe,CAAA;AAClJ;AAEA,IAAa,IAAiB,EAAW,CAAmB,GAE/C,IAAgB,EAAS,QAEzB,IAAoB,EAAgF,SAA2B,GAAO,GAAK;CACvJ,IAAM,EAAE,cAAW,gBAAa,GAAG,GAAG,MAAoB;CAC1D,OAAO,kBAAC,EAAS,YAAV;EAA0B;EAAK,WAAW,EAA8C,4BAA4B,CAAS;EAAe;EAAY,GAAI;CAAkB,CAAA;AACtL,CAAC,GAEY,IAAe,EAAsE,SAAsB,GAAO,GAAK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E,cAAW,GAAG,MAAgB;CACtC,OAAO,kBAAC,EAAY,QAAb;EAAyB;EAAK,WAAW,EAA6C,wBAAwB,CAAS;EAAG,GAAI;CAAc,CAAA;AACpJ,CAAC,GAEY,IAAc,EAA0E,SAAqB,GAAO,GAAK;CACrI,IAAM,EAAE,cAAW,GAAG,MAAc;CACpC,OAAO,kBAAC,EAAY,MAAb;EAAuB;EAAK,WAAW,EAA2C,wBAAwB,CAAS;EAAG,GAAI;CAAY,CAAA;AAC9I,CAAC,GAEY,IAAe,EAA4E,SAAsB,GAAO,GAAK;CACzI,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAY,OAAb;EAAwB;EAAK,WAAW,EAA4C,uBAAuB,CAAS;EAAG,GAAI;CAAa,CAAA;AAChJ,CAAC,GAEY,IAAmB,EAAoF,SAA0B,GAAO,GAAK;CACzJ,IAAM,EAAE,cAAW,GAAG,MAAmB;CACzC,OAAO,kBAAC,EAAY,WAAb;EAA4B;EAAK,WAAW,EAAgD,2BAA2B,CAAS;EAAG,GAAI;CAAiB,CAAA;AAChK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../../src/components/navigation-data/navigation-menu.tsx"],"sourcesContent":["import { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { CaretDownIcon } from \"@phosphor-icons/react/dist/csr/CaretDown\";\nimport { forwardRef, type ComponentRef, type ForwardedRef, type ReactElement, type RefAttributes } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nfunction NavigationMenuInner<Value = string>(props: BaseNavigationMenu.Root.Props<Value>, ref: ForwardedRef<HTMLElement>) {\n\tconst { className, ...rootProps } = props;\n\treturn <BaseNavigationMenu.Root ref={ref} className={withStateClassName<BaseNavigationMenu.Root.State>(\"lyds-navigation-menu\", className)} {...rootProps} />;\n}\n\nexport const NavigationMenu = forwardRef(NavigationMenuInner) as <Value = string>(props: BaseNavigationMenu.Root.Props<Value> & RefAttributes<HTMLElement>) => ReactElement;\n\nexport const NavigationMenuList = forwardRef<ComponentRef<typeof BaseNavigationMenu.List>, BaseNavigationMenu.List.Props>(function NavigationMenuList(props, ref) {\n\tconst { className, ...listProps } = props;\n\treturn <BaseNavigationMenu.List ref={ref} className={withStateClassName<BaseNavigationMenu.List.State>(\"lyds-navigation-menu__list\", className)} {...listProps} />;\n});\n\nexport const NavigationMenuItem = BaseNavigationMenu.Item;\n\nexport const NavigationMenuTrigger = forwardRef<ComponentRef<typeof BaseNavigationMenu.Trigger>, BaseNavigationMenu.Trigger.Props>(function NavigationMenuTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseNavigationMenu.Trigger ref={ref} className={withStateClassName<BaseNavigationMenu.Trigger.State>(\"lyds-navigation-menu__trigger\", className)} {...triggerProps} />;\n});\n\nexport const NavigationMenuIcon = forwardRef<ComponentRef<typeof BaseNavigationMenu.Icon>, BaseNavigationMenu.Icon.Props>(function NavigationMenuIcon(props, ref) {\n\tconst { className, children, ...iconProps } = props;\n\treturn (\n\t\t<BaseNavigationMenu.Icon ref={ref} className={withStateClassName<BaseNavigationMenu.Icon.State>(\"lyds-navigation-menu__icon\", className)} {...iconProps}>\n\t\t\t{children ?? <CaretDownIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseNavigationMenu.Icon>\n\t);\n});\n\nexport const NavigationMenuLink = forwardRef<ComponentRef<typeof BaseNavigationMenu.Link>, BaseNavigationMenu.Link.Props>(function NavigationMenuLink(props, ref) {\n\tconst { className, ...linkProps } = props;\n\treturn <BaseNavigationMenu.Link ref={ref} className={withStateClassName<BaseNavigationMenu.Link.State>(\"lyds-navigation-menu__link\", className)} {...linkProps} />;\n});\n\nexport const NavigationMenuContent = forwardRef<ComponentRef<typeof BaseNavigationMenu.Content>, BaseNavigationMenu.Content.Props>(function NavigationMenuContent(props, ref) {\n\tconst { className, ...contentProps } = props;\n\treturn <BaseNavigationMenu.Content ref={ref} className={withStateClassName<BaseNavigationMenu.Content.State>(\"lyds-navigation-menu__content\", className)} {...contentProps} />;\n});\n\nexport const NavigationMenuPortal = BaseNavigationMenu.Portal;\n\nexport const NavigationMenuPositioner = forwardRef<ComponentRef<typeof BaseNavigationMenu.Positioner>, BaseNavigationMenu.Positioner.Props>(function NavigationMenuPositioner(props, ref) {\n\tconst { className, sideOffset = 8, ...positionerProps } = props;\n\treturn (\n\t\t<BaseNavigationMenu.Positioner\n\t\t\tref={ref}\n\t\t\tclassName={withStateClassName<BaseNavigationMenu.Positioner.State>(\"lyds-navigation-menu__positioner\", className)}\n\t\t\tsideOffset={sideOffset}\n\t\t\t{...positionerProps}\n\t\t/>\n\t);\n});\n\nexport const NavigationMenuPopup = forwardRef<ComponentRef<typeof BaseNavigationMenu.Popup>, BaseNavigationMenu.Popup.Props>(function NavigationMenuPopup(props, ref) {\n\tconst { className, ...popupProps } = props;\n\treturn <BaseNavigationMenu.Popup ref={ref} className={withStateClassName<BaseNavigationMenu.Popup.State>(\"lyds-navigation-menu__popup\", className)} {...popupProps} />;\n});\n\nexport const NavigationMenuViewport = forwardRef<ComponentRef<typeof BaseNavigationMenu.Viewport>, BaseNavigationMenu.Viewport.Props>(function NavigationMenuViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseNavigationMenu.Viewport ref={ref} className={withStateClassName<BaseNavigationMenu.Viewport.State>(\"lyds-navigation-menu__viewport\", className)} {...viewportProps} />;\n});\n\nexport const NavigationMenuArrow = forwardRef<ComponentRef<typeof BaseNavigationMenu.Arrow>, BaseNavigationMenu.Arrow.Props>(function NavigationMenuArrow(props, ref) {\n\tconst { className, ...arrowProps } = props;\n\treturn <BaseNavigationMenu.Arrow ref={ref} className={withStateClassName<BaseNavigationMenu.Arrow.State>(\"lyds-navigation-menu__arrow\", className)} {...arrowProps} />;\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../../src/components/navigation-data/navigation-menu.tsx"],"sourcesContent":["import { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { CaretDownIcon } from \"@phosphor-icons/react/dist/csr/CaretDown\";\nimport { forwardRef, type ComponentRef, type ForwardedRef, type ReactElement, type RefAttributes } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nfunction NavigationMenuInner<Value = string>(props: BaseNavigationMenu.Root.Props<Value>, ref: ForwardedRef<HTMLElement>) {\n\tconst { className, ...rootProps } = props;\n\treturn <BaseNavigationMenu.Root ref={ref} className={withStateClassName<BaseNavigationMenu.Root.State>(\"lyds-navigation-menu\", className)} {...rootProps} />;\n}\n\nexport const NavigationMenu = forwardRef(NavigationMenuInner) as <Value = string>(props: BaseNavigationMenu.Root.Props<Value> & RefAttributes<HTMLElement>) => ReactElement;\n\nexport const NavigationMenuList = forwardRef<ComponentRef<typeof BaseNavigationMenu.List>, BaseNavigationMenu.List.Props>(function NavigationMenuList(props, ref) {\n\tconst { className, ...listProps } = props;\n\treturn <BaseNavigationMenu.List ref={ref} className={withStateClassName<BaseNavigationMenu.List.State>(\"lyds-navigation-menu__list\", className)} {...listProps} />;\n});\n\nexport const NavigationMenuItem = BaseNavigationMenu.Item;\n\nexport const NavigationMenuTrigger = forwardRef<ComponentRef<typeof BaseNavigationMenu.Trigger>, BaseNavigationMenu.Trigger.Props>(function NavigationMenuTrigger(props, ref) {\n\tconst { className, ...triggerProps } = props;\n\treturn <BaseNavigationMenu.Trigger ref={ref} className={withStateClassName<BaseNavigationMenu.Trigger.State>(\"lyds-navigation-menu__trigger\", className)} {...triggerProps} />;\n});\n\nexport const NavigationMenuIcon = forwardRef<ComponentRef<typeof BaseNavigationMenu.Icon>, BaseNavigationMenu.Icon.Props>(function NavigationMenuIcon(props, ref) {\n\tconst { className, children, ...iconProps } = props;\n\treturn (\n\t\t<BaseNavigationMenu.Icon ref={ref} className={withStateClassName<BaseNavigationMenu.Icon.State>(\"lyds-navigation-menu__icon\", className)} {...iconProps}>\n\t\t\t{children ?? <CaretDownIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseNavigationMenu.Icon>\n\t);\n});\n\nexport const NavigationMenuLink = forwardRef<ComponentRef<typeof BaseNavigationMenu.Link>, BaseNavigationMenu.Link.Props>(function NavigationMenuLink(props, ref) {\n\tconst { className, ...linkProps } = props;\n\treturn <BaseNavigationMenu.Link ref={ref} className={withStateClassName<BaseNavigationMenu.Link.State>(\"lyds-navigation-menu__link\", className)} {...linkProps} />;\n});\n\nexport const NavigationMenuContent = forwardRef<ComponentRef<typeof BaseNavigationMenu.Content>, BaseNavigationMenu.Content.Props>(function NavigationMenuContent(props, ref) {\n\tconst { className, ...contentProps } = props;\n\treturn <BaseNavigationMenu.Content ref={ref} className={withStateClassName<BaseNavigationMenu.Content.State>(\"lyds-navigation-menu__content\", className)} {...contentProps} />;\n});\n\nexport const NavigationMenuPortal = BaseNavigationMenu.Portal;\n\nexport const NavigationMenuPositioner = forwardRef<ComponentRef<typeof BaseNavigationMenu.Positioner>, BaseNavigationMenu.Positioner.Props>(function NavigationMenuPositioner(props, ref) {\n\tconst { className, sideOffset = 8, ...positionerProps } = props;\n\treturn (\n\t\t<BaseNavigationMenu.Positioner\n\t\t\tref={ref}\n\t\t\tclassName={withStateClassName<BaseNavigationMenu.Positioner.State>(\"lyds-navigation-menu__positioner\", className)}\n\t\t\tsideOffset={sideOffset}\n\t\t\t{...positionerProps}\n\t\t/>\n\t);\n});\n\nexport const NavigationMenuPopup = forwardRef<ComponentRef<typeof BaseNavigationMenu.Popup>, BaseNavigationMenu.Popup.Props>(function NavigationMenuPopup(props, ref) {\n\tconst { className, ...popupProps } = props;\n\treturn <BaseNavigationMenu.Popup ref={ref} className={withStateClassName<BaseNavigationMenu.Popup.State>(\"lyds-navigation-menu__popup\", className)} {...popupProps} />;\n});\n\nexport const NavigationMenuViewport = forwardRef<ComponentRef<typeof BaseNavigationMenu.Viewport>, BaseNavigationMenu.Viewport.Props>(function NavigationMenuViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseNavigationMenu.Viewport ref={ref} className={withStateClassName<BaseNavigationMenu.Viewport.State>(\"lyds-navigation-menu__viewport\", className)} {...viewportProps} />;\n});\n\nexport const NavigationMenuArrow = forwardRef<ComponentRef<typeof BaseNavigationMenu.Arrow>, BaseNavigationMenu.Arrow.Props>(function NavigationMenuArrow(props, ref) {\n\tconst { className, ...arrowProps } = props;\n\treturn <BaseNavigationMenu.Arrow ref={ref} className={withStateClassName<BaseNavigationMenu.Arrow.State>(\"lyds-navigation-menu__arrow\", className)} {...arrowProps} />;\n});\n"],"mappings":";;;;;;;AAKA,SAAS,EAAoC,GAA6C,GAAgC;CACzH,IAAM,EAAE,cAAW,GAAG,MAAc;CACpC,OAAO,kBAAC,EAAmB,MAApB;EAA8B;EAAK,WAAW,EAAkD,wBAAwB,CAAS;EAAG,GAAI;CAAY,CAAA;AAC5J;AAEA,IAAa,IAAiB,EAAW,CAAmB,GAE/C,IAAqB,EAAwF,SAA4B,GAAO,GAAK;CACjK,IAAM,EAAE,cAAW,GAAG,MAAc;CACpC,OAAO,kBAAC,EAAmB,MAApB;EAA8B;EAAK,WAAW,EAAkD,8BAA8B,CAAS;EAAG,GAAI;CAAY,CAAA;AAClK,CAAC,GAEY,IAAqB,EAAmB,MAExC,IAAwB,EAA8F,SAA+B,GAAO,GAAK;CAC7K,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAmB,SAApB;EAAiC;EAAK,WAAW,EAAqD,iCAAiC,CAAS;EAAG,GAAI;CAAe,CAAA;AAC9K,CAAC,GAEY,IAAqB,EAAwF,SAA4B,GAAO,GAAK;CACjK,IAAM,EAAE,cAAW,aAAU,GAAG,MAAc;CAC9C,OACC,kBAAC,EAAmB,MAApB;EAA8B;EAAK,WAAW,EAAkD,8BAA8B,CAAS;EAAG,GAAI;EAC5I,UAAA,KAAY,kBAAC,GAAD;GAAe,eAAY;GAAO,QAAO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{"version":3,"file":"scroll-area.js","names":[],"sources":["../../../src/components/navigation-data/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef, type ComponentRef } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nexport const ScrollArea = forwardRef<ComponentRef<typeof BaseScrollArea.Root>, BaseScrollArea.Root.Props>(function ScrollArea(props, ref) {\n\tconst { className, ...rootProps } = props;\n\treturn <BaseScrollArea.Root ref={ref} className={withStateClassName<BaseScrollArea.Root.State>(\"lyds-scroll-area\", className)} {...rootProps} />;\n});\n\nexport const ScrollAreaViewport = forwardRef<ComponentRef<typeof BaseScrollArea.Viewport>, BaseScrollArea.Viewport.Props>(function ScrollAreaViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseScrollArea.Viewport ref={ref} className={withStateClassName<BaseScrollArea.Viewport.State>(\"lyds-scroll-area__viewport\", className)} {...viewportProps} />;\n});\n\nexport const ScrollAreaContent = forwardRef<ComponentRef<typeof BaseScrollArea.Content>, BaseScrollArea.Content.Props>(function ScrollAreaContent(props, ref) {\n\tconst { className, ...contentProps } = props;\n\treturn <BaseScrollArea.Content ref={ref} className={withStateClassName<BaseScrollArea.Content.State>(\"lyds-scroll-area__content\", className)} {...contentProps} />;\n});\n\nexport const ScrollAreaScrollbar = forwardRef<ComponentRef<typeof BaseScrollArea.Scrollbar>, BaseScrollArea.Scrollbar.Props>(function ScrollAreaScrollbar(props, ref) {\n\tconst { className, ...scrollbarProps } = props;\n\treturn <BaseScrollArea.Scrollbar ref={ref} className={withStateClassName<BaseScrollArea.Scrollbar.State>(\"lyds-scroll-area__scrollbar\", className)} {...scrollbarProps} />;\n});\n\nexport const ScrollAreaThumb = forwardRef<ComponentRef<typeof BaseScrollArea.Thumb>, BaseScrollArea.Thumb.Props>(function ScrollAreaThumb(props, ref) {\n\tconst { className, ...thumbProps } = props;\n\treturn <BaseScrollArea.Thumb ref={ref} className={withStateClassName<BaseScrollArea.Thumb.State>(\"lyds-scroll-area__thumb\", className)} {...thumbProps} />;\n});\n\nexport const ScrollAreaCorner = forwardRef<ComponentRef<typeof BaseScrollArea.Corner>, BaseScrollArea.Corner.Props>(function ScrollAreaCorner(props, ref) {\n\tconst { className, ...cornerProps } = props;\n\treturn <BaseScrollArea.Corner ref={ref} className={withStateClassName<BaseScrollArea.Corner.State>(\"lyds-scroll-area__corner\", className)} {...cornerProps} />;\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":[],"sources":["../../../src/components/navigation-data/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef, type ComponentRef } from \"react\";\n\nimport { withStateClassName } from \"@/internal\";\nexport const ScrollArea = forwardRef<ComponentRef<typeof BaseScrollArea.Root>, BaseScrollArea.Root.Props>(function ScrollArea(props, ref) {\n\tconst { className, ...rootProps } = props;\n\treturn <BaseScrollArea.Root ref={ref} className={withStateClassName<BaseScrollArea.Root.State>(\"lyds-scroll-area\", className)} {...rootProps} />;\n});\n\nexport const ScrollAreaViewport = forwardRef<ComponentRef<typeof BaseScrollArea.Viewport>, BaseScrollArea.Viewport.Props>(function ScrollAreaViewport(props, ref) {\n\tconst { className, ...viewportProps } = props;\n\treturn <BaseScrollArea.Viewport ref={ref} className={withStateClassName<BaseScrollArea.Viewport.State>(\"lyds-scroll-area__viewport\", className)} {...viewportProps} />;\n});\n\nexport const ScrollAreaContent = forwardRef<ComponentRef<typeof BaseScrollArea.Content>, BaseScrollArea.Content.Props>(function ScrollAreaContent(props, ref) {\n\tconst { className, ...contentProps } = props;\n\treturn <BaseScrollArea.Content ref={ref} className={withStateClassName<BaseScrollArea.Content.State>(\"lyds-scroll-area__content\", className)} {...contentProps} />;\n});\n\nexport const ScrollAreaScrollbar = forwardRef<ComponentRef<typeof BaseScrollArea.Scrollbar>, BaseScrollArea.Scrollbar.Props>(function ScrollAreaScrollbar(props, ref) {\n\tconst { className, ...scrollbarProps } = props;\n\treturn <BaseScrollArea.Scrollbar ref={ref} className={withStateClassName<BaseScrollArea.Scrollbar.State>(\"lyds-scroll-area__scrollbar\", className)} {...scrollbarProps} />;\n});\n\nexport const ScrollAreaThumb = forwardRef<ComponentRef<typeof BaseScrollArea.Thumb>, BaseScrollArea.Thumb.Props>(function ScrollAreaThumb(props, ref) {\n\tconst { className, ...thumbProps } = props;\n\treturn <BaseScrollArea.Thumb ref={ref} className={withStateClassName<BaseScrollArea.Thumb.State>(\"lyds-scroll-area__thumb\", className)} {...thumbProps} />;\n});\n\nexport const ScrollAreaCorner = forwardRef<ComponentRef<typeof BaseScrollArea.Corner>, BaseScrollArea.Corner.Props>(function ScrollAreaCorner(props, ref) {\n\tconst { className, ...cornerProps } = props;\n\treturn <BaseScrollArea.Corner ref={ref} className={withStateClassName<BaseScrollArea.Corner.State>(\"lyds-scroll-area__corner\", className)} {...cornerProps} />;\n});\n"],"mappings":";;;;;;AAIA,IAAa,IAAa,EAAgF,SAAoB,GAAO,GAAK;CACzI,IAAM,EAAE,cAAW,GAAG,MAAc;CACpC,OAAO,kBAAC,EAAe,MAAhB;EAA0B;EAAK,WAAW,EAA8C,oBAAoB,CAAS;EAAG,GAAI;CAAY,CAAA;AAChJ,CAAC,GAEY,IAAqB,EAAwF,SAA4B,GAAO,GAAK;CACjK,IAAM,EAAE,cAAW,GAAG,MAAkB;CACxC,OAAO,kBAAC,EAAe,UAAhB;EAA8B;EAAK,WAAW,EAAkD,8BAA8B,CAAS;EAAG,GAAI;CAAgB,CAAA;AACtK,CAAC,GAEY,IAAoB,EAAsF,SAA2B,GAAO,GAAK;CAC7J,IAAM,EAAE,cAAW,GAAG,MAAiB;CACvC,OAAO,kBAAC,EAAe,SAAhB;EAA6B;EAAK,WAAW,EAAiD,6BAA6B,CAAS;EAAG,GAAI;CAAe,CAAA;AAClK,CAAC,GAEY,IAAsB,EAA0F,SAA6B,GAAO,GAAK;CACrK,IAAM,EAAE,cAAW,GAAG,MAAmB;CACzC,OAAO,kBAAC,EAAe,WAAhB;EAA+B;EAAK,WAAW,EAAmD,+BAA+B,CAAS;EAAG,GAAI;CAAiB,CAAA;AAC1K,CAAC,GAEY,IAAkB,EAAkF,SAAyB,GAAO,GAAK;CACrJ,IAAM,EAAE,cAAW,GAAG,MAAe;CACrC,OAAO,kBAAC,EAAe,OAAhB;EAA2B;EAAK,WAAW,EAA+C,2BAA2B,CAAS;EAAG,GAAI;CAAa,CAAA;AAC1J,CAAC,GAEY,IAAmB,EAAoF,SAA0B,GAAO,GAAK;CACzJ,IAAM,EAAE,cAAW,GAAG,MAAgB;CACtC,OAAO,kBAAC,EAAe,QAAhB;EAA4B;EAAK,WAAW,EAAgD,4BAA4B,CAAS;EAAG,GAAI;CAAc,CAAA;AAC9J,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-collection.js","names":[],"sources":["../../../src/components/navigation-data/table-collection.tsx"],"sourcesContent":["import {\n\tforwardRef,\n\ttype AnchorHTMLAttributes,\n\ttype ButtonHTMLAttributes,\n\ttype HTMLAttributes,\n\ttype LiHTMLAttributes,\n\ttype OlHTMLAttributes,\n\ttype TableHTMLAttributes,\n\ttype TdHTMLAttributes,\n\ttype ThHTMLAttributes\n} from \"react\";\n\nimport type { HeadingLevel } from \"@/components/foundations/section-heading\";\nimport { cx } from \"@/internal\";\nexport const TableFrame = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function TableFrame({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-table-frame\", className)} {...props} />;\n});\n\nexport const Table = forwardRef<HTMLTableElement, TableHTMLAttributes<HTMLTableElement>>(function Table({ className, ...props }, ref) {\n\treturn <table ref={ref} className={cx(\"lyds-table\", className)} {...props} />;\n});\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, HTMLAttributes<HTMLTableCaptionElement>>(function TableCaption({ className, ...props }, ref) {\n\treturn <caption ref={ref} className={cx(\"lyds-table__caption\", className)} {...props} />;\n});\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableHeader({ className, ...props }, ref) {\n\treturn <thead ref={ref} className={cx(\"lyds-table__header\", className)} {...props} />;\n});\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableBody({ className, ...props }, ref) {\n\treturn <tbody ref={ref} className={cx(\"lyds-table__body\", className)} {...props} />;\n});\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableFooter({ className, ...props }, ref) {\n\treturn <tfoot ref={ref} className={cx(\"lyds-table__footer\", className)} {...props} />;\n});\n\nexport const TableRow = forwardRef<HTMLTableRowElement, HTMLAttributes<HTMLTableRowElement>>(function TableRow({ className, ...props }, ref) {\n\treturn <tr ref={ref} className={cx(\"lyds-table__row\", className)} {...props} />;\n});\n\nexport interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {\n\ttextAlign?: \"start\" | \"center\" | \"end\";\n}\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead({ className, scope = \"col\", textAlign = \"start\", ...props }, ref) {\n\treturn <th ref={ref} className={cx(\"lyds-table__head\", className)} data-align={textAlign} scope={scope} {...props} />;\n});\n\nexport interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {\n\ttextAlign?: \"start\" | \"center\" | \"end\";\n\tnumeric?: boolean;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell({ className, textAlign = \"start\", numeric = false, ...props }, ref) {\n\treturn <td ref={ref} className={cx(\"lyds-table__cell\", className)} data-align={textAlign} data-numeric={numeric ? \"\" : undefined} {...props} />;\n});\n\n/** 純呈現用結構。資料擷取、排序、篩選與分頁由使用端負責。 */\nexport const DataTable = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function DataTable({ className, ...props }, ref) {\n\treturn <section ref={ref} className={cx(\"lyds-data-table\", className)} {...props} />;\n});\n\nexport const DataTableHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableHeader({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__header\", className)} {...props} />;\n});\n\nexport interface DataTableTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n\t/** Heading level for the surrounding document outline. */\n\tlevel?: HeadingLevel;\n}\n\nexport const DataTableTitle = forwardRef<HTMLHeadingElement, DataTableTitleProps>(function DataTableTitle({ children, className, level = 2, ...props }, ref) {\n\tconst Heading = `h${level}` as const;\n\treturn (\n\t\t<Heading ref={ref} className={cx(\"lyds-data-table__title\", className)} {...props}>\n\t\t\t{children}\n\t\t</Heading>\n\t);\n});\n\nexport const DataTableDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(function DataTableDescription({ className, ...props }, ref) {\n\treturn <p ref={ref} className={cx(\"lyds-data-table__description\", className)} {...props} />;\n});\n\nexport const DataTableControls = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableControls({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__controls\", className)} {...props} />;\n});\n\nexport interface DataTableRegionProps extends HTMLAttributes<HTMLDivElement> {\n\tlabel?: string;\n}\n\nexport const DataTableRegion = forwardRef<HTMLDivElement, DataTableRegionProps>(function DataTableRegion({ className, label, ...props }, ref) {\n\treturn <div ref={ref} aria-label={label} className={cx(\"lyds-data-table__region\", className)} role={label ? \"region\" : undefined} {...props} />;\n});\n\nexport const DataTableStatus = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableStatus({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__status\", className)} {...props} />;\n});\n\nexport interface CollectionProps extends HTMLAttributes<HTMLUListElement> {\n\tdensity?: \"comfortable\" | \"compact\";\n}\n\nexport const Collection = forwardRef<HTMLUListElement, CollectionProps>(function Collection({ className, density = \"comfortable\", ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-collection\", className)} data-density={density} {...props} />;\n});\n\nexport interface OrderedCollectionProps extends OlHTMLAttributes<HTMLOListElement> {\n\tdensity?: \"comfortable\" | \"compact\";\n}\n\nexport const OrderedCollection = forwardRef<HTMLOListElement, OrderedCollectionProps>(function OrderedCollection({ className, density = \"comfortable\", ...props }, ref) {\n\treturn <ol ref={ref} className={cx(\"lyds-collection\", className)} data-density={density} {...props} />;\n});\n\nexport type CollectionItemProps = LiHTMLAttributes<HTMLLIElement>;\n\nexport const CollectionItem = forwardRef<HTMLLIElement, CollectionItemProps>(function CollectionItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-collection__item\", className)} {...props} />;\n});\n\nexport const CollectionContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionContent({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__content\", className)} {...props} />;\n});\n\nexport interface CollectionHeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n\t/** Heading level for the surrounding document outline. */\n\tlevel?: HeadingLevel;\n}\n\nexport const CollectionHeading = forwardRef<HTMLHeadingElement, CollectionHeadingProps>(function CollectionHeading({ children, className, level = 3, ...props }, ref) {\n\tconst Heading = `h${level}` as const;\n\treturn (\n\t\t<Heading ref={ref} className={cx(\"lyds-collection__heading\", className)} {...props}>\n\t\t\t{children}\n\t\t</Heading>\n\t);\n});\n\nexport const CollectionDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(function CollectionDescription({ className, ...props }, ref) {\n\treturn <p ref={ref} className={cx(\"lyds-collection__description\", className)} {...props} />;\n});\n\nexport const CollectionMeta = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionMeta({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__meta\", className)} {...props} />;\n});\n\nexport const CollectionActions = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionActions({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__actions\", className)} {...props} />;\n});\n\nexport interface CollectionLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tselected?: boolean;\n}\n\nexport const CollectionLink = forwardRef<HTMLAnchorElement, CollectionLinkProps>(function CollectionLink({ children, className, selected = false, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} aria-current={selected ? \"page\" : undefined} className={cx(\"lyds-collection__interactive\", className)} data-selected={selected ? \"\" : undefined} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface CollectionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tselected?: boolean;\n}\n\nexport const CollectionButton = forwardRef<HTMLButtonElement, CollectionButtonProps>(function CollectionButton({ className, selected = false, type = \"button\", ...props }, ref) {\n\treturn <button ref={ref} aria-pressed={selected} className={cx(\"lyds-collection__interactive\", className)} data-selected={selected ? \"\" : undefined} type={type} {...props} />;\n});\n\nexport const List = Collection;\nexport const OrderedList = OrderedCollection;\nexport const ListItem = CollectionItem;\nexport const ListContent = CollectionContent;\nexport const ListHeading = CollectionHeading;\nexport const ListDescription = CollectionDescription;\nexport const ListMeta = CollectionMeta;\nexport const ListActions = CollectionActions;\nexport const ListLink = CollectionLink;\nexport const ListButton = CollectionButton;\n"],"mappings":";;;;AAcA,IAAa,IAAa,EAA2D,SAAoB,EAAE,cAAW,GAAG,KAAS,GAAK;CACtI,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,oBAAoB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACjF,CAAC,GAEY,IAAQ,EAAoE,SAAe,EAAE,cAAW,GAAG,KAAS,GAAK;CACrI,OAAO,kBAAC,SAAD;EAAY;EAAK,WAAW,EAAG,cAAc,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC7E,CAAC,GAEY,IAAe,EAA6E,SAAsB,EAAE,cAAW,G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AAD;EAAU;EAAK,WAAW,EAAG,4BAA4B,CAAS;EAAG,GAAI;CAAQ,CAAA;AACzF,CAAC,GAMY,IAAiB,EAAmD,SAAwB,EAAE,aAAU,cAAW,cAAW,IAAO,GAAG,KAAS,GAAK;CAClK,OACC,kBAAC,KAAD;EAAQ;EAAK,gBAAc,IAAW,SAAS,KAAA;EAAW,WAAW,EAAG,gCAAgC,CAAS;EAAG,iBAAe,IAAW,KAAK,KAAA;EAAW,GAAI;EAChK;CACC,CAAA;AAEL,CAAC,GAMY,IAAmB,EAAqD,SAA0B,EAAE,cAAW,cAAW,IAAO,UAAO,UAAU,GAAG,KAAS,GAAK;CAC/K,OAAO,kBAAC,UAAD;EAAa;EAAK,gBAAc;EAAU,WAAW,EAAG,gCAAgC,CAAS;EAAG,iBAAe,IAAW,KAAK,KAAA;EAAiB;EAAM,GAAI;CAAQ,CAAA;AAC9K,CAAC,GAEY,IAAO,GACP,IAAc,GACd,IAAW,GACX,IAAc,GACd,IAAc,GACd,IAAkB,GAClB,IAAW,GACX,IAAc,GACd,IAAW,GACX,IAAa"}
|
|
1
|
+
{"version":3,"file":"table-collection.js","names":[],"sources":["../../../src/components/navigation-data/table-collection.tsx"],"sourcesContent":["import {\n\tforwardRef,\n\ttype AnchorHTMLAttributes,\n\ttype ButtonHTMLAttributes,\n\ttype HTMLAttributes,\n\ttype LiHTMLAttributes,\n\ttype OlHTMLAttributes,\n\ttype TableHTMLAttributes,\n\ttype TdHTMLAttributes,\n\ttype ThHTMLAttributes\n} from \"react\";\n\nimport type { HeadingLevel } from \"@/components/foundations/section-heading\";\nimport { cx } from \"@/internal\";\nexport const TableFrame = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function TableFrame({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-table-frame\", className)} {...props} />;\n});\n\nexport const Table = forwardRef<HTMLTableElement, TableHTMLAttributes<HTMLTableElement>>(function Table({ className, ...props }, ref) {\n\treturn <table ref={ref} className={cx(\"lyds-table\", className)} {...props} />;\n});\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, HTMLAttributes<HTMLTableCaptionElement>>(function TableCaption({ className, ...props }, ref) {\n\treturn <caption ref={ref} className={cx(\"lyds-table__caption\", className)} {...props} />;\n});\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableHeader({ className, ...props }, ref) {\n\treturn <thead ref={ref} className={cx(\"lyds-table__header\", className)} {...props} />;\n});\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableBody({ className, ...props }, ref) {\n\treturn <tbody ref={ref} className={cx(\"lyds-table__body\", className)} {...props} />;\n});\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(function TableFooter({ className, ...props }, ref) {\n\treturn <tfoot ref={ref} className={cx(\"lyds-table__footer\", className)} {...props} />;\n});\n\nexport const TableRow = forwardRef<HTMLTableRowElement, HTMLAttributes<HTMLTableRowElement>>(function TableRow({ className, ...props }, ref) {\n\treturn <tr ref={ref} className={cx(\"lyds-table__row\", className)} {...props} />;\n});\n\nexport interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {\n\ttextAlign?: \"start\" | \"center\" | \"end\";\n}\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead({ className, scope = \"col\", textAlign = \"start\", ...props }, ref) {\n\treturn <th ref={ref} className={cx(\"lyds-table__head\", className)} data-align={textAlign} scope={scope} {...props} />;\n});\n\nexport interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {\n\ttextAlign?: \"start\" | \"center\" | \"end\";\n\tnumeric?: boolean;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell({ className, textAlign = \"start\", numeric = false, ...props }, ref) {\n\treturn <td ref={ref} className={cx(\"lyds-table__cell\", className)} data-align={textAlign} data-numeric={numeric ? \"\" : undefined} {...props} />;\n});\n\n/** 純呈現用結構。資料擷取、排序、篩選與分頁由使用端負責。 */\nexport const DataTable = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(function DataTable({ className, ...props }, ref) {\n\treturn <section ref={ref} className={cx(\"lyds-data-table\", className)} {...props} />;\n});\n\nexport const DataTableHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableHeader({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__header\", className)} {...props} />;\n});\n\nexport interface DataTableTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n\t/** Heading level for the surrounding document outline. */\n\tlevel?: HeadingLevel;\n}\n\nexport const DataTableTitle = forwardRef<HTMLHeadingElement, DataTableTitleProps>(function DataTableTitle({ children, className, level = 2, ...props }, ref) {\n\tconst Heading = `h${level}` as const;\n\treturn (\n\t\t<Heading ref={ref} className={cx(\"lyds-data-table__title\", className)} {...props}>\n\t\t\t{children}\n\t\t</Heading>\n\t);\n});\n\nexport const DataTableDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(function DataTableDescription({ className, ...props }, ref) {\n\treturn <p ref={ref} className={cx(\"lyds-data-table__description\", className)} {...props} />;\n});\n\nexport const DataTableControls = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableControls({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__controls\", className)} {...props} />;\n});\n\nexport interface DataTableRegionProps extends HTMLAttributes<HTMLDivElement> {\n\tlabel?: string;\n}\n\nexport const DataTableRegion = forwardRef<HTMLDivElement, DataTableRegionProps>(function DataTableRegion({ className, label, ...props }, ref) {\n\treturn <div ref={ref} aria-label={label} className={cx(\"lyds-data-table__region\", className)} role={label ? \"region\" : undefined} {...props} />;\n});\n\nexport const DataTableStatus = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DataTableStatus({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-data-table__status\", className)} {...props} />;\n});\n\nexport interface CollectionProps extends HTMLAttributes<HTMLUListElement> {\n\tdensity?: \"comfortable\" | \"compact\";\n}\n\nexport const Collection = forwardRef<HTMLUListElement, CollectionProps>(function Collection({ className, density = \"comfortable\", ...props }, ref) {\n\treturn <ul ref={ref} className={cx(\"lyds-collection\", className)} data-density={density} {...props} />;\n});\n\nexport interface OrderedCollectionProps extends OlHTMLAttributes<HTMLOListElement> {\n\tdensity?: \"comfortable\" | \"compact\";\n}\n\nexport const OrderedCollection = forwardRef<HTMLOListElement, OrderedCollectionProps>(function OrderedCollection({ className, density = \"comfortable\", ...props }, ref) {\n\treturn <ol ref={ref} className={cx(\"lyds-collection\", className)} data-density={density} {...props} />;\n});\n\nexport type CollectionItemProps = LiHTMLAttributes<HTMLLIElement>;\n\nexport const CollectionItem = forwardRef<HTMLLIElement, CollectionItemProps>(function CollectionItem({ className, ...props }, ref) {\n\treturn <li ref={ref} className={cx(\"lyds-collection__item\", className)} {...props} />;\n});\n\nexport const CollectionContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionContent({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__content\", className)} {...props} />;\n});\n\nexport interface CollectionHeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n\t/** Heading level for the surrounding document outline. */\n\tlevel?: HeadingLevel;\n}\n\nexport const CollectionHeading = forwardRef<HTMLHeadingElement, CollectionHeadingProps>(function CollectionHeading({ children, className, level = 3, ...props }, ref) {\n\tconst Heading = `h${level}` as const;\n\treturn (\n\t\t<Heading ref={ref} className={cx(\"lyds-collection__heading\", className)} {...props}>\n\t\t\t{children}\n\t\t</Heading>\n\t);\n});\n\nexport const CollectionDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(function CollectionDescription({ className, ...props }, ref) {\n\treturn <p ref={ref} className={cx(\"lyds-collection__description\", className)} {...props} />;\n});\n\nexport const CollectionMeta = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionMeta({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__meta\", className)} {...props} />;\n});\n\nexport const CollectionActions = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CollectionActions({ className, ...props }, ref) {\n\treturn <div ref={ref} className={cx(\"lyds-collection__actions\", className)} {...props} />;\n});\n\nexport interface CollectionLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n\tselected?: boolean;\n}\n\nexport const CollectionLink = forwardRef<HTMLAnchorElement, CollectionLinkProps>(function CollectionLink({ children, className, selected = false, ...props }, ref) {\n\treturn (\n\t\t<a ref={ref} aria-current={selected ? \"page\" : undefined} className={cx(\"lyds-collection__interactive\", className)} data-selected={selected ? \"\" : undefined} {...props}>\n\t\t\t{children}\n\t\t</a>\n\t);\n});\n\nexport interface CollectionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tselected?: boolean;\n}\n\nexport const CollectionButton = forwardRef<HTMLButtonElement, CollectionButtonProps>(function CollectionButton({ className, selected = false, type = \"button\", ...props }, ref) {\n\treturn <button ref={ref} aria-pressed={selected} className={cx(\"lyds-collection__interactive\", className)} data-selected={selected ? \"\" : undefined} type={type} {...props} />;\n});\n\nexport const List = Collection;\nexport const OrderedList = OrderedCollection;\nexport const ListItem = CollectionItem;\nexport const ListContent = CollectionContent;\nexport const ListHeading = CollectionHeading;\nexport const ListDescription = CollectionDescription;\nexport const ListMeta = CollectionMeta;\nexport const ListActions = CollectionActions;\nexport const ListLink = CollectionLink;\nexport const ListButton = CollectionButton;\n"],"mappings":";;;;;AAcA,IAAa,IAAa,EAA2D,SAAoB,EAAE,cAAW,GAAG,KAAS,GAAK;CACtI,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,oBAAoB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACjF,CAAC,GAEY,IAAQ,EAAoE,SAAe,EAAE,cAAW,GAAG,KAAS,GA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WAAW,EAAG,yBAAyB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACtF,CAAC,GAEY,IAAoB,EAA2D,SAA2B,EAAE,cAAW,GAAG,KAAS,GAAK;CACpJ,OAAO,kBAAC,OAAD;EAAU;EAAK,WAAW,EAAG,4BAA4B,CAAS;EAAG,GAAI;CAAQ,CAAA;AACzF,CAAC,GAMY,IAAiB,EAAmD,SAAwB,EAAE,aAAU,cAAW,cAAW,IAAO,GAAG,KAAS,GAAK;CAClK,OACC,kBAAC,KAAD;EAAQ;EAAK,gBAAc,IAAW,SAAS,KAAA;EAAW,WAAW,EAAG,gCAAgC,CAAS;EAAG,iBAAe,IAAW,KAAK,KAAA;EAAW,GAAI;EAChK;CACC,CAAA;AAEL,CAAC,GAMY,IAAmB,EAAqD,SAA0B,EAAE,cAAW,cAAW,IAAO,UAAO,UAAU,GAAG,KAAS,GAAK;CAC/K,OAAO,kBAAC,UAAD;EAAa;EAAK,gBAAc;EAAU,WAAW,EAAG,gCAAgC,CAAS;EAAG,iBAAe,IAAW,KAAK,KAAA;EAAiB;EAAM,GAAI;CAAQ,CAAA;AAC9K,CAAC,GAEY,IAAO,GACP,IAAc,GACd,IAAW,GACX,IAAc,GACd,IAAc,GACd,IAAkB,GAClB,IAAW,GACX,IAAc,GACd,IAAW,GACX,IAAa"}
|
|
@@ -32,7 +32,15 @@ export type DialogHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
|
32
32
|
export declare const DialogHeader: import('react').ForwardRefExoticComponent<DialogHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
33
33
|
export type DialogBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
34
34
|
export declare const DialogBody: import('react').ForwardRefExoticComponent<DialogBodyProps & RefAttributes<HTMLDivElement>>;
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* `stretch`, the default, gives every child an equal column so a Cancel/Confirm pair reads as
|
|
37
|
+
* one balanced decision. `end` sizes the actions to their own labels and puts them at the end
|
|
38
|
+
* of the row; `between` separates supporting copy from the actions.
|
|
39
|
+
*/
|
|
40
|
+
export type OverlayFooterAlign = "end" | "between" | "stretch";
|
|
41
|
+
export interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
align?: OverlayFooterAlign;
|
|
43
|
+
}
|
|
36
44
|
export declare const DialogFooter: import('react').ForwardRefExoticComponent<DialogFooterProps & RefAttributes<HTMLDivElement>>;
|
|
37
45
|
export declare const Dialog: {
|
|
38
46
|
readonly Root: typeof DialogRoot;
|
|
@@ -88,6 +96,7 @@ export declare const AlertDialogPopup: import('react').ForwardRefExoticComponent
|
|
|
88
96
|
export declare const AlertDialogClose: import('react').ForwardRefExoticComponent<Omit<DialogCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
89
97
|
export interface AlertDialogActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
90
98
|
children?: ReactNode;
|
|
99
|
+
align?: OverlayFooterAlign;
|
|
91
100
|
}
|
|
92
101
|
export declare const AlertDialogActions: import('react').ForwardRefExoticComponent<AlertDialogActionsProps & RefAttributes<HTMLDivElement>>;
|
|
93
102
|
export declare const AlertDialog: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cx as e, withStateClassName as t } from "../../internal/class-names.js";
|
|
2
3
|
import { useMessages as n } from "../../intl/provider.js";
|
|
3
4
|
import { forwardRef as r } from "react";
|
|
@@ -83,11 +84,12 @@ var f = r(function(e, t) {
|
|
|
83
84
|
ref: r,
|
|
84
85
|
className: e("lyds-dialog__body", t)
|
|
85
86
|
});
|
|
86
|
-
}), x = r(function({
|
|
87
|
+
}), x = r(function({ align: t = "stretch", className: n, ...r }, a) {
|
|
87
88
|
return /* @__PURE__ */ i("div", {
|
|
88
|
-
...
|
|
89
|
-
ref:
|
|
90
|
-
|
|
89
|
+
...r,
|
|
90
|
+
ref: a,
|
|
91
|
+
"data-align": t,
|
|
92
|
+
className: e("lyds-dialog__footer", n)
|
|
91
93
|
});
|
|
92
94
|
}), S = {
|
|
93
95
|
Root: u,
|
|
@@ -134,11 +136,12 @@ var E = r(function({ children: e, className: r, closeButton: o, closeLabel: s, c
|
|
|
134
136
|
className: t(o === "icon" ? "lyds-overlayClose" : "lyds-overlayCloseAction", a),
|
|
135
137
|
children: r ?? /* @__PURE__ */ i(l, {})
|
|
136
138
|
});
|
|
137
|
-
}), O = r(function({
|
|
139
|
+
}), O = r(function({ align: t = "stretch", className: n, ...r }, a) {
|
|
138
140
|
return /* @__PURE__ */ i("div", {
|
|
139
|
-
...
|
|
140
|
-
ref:
|
|
141
|
-
|
|
141
|
+
...r,
|
|
142
|
+
ref: a,
|
|
143
|
+
"data-align": t,
|
|
144
|
+
className: e("lyds-dialog__footer lyds-alertDialog__actions", n)
|
|
142
145
|
});
|
|
143
146
|
}), k = {
|
|
144
147
|
Root: w,
|