@linyao.tw/ui 0.0.0-snapshot.07df57

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.
Files changed (169) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +85 -0
  3. package/dist/components/date-time/calendar.d.ts +20 -0
  4. package/dist/components/date-time/calendar.js +102 -0
  5. package/dist/components/date-time/calendar.js.map +1 -0
  6. package/dist/components/date-time/date-field.d.ts +11 -0
  7. package/dist/components/date-time/date-field.js +44 -0
  8. package/dist/components/date-time/date-field.js.map +1 -0
  9. package/dist/components/date-time/date-picker.d.ts +28 -0
  10. package/dist/components/date-time/date-picker.js +74 -0
  11. package/dist/components/date-time/date-picker.js.map +1 -0
  12. package/dist/components/date-time/date-range-picker.d.ts +11 -0
  13. package/dist/components/date-time/date-range-picker.js +79 -0
  14. package/dist/components/date-time/date-range-picker.js.map +1 -0
  15. package/dist/components/date-time/date-types.d.ts +110 -0
  16. package/dist/components/date-time/index.d.ts +8 -0
  17. package/dist/components/date-time/index.js +8 -0
  18. package/dist/components/date-time/shared.d.ts +25 -0
  19. package/dist/components/date-time/shared.js +53 -0
  20. package/dist/components/date-time/shared.js.map +1 -0
  21. package/dist/components/date-time/time-field.d.ts +13 -0
  22. package/dist/components/date-time/time-field.js +52 -0
  23. package/dist/components/date-time/time-field.js.map +1 -0
  24. package/dist/components/feedback/alert.d.ts +21 -0
  25. package/dist/components/feedback/alert.js +44 -0
  26. package/dist/components/feedback/alert.js.map +1 -0
  27. package/dist/components/feedback/banner.d.ts +8 -0
  28. package/dist/components/feedback/banner.js +20 -0
  29. package/dist/components/feedback/banner.js.map +1 -0
  30. package/dist/components/feedback/empty-state.d.ts +12 -0
  31. package/dist/components/feedback/empty-state.js +48 -0
  32. package/dist/components/feedback/empty-state.js.map +1 -0
  33. package/dist/components/feedback/feedback.module.js +42 -0
  34. package/dist/components/feedback/feedback.module.js.map +1 -0
  35. package/dist/components/feedback/feedback.types.d.ts +8 -0
  36. package/dist/components/feedback/feedback.types.js +24 -0
  37. package/dist/components/feedback/feedback.types.js.map +1 -0
  38. package/dist/components/feedback/index.d.ts +9 -0
  39. package/dist/components/feedback/meter.d.ts +12 -0
  40. package/dist/components/feedback/meter.js +28 -0
  41. package/dist/components/feedback/meter.js.map +1 -0
  42. package/dist/components/feedback/progress.d.ts +12 -0
  43. package/dist/components/feedback/progress.js +28 -0
  44. package/dist/components/feedback/progress.js.map +1 -0
  45. package/dist/components/feedback/skeleton.d.ts +5 -0
  46. package/dist/components/feedback/skeleton.js +18 -0
  47. package/dist/components/feedback/skeleton.js.map +1 -0
  48. package/dist/components/feedback/spinner.d.ts +23 -0
  49. package/dist/components/feedback/spinner.js +35 -0
  50. package/dist/components/feedback/spinner.js.map +1 -0
  51. package/dist/components/feedback/toast.d.ts +33 -0
  52. package/dist/components/feedback/toast.js +76 -0
  53. package/dist/components/feedback/toast.js.map +1 -0
  54. package/dist/components/forms/CodeField.d.ts +23 -0
  55. package/dist/components/forms/CodeField.js +63 -0
  56. package/dist/components/forms/CodeField.js.map +1 -0
  57. package/dist/components/forms/FileUpload.d.ts +34 -0
  58. package/dist/components/forms/FileUpload.js +319 -0
  59. package/dist/components/forms/FileUpload.js.map +1 -0
  60. package/dist/components/forms/Input.d.ts +14 -0
  61. package/dist/components/forms/Input.js +33 -0
  62. package/dist/components/forms/Input.js.map +1 -0
  63. package/dist/components/forms/NumberField.d.ts +15 -0
  64. package/dist/components/forms/NumberField.js +71 -0
  65. package/dist/components/forms/NumberField.js.map +1 -0
  66. package/dist/components/forms/OTPField.d.ts +15 -0
  67. package/dist/components/forms/OTPField.js +54 -0
  68. package/dist/components/forms/OTPField.js.map +1 -0
  69. package/dist/components/forms/TextField.d.ts +61 -0
  70. package/dist/components/forms/TextField.js +199 -0
  71. package/dist/components/forms/TextField.js.map +1 -0
  72. package/dist/components/forms/index.d.ts +7 -0
  73. package/dist/components/forms/internal.d.ts +33 -0
  74. package/dist/components/forms/internal.js +61 -0
  75. package/dist/components/forms/internal.js.map +1 -0
  76. package/dist/components/foundations/Avatar.d.ts +33 -0
  77. package/dist/components/foundations/Avatar.js +45 -0
  78. package/dist/components/foundations/Avatar.js.map +1 -0
  79. package/dist/components/foundations/Badge.d.ts +15 -0
  80. package/dist/components/foundations/Badge.js +32 -0
  81. package/dist/components/foundations/Badge.js.map +1 -0
  82. package/dist/components/foundations/Button.d.ts +18 -0
  83. package/dist/components/foundations/Button.js +47 -0
  84. package/dist/components/foundations/Button.js.map +1 -0
  85. package/dist/components/foundations/Card.d.ts +47 -0
  86. package/dist/components/foundations/Card.js +57 -0
  87. package/dist/components/foundations/Card.js.map +1 -0
  88. package/dist/components/foundations/IconButton.d.ts +25 -0
  89. package/dist/components/foundations/IconButton.js +19 -0
  90. package/dist/components/foundations/IconButton.js.map +1 -0
  91. package/dist/components/foundations/Link.d.ts +19 -0
  92. package/dist/components/foundations/Link.js +40 -0
  93. package/dist/components/foundations/Link.js.map +1 -0
  94. package/dist/components/foundations/ListCell.d.ts +68 -0
  95. package/dist/components/foundations/ListCell.js +105 -0
  96. package/dist/components/foundations/ListCell.js.map +1 -0
  97. package/dist/components/foundations/SectionHeading.d.ts +17 -0
  98. package/dist/components/foundations/SectionHeading.js +50 -0
  99. package/dist/components/foundations/SectionHeading.js.map +1 -0
  100. package/dist/components/foundations/Separator.d.ts +11 -0
  101. package/dist/components/foundations/Separator.js +21 -0
  102. package/dist/components/foundations/Separator.js.map +1 -0
  103. package/dist/components/foundations/index.d.ts +9 -0
  104. package/dist/components/foundations/shared.d.ts +5 -0
  105. package/dist/components/foundations/shared.js +8 -0
  106. package/dist/components/foundations/shared.js.map +1 -0
  107. package/dist/components/navigation-data/breadcrumb-pagination.d.ts +34 -0
  108. package/dist/components/navigation-data/breadcrumb-pagination.js +161 -0
  109. package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -0
  110. package/dist/components/navigation-data/command-palette.d.ts +35 -0
  111. package/dist/components/navigation-data/command-palette.js +151 -0
  112. package/dist/components/navigation-data/command-palette.js.map +1 -0
  113. package/dist/components/navigation-data/header-tab-bar.d.ts +23 -0
  114. package/dist/components/navigation-data/header-tab-bar.js +102 -0
  115. package/dist/components/navigation-data/header-tab-bar.js.map +1 -0
  116. package/dist/components/navigation-data/index.d.ts +7 -0
  117. package/dist/components/navigation-data/menubar-toolbar.d.ts +26 -0
  118. package/dist/components/navigation-data/menubar-toolbar.js +161 -0
  119. package/dist/components/navigation-data/menubar-toolbar.js.map +1 -0
  120. package/dist/components/navigation-data/navigation-menu.d.ts +14 -0
  121. package/dist/components/navigation-data/navigation-menu.js +87 -0
  122. package/dist/components/navigation-data/navigation-menu.js.map +1 -0
  123. package/dist/components/navigation-data/scroll-area.d.ts +6 -0
  124. package/dist/components/navigation-data/scroll-area.js +52 -0
  125. package/dist/components/navigation-data/scroll-area.js.map +1 -0
  126. package/dist/components/navigation-data/table-collection.d.ts +61 -0
  127. package/dist/components/navigation-data/table-collection.js +181 -0
  128. package/dist/components/navigation-data/table-collection.js.map +1 -0
  129. package/dist/components/navigation-data/utils.d.ts +2 -0
  130. package/dist/components/navigation-data/utils.js +11 -0
  131. package/dist/components/navigation-data/utils.js.map +1 -0
  132. package/dist/components/overlays/class-names.d.ts +6 -0
  133. package/dist/components/overlays/class-names.js +11 -0
  134. package/dist/components/overlays/class-names.js.map +1 -0
  135. package/dist/components/overlays/dialog.d.ts +98 -0
  136. package/dist/components/overlays/dialog.js +158 -0
  137. package/dist/components/overlays/dialog.js.map +1 -0
  138. package/dist/components/overlays/disclosure.d.ts +40 -0
  139. package/dist/components/overlays/disclosure.js +138 -0
  140. package/dist/components/overlays/disclosure.js.map +1 -0
  141. package/dist/components/overlays/drawer.d.ts +88 -0
  142. package/dist/components/overlays/drawer.js +192 -0
  143. package/dist/components/overlays/drawer.js.map +1 -0
  144. package/dist/components/overlays/floating.d.ts +83 -0
  145. package/dist/components/overlays/floating.js +220 -0
  146. package/dist/components/overlays/floating.js.map +1 -0
  147. package/dist/components/overlays/index.d.ts +4 -0
  148. package/dist/components/selection/classnames.d.ts +4 -0
  149. package/dist/components/selection/classnames.js +14 -0
  150. package/dist/components/selection/classnames.js.map +1 -0
  151. package/dist/components/selection/combobox.d.ts +118 -0
  152. package/dist/components/selection/combobox.js +284 -0
  153. package/dist/components/selection/combobox.js.map +1 -0
  154. package/dist/components/selection/controls.d.ts +65 -0
  155. package/dist/components/selection/controls.js +171 -0
  156. package/dist/components/selection/controls.js.map +1 -0
  157. package/dist/components/selection/index.d.ts +7 -0
  158. package/dist/components/selection/menu.d.ts +87 -0
  159. package/dist/components/selection/menu.js +157 -0
  160. package/dist/components/selection/menu.js.map +1 -0
  161. package/dist/components/selection/select.d.ts +55 -0
  162. package/dist/components/selection/select.js +138 -0
  163. package/dist/components/selection/select.js.map +1 -0
  164. package/dist/components/selection/selection.module.js +51 -0
  165. package/dist/components/selection/selection.module.js.map +1 -0
  166. package/dist/index.d.ts +7 -0
  167. package/dist/index.js +52 -0
  168. package/dist/styles.css +2 -0
  169. package/package.json +74 -0
@@ -0,0 +1,47 @@
1
+ import { ComponentRenderProp, ElementProps } from './shared.js';
2
+ import * as React from "react";
3
+ export type CardVariant = "material" | "elevated" | "inset" | "outline" | "cloud";
4
+ export type CardSize = "sm" | "md" | "lg";
5
+ export interface CardState extends Record<string, unknown> {
6
+ size: CardSize;
7
+ variant: CardVariant;
8
+ }
9
+ export interface CardProps extends Omit<ElementProps<"div">, "children"> {
10
+ children: React.ReactNode;
11
+ variant?: CardVariant;
12
+ size?: CardSize;
13
+ render?: ComponentRenderProp<CardState>;
14
+ }
15
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
16
+ export type CloudBoxProps = Omit<CardProps, "variant">;
17
+ export declare const CloudBox: React.ForwardRefExoticComponent<CloudBoxProps & React.RefAttributes<HTMLDivElement>>;
18
+ type CardSlotProps<ElementType extends React.ElementType> = Omit<ElementProps<ElementType>, "children"> & {
19
+ children: React.ReactNode;
20
+ render?: ComponentRenderProp<Record<string, unknown>>;
21
+ };
22
+ export type CardHeaderProps = CardSlotProps<"div">;
23
+ export declare const CardHeader: React.ForwardRefExoticComponent<Omit<ElementProps<"div">, "children"> & {
24
+ children: React.ReactNode;
25
+ render?: ComponentRenderProp<Record<string, unknown>>;
26
+ } & React.RefAttributes<HTMLDivElement>>;
27
+ export type CardTitleProps = CardSlotProps<"h3">;
28
+ export declare const CardTitle: React.ForwardRefExoticComponent<Omit<ElementProps<"h3">, "children"> & {
29
+ children: React.ReactNode;
30
+ render?: ComponentRenderProp<Record<string, unknown>>;
31
+ } & React.RefAttributes<HTMLHeadingElement>>;
32
+ export type CardDescriptionProps = CardSlotProps<"p">;
33
+ export declare const CardDescription: React.ForwardRefExoticComponent<Omit<ElementProps<"p">, "children"> & {
34
+ children: React.ReactNode;
35
+ render?: ComponentRenderProp<Record<string, unknown>>;
36
+ } & React.RefAttributes<HTMLParagraphElement>>;
37
+ export type CardBodyProps = CardSlotProps<"div">;
38
+ export declare const CardBody: React.ForwardRefExoticComponent<Omit<ElementProps<"div">, "children"> & {
39
+ children: React.ReactNode;
40
+ render?: ComponentRenderProp<Record<string, unknown>>;
41
+ } & React.RefAttributes<HTMLDivElement>>;
42
+ export type CardFooterProps = CardSlotProps<"div">;
43
+ export declare const CardFooter: React.ForwardRefExoticComponent<Omit<ElementProps<"div">, "children"> & {
44
+ children: React.ReactNode;
45
+ render?: ComponentRenderProp<Record<string, unknown>>;
46
+ } & React.RefAttributes<HTMLDivElement>>;
47
+ export {};
@@ -0,0 +1,57 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import * as t from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { useRender as r } from "@base-ui/react/use-render";
5
+ //#region src/components/foundations/Card.tsx
6
+ var i = t.forwardRef(function({ children: t, variant: n = "material", size: i = "md", render: a, className: o, ...s }, c) {
7
+ return r({
8
+ defaultTagName: "div",
9
+ ref: c,
10
+ render: a,
11
+ state: {
12
+ size: i,
13
+ variant: n
14
+ },
15
+ props: {
16
+ ...s,
17
+ children: t,
18
+ className: e("lyds-card", o)
19
+ }
20
+ });
21
+ });
22
+ i.displayName = "Card";
23
+ var a = t.forwardRef(function(e, t) {
24
+ return /* @__PURE__ */ n(i, {
25
+ ...e,
26
+ ref: t,
27
+ variant: "cloud"
28
+ });
29
+ });
30
+ a.displayName = "CloudBox";
31
+ function o(t, n, i, a, o, s, c) {
32
+ return r({
33
+ defaultTagName: t,
34
+ ref: c,
35
+ render: a,
36
+ props: {
37
+ ...s,
38
+ children: i,
39
+ className: e(`lyds-card__${n}`, o)
40
+ }
41
+ });
42
+ }
43
+ var s = t.forwardRef(function({ children: e, render: t, className: n, ...r }, i) {
44
+ return o("div", "header", e, t, n, r, i);
45
+ }), c = t.forwardRef(function({ children: e, render: t, className: n, ...r }, i) {
46
+ return o("h3", "title", e, t, n, r, i);
47
+ }), l = t.forwardRef(function({ children: e, render: t, className: n, ...r }, i) {
48
+ return o("p", "description", e, t, n, r, i);
49
+ }), u = t.forwardRef(function({ children: e, render: t, className: n, ...r }, i) {
50
+ return o("div", "body", e, t, n, r, i);
51
+ }), d = t.forwardRef(function({ children: e, render: t, className: n, ...r }, i) {
52
+ return o("div", "footer", e, t, n, r, i);
53
+ });
54
+ //#endregion
55
+ export { i as Card, u as CardBody, l as CardDescription, d as CardFooter, s as CardHeader, c as CardTitle, a as CloudBox };
56
+
57
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","names":[],"sources":["../../../src/components/foundations/Card.tsx"],"sourcesContent":["import { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nimport { type ComponentRenderProp, type ElementProps, mergeClassNames } from \"./shared\";\n\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: mergeClassNames(\"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: mergeClassNames(`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\">;\nexport const CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(function CardTitle({ children, render, className, ...props }, ref) {\n\treturn useCardSlot(\"h3\", \"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,EAAgB,aAAa,CAAS;EAClD;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,EAAgB,cAAc,KAAY,CAAS;EAC/D;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,GAGY,IAAY,EAAM,WAA+C,SAAmB,EAAE,aAAU,WAAQ,cAAW,GAAG,KAAS,GAAK;CAChJ,OAAO,EAAY,MAAM,SAAS,GAAU,GAAQ,GAAW,GAAO,CAAG;AAC1E,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"}
@@ -0,0 +1,25 @@
1
+ import { ButtonProps } from './Button.js';
2
+ 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
+ type IconButtonBaseProps = Omit<ButtonProps, "aria-label" | "aria-labelledby" | "children" | "endIcon" | "startIcon"> & {
11
+ children: React.ReactNode;
12
+ };
13
+ export type IconButtonProps = IconButtonBaseProps & AccessibleName;
14
+ export declare const IconButton: React.ForwardRefExoticComponent<(Omit<Omit<ButtonProps, "aria-label" | "aria-labelledby" | "children" | "startIcon" | "endIcon"> & {
15
+ children: React.ReactNode;
16
+ } & {
17
+ "aria-label": string;
18
+ "aria-labelledby"?: string;
19
+ }, "ref"> | Omit<Omit<ButtonProps, "aria-label" | "aria-labelledby" | "children" | "startIcon" | "endIcon"> & {
20
+ children: React.ReactNode;
21
+ } & {
22
+ "aria-label"?: string;
23
+ "aria-labelledby": string;
24
+ }, "ref">) & React.RefAttributes<HTMLElement>>;
25
+ export {};
@@ -0,0 +1,19 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import { Button as t } from "./Button.js";
3
+ import * as n from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region src/components/foundations/IconButton.tsx
6
+ var i = n.forwardRef(function({ children: n, className: i, loading: a = !1, ...o }, s) {
7
+ return /* @__PURE__ */ r(t, {
8
+ ...o,
9
+ ref: s,
10
+ className: e("lyds-icon-button", i),
11
+ loading: a,
12
+ children: a ? null : n
13
+ });
14
+ });
15
+ i.displayName = "IconButton";
16
+ //#endregion
17
+ export { i as IconButton };
18
+
19
+ //# sourceMappingURL=IconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.js","names":[],"sources":["../../../src/components/foundations/IconButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Button, type ButtonProps } from \"./Button\";\nimport { mergeClassNames } from \"./shared\";\n\ntype AccessibleName =\n\t| {\n\t\t\t\"aria-label\": string;\n\t\t\t\"aria-labelledby\"?: string;\n\t }\n\t| {\n\t\t\t\"aria-label\"?: string;\n\t\t\t\"aria-labelledby\": string;\n\t };\n\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={mergeClassNames(\"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":";;;;;AAoBA,IAAa,IAAa,EAAM,WAAyC,SAAoB,EAAE,aAAU,cAAW,aAAU,IAAO,GAAG,KAAS,GAAK;CACrJ,OACC,kBAAC,GAAD;EAAQ,GAAI;EAAY;EAAK,WAAW,EAAgB,oBAAoB,CAAS;EAAY;EAC/F,UAAA,IAAU,OAAO;CACX,CAAA;AAEV,CAAC;AAED,EAAW,cAAc"}
@@ -0,0 +1,19 @@
1
+ import { ComponentRenderProp, ElementProps } from './shared.js';
2
+ import * as React from "react";
3
+ export type LinkVariant = "default" | "accent" | "subtle";
4
+ export type LinkSize = "sm" | "md" | "lg";
5
+ export interface LinkState extends Record<string, unknown> {
6
+ disabled: boolean;
7
+ external: boolean;
8
+ size: LinkSize;
9
+ variant: LinkVariant;
10
+ }
11
+ export interface LinkProps extends Omit<ElementProps<"a">, "children"> {
12
+ children: React.ReactNode;
13
+ variant?: LinkVariant;
14
+ size?: LinkSize;
15
+ disabled?: boolean;
16
+ external?: boolean;
17
+ render?: ComponentRenderProp<LinkState>;
18
+ }
19
+ export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,40 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import * as t from "react";
3
+ import { useRender as n } from "@base-ui/react/use-render";
4
+ //#region src/components/foundations/Link.tsx
5
+ var r = t.forwardRef(function({ children: t, variant: r = "default", size: i = "md", disabled: a = !1, external: o = !1, render: s, className: c, href: l, target: u, rel: d, onClick: f, ...p }, m) {
6
+ let h = {
7
+ disabled: a,
8
+ external: o,
9
+ size: i,
10
+ variant: r
11
+ }, g = u === "_blank" && !d ? "noopener noreferrer" : d;
12
+ return n({
13
+ defaultTagName: "a",
14
+ ref: m,
15
+ render: a ? void 0 : s,
16
+ state: h,
17
+ props: {
18
+ ...p,
19
+ children: t,
20
+ href: a ? void 0 : l,
21
+ target: u,
22
+ rel: g,
23
+ "aria-disabled": a || void 0,
24
+ tabIndex: a ? -1 : p.tabIndex,
25
+ className: e("lyds-link", c),
26
+ onClick: (e) => {
27
+ if (a) {
28
+ e.preventDefault(), e.stopPropagation();
29
+ return;
30
+ }
31
+ f?.(e);
32
+ }
33
+ }
34
+ });
35
+ });
36
+ r.displayName = "Link";
37
+ //#endregion
38
+ export { r as Link };
39
+
40
+ //# sourceMappingURL=Link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.js","names":[],"sources":["../../../src/components/foundations/Link.tsx"],"sourcesContent":["import { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nimport { type ComponentRenderProp, type ElementProps, mergeClassNames } from \"./shared\";\n\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 state: LinkState = { disabled, external, size, variant };\n\tconst secureRel = target === \"_blank\" && !rel ? \"noopener noreferrer\" : rel;\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,\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\ttabIndex: disabled ? -1 : props.tabIndex,\n\t\t\tclassName: mergeClassNames(\"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,IAAmB;EAAE;EAAU;EAAU;EAAM;CAAQ,GACvD,IAAY,MAAW,YAAY,CAAC,IAAM,wBAAwB;CAExE,OAAO,EAAwC;EAC9C,gBAAgB;EAChB;EAGA,QAAQ,IAAW,KAAA,IAAY;EAC/B;EACA,OAAO;GACN,GAAG;GACH;GACA,MAAM,IAAW,KAAA,IAAY;GAC7B;GACA,KAAK;GACL,iBAAiB,KAAY,KAAA;GAC7B,UAAU,IAAW,KAAK,EAAM;GAChC,WAAW,EAAgB,aAAa,CAAS;GACjD,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"}
@@ -0,0 +1,68 @@
1
+ import { ComponentRenderProp, ElementProps } from './shared.js';
2
+ import * as React from "react";
3
+ export type ListCellVariant = "default" | "inset";
4
+ export type ListCellSize = "sm" | "md" | "lg";
5
+ export type ListCellCurrentSemantics = "page" | "step" | "location" | "date" | "time";
6
+ export interface ListCellState extends Record<string, unknown> {
7
+ disabled: boolean;
8
+ interactive: boolean;
9
+ selected: boolean;
10
+ size: ListCellSize;
11
+ variant: ListCellVariant;
12
+ }
13
+ type ListCellSelectionProps = {
14
+ selected?: never;
15
+ selectionSemantics?: never;
16
+ } | {
17
+ selected: boolean;
18
+ selectionSemantics: ListCellCurrentSemantics;
19
+ } | {
20
+ selected: boolean;
21
+ selectionSemantics: "selected";
22
+ role: "gridcell" | "option" | "row" | "tab" | "treeitem";
23
+ };
24
+ export type ListCellProps = Omit<ElementProps<"div">, "children" | "title"> & ListCellSelectionProps & {
25
+ children?: React.ReactNode;
26
+ leading?: React.ReactNode;
27
+ title?: React.ReactNode;
28
+ description?: React.ReactNode;
29
+ metadata?: React.ReactNode;
30
+ trailing?: React.ReactNode;
31
+ action?: ListCellActionProps;
32
+ actionRef?: React.Ref<HTMLElement>;
33
+ variant?: ListCellVariant;
34
+ size?: ListCellSize;
35
+ disabled?: boolean;
36
+ render?: ComponentRenderProp<ListCellState>;
37
+ };
38
+ type AccessibleName = {
39
+ "aria-label": string;
40
+ "aria-labelledby"?: string;
41
+ } | {
42
+ "aria-label"?: string;
43
+ "aria-labelledby": string;
44
+ };
45
+ type ListCellLinkActionProps = Omit<ElementProps<"a">, "aria-label" | "aria-labelledby" | "children" | "className"> & {
46
+ href: string;
47
+ className?: string;
48
+ disabled?: boolean;
49
+ };
50
+ type ListCellButtonActionProps = Omit<ElementProps<"button">, "aria-label" | "aria-labelledby" | "children" | "className" | "href"> & {
51
+ href?: never;
52
+ className?: string;
53
+ disabled?: boolean;
54
+ };
55
+ export type ListCellActionProps = AccessibleName & (ListCellLinkActionProps | ListCellButtonActionProps);
56
+ export declare const ListCellAction: React.ForwardRefExoticComponent<ListCellActionProps & React.RefAttributes<HTMLElement>>;
57
+ export declare const ListCell: React.ForwardRefExoticComponent<ListCellProps & React.RefAttributes<HTMLElement>>;
58
+ interface ListCellSlotProps extends Omit<ElementProps<"span">, "children"> {
59
+ children: React.ReactNode;
60
+ render?: ComponentRenderProp<Record<string, unknown>>;
61
+ }
62
+ export declare const ListCellLeading: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
63
+ export declare const ListCellContent: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
64
+ export declare const ListCellTitle: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
65
+ export declare const ListCellDescription: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
66
+ export declare const ListCellMetadata: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
67
+ export declare const ListCellTrailing: React.ForwardRefExoticComponent<ListCellSlotProps & React.RefAttributes<HTMLElement>>;
68
+ export {};
@@ -0,0 +1,105 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import * as t from "react";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { useRender as a } from "@base-ui/react/use-render";
5
+ //#region src/components/foundations/ListCell.tsx
6
+ var o = t.createContext({
7
+ current: void 0,
8
+ disabled: !1
9
+ }), s = t.forwardRef(function(n, i) {
10
+ let a = t.useContext(o), s = a.disabled || n.disabled === !0;
11
+ if ("href" in n && n.href !== void 0) {
12
+ let { className: t, href: o, onClick: c, rel: l, target: u, ...d } = n;
13
+ return /* @__PURE__ */ r("a", {
14
+ ...d,
15
+ ref: i,
16
+ href: s ? void 0 : o,
17
+ target: u,
18
+ rel: u === "_blank" && !l ? "noopener noreferrer" : l,
19
+ "aria-current": n["aria-current"] ?? a.current,
20
+ "aria-disabled": s || void 0,
21
+ tabIndex: s ? -1 : d.tabIndex,
22
+ className: e("lyds-list-cell__action", t),
23
+ onClick: (e) => {
24
+ if (s) {
25
+ e.preventDefault();
26
+ return;
27
+ }
28
+ c?.(e);
29
+ },
30
+ children: /* @__PURE__ */ r("span", {
31
+ className: "lyds-sr-only",
32
+ children: n["aria-label"] ?? ""
33
+ })
34
+ });
35
+ }
36
+ let { className: c, onClick: l, type: u, ...d } = n;
37
+ return /* @__PURE__ */ r("button", {
38
+ ...d,
39
+ ref: i,
40
+ type: u ?? "button",
41
+ disabled: s,
42
+ "aria-current": n["aria-current"] ?? a.current,
43
+ className: e("lyds-list-cell__action", c),
44
+ onClick: l
45
+ });
46
+ });
47
+ s.displayName = "ListCellAction";
48
+ var c = t.forwardRef(function({ children: t, leading: c, title: l, description: g, metadata: _, trailing: v, action: y, actionRef: b, variant: x = "default", size: S = "md", selected: C = !1, selectionSemantics: w, disabled: T = !1, render: E, className: D, ...O }, k) {
49
+ let A = {
50
+ disabled: T,
51
+ interactive: y != null,
52
+ selected: C,
53
+ size: S,
54
+ variant: x
55
+ }, j = t ?? /* @__PURE__ */ i(n, { children: [
56
+ c == null ? null : /* @__PURE__ */ r(u, { children: c }),
57
+ /* @__PURE__ */ i(d, { children: [l == null ? null : /* @__PURE__ */ r(f, { children: l }), g == null ? null : /* @__PURE__ */ r(p, { children: g })] }),
58
+ _ == null ? null : /* @__PURE__ */ r(m, { children: _ }),
59
+ v == null ? null : /* @__PURE__ */ r(h, { children: v })
60
+ ] }), M = w && w !== "selected" ? w : void 0, N = M ? C ? M : !1 : void 0;
61
+ return a({
62
+ defaultTagName: "div",
63
+ ref: k,
64
+ render: E,
65
+ state: A,
66
+ props: {
67
+ ...O,
68
+ className: e("lyds-list-cell", D),
69
+ "aria-current": !y && N !== void 0 ? N : O["aria-current"],
70
+ "aria-disabled": !y && T ? !0 : O["aria-disabled"],
71
+ "aria-selected": w === "selected" ? C : O["aria-selected"],
72
+ children: /* @__PURE__ */ i(o.Provider, {
73
+ value: {
74
+ current: N,
75
+ disabled: T
76
+ },
77
+ children: [y ? /* @__PURE__ */ r(s, {
78
+ ref: b,
79
+ ...y
80
+ }) : null, j]
81
+ })
82
+ }
83
+ });
84
+ });
85
+ c.displayName = "ListCell";
86
+ function l(n) {
87
+ let r = t.forwardRef(function({ children: t, render: r, className: i, ...o }, s) {
88
+ return a({
89
+ defaultTagName: "span",
90
+ ref: s,
91
+ render: r,
92
+ props: {
93
+ ...o,
94
+ children: t,
95
+ className: e(`lyds-list-cell__${n}`, i)
96
+ }
97
+ });
98
+ });
99
+ return r.displayName = `ListCell${n[0]?.toUpperCase() ?? ""}${n.slice(1)}`, r;
100
+ }
101
+ var u = l("leading"), d = l("content"), f = l("title"), p = l("description"), m = l("metadata"), h = l("trailing");
102
+ //#endregion
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
+
105
+ //# sourceMappingURL=ListCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListCell.js","names":[],"sources":["../../../src/components/foundations/ListCell.tsx"],"sourcesContent":["import { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nimport { type ComponentRenderProp, type ElementProps, mergeClassNames } from \"./shared\";\n\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 AccessibleName =\n\t| {\n\t\t\t\"aria-label\": string;\n\t\t\t\"aria-labelledby\"?: string;\n\t }\n\t| {\n\t\t\t\"aria-label\"?: string;\n\t\t\t\"aria-labelledby\": string;\n\t };\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={mergeClassNames(\"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={mergeClassNames(\"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: mergeClassNames(\"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: mergeClassNames(`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":"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"}
@@ -0,0 +1,17 @@
1
+ import { ComponentRenderProp, ElementProps } from './shared.js';
2
+ import * as React from "react";
3
+ export type SectionHeadingSize = "sm" | "md" | "lg";
4
+ export type SectionHeadingLevel = 2 | 3 | 4 | 5 | 6;
5
+ export interface SectionHeadingState extends Record<string, unknown> {
6
+ size: SectionHeadingSize;
7
+ }
8
+ export interface SectionHeadingProps extends Omit<ElementProps<"header">, "children" | "title"> {
9
+ children: React.ReactNode;
10
+ annotation?: React.ReactNode;
11
+ description?: React.ReactNode;
12
+ action?: React.ReactNode;
13
+ level?: SectionHeadingLevel;
14
+ size?: SectionHeadingSize;
15
+ render?: ComponentRenderProp<SectionHeadingState>;
16
+ }
17
+ export declare const SectionHeading: React.ForwardRefExoticComponent<SectionHeadingProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,50 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import * as t from "react";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { useRender as a } from "@base-ui/react/use-render";
5
+ //#region src/components/foundations/SectionHeading.tsx
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
+ let h = `h${l}`;
8
+ return a({
9
+ defaultTagName: "header",
10
+ ref: m,
11
+ render: d,
12
+ state: { size: u },
13
+ props: {
14
+ ...p,
15
+ className: e("lyds-section-heading", f),
16
+ children: /* @__PURE__ */ i(n, { children: [
17
+ /* @__PURE__ */ r("span", {
18
+ className: "lyds-section-heading__rail",
19
+ "aria-hidden": "true"
20
+ }),
21
+ /* @__PURE__ */ i("span", {
22
+ className: "lyds-section-heading__content",
23
+ children: [
24
+ o == null ? null : /* @__PURE__ */ r("span", {
25
+ className: "lyds-section-heading__annotation",
26
+ children: o
27
+ }),
28
+ /* @__PURE__ */ r(h, {
29
+ className: "lyds-section-heading__title",
30
+ children: t
31
+ }),
32
+ s == null ? null : /* @__PURE__ */ r("span", {
33
+ className: "lyds-section-heading__description",
34
+ children: s
35
+ })
36
+ ]
37
+ }),
38
+ c == null ? null : /* @__PURE__ */ r("span", {
39
+ className: "lyds-section-heading__action",
40
+ children: c
41
+ })
42
+ ] })
43
+ }
44
+ });
45
+ });
46
+ o.displayName = "SectionHeading";
47
+ //#endregion
48
+ export { o as SectionHeading };
49
+
50
+ //# sourceMappingURL=SectionHeading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionHeading.js","names":[],"sources":["../../../src/components/foundations/SectionHeading.tsx"],"sourcesContent":["import { useRender } from \"@base-ui/react/use-render\";\nimport * as React from \"react\";\nimport { type ComponentRenderProp, type ElementProps, mergeClassNames } from \"./shared\";\n\nexport type SectionHeadingSize = \"sm\" | \"md\" | \"lg\";\nexport type SectionHeadingLevel = 2 | 3 | 4 | 5 | 6;\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: mergeClassNames(\"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":";;;;;AAqBA,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,EAAgB,wBAAwB,CAAS;GAC5D,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"}
@@ -0,0 +1,11 @@
1
+ import { SeparatorProps as BaseSeparatorProps } from '@base-ui/react/separator';
2
+ import * as React from "react";
3
+ export type SeparatorVariant = "solid" | "technical";
4
+ export type SeparatorSpacing = "none" | "sm" | "md" | "lg";
5
+ export interface SeparatorProps extends Omit<BaseSeparatorProps, "className" | "style"> {
6
+ variant?: SeparatorVariant;
7
+ spacing?: SeparatorSpacing;
8
+ className?: string;
9
+ style?: React.CSSProperties;
10
+ }
11
+ export declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,21 @@
1
+ import { mergeClassNames as e } from "./shared.js";
2
+ import * as t from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { Separator as r } from "@base-ui/react/separator";
5
+ //#region src/components/foundations/Separator.tsx
6
+ var i = t.forwardRef(function({ variant: t = "solid", spacing: i = "md", orientation: a = "horizontal", className: o, style: s, ...c }, l) {
7
+ return /* @__PURE__ */ n(r, {
8
+ ...c,
9
+ ref: l,
10
+ orientation: a,
11
+ "data-variant": t,
12
+ "data-spacing": i,
13
+ className: e("lyds-separator", o),
14
+ style: s
15
+ });
16
+ });
17
+ i.displayName = "Separator";
18
+ //#endregion
19
+ export { i as Separator };
20
+
21
+ //# sourceMappingURL=Separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.js","names":[],"sources":["../../../src/components/foundations/Separator.tsx"],"sourcesContent":["import { Separator as BaseSeparator, type SeparatorProps as BaseSeparatorProps } from \"@base-ui/react/separator\";\nimport * as React from \"react\";\nimport { mergeClassNames } from \"./shared\";\n\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={mergeClassNames(\"lyds-separator\", className)} style={style} />;\n});\n\nSeparator.displayName = \"Separator\";\n"],"mappings":";;;;;AAcA,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,EAAgB,kBAAkB,CAAS;EAAU;CAAQ,CAAA;AAC5L,CAAC;AAED,EAAU,cAAc"}
@@ -0,0 +1,9 @@
1
+ export * from './Avatar.js';
2
+ export * from './Badge.js';
3
+ export * from './Button.js';
4
+ export * from './Card.js';
5
+ export * from './IconButton.js';
6
+ export * from './Link.js';
7
+ export * from './ListCell.js';
8
+ export * from './SectionHeading.js';
9
+ export * from './Separator.js';
@@ -0,0 +1,5 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import type * as React from "react";
3
+ export type ComponentRenderProp<State extends Record<string, unknown>> = useRender.RenderProp<State>;
4
+ export type ElementProps<ElementType extends React.ElementType> = Omit<React.ComponentPropsWithoutRef<ElementType>, "color">;
5
+ export declare function mergeClassNames(...classNames: Array<string | undefined | false>): string;
@@ -0,0 +1,8 @@
1
+ //#region src/components/foundations/shared.ts
2
+ function e(...e) {
3
+ return e.filter(Boolean).join(" ");
4
+ }
5
+ //#endregion
6
+ export { e as mergeClassNames };
7
+
8
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../../../src/components/foundations/shared.ts"],"sourcesContent":["import type { useRender } from \"@base-ui/react/use-render\";\nimport type * as React from \"react\";\n\nexport type ComponentRenderProp<State extends Record<string, unknown>> = useRender.RenderProp<State>;\n\nexport type ElementProps<ElementType extends React.ElementType> = Omit<React.ComponentPropsWithoutRef<ElementType>, \"color\">;\n\nexport function mergeClassNames(...classNames: Array<string | undefined | false>): string {\n\treturn classNames.filter(Boolean).join(\" \");\n}\n"],"mappings":";AAOA,SAAgB,EAAgB,GAAG,GAAuD;CACzF,OAAO,EAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAC3C"}
@@ -0,0 +1,34 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, LiHTMLAttributes, ReactNode } from 'react';
2
+ export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
3
+ /** 麵包屑導覽區域的無障礙名稱。 */
4
+ label?: string;
5
+ }
6
+ export declare const Breadcrumb: import('react').ForwardRefExoticComponent<BreadcrumbProps & import('react').RefAttributes<HTMLElement>>;
7
+ export declare const BreadcrumbList: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLOListElement> & import('react').RefAttributes<HTMLOListElement>>;
8
+ export declare const BreadcrumbItem: import('react').ForwardRefExoticComponent<LiHTMLAttributes<HTMLLIElement> & import('react').RefAttributes<HTMLLIElement>>;
9
+ export declare const BreadcrumbLink: import('react').ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & import('react').RefAttributes<HTMLAnchorElement>>;
10
+ export declare const BreadcrumbPage: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & import('react').RefAttributes<HTMLSpanElement>>;
11
+ export interface BreadcrumbSeparatorProps extends HTMLAttributes<HTMLSpanElement> {
12
+ children?: ReactNode;
13
+ }
14
+ export declare const BreadcrumbSeparator: import('react').ForwardRefExoticComponent<BreadcrumbSeparatorProps & import('react').RefAttributes<HTMLSpanElement>>;
15
+ export declare const BreadcrumbEllipsis: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & import('react').RefAttributes<HTMLSpanElement>>;
16
+ export interface PaginationProps extends HTMLAttributes<HTMLElement> {
17
+ /** 分頁導覽區域的無障礙名稱。 */
18
+ label?: string;
19
+ }
20
+ export declare const Pagination: import('react').ForwardRefExoticComponent<PaginationProps & import('react').RefAttributes<HTMLElement>>;
21
+ export declare const PaginationList: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & import('react').RefAttributes<HTMLUListElement>>;
22
+ export declare const PaginationItem: import('react').ForwardRefExoticComponent<LiHTMLAttributes<HTMLLIElement> & import('react').RefAttributes<HTMLLIElement>>;
23
+ export interface PaginationLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
24
+ current?: boolean;
25
+ disabled?: boolean;
26
+ }
27
+ export declare const PaginationLink: import('react').ForwardRefExoticComponent<PaginationLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
28
+ export interface PaginationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
29
+ current?: boolean;
30
+ }
31
+ export declare const PaginationButton: import('react').ForwardRefExoticComponent<PaginationButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
32
+ export declare const PaginationPrevious: import('react').ForwardRefExoticComponent<PaginationLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
33
+ export declare const PaginationNext: import('react').ForwardRefExoticComponent<PaginationLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
34
+ export declare const PaginationEllipsis: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & import('react').RefAttributes<HTMLSpanElement>>;