@linyao.tw/ui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/components/date-time/calendar.js +7 -6
- package/dist/components/date-time/calendar.js.map +1 -1
- package/dist/components/date-time/date-field.js +9 -8
- package/dist/components/date-time/date-field.js.map +1 -1
- package/dist/components/date-time/date-picker.js +7 -6
- package/dist/components/date-time/date-picker.js.map +1 -1
- package/dist/components/date-time/date-range-picker.js +7 -6
- package/dist/components/date-time/date-range-picker.js.map +1 -1
- package/dist/components/date-time/index.js +0 -1
- package/dist/components/date-time/shared.d.ts +0 -1
- package/dist/components/date-time/shared.js +6 -9
- package/dist/components/date-time/shared.js.map +1 -1
- package/dist/components/date-time/time-field.js +7 -6
- package/dist/components/date-time/time-field.js.map +1 -1
- package/dist/components/feedback/alert.js +34 -34
- package/dist/components/feedback/alert.js.map +1 -1
- package/dist/components/feedback/banner.js +14 -14
- package/dist/components/feedback/banner.js.map +1 -1
- package/dist/components/feedback/empty-state.d.ts +2 -1
- package/dist/components/feedback/empty-state.js +30 -31
- package/dist/components/feedback/empty-state.js.map +1 -1
- package/dist/components/feedback/feedback.types.d.ts +0 -1
- package/dist/components/feedback/feedback.types.js +2 -5
- package/dist/components/feedback/feedback.types.js.map +1 -1
- package/dist/components/feedback/index.d.ts +8 -8
- package/dist/components/feedback/meter.js +20 -21
- package/dist/components/feedback/meter.js.map +1 -1
- package/dist/components/feedback/progress.js +20 -21
- package/dist/components/feedback/progress.js.map +1 -1
- package/dist/components/feedback/skeleton.js +10 -11
- package/dist/components/feedback/skeleton.js.map +1 -1
- package/dist/components/feedback/spinner.js +24 -25
- package/dist/components/feedback/spinner.js.map +1 -1
- package/dist/components/feedback/toast.js +22 -21
- package/dist/components/feedback/toast.js.map +1 -1
- package/dist/components/forms/{CodeField.d.ts → code-field.d.ts} +1 -1
- package/dist/components/forms/code-field.js +65 -0
- package/dist/components/forms/code-field.js.map +1 -0
- package/dist/components/forms/{FileUpload.d.ts → file-upload.d.ts} +1 -1
- package/dist/components/forms/{FileUpload.js → file-upload.js} +127 -111
- package/dist/components/forms/file-upload.js.map +1 -0
- package/dist/components/forms/index.d.ts +6 -6
- package/dist/components/forms/{Input.js → input.js} +3 -3
- package/dist/components/forms/input.js.map +1 -0
- package/dist/components/forms/internal.d.ts +0 -2
- package/dist/components/forms/internal.js +12 -17
- package/dist/components/forms/internal.js.map +1 -1
- package/dist/components/forms/number-field.js +73 -0
- package/dist/components/forms/number-field.js.map +1 -0
- package/dist/components/forms/otp-field.js +57 -0
- package/dist/components/forms/otp-field.js.map +1 -0
- package/dist/components/forms/{TextField.d.ts → text-field.d.ts} +5 -0
- package/dist/components/forms/text-field.js +200 -0
- package/dist/components/forms/text-field.js.map +1 -0
- package/dist/components/foundations/{Avatar.js → avatar.js} +3 -3
- package/dist/components/foundations/avatar.js.map +1 -0
- package/dist/components/foundations/{Badge.d.ts → badge.d.ts} +1 -1
- package/dist/components/foundations/{Badge.js → badge.js} +3 -3
- package/dist/components/foundations/badge.js.map +1 -0
- package/dist/components/foundations/{Button.js → button.js} +3 -3
- package/dist/components/foundations/button.js.map +1 -0
- package/dist/components/foundations/{Card.d.ts → card.d.ts} +9 -2
- package/dist/components/foundations/{Card.js → card.js} +5 -5
- package/dist/components/foundations/card.js.map +1 -0
- package/dist/components/foundations/{IconButton.d.ts → icon-button.d.ts} +2 -8
- package/dist/components/foundations/{IconButton.js → icon-button.js} +4 -4
- package/dist/components/foundations/icon-button.js.map +1 -0
- package/dist/components/foundations/index.d.ts +9 -9
- package/dist/components/foundations/{Link.d.ts → link.d.ts} +1 -1
- package/dist/components/foundations/link.js +46 -0
- package/dist/components/foundations/link.js.map +1 -0
- package/dist/components/foundations/{ListCell.d.ts → list-cell.d.ts} +1 -8
- package/dist/components/foundations/{ListCell.js → list-cell.js} +3 -3
- package/dist/components/foundations/list-cell.js.map +1 -0
- package/dist/components/foundations/{SectionHeading.d.ts → section-heading.d.ts} +5 -2
- package/dist/components/foundations/{SectionHeading.js → section-heading.js} +3 -3
- package/dist/components/foundations/section-heading.js.map +1 -0
- package/dist/components/foundations/{Separator.js → separator.js} +3 -3
- package/dist/components/foundations/separator.js.map +1 -0
- package/dist/components/navigation-data/breadcrumb-pagination.js +88 -81
- package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -1
- package/dist/components/navigation-data/command-palette.d.ts +26 -0
- package/dist/components/navigation-data/command-palette.js +100 -72
- package/dist/components/navigation-data/command-palette.js.map +1 -1
- package/dist/components/navigation-data/header-tab-bar.js +49 -46
- package/dist/components/navigation-data/header-tab-bar.js.map +1 -1
- package/dist/components/navigation-data/index.d.ts +7 -7
- package/dist/components/navigation-data/menubar-toolbar.js +1 -1
- package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
- package/dist/components/navigation-data/navigation-menu.js +1 -1
- package/dist/components/navigation-data/navigation-menu.js.map +1 -1
- package/dist/components/navigation-data/scroll-area.js +1 -1
- package/dist/components/navigation-data/scroll-area.js.map +1 -1
- package/dist/components/navigation-data/table-collection.d.ts +12 -3
- package/dist/components/navigation-data/table-collection.js +11 -9
- package/dist/components/navigation-data/table-collection.js.map +1 -1
- package/dist/components/overlays/dialog.d.ts +13 -2
- package/dist/components/overlays/dialog.js +136 -131
- package/dist/components/overlays/dialog.js.map +1 -1
- package/dist/components/overlays/disclosure.js +1 -1
- package/dist/components/overlays/disclosure.js.map +1 -1
- package/dist/components/overlays/drawer.d.ts +5 -1
- package/dist/components/overlays/drawer.js +156 -152
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/floating.js +115 -113
- package/dist/components/overlays/floating.js.map +1 -1
- package/dist/components/overlays/index.d.ts +4 -4
- package/dist/components/selection/combobox.js +93 -93
- package/dist/components/selection/combobox.js.map +1 -1
- package/dist/components/selection/controls.d.ts +4 -1
- package/dist/components/selection/controls.js +140 -118
- package/dist/components/selection/controls.js.map +1 -1
- package/dist/components/selection/menu.js +120 -121
- package/dist/components/selection/menu.js.map +1 -1
- package/dist/components/selection/select.js +107 -107
- package/dist/components/selection/select.js.map +1 -1
- package/dist/fonts.css +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +37 -33
- package/dist/internal/accessible-name.d.ts +12 -0
- package/dist/internal/class-names.d.ts +12 -0
- package/dist/{components/selection/classnames.js → internal/class-names.js} +3 -3
- package/dist/internal/class-names.js.map +1 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/{components/foundations/shared.d.ts → internal/render.d.ts} +2 -1
- package/dist/intl/index.d.ts +2 -0
- package/dist/intl/messages.d.ts +48 -0
- package/dist/intl/messages.js +80 -0
- package/dist/intl/messages.js.map +1 -0
- package/dist/intl/provider.d.ts +18 -0
- package/dist/intl/provider.js +22 -0
- package/dist/intl/provider.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -4
- package/dist/components/feedback/feedback.module.js +0 -42
- package/dist/components/feedback/feedback.module.js.map +0 -1
- package/dist/components/forms/CodeField.js +0 -63
- package/dist/components/forms/CodeField.js.map +0 -1
- package/dist/components/forms/FileUpload.js.map +0 -1
- package/dist/components/forms/Input.js.map +0 -1
- package/dist/components/forms/NumberField.js +0 -71
- package/dist/components/forms/NumberField.js.map +0 -1
- package/dist/components/forms/OTPField.js +0 -54
- package/dist/components/forms/OTPField.js.map +0 -1
- package/dist/components/forms/TextField.js +0 -199
- package/dist/components/forms/TextField.js.map +0 -1
- package/dist/components/foundations/Avatar.js.map +0 -1
- package/dist/components/foundations/Badge.js.map +0 -1
- package/dist/components/foundations/Button.js.map +0 -1
- package/dist/components/foundations/Card.js.map +0 -1
- package/dist/components/foundations/IconButton.js.map +0 -1
- package/dist/components/foundations/Link.js +0 -40
- package/dist/components/foundations/Link.js.map +0 -1
- package/dist/components/foundations/ListCell.js.map +0 -1
- package/dist/components/foundations/SectionHeading.js.map +0 -1
- package/dist/components/foundations/Separator.js.map +0 -1
- package/dist/components/foundations/shared.js +0 -8
- package/dist/components/foundations/shared.js.map +0 -1
- package/dist/components/navigation-data/utils.d.ts +0 -2
- package/dist/components/navigation-data/utils.js +0 -11
- package/dist/components/navigation-data/utils.js.map +0 -1
- package/dist/components/overlays/class-names.d.ts +0 -6
- package/dist/components/overlays/class-names.js +0 -11
- package/dist/components/overlays/class-names.js.map +0 -1
- package/dist/components/selection/classnames.d.ts +0 -4
- package/dist/components/selection/classnames.js.map +0 -1
- package/dist/components/selection/selection.module.js +0 -51
- package/dist/components/selection/selection.module.js.map +0 -1
- /package/dist/components/forms/{Input.d.ts → input.d.ts} +0 -0
- /package/dist/components/forms/{NumberField.d.ts → number-field.d.ts} +0 -0
- /package/dist/components/forms/{OTPField.d.ts → otp-field.d.ts} +0 -0
- /package/dist/components/foundations/{Avatar.d.ts → avatar.d.ts} +0 -0
- /package/dist/components/foundations/{Button.d.ts → button.d.ts} +0 -0
- /package/dist/components/foundations/{Separator.d.ts → separator.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/foundations/card.tsx"],"sourcesContent":["import { type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nimport type { HeadingLevel } from \"./section-heading\";\nexport type CardVariant = \"material\" | \"elevated\" | \"inset\" | \"outline\" | \"cloud\";\nexport type CardSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface CardState extends Record<string, unknown> {\n\tsize: CardSize;\n\tvariant: CardVariant;\n}\n\nexport interface CardProps extends Omit<ElementProps<\"div\">, \"children\"> {\n\tchildren: React.ReactNode;\n\tvariant?: CardVariant;\n\tsize?: CardSize;\n\trender?: ComponentRenderProp<CardState>;\n}\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card({ children, variant = \"material\", size = \"md\", render, className, ...props }, ref) {\n\treturn useRender<CardState, HTMLDivElement>({\n\t\tdefaultTagName: \"div\",\n\t\tref,\n\t\trender,\n\t\tstate: { size, variant },\n\t\tprops: {\n\t\t\t...props,\n\t\t\tchildren,\n\t\t\tclassName: cx(\"lyds-card\", className)\n\t\t}\n\t});\n});\n\nCard.displayName = \"Card\";\n\nexport type CloudBoxProps = Omit<CardProps, \"variant\">;\n\nexport const CloudBox = React.forwardRef<HTMLDivElement, CloudBoxProps>(function CloudBox(props, ref) {\n\treturn <Card {...props} ref={ref} variant=\"cloud\" />;\n});\n\nCloudBox.displayName = \"CloudBox\";\n\ntype CardSlotProps<ElementType extends React.ElementType> = Omit<ElementProps<ElementType>, \"children\"> & {\n\tchildren: React.ReactNode;\n\trender?: ComponentRenderProp<Record<string, unknown>>;\n};\n\nfunction useCardSlot<Element extends HTMLElement>(\n\tdefaultTagName: keyof React.JSX.IntrinsicElements,\n\tslotName: string,\n\tchildren: React.ReactNode,\n\trender: ComponentRenderProp<Record<string, unknown>> | undefined,\n\tclassName: string | undefined,\n\tprops: Record<string, unknown>,\n\tref: React.ForwardedRef<Element>\n) {\n\treturn useRender<Record<string, unknown>, Element>({\n\t\tdefaultTagName,\n\t\tref,\n\t\trender,\n\t\tprops: {\n\t\t\t...props,\n\t\t\tchildren,\n\t\t\tclassName: cx(`lyds-card__${slotName}`, className)\n\t\t}\n\t});\n}\n\nexport type CardHeaderProps = CardSlotProps<\"div\">;\nexport const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(function CardHeader({ children, render, className, ...props }, ref) {\n\treturn useCardSlot(\"div\", \"header\", children, render, className, props, ref);\n});\n\nexport type CardTitleProps = CardSlotProps<\"h3\"> & {\n\t/** Heading level for the surrounding document outline. Cards nest, so this is rarely h3. */\n\tlevel?: HeadingLevel;\n};\n\nexport const CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(function CardTitle({ children, level = 3, render, className, ...props }, ref) {\n\treturn useCardSlot(`h${level}` as const, \"title\", children, render, className, props, ref);\n});\n\nexport type CardDescriptionProps = CardSlotProps<\"p\">;\nexport const CardDescription = React.forwardRef<HTMLParagraphElement, CardDescriptionProps>(function CardDescription({ children, render, className, ...props }, ref) {\n\treturn useCardSlot(\"p\", \"description\", children, render, className, props, ref);\n});\n\nexport type CardBodyProps = CardSlotProps<\"div\">;\nexport const CardBody = React.forwardRef<HTMLDivElement, CardBodyProps>(function CardBody({ children, render, className, ...props }, ref) {\n\treturn useCardSlot(\"div\", \"body\", children, render, className, props, ref);\n});\n\nexport type CardFooterProps = CardSlotProps<\"div\">;\nexport const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(function CardFooter({ children, render, className, ...props }, ref) {\n\treturn useCardSlot(\"div\", \"footer\", children, render, className, props, ref);\n});\n"],"mappings":";;;;;AAmBA,IAAa,IAAO,EAAM,WAAsC,SAAc,EAAE,aAAU,aAAU,YAAY,UAAO,MAAM,WAAQ,cAAW,GAAG,KAAS,GAAK;CAChK,OAAO,EAAqC;EAC3C,gBAAgB;EAChB;EACA;EACA,OAAO;GAAE;GAAM;EAAQ;EACvB,OAAO;GACN,GAAG;GACH;GACA,WAAW,EAAG,aAAa,CAAS;EACrC;CACD,CAAC;AACF,CAAC;AAED,EAAK,cAAc;AAInB,IAAa,IAAW,EAAM,WAA0C,SAAkB,GAAO,GAAK;CACrG,OAAO,kBAAC,GAAD;EAAM,GAAI;EAAY;EAAK,SAAQ;CAAS,CAAA;AACpD,CAAC;AAED,EAAS,cAAc;AAOvB,SAAS,EACR,GACA,GACA,GACA,GACA,GACA,GACA,GACC;CACD,OAAO,EAA4C;EAClD;EACA;EACA;EACA,OAAO;GACN,GAAG;GACH;GACA,WAAW,EAAG,cAAc,KAAY,CAAS;EAClD;CACD,CAAC;AACF;AAGA,IAAa,IAAa,EAAM,WAA4C,SAAoB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;CAC/I,OAAO,EAAY,OAAO,UAAU,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC5E,CAAC,GAOY,IAAY,EAAM,WAA+C,SAAmB,EAAE,aAAU,WAAQ,GAAG,WAAQ,cAAW,GAAG,KAAS,GAAK;CAC3J,OAAO,EAAY,IAAI,KAAkB,SAAS,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC1F,CAAC,GAGY,IAAkB,EAAM,WAAuD,SAAyB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;CACpK,OAAO,EAAY,KAAK,eAAe,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC/E,CAAC,GAGY,IAAW,EAAM,WAA0C,SAAkB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;CACzI,OAAO,EAAY,OAAO,QAAQ,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC1E,CAAC,GAGY,IAAa,EAAM,WAA4C,SAAoB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;CAC/I,OAAO,EAAY,OAAO,UAAU,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC5E,CAAC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AccessibleName } from '../../internal/index.js';
|
|
2
|
+
import { ButtonProps } from './button.js';
|
|
2
3
|
import * as React from "react";
|
|
3
|
-
type AccessibleName = {
|
|
4
|
-
"aria-label": string;
|
|
5
|
-
"aria-labelledby"?: string;
|
|
6
|
-
} | {
|
|
7
|
-
"aria-label"?: string;
|
|
8
|
-
"aria-labelledby": string;
|
|
9
|
-
};
|
|
10
4
|
type IconButtonBaseProps = Omit<ButtonProps, "aria-label" | "aria-labelledby" | "children" | "endIcon" | "startIcon"> & {
|
|
11
5
|
children: React.ReactNode;
|
|
12
6
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button as t } from "./
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
|
+
import { Button as t } from "./button.js";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/foundations/
|
|
5
|
+
//#region src/components/foundations/icon-button.tsx
|
|
6
6
|
var i = n.forwardRef(function({ children: n, className: i, loading: a = !1, ...o }, s) {
|
|
7
7
|
return /* @__PURE__ */ r(t, {
|
|
8
8
|
...o,
|
|
@@ -16,4 +16,4 @@ i.displayName = "IconButton";
|
|
|
16
16
|
//#endregion
|
|
17
17
|
export { i as IconButton };
|
|
18
18
|
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.js","names":[],"sources":["../../../src/components/foundations/icon-button.tsx"],"sourcesContent":["import { type AccessibleName, cx } from \"@/internal\";\nimport * as React from \"react\";\nimport { Button, type ButtonProps } from \"./button\";\ntype IconButtonBaseProps = Omit<ButtonProps, \"aria-label\" | \"aria-labelledby\" | \"children\" | \"endIcon\" | \"startIcon\"> & {\n\tchildren: React.ReactNode;\n};\n\nexport type IconButtonProps = IconButtonBaseProps & AccessibleName;\n\nexport const IconButton = React.forwardRef<HTMLElement, IconButtonProps>(function IconButton({ children, className, loading = false, ...props }, ref) {\n\treturn (\n\t\t<Button {...props} ref={ref} className={cx(\"lyds-icon-button\", className)} loading={loading}>\n\t\t\t{loading ? null : children}\n\t\t</Button>\n\t);\n});\n\nIconButton.displayName = \"IconButton\";\n"],"mappings":";;;;;AASA,IAAa,IAAa,EAAM,WAAyC,SAAoB,EAAE,aAAU,cAAW,aAAU,IAAO,GAAG,KAAS,GAAK;CACrJ,OACC,kBAAC,GAAD;EAAQ,GAAI;EAAY;EAAK,WAAW,EAAG,oBAAoB,CAAS;EAAY;EAClF,UAAA,IAAU,OAAO;CACX,CAAA;AAEV,CAAC;AAED,EAAW,cAAc"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
1
|
+
export { Avatar, type AvatarBaseProps, type AvatarProps, type AvatarSize, type AvatarStatus, type AvatarVariant } from './avatar.js';
|
|
2
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeState, type BadgeVariant } from './badge.js';
|
|
3
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './button.js';
|
|
4
|
+
export { Card, CardBody, CardDescription, CardFooter, CardHeader, CardTitle, CloudBox, type CardBodyProps, type CardDescriptionProps, type CardFooterProps, type CardHeaderProps, type CardProps, type CardSize, type CardState, type CardTitleProps, type CardVariant, type CloudBoxProps } from './card.js';
|
|
5
|
+
export { IconButton, type IconButtonProps } from './icon-button.js';
|
|
6
|
+
export { Link, type LinkProps, type LinkSize, type LinkState, type LinkVariant } from './link.js';
|
|
7
|
+
export { ListCell, ListCellAction, ListCellContent, ListCellDescription, ListCellLeading, ListCellMetadata, ListCellTitle, ListCellTrailing, type ListCellActionProps, type ListCellCurrentSemantics, type ListCellProps, type ListCellSize, type ListCellState, type ListCellVariant } from './list-cell.js';
|
|
8
|
+
export { SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, type SectionHeadingSize, type SectionHeadingState } from './section-heading.js';
|
|
9
|
+
export { Separator, type SeparatorProps, type SeparatorSpacing, type SeparatorVariant } from './separator.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentRenderProp, ElementProps } from '
|
|
1
|
+
import { ComponentRenderProp, ElementProps } from '../../internal/index.js';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export type LinkVariant = "default" | "accent" | "subtle";
|
|
4
4
|
export type LinkSize = "sm" | "md" | "lg";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
|
+
import { useMessages as t } from "../../intl/provider.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { useRender as o } from "@base-ui/react/use-render";
|
|
6
|
+
//#region src/components/foundations/link.tsx
|
|
7
|
+
var s = n.forwardRef(function({ children: n, variant: s = "default", size: c = "md", disabled: l = !1, external: u = !1, render: d, className: f, href: p, target: m, rel: h, onClick: g, ..._ }, v) {
|
|
8
|
+
let y = t(), b = {
|
|
9
|
+
disabled: l,
|
|
10
|
+
external: u,
|
|
11
|
+
size: c,
|
|
12
|
+
variant: s
|
|
13
|
+
}, x = m === "_blank" && !h ? "noopener noreferrer" : h, S = !l && m === "_blank";
|
|
14
|
+
return o({
|
|
15
|
+
defaultTagName: "a",
|
|
16
|
+
ref: v,
|
|
17
|
+
render: l ? void 0 : d,
|
|
18
|
+
state: b,
|
|
19
|
+
props: {
|
|
20
|
+
..._,
|
|
21
|
+
children: S ? /* @__PURE__ */ a(r, { children: [n, /* @__PURE__ */ i("span", {
|
|
22
|
+
className: "lyds-sr-only",
|
|
23
|
+
children: y.linkOpensInNewWindow
|
|
24
|
+
})] }) : n,
|
|
25
|
+
href: l ? void 0 : p,
|
|
26
|
+
target: m,
|
|
27
|
+
rel: x,
|
|
28
|
+
"aria-disabled": l || void 0,
|
|
29
|
+
"data-external": u || void 0,
|
|
30
|
+
tabIndex: l ? -1 : _.tabIndex,
|
|
31
|
+
className: e("lyds-link", f),
|
|
32
|
+
onClick: (e) => {
|
|
33
|
+
if (l) {
|
|
34
|
+
e.preventDefault(), e.stopPropagation();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
g?.(e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
s.displayName = "Link";
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as Link };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../../src/components/foundations/link.tsx"],"sourcesContent":["import { type ComponentRenderProp, cx, type ElementProps } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nexport type LinkVariant = \"default\" | \"accent\" | \"subtle\";\nexport type LinkSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface LinkState extends Record<string, unknown> {\n\tdisabled: boolean;\n\texternal: boolean;\n\tsize: LinkSize;\n\tvariant: LinkVariant;\n}\n\nexport interface LinkProps extends Omit<ElementProps<\"a\">, \"children\"> {\n\tchildren: React.ReactNode;\n\tvariant?: LinkVariant;\n\tsize?: LinkSize;\n\tdisabled?: boolean;\n\texternal?: boolean;\n\trender?: ComponentRenderProp<LinkState>;\n}\n\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n\t{ children, variant = \"default\", size = \"md\", disabled = false, external = false, render, className, href, target, rel, onClick, ...props },\n\tref\n) {\n\tconst messages = useMessages();\n\tconst state: LinkState = { disabled, external, size, variant };\n\tconst secureRel = target === \"_blank\" && !rel ? \"noopener noreferrer\" : rel;\n\t// The warning belongs to what the link actually does, not to the decorative flag: a link is\n\t// only unexpected when it really opens a new window.\n\tconst opensNewWindow = !disabled && target === \"_blank\";\n\n\treturn useRender<LinkState, HTMLAnchorElement>({\n\t\tdefaultTagName: \"a\",\n\t\tref,\n\t\t// 多型 `render` 函式或路由元件可能重新加入導覽行為。\n\t\t// 停用時改用無互動的原生連結,確保元件契約成立。\n\t\trender: disabled ? undefined : render,\n\t\tstate,\n\t\tprops: {\n\t\t\t...props,\n\t\t\tchildren: opensNewWindow ? (\n\t\t\t\t<>\n\t\t\t\t\t{children}\n\t\t\t\t\t<span className=\"lyds-sr-only\">{messages.linkOpensInNewWindow}</span>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t),\n\t\t\thref: disabled ? undefined : href,\n\t\t\ttarget,\n\t\t\trel: secureRel,\n\t\t\t\"aria-disabled\": disabled || undefined,\n\t\t\t\"data-external\": external || undefined,\n\t\t\ttabIndex: disabled ? -1 : props.tabIndex,\n\t\t\tclassName: cx(\"lyds-link\", className),\n\t\t\tonClick: (event: React.MouseEvent<HTMLAnchorElement>) => {\n\t\t\t\tif (disabled) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tonClick?.(event);\n\t\t\t}\n\t\t}\n\t});\n});\n\nLink.displayName = \"Link\";\n"],"mappings":";;;;;;AAuBA,IAAa,IAAO,EAAM,WAAyC,SAClE,EAAE,aAAU,aAAU,WAAW,UAAO,MAAM,cAAW,IAAO,cAAW,IAAO,WAAQ,cAAW,SAAM,WAAQ,QAAK,YAAS,GAAG,KACpI,GACC;CACD,IAAM,IAAW,EAAY,GACvB,IAAmB;EAAE;EAAU;EAAU;EAAM;CAAQ,GACvD,IAAY,MAAW,YAAY,CAAC,IAAM,wBAAwB,GAGlE,IAAiB,CAAC,KAAY,MAAW;CAE/C,OAAO,EAAwC;EAC9C,gBAAgB;EAChB;EAGA,QAAQ,IAAW,KAAA,IAAY;EAC/B;EACA,OAAO;GACN,GAAG;GACH,UAAU,IACT,kBAAA,GAAA,EAAA,UAAA,CACE,GACD,kBAAC,QAAD;IAAM,WAAU;IAAgB,UAAA,EAAS;GAA2B,CAAA,CACnE,EAAA,CAAA,IAEF;GAED,MAAM,IAAW,KAAA,IAAY;GAC7B;GACA,KAAK;GACL,iBAAiB,KAAY,KAAA;GAC7B,iBAAiB,KAAY,KAAA;GAC7B,UAAU,IAAW,KAAK,EAAM;GAChC,WAAW,EAAG,aAAa,CAAS;GACpC,UAAU,MAA+C;IACxD,IAAI,GAAU;KAEb,AADA,EAAM,eAAe,GACrB,EAAM,gBAAgB;KACtB;IACD;IAEA,IAAU,CAAK;GAChB;EACD;CACD,CAAC;AACF,CAAC;AAED,EAAK,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentRenderProp, ElementProps } from '
|
|
1
|
+
import { AccessibleName, ComponentRenderProp, ElementProps } from '../../internal/index.js';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export type ListCellVariant = "default" | "inset";
|
|
4
4
|
export type ListCellSize = "sm" | "md" | "lg";
|
|
@@ -35,13 +35,6 @@ export type ListCellProps = Omit<ElementProps<"div">, "children" | "title"> & Li
|
|
|
35
35
|
disabled?: boolean;
|
|
36
36
|
render?: ComponentRenderProp<ListCellState>;
|
|
37
37
|
};
|
|
38
|
-
type AccessibleName = {
|
|
39
|
-
"aria-label": string;
|
|
40
|
-
"aria-labelledby"?: string;
|
|
41
|
-
} | {
|
|
42
|
-
"aria-label"?: string;
|
|
43
|
-
"aria-labelledby": string;
|
|
44
|
-
};
|
|
45
38
|
type ListCellLinkActionProps = Omit<ElementProps<"a">, "aria-label" | "aria-labelledby" | "children" | "className"> & {
|
|
46
39
|
href: string;
|
|
47
40
|
className?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { useRender as a } from "@base-ui/react/use-render";
|
|
5
|
-
//#region src/components/foundations/
|
|
5
|
+
//#region src/components/foundations/list-cell.tsx
|
|
6
6
|
var o = t.createContext({
|
|
7
7
|
current: void 0,
|
|
8
8
|
disabled: !1
|
|
@@ -102,4 +102,4 @@ var u = l("leading"), d = l("content"), f = l("title"), p = l("description"), m
|
|
|
102
102
|
//#endregion
|
|
103
103
|
export { c as ListCell, s as ListCellAction, d as ListCellContent, p as ListCellDescription, u as ListCellLeading, m as ListCellMetadata, f as ListCellTitle, h as ListCellTrailing };
|
|
104
104
|
|
|
105
|
-
//# sourceMappingURL=
|
|
105
|
+
//# sourceMappingURL=list-cell.js.map
|
|
@@ -0,0 +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":";;;;;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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AU,IAAoB,IAAW,IAAmB,KAAS,KAAA;CAE3E,OAAO,EAAsC;EAC5C,gBAAgB;EAChB;EACA;EACA;EACA,OAAO;GACN,GAAG;GACH,WAAW,EAAG,kBAAkB,CAAS;GACzC,gBAAgB,CAAC,KAAU,MAAY,KAAA,IAAY,IAAU,EAAM;GACnE,iBAAiB,CAAC,KAAU,IAAW,KAAO,EAAM;GACpD,iBAAiB,MAAuB,aAAa,IAAW,EAAM;GACtE,UACC,kBAAC,EAAgB,UAAjB;IAA0B,OAAO;KAAE;KAAS;IAAS;IAArD,UAAA,CACE,IAAS,kBAAC,GAAD;KAAgB,KAAK;KAAW,GAAI;IAAS,CAAA,IAAI,MAC1D,CACwB;;EAE5B;CACD,CAAC;AACF,CAAC;AAED,EAAS,cAAc;AASvB,SAAS,EAAmB,GAA4B;CACvD,IAAM,IAAO,EAAM,WAA2C,SAAsB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;EACnI,OAAO,EAAgD;GACtD,gBAAgB;GAChB;GACA;GACA,OAAO;IACN,GAAG;IACH;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,7 +1,10 @@
|
|
|
1
|
-
import { ComponentRenderProp, ElementProps } from '
|
|
1
|
+
import { ComponentRenderProp, ElementProps } from '../../internal/index.js';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export type SectionHeadingSize = "sm" | "md" | "lg";
|
|
4
|
-
|
|
4
|
+
/** Heading levels a component may render. h1 is the page's, so components never take it. */
|
|
5
|
+
export type HeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
/** @deprecated Use `HeadingLevel`, which every component that renders a heading now shares. */
|
|
7
|
+
export type SectionHeadingLevel = HeadingLevel;
|
|
5
8
|
export interface SectionHeadingState extends Record<string, unknown> {
|
|
6
9
|
size: SectionHeadingSize;
|
|
7
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { useRender as a } from "@base-ui/react/use-render";
|
|
5
|
-
//#region src/components/foundations/
|
|
5
|
+
//#region src/components/foundations/section-heading.tsx
|
|
6
6
|
var o = t.forwardRef(function({ children: t, annotation: o, description: s, action: c, level: l = 2, size: u = "md", render: d, className: f, ...p }, m) {
|
|
7
7
|
let h = `h${l}`;
|
|
8
8
|
return a({
|
|
@@ -47,4 +47,4 @@ o.displayName = "SectionHeading";
|
|
|
47
47
|
//#endregion
|
|
48
48
|
export { o as SectionHeading };
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=
|
|
50
|
+
//# sourceMappingURL=section-heading.js.map
|
|
@@ -0,0 +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":";;;;;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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { Separator as r } from "@base-ui/react/separator";
|
|
5
|
-
//#region src/components/foundations/
|
|
5
|
+
//#region src/components/foundations/separator.tsx
|
|
6
6
|
var i = t.forwardRef(function({ variant: t = "solid", spacing: i = "md", orientation: a = "horizontal", className: o, style: s, ...c }, l) {
|
|
7
7
|
return /* @__PURE__ */ n(r, {
|
|
8
8
|
...c,
|
|
@@ -18,4 +18,4 @@ i.displayName = "Separator";
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { i as Separator };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +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":";;;;;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,91 +1,95 @@
|
|
|
1
|
-
import { cx as e } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { cx as e } from "../../internal/class-names.js";
|
|
2
|
+
import { useMessages as t } from "../../intl/provider.js";
|
|
3
|
+
import { CaretRightIcon as n } from "@phosphor-icons/react/dist/csr/CaretRight";
|
|
4
|
+
import { forwardRef as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { ArrowLeftIcon as o } from "@phosphor-icons/react/dist/csr/ArrowLeft";
|
|
7
|
+
import { ArrowRightIcon as s } from "@phosphor-icons/react/dist/csr/ArrowRight";
|
|
8
|
+
import { DotsThreeIcon as c } from "@phosphor-icons/react/dist/csr/DotsThree";
|
|
8
9
|
//#region src/components/navigation-data/breadcrumb-pagination.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var l = r(function({ className: n, label: r, ...a }, o) {
|
|
11
|
+
let s = t();
|
|
12
|
+
return /* @__PURE__ */ i("nav", {
|
|
13
|
+
ref: o,
|
|
14
|
+
"aria-label": r ?? s.breadcrumbLabel,
|
|
15
|
+
className: e("lyds-breadcrumb", n),
|
|
16
|
+
...a
|
|
15
17
|
});
|
|
16
|
-
}),
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
ref:
|
|
18
|
+
}), u = r(function({ className: t, ...n }, r) {
|
|
19
|
+
return /* @__PURE__ */ i("ol", {
|
|
20
|
+
ref: r,
|
|
19
21
|
className: e("lyds-breadcrumb__list", t),
|
|
20
22
|
...n
|
|
21
23
|
});
|
|
22
|
-
}),
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
ref:
|
|
24
|
+
}), d = r(function({ className: t, ...n }, r) {
|
|
25
|
+
return /* @__PURE__ */ i("li", {
|
|
26
|
+
ref: r,
|
|
25
27
|
className: e("lyds-breadcrumb__item", t),
|
|
26
28
|
...n
|
|
27
29
|
});
|
|
28
|
-
}),
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
}), f = r(function({ children: t, className: n, ...r }, a) {
|
|
31
|
+
return /* @__PURE__ */ i("a", {
|
|
30
32
|
ref: a,
|
|
31
33
|
className: e("lyds-breadcrumb__link", n),
|
|
32
|
-
...
|
|
34
|
+
...r,
|
|
33
35
|
children: t
|
|
34
36
|
});
|
|
35
|
-
}),
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
ref:
|
|
37
|
+
}), p = r(function({ className: t, ...n }, r) {
|
|
38
|
+
return /* @__PURE__ */ i("span", {
|
|
39
|
+
ref: r,
|
|
38
40
|
"aria-current": "page",
|
|
39
41
|
className: e("lyds-breadcrumb__page", t),
|
|
40
42
|
...n
|
|
41
43
|
});
|
|
42
|
-
}),
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
}), m = r(function({ children: t, className: r, ...a }, o) {
|
|
45
|
+
return /* @__PURE__ */ i("span", {
|
|
44
46
|
ref: o,
|
|
45
47
|
"aria-hidden": "true",
|
|
46
|
-
className: e("lyds-breadcrumb__separator",
|
|
48
|
+
className: e("lyds-breadcrumb__separator", r),
|
|
47
49
|
...a,
|
|
48
|
-
children:
|
|
50
|
+
children: t ?? /* @__PURE__ */ i(n, {
|
|
49
51
|
"aria-hidden": "true",
|
|
50
52
|
weight: "bold"
|
|
51
53
|
})
|
|
52
54
|
});
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
}), h = r(function({ "aria-label": n, className: r, children: o, ...s }, l) {
|
|
56
|
+
let u = t();
|
|
57
|
+
return /* @__PURE__ */ a("span", {
|
|
58
|
+
ref: l,
|
|
59
|
+
className: e("lyds-breadcrumb__ellipsis", r),
|
|
60
|
+
...s,
|
|
61
|
+
children: [o ? /* @__PURE__ */ i("span", {
|
|
59
62
|
"aria-hidden": "true",
|
|
60
|
-
children:
|
|
61
|
-
}) : /* @__PURE__ */
|
|
63
|
+
children: o
|
|
64
|
+
}) : /* @__PURE__ */ i(c, {
|
|
62
65
|
"aria-hidden": "true",
|
|
63
66
|
weight: "bold"
|
|
64
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ i("span", {
|
|
65
68
|
className: "lyds-sr-only",
|
|
66
|
-
children:
|
|
69
|
+
children: n ?? u.breadcrumbMore
|
|
67
70
|
})]
|
|
68
71
|
});
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
}), g = r(function({ className: n, label: r, ...a }, o) {
|
|
73
|
+
let s = t();
|
|
74
|
+
return /* @__PURE__ */ i("nav", {
|
|
75
|
+
ref: o,
|
|
76
|
+
"aria-label": r ?? s.paginationLabel,
|
|
77
|
+
className: e("lyds-pagination", n),
|
|
78
|
+
...a
|
|
75
79
|
});
|
|
76
|
-
}),
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
ref:
|
|
80
|
+
}), _ = r(function({ className: t, ...n }, r) {
|
|
81
|
+
return /* @__PURE__ */ i("ul", {
|
|
82
|
+
ref: r,
|
|
79
83
|
className: e("lyds-pagination__list", t),
|
|
80
84
|
...n
|
|
81
85
|
});
|
|
82
|
-
}),
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
ref:
|
|
86
|
+
}), v = r(function({ className: t, ...n }, r) {
|
|
87
|
+
return /* @__PURE__ */ i("li", {
|
|
88
|
+
ref: r,
|
|
85
89
|
className: e("lyds-pagination__item", t),
|
|
86
90
|
...n
|
|
87
91
|
});
|
|
88
|
-
}),
|
|
92
|
+
}), y = r(function({ children: t, className: n, current: r = !1, disabled: a = !1, href: o, onClick: s, tabIndex: c, ...l }, u) {
|
|
89
93
|
let d = {
|
|
90
94
|
onClick: (e) => {
|
|
91
95
|
if (a) {
|
|
@@ -96,66 +100,69 @@ var c = n(function({ className: t, label: n = "麵包屑導覽", ...i }, a) {
|
|
|
96
100
|
},
|
|
97
101
|
tabIndex: a ? -1 : c
|
|
98
102
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ i("a", {
|
|
100
104
|
...l,
|
|
101
105
|
ref: u,
|
|
102
|
-
"aria-current":
|
|
106
|
+
"aria-current": r ? "page" : void 0,
|
|
103
107
|
"aria-disabled": a || void 0,
|
|
104
108
|
className: e("lyds-pagination__control", n),
|
|
105
|
-
"data-current":
|
|
109
|
+
"data-current": r ? "" : void 0,
|
|
106
110
|
"data-disabled": a ? "" : void 0,
|
|
107
111
|
href: a ? void 0 : o,
|
|
108
112
|
role: a ? "link" : void 0,
|
|
109
113
|
...d,
|
|
110
114
|
children: t
|
|
111
115
|
});
|
|
112
|
-
}),
|
|
113
|
-
return /* @__PURE__ */
|
|
116
|
+
}), b = r(function({ className: t, current: n = !1, type: r = "button", ...a }, o) {
|
|
117
|
+
return /* @__PURE__ */ i("button", {
|
|
114
118
|
ref: o,
|
|
115
119
|
"aria-current": n ? "page" : void 0,
|
|
116
120
|
className: e("lyds-pagination__control", t),
|
|
117
121
|
"data-current": n ? "" : void 0,
|
|
118
|
-
type:
|
|
122
|
+
type: r,
|
|
119
123
|
...a
|
|
120
124
|
});
|
|
121
|
-
}),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
}), x = r(function({ "aria-label": e, children: n, ...r }, a) {
|
|
126
|
+
let s = t();
|
|
127
|
+
return /* @__PURE__ */ i(y, {
|
|
128
|
+
ref: a,
|
|
129
|
+
"aria-label": e ?? s.paginationPrevious,
|
|
130
|
+
...r,
|
|
131
|
+
children: n ?? /* @__PURE__ */ i(o, {
|
|
127
132
|
"aria-hidden": "true",
|
|
128
133
|
weight: "bold"
|
|
129
134
|
})
|
|
130
135
|
});
|
|
131
|
-
}),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
}), S = r(function({ "aria-label": e, children: n, ...r }, a) {
|
|
137
|
+
let o = t();
|
|
138
|
+
return /* @__PURE__ */ i(y, {
|
|
139
|
+
ref: a,
|
|
140
|
+
"aria-label": e ?? o.paginationNext,
|
|
141
|
+
...r,
|
|
142
|
+
children: n ?? /* @__PURE__ */ i(s, {
|
|
137
143
|
"aria-hidden": "true",
|
|
138
144
|
weight: "bold"
|
|
139
145
|
})
|
|
140
146
|
});
|
|
141
|
-
}),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
}), C = r(function({ "aria-label": n, children: r, className: o, ...s }, l) {
|
|
148
|
+
let u = t();
|
|
149
|
+
return /* @__PURE__ */ a("span", {
|
|
150
|
+
ref: l,
|
|
151
|
+
className: e("lyds-pagination__ellipsis", o),
|
|
152
|
+
...s,
|
|
153
|
+
children: [r ? /* @__PURE__ */ i("span", {
|
|
147
154
|
"aria-hidden": "true",
|
|
148
|
-
children:
|
|
149
|
-
}) : /* @__PURE__ */
|
|
155
|
+
children: r
|
|
156
|
+
}) : /* @__PURE__ */ i(c, {
|
|
150
157
|
"aria-hidden": "true",
|
|
151
158
|
weight: "bold"
|
|
152
|
-
}), /* @__PURE__ */
|
|
159
|
+
}), /* @__PURE__ */ i("span", {
|
|
153
160
|
className: "lyds-sr-only",
|
|
154
|
-
children:
|
|
161
|
+
children: n ?? u.paginationMore
|
|
155
162
|
})]
|
|
156
163
|
});
|
|
157
164
|
});
|
|
158
165
|
//#endregion
|
|
159
|
-
export {
|
|
166
|
+
export { l as Breadcrumb, h as BreadcrumbEllipsis, d as BreadcrumbItem, f as BreadcrumbLink, u as BreadcrumbList, p as BreadcrumbPage, m as BreadcrumbSeparator, g as Pagination, b as PaginationButton, C as PaginationEllipsis, v as PaginationItem, y as PaginationLink, _ as PaginationList, S as PaginationNext, x as PaginationPrevious };
|
|
160
167
|
|
|
161
168
|
//# sourceMappingURL=breadcrumb-pagination.js.map
|
|
@@ -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 \"./utils.js\";\n\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\treturn <nav ref={ref} aria-label={label} 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(\n\t{ \"aria-label\": ariaLabel = \"更多頁面\", className, children, ...props },\n\tref\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}</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\treturn <nav ref={ref} aria-label={label} 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\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel} {...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\treturn (\n\t\t<PaginationLink ref={ref} aria-label={ariaLabel} {...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(\n\t{ \"aria-label\": ariaLabel = \"更多頁面\", children, className, ...props },\n\tref\n) {\n\treturn (\n\t\t<span ref={ref} className={cx(\"lyds-pagination__ellipsis\", className)} {...props}>\n\t\t\t{children ? <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3C;;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,EAAE,cAAW,GAAG,KAAS,GAAK;CAC9I,OAAO,kBAAC,MAAD;EAAS;EAAK,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Y;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"}
|
|
@@ -33,3 +33,29 @@ export declare const CommandPaletteEmpty: import('react').ForwardRefExoticCompon
|
|
|
33
33
|
export declare const CommandPaletteSeparator: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ComboboxSeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
34
34
|
export declare const CommandPaletteStatus: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteStatusProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
35
35
|
export declare const CommandPaletteShortcut: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
36
|
+
/**
|
|
37
|
+
* Every component built on a context root also exposes its parts as a namespace, so composing one
|
|
38
|
+
* reads the same way as composing a Dialog or a Select.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CommandPaletteNamespace: typeof CommandPalette & {
|
|
41
|
+
Backdrop: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogBackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
42
|
+
Close: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogCloseProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
Description: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogDescriptionProps, "ref"> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
44
|
+
Empty: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteEmptyProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
45
|
+
Group: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
46
|
+
GroupLabel: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
47
|
+
Input: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteInputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
48
|
+
Item: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ComboboxItemProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
49
|
+
ItemIndicator: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ComboboxItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
50
|
+
Label: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ComboboxLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
51
|
+
List: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
|
+
Popup: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
53
|
+
Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
54
|
+
Root: typeof CommandPalette;
|
|
55
|
+
Separator: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ComboboxSeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
56
|
+
Shortcut: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
57
|
+
Status: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AutocompleteStatusProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
58
|
+
Title: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogTitleProps, "ref"> & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
59
|
+
Trigger: import('react').ForwardRefExoticComponent<Omit<BaseDialog.Trigger.Props<unknown>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
60
|
+
Viewport: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogViewportProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
61
|
+
};
|