@linyao.tw/ui 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +9 -1
  2. package/dist/components/date-time/calendar.js +8 -6
  3. package/dist/components/date-time/calendar.js.map +1 -1
  4. package/dist/components/date-time/date-field.js +10 -8
  5. package/dist/components/date-time/date-field.js.map +1 -1
  6. package/dist/components/date-time/date-picker.js +8 -6
  7. package/dist/components/date-time/date-picker.js.map +1 -1
  8. package/dist/components/date-time/date-range-picker.js +8 -6
  9. package/dist/components/date-time/date-range-picker.js.map +1 -1
  10. package/dist/components/date-time/index.js +1 -1
  11. package/dist/components/date-time/shared.d.ts +0 -1
  12. package/dist/components/date-time/shared.js +7 -9
  13. package/dist/components/date-time/shared.js.map +1 -1
  14. package/dist/components/date-time/time-field.js +8 -6
  15. package/dist/components/date-time/time-field.js.map +1 -1
  16. package/dist/components/feedback/alert.js +35 -34
  17. package/dist/components/feedback/alert.js.map +1 -1
  18. package/dist/components/feedback/banner.js +15 -14
  19. package/dist/components/feedback/banner.js.map +1 -1
  20. package/dist/components/feedback/empty-state.d.ts +2 -1
  21. package/dist/components/feedback/empty-state.js +31 -31
  22. package/dist/components/feedback/empty-state.js.map +1 -1
  23. package/dist/components/feedback/feedback.types.d.ts +0 -1
  24. package/dist/components/feedback/feedback.types.js +3 -5
  25. package/dist/components/feedback/feedback.types.js.map +1 -1
  26. package/dist/components/feedback/index.d.ts +8 -8
  27. package/dist/components/feedback/meter.js +21 -21
  28. package/dist/components/feedback/meter.js.map +1 -1
  29. package/dist/components/feedback/progress.js +21 -21
  30. package/dist/components/feedback/progress.js.map +1 -1
  31. package/dist/components/feedback/skeleton.js +11 -11
  32. package/dist/components/feedback/skeleton.js.map +1 -1
  33. package/dist/components/feedback/spinner.js +25 -25
  34. package/dist/components/feedback/spinner.js.map +1 -1
  35. package/dist/components/feedback/toast.js +23 -21
  36. package/dist/components/feedback/toast.js.map +1 -1
  37. package/dist/components/forms/{CodeField.d.ts → code-field.d.ts} +1 -1
  38. package/dist/components/forms/code-field.js +66 -0
  39. package/dist/components/forms/code-field.js.map +1 -0
  40. package/dist/components/forms/{FileUpload.d.ts → file-upload.d.ts} +1 -1
  41. package/dist/components/forms/{FileUpload.js → file-upload.js} +128 -111
  42. package/dist/components/forms/file-upload.js.map +1 -0
  43. package/dist/components/forms/index.d.ts +6 -6
  44. package/dist/components/forms/{Input.js → input.js} +4 -3
  45. package/dist/components/forms/input.js.map +1 -0
  46. package/dist/components/forms/internal.d.ts +0 -2
  47. package/dist/components/forms/internal.js +22 -25
  48. package/dist/components/forms/internal.js.map +1 -1
  49. package/dist/components/forms/number-field.js +74 -0
  50. package/dist/components/forms/number-field.js.map +1 -0
  51. package/dist/components/forms/otp-field.js +58 -0
  52. package/dist/components/forms/otp-field.js.map +1 -0
  53. package/dist/components/forms/{TextField.d.ts → text-field.d.ts} +5 -0
  54. package/dist/components/forms/text-field.js +201 -0
  55. package/dist/components/forms/text-field.js.map +1 -0
  56. package/dist/components/foundations/{Avatar.js → avatar.js} +13 -10
  57. package/dist/components/foundations/avatar.js.map +1 -0
  58. package/dist/components/foundations/{Badge.d.ts → badge.d.ts} +1 -1
  59. package/dist/components/foundations/{Badge.js → badge.js} +4 -3
  60. package/dist/components/foundations/badge.js.map +1 -0
  61. package/dist/components/foundations/{Button.js → button.js} +4 -3
  62. package/dist/components/foundations/button.js.map +1 -0
  63. package/dist/components/foundations/{Card.d.ts → card.d.ts} +9 -2
  64. package/dist/components/foundations/{Card.js → card.js} +6 -5
  65. package/dist/components/foundations/card.js.map +1 -0
  66. package/dist/components/foundations/{IconButton.d.ts → icon-button.d.ts} +2 -8
  67. package/dist/components/foundations/{IconButton.js → icon-button.js} +5 -4
  68. package/dist/components/foundations/icon-button.js.map +1 -0
  69. package/dist/components/foundations/index.d.ts +9 -9
  70. package/dist/components/foundations/{Link.d.ts → link.d.ts} +1 -1
  71. package/dist/components/foundations/link.js +47 -0
  72. package/dist/components/foundations/link.js.map +1 -0
  73. package/dist/components/foundations/{ListCell.d.ts → list-cell.d.ts} +1 -8
  74. package/dist/components/foundations/{ListCell.js → list-cell.js} +4 -3
  75. package/dist/components/foundations/list-cell.js.map +1 -0
  76. package/dist/components/foundations/{SectionHeading.d.ts → section-heading.d.ts} +5 -2
  77. package/dist/components/foundations/{SectionHeading.js → section-heading.js} +4 -3
  78. package/dist/components/foundations/section-heading.js.map +1 -0
  79. package/dist/components/foundations/{Separator.js → separator.js} +4 -3
  80. package/dist/components/foundations/separator.js.map +1 -0
  81. package/dist/components/navigation-data/breadcrumb-pagination.js +89 -81
  82. package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -1
  83. package/dist/components/navigation-data/command-palette.d.ts +26 -0
  84. package/dist/components/navigation-data/command-palette.js +101 -72
  85. package/dist/components/navigation-data/command-palette.js.map +1 -1
  86. package/dist/components/navigation-data/header-tab-bar.js +50 -46
  87. package/dist/components/navigation-data/header-tab-bar.js.map +1 -1
  88. package/dist/components/navigation-data/index.d.ts +7 -7
  89. package/dist/components/navigation-data/menubar-toolbar.js +2 -1
  90. package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
  91. package/dist/components/navigation-data/navigation-menu.js +2 -1
  92. package/dist/components/navigation-data/navigation-menu.js.map +1 -1
  93. package/dist/components/navigation-data/scroll-area.js +2 -1
  94. package/dist/components/navigation-data/scroll-area.js.map +1 -1
  95. package/dist/components/navigation-data/table-collection.d.ts +12 -3
  96. package/dist/components/navigation-data/table-collection.js +12 -9
  97. package/dist/components/navigation-data/table-collection.js.map +1 -1
  98. package/dist/components/overlays/dialog.d.ts +23 -3
  99. package/dist/components/overlays/dialog.js +138 -130
  100. package/dist/components/overlays/dialog.js.map +1 -1
  101. package/dist/components/overlays/disclosure.js +2 -1
  102. package/dist/components/overlays/disclosure.js.map +1 -1
  103. package/dist/components/overlays/drawer.d.ts +9 -2
  104. package/dist/components/overlays/drawer.js +158 -151
  105. package/dist/components/overlays/drawer.js.map +1 -1
  106. package/dist/components/overlays/floating.js +116 -113
  107. package/dist/components/overlays/floating.js.map +1 -1
  108. package/dist/components/overlays/index.d.ts +4 -4
  109. package/dist/components/selection/combobox.js +94 -93
  110. package/dist/components/selection/combobox.js.map +1 -1
  111. package/dist/components/selection/controls.d.ts +4 -1
  112. package/dist/components/selection/controls.js +141 -118
  113. package/dist/components/selection/controls.js.map +1 -1
  114. package/dist/components/selection/menu.js +121 -121
  115. package/dist/components/selection/menu.js.map +1 -1
  116. package/dist/components/selection/select.js +108 -107
  117. package/dist/components/selection/select.js.map +1 -1
  118. package/dist/fonts.css +13 -0
  119. package/dist/index.d.ts +1 -0
  120. package/dist/index.js +39 -33
  121. package/dist/internal/accessible-name.d.ts +12 -0
  122. package/dist/internal/class-names.d.ts +12 -0
  123. package/dist/{components/selection/classnames.js → internal/class-names.js} +4 -3
  124. package/dist/internal/class-names.js.map +1 -0
  125. package/dist/internal/index.d.ts +3 -0
  126. package/dist/{components/foundations/shared.d.ts → internal/render.d.ts} +2 -1
  127. package/dist/intl/index.d.ts +3 -0
  128. package/dist/intl/linyao-provider.d.ts +38 -0
  129. package/dist/intl/linyao-provider.js +27 -0
  130. package/dist/intl/linyao-provider.js.map +1 -0
  131. package/dist/intl/messages.d.ts +48 -0
  132. package/dist/intl/messages.js +81 -0
  133. package/dist/intl/messages.js.map +1 -0
  134. package/dist/intl/provider.d.ts +18 -0
  135. package/dist/intl/provider.js +31 -0
  136. package/dist/intl/provider.js.map +1 -0
  137. package/dist/styles.css +1 -1
  138. package/package.json +6 -4
  139. package/dist/components/feedback/feedback.module.js +0 -42
  140. package/dist/components/feedback/feedback.module.js.map +0 -1
  141. package/dist/components/forms/CodeField.js +0 -63
  142. package/dist/components/forms/CodeField.js.map +0 -1
  143. package/dist/components/forms/FileUpload.js.map +0 -1
  144. package/dist/components/forms/Input.js.map +0 -1
  145. package/dist/components/forms/NumberField.js +0 -71
  146. package/dist/components/forms/NumberField.js.map +0 -1
  147. package/dist/components/forms/OTPField.js +0 -54
  148. package/dist/components/forms/OTPField.js.map +0 -1
  149. package/dist/components/forms/TextField.js +0 -199
  150. package/dist/components/forms/TextField.js.map +0 -1
  151. package/dist/components/foundations/Avatar.js.map +0 -1
  152. package/dist/components/foundations/Badge.js.map +0 -1
  153. package/dist/components/foundations/Button.js.map +0 -1
  154. package/dist/components/foundations/Card.js.map +0 -1
  155. package/dist/components/foundations/IconButton.js.map +0 -1
  156. package/dist/components/foundations/Link.js +0 -40
  157. package/dist/components/foundations/Link.js.map +0 -1
  158. package/dist/components/foundations/ListCell.js.map +0 -1
  159. package/dist/components/foundations/SectionHeading.js.map +0 -1
  160. package/dist/components/foundations/Separator.js.map +0 -1
  161. package/dist/components/foundations/shared.js +0 -8
  162. package/dist/components/foundations/shared.js.map +0 -1
  163. package/dist/components/navigation-data/utils.d.ts +0 -2
  164. package/dist/components/navigation-data/utils.js +0 -11
  165. package/dist/components/navigation-data/utils.js.map +0 -1
  166. package/dist/components/overlays/class-names.d.ts +0 -6
  167. package/dist/components/overlays/class-names.js +0 -11
  168. package/dist/components/overlays/class-names.js.map +0 -1
  169. package/dist/components/selection/classnames.d.ts +0 -4
  170. package/dist/components/selection/classnames.js.map +0 -1
  171. package/dist/components/selection/selection.module.js +0 -51
  172. package/dist/components/selection/selection.module.js.map +0 -1
  173. /package/dist/components/forms/{Input.d.ts → input.d.ts} +0 -0
  174. /package/dist/components/forms/{NumberField.d.ts → number-field.d.ts} +0 -0
  175. /package/dist/components/forms/{OTPField.d.ts → otp-field.d.ts} +0 -0
  176. /package/dist/components/foundations/{Avatar.d.ts → avatar.d.ts} +0 -0
  177. /package/dist/components/foundations/{Button.d.ts → button.d.ts} +0 -0
  178. /package/dist/components/foundations/{Separator.d.ts → separator.d.ts} +0 -0
@@ -1,192 +1,199 @@
1
- import { mergeClassName as e } from "./class-names.js";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { XIcon as i } from "@phosphor-icons/react/dist/csr/X";
5
- import { Drawer as a } from "@base-ui/react/drawer";
1
+ "use client";
2
+ import { cx as e, withStateClassName as t } from "../../internal/class-names.js";
3
+ import { useMessages as n } from "../../intl/provider.js";
4
+ import { forwardRef as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { XIcon as o } from "@phosphor-icons/react/dist/csr/X";
7
+ import { Drawer as s } from "@base-ui/react/drawer";
6
8
  //#region src/components/overlays/drawer.tsx
7
- function o() {
8
- return /* @__PURE__ */ n(i, {
9
+ function c() {
10
+ return /* @__PURE__ */ i(o, {
9
11
  "aria-hidden": "true",
10
12
  className: "lyds-overlayClose__glyph",
11
13
  weight: "bold"
12
14
  });
13
15
  }
14
- function s({ swipeDirection: e = "right", ...t }) {
15
- return /* @__PURE__ */ n(a.Root, {
16
+ function l({ swipeDirection: e = "right", ...t }) {
17
+ return /* @__PURE__ */ i(s.Root, {
16
18
  ...t,
17
19
  swipeDirection: e
18
20
  });
19
21
  }
20
- function c({ className: t, ...r }) {
21
- return /* @__PURE__ */ n(a.Trigger, {
22
- ...r,
23
- className: e("lyds-drawer__trigger", t)
22
+ function u({ className: e, ...n }) {
23
+ return /* @__PURE__ */ i(s.Trigger, {
24
+ ...n,
25
+ className: t("lyds-drawer__trigger", e)
24
26
  });
25
27
  }
26
- var l = t(function(e, t) {
27
- return /* @__PURE__ */ n(a.Portal, {
28
+ var d = r(function(e, t) {
29
+ return /* @__PURE__ */ i(s.Portal, {
28
30
  ...e,
29
31
  ref: t
30
32
  });
31
- }), u = t(function({ className: t, ...r }, i) {
32
- return /* @__PURE__ */ n(a.Backdrop, {
33
- ...r,
34
- ref: i,
35
- className: e("lyds-drawer__backdrop", t)
33
+ }), f = r(function({ className: e, ...n }, r) {
34
+ return /* @__PURE__ */ i(s.Backdrop, {
35
+ ...n,
36
+ ref: r,
37
+ className: t("lyds-drawer__backdrop", e)
36
38
  });
37
- }), d = t(function({ className: t, ...r }, i) {
38
- return /* @__PURE__ */ n(a.Viewport, {
39
- ...r,
40
- ref: i,
41
- className: e("lyds-drawer__viewport", t)
39
+ }), p = r(function({ className: e, ...n }, r) {
40
+ return /* @__PURE__ */ i(s.Viewport, {
41
+ ...n,
42
+ ref: r,
43
+ className: t("lyds-drawer__viewport", e)
44
+ });
45
+ }), m = r(function({ children: e, className: r, closeButton: o, closeLabel: c, closeProps: l, hasCustomClose: u = !1, ...d }, f) {
46
+ let p = n(), m = o ?? !u;
47
+ return /* @__PURE__ */ a(s.Popup, {
48
+ ...d,
49
+ ref: f,
50
+ className: t("lyds-drawer__popup", r),
51
+ children: [m ? /* @__PURE__ */ i(v, {
52
+ ...l,
53
+ "aria-label": c ?? p.drawerClose
54
+ }) : null, e]
55
+ });
56
+ }), h = r(function({ className: e, ...n }, r) {
57
+ return /* @__PURE__ */ i(s.Content, {
58
+ ...n,
59
+ ref: r,
60
+ className: t("lyds-drawer__content", e)
42
61
  });
43
- }), f = t(function({ children: t, className: i, closeLabel: o = "關閉側欄", closeProps: s, hasCustomClose: c = !1, ...l }, u) {
44
- return /* @__PURE__ */ r(a.Popup, {
45
- ...l,
46
- ref: u,
47
- className: e("lyds-drawer__popup", i),
48
- children: [t, c ? null : /* @__PURE__ */ n(g, {
49
- ...s,
50
- "aria-label": o
51
- })]
52
- });
53
- }), p = t(function({ className: t, ...r }, i) {
54
- return /* @__PURE__ */ n(a.Content, {
55
- ...r,
56
- ref: i,
57
- className: e("lyds-drawer__content", t)
62
+ }), g = r(function({ className: e, ...n }, r) {
63
+ return /* @__PURE__ */ i(s.Title, {
64
+ ...n,
65
+ ref: r,
66
+ className: t("lyds-drawer__title", e)
58
67
  });
59
- }), m = t(function({ className: t, ...r }, i) {
60
- return /* @__PURE__ */ n(a.Title, {
61
- ...r,
62
- ref: i,
63
- className: e("lyds-drawer__title", t)
68
+ }), _ = r(function({ className: e, ...n }, r) {
69
+ return /* @__PURE__ */ i(s.Description, {
70
+ ...n,
71
+ ref: r,
72
+ className: t("lyds-drawer__description", e)
64
73
  });
65
- }), h = t(function({ className: t, ...r }, i) {
66
- return /* @__PURE__ */ n(a.Description, {
67
- ...r,
68
- ref: i,
69
- className: e("lyds-drawer__description", t)
70
- });
71
- }), g = t(function({ "aria-label": t, children: r, className: i, variant: s = r == null ? "icon" : "action", ...c }, l) {
72
- return /* @__PURE__ */ n(a.Close, {
73
- ...c,
74
- ref: l,
75
- "aria-label": t ?? (r == null ? "關閉側欄" : void 0),
76
- className: e(s === "icon" ? "lyds-overlayClose" : "lyds-overlayCloseAction", i),
77
- children: r ?? /* @__PURE__ */ n(o, {})
78
- });
79
- }), _ = t(function({ className: t, ...r }, i) {
80
- return /* @__PURE__ */ n(a.SwipeArea, {
81
- ...r,
82
- ref: i,
83
- className: e("lyds-drawer__swipeArea", t)
74
+ }), v = r(function({ "aria-label": e, children: r, className: a, variant: o = r == null ? "icon" : "action", ...l }, u) {
75
+ let d = n();
76
+ return /* @__PURE__ */ i(s.Close, {
77
+ ...l,
78
+ ref: u,
79
+ "aria-label": e ?? (r == null ? d.drawerClose : void 0),
80
+ className: t(o === "icon" ? "lyds-overlayClose" : "lyds-overlayCloseAction", a),
81
+ children: r ?? /* @__PURE__ */ i(c, {})
84
82
  });
85
- }), v = t(function({ className: e, ...t }, r) {
86
- return /* @__PURE__ */ n("div", {
87
- ...t,
83
+ }), y = r(function({ className: e, ...n }, r) {
84
+ return /* @__PURE__ */ i(s.SwipeArea, {
85
+ ...n,
88
86
  ref: r,
89
- className: e ? `lyds-drawer__header ${e}` : "lyds-drawer__header"
87
+ className: t("lyds-drawer__swipeArea", e)
90
88
  });
91
- }), y = t(function({ className: e, ...t }, r) {
92
- return /* @__PURE__ */ n("div", {
93
- ...t,
89
+ }), b = r(function({ className: t, ...n }, r) {
90
+ return /* @__PURE__ */ i("div", {
91
+ ...n,
94
92
  ref: r,
95
- className: e ? `lyds-drawer__body ${e}` : "lyds-drawer__body"
93
+ className: e("lyds-drawer__header", t)
96
94
  });
97
- }), b = t(function({ className: e, ...t }, r) {
98
- return /* @__PURE__ */ n("div", {
99
- ...t,
95
+ }), x = r(function({ className: t, ...n }, r) {
96
+ return /* @__PURE__ */ i("div", {
97
+ ...n,
100
98
  ref: r,
101
- className: e ? `lyds-drawer__footer ${e}` : "lyds-drawer__footer"
102
- });
103
- }), x = {
104
- Root: s,
105
- Trigger: c,
106
- Portal: l,
107
- Backdrop: u,
108
- Viewport: d,
109
- Popup: f,
110
- Content: p,
111
- Header: v,
112
- Body: y,
113
- Footer: b,
114
- Title: m,
115
- Description: h,
116
- Close: g,
117
- SwipeArea: _,
118
- Provider: a.Provider,
119
- Indent: a.Indent,
120
- IndentBackground: a.IndentBackground,
121
- VirtualKeyboardProvider: a.VirtualKeyboardProvider,
122
- createHandle: a.createHandle,
123
- Handle: a.Handle
124
- }, S = [.45, .92];
125
- function C({ snapPoints: e = S, defaultSnapPoint: t, ...r }) {
126
- let i = e.at(-1) ?? null;
127
- return /* @__PURE__ */ n(a.Root, {
99
+ className: e("lyds-drawer__body", t)
100
+ });
101
+ }), S = r(function({ align: t = "stretch", className: n, ...r }, a) {
102
+ return /* @__PURE__ */ i("div", {
128
103
  ...r,
104
+ ref: a,
105
+ "data-align": t,
106
+ className: e("lyds-drawer__footer", n)
107
+ });
108
+ }), C = {
109
+ Root: l,
110
+ Trigger: u,
111
+ Portal: d,
112
+ Backdrop: f,
113
+ Viewport: p,
114
+ Popup: m,
115
+ Content: h,
116
+ Header: b,
117
+ Body: x,
118
+ Footer: S,
119
+ Title: g,
120
+ Description: _,
121
+ Close: v,
122
+ SwipeArea: y,
123
+ Provider: s.Provider,
124
+ Indent: s.Indent,
125
+ IndentBackground: s.IndentBackground,
126
+ VirtualKeyboardProvider: s.VirtualKeyboardProvider,
127
+ createHandle: s.createHandle,
128
+ Handle: s.Handle
129
+ }, w = [.45, .92];
130
+ function T({ snapPoints: e = w, defaultSnapPoint: t, ...n }) {
131
+ let r = e.at(-1) ?? null;
132
+ return /* @__PURE__ */ i(s.Root, {
133
+ ...n,
129
134
  swipeDirection: "down",
130
135
  snapPoints: e,
131
- defaultSnapPoint: t ?? i
136
+ defaultSnapPoint: t ?? r
132
137
  });
133
138
  }
134
- var w = t(function({ children: t, className: i, closeLabel: o = "關閉底部面板", closeProps: s, hasCustomClose: c = !1, ...l }, u) {
135
- return /* @__PURE__ */ r(a.Popup, {
136
- ...l,
137
- ref: u,
138
- className: e("lyds-drawer__popup lyds-bottomSheet__popup", i),
139
- children: [t, c ? null : /* @__PURE__ */ n(g, {
140
- ...s,
141
- "aria-label": o
142
- })]
143
- });
144
- }), T = t(function({ className: e, ...t }, r) {
145
- return /* @__PURE__ */ n("div", {
146
- ...t,
139
+ var E = r(function({ children: e, className: r, closeButton: o, closeLabel: c, closeProps: l, hasCustomClose: u = !1, ...d }, f) {
140
+ let p = n(), m = o ?? !u;
141
+ return /* @__PURE__ */ a(s.Popup, {
142
+ ...d,
143
+ ref: f,
144
+ className: t("lyds-drawer__popup lyds-bottomSheet__popup", r),
145
+ children: [m ? /* @__PURE__ */ i(v, {
146
+ ...l,
147
+ "aria-label": c ?? p.bottomSheetClose
148
+ }) : null, e]
149
+ });
150
+ }), D = r(function({ className: t, ...n }, r) {
151
+ return /* @__PURE__ */ i("div", {
152
+ ...n,
147
153
  ref: r,
148
154
  "aria-hidden": "true",
149
- className: e ? `lyds-bottomSheet__handle ${e}` : "lyds-bottomSheet__handle",
150
- children: /* @__PURE__ */ n("span", { className: "lyds-bottomSheet__handleBar" })
155
+ className: e("lyds-bottomSheet__handle", t),
156
+ children: /* @__PURE__ */ i("span", { className: "lyds-bottomSheet__handleBar" })
151
157
  });
152
- }), E = t(function({ className: e, ...t }, r) {
153
- return /* @__PURE__ */ n("div", {
154
- ...t,
158
+ }), O = r(function({ className: t, ...n }, r) {
159
+ return /* @__PURE__ */ i("div", {
160
+ ...n,
155
161
  ref: r,
156
- className: e ? `lyds-drawer__header lyds-bottomSheet__header ${e}` : "lyds-drawer__header lyds-bottomSheet__header"
162
+ className: e("lyds-drawer__header lyds-bottomSheet__header", t)
157
163
  });
158
- }), D = t(function({ className: e, ...t }, r) {
159
- return /* @__PURE__ */ n("div", {
160
- ...t,
164
+ }), k = r(function({ className: t, ...n }, r) {
165
+ return /* @__PURE__ */ i("div", {
166
+ ...n,
161
167
  ref: r,
162
- className: e ? `lyds-drawer__body lyds-bottomSheet__body ${e}` : "lyds-drawer__body lyds-bottomSheet__body"
168
+ className: e("lyds-drawer__body lyds-bottomSheet__body", t)
163
169
  });
164
- }), O = t(function({ className: e, ...t }, r) {
165
- return /* @__PURE__ */ n("div", {
166
- ...t,
167
- ref: r,
168
- className: e ? `lyds-drawer__footer lyds-bottomSheet__footer ${e}` : "lyds-drawer__footer lyds-bottomSheet__footer"
169
- });
170
- }), k = {
171
- Root: C,
172
- Trigger: c,
173
- Portal: l,
174
- Backdrop: u,
175
- Viewport: d,
176
- Popup: w,
177
- Content: p,
178
- Handle: T,
179
- Header: E,
180
- Body: D,
181
- Footer: O,
182
- Title: m,
183
- Description: h,
184
- Close: g,
185
- SwipeArea: _,
186
- createHandle: a.createHandle,
187
- ImperativeHandle: a.Handle
170
+ }), A = r(function({ align: t = "stretch", className: n, ...r }, a) {
171
+ return /* @__PURE__ */ i("div", {
172
+ ...r,
173
+ ref: a,
174
+ "data-align": t,
175
+ className: e("lyds-drawer__footer lyds-bottomSheet__footer", n)
176
+ });
177
+ }), j = {
178
+ Root: T,
179
+ Trigger: u,
180
+ Portal: d,
181
+ Backdrop: f,
182
+ Viewport: p,
183
+ Popup: E,
184
+ Content: h,
185
+ Handle: D,
186
+ Header: O,
187
+ Body: k,
188
+ Footer: A,
189
+ Title: g,
190
+ Description: _,
191
+ Close: v,
192
+ SwipeArea: y,
193
+ createHandle: s.createHandle,
194
+ ImperativeHandle: s.Handle
188
195
  };
189
196
  //#endregion
190
- export { k as BottomSheet, D as BottomSheetBody, O as BottomSheetFooter, T as BottomSheetHandle, E as BottomSheetHeader, w as BottomSheetPopup, C as BottomSheetRoot, x as Drawer, u as DrawerBackdrop, y as DrawerBody, g as DrawerClose, p as DrawerContent, h as DrawerDescription, b as DrawerFooter, v as DrawerHeader, f as DrawerPopup, l as DrawerPortal, s as DrawerRoot, _ as DrawerSwipeArea, m as DrawerTitle, c as DrawerTrigger, d as DrawerViewport };
197
+ export { j as BottomSheet, k as BottomSheetBody, A as BottomSheetFooter, D as BottomSheetHandle, O as BottomSheetHeader, E as BottomSheetPopup, T as BottomSheetRoot, C as Drawer, f as DrawerBackdrop, x as DrawerBody, v as DrawerClose, h as DrawerContent, _ as DrawerDescription, S as DrawerFooter, b as DrawerHeader, m as DrawerPopup, d as DrawerPortal, l as DrawerRoot, y as DrawerSwipeArea, g as DrawerTitle, u as DrawerTrigger, p as DrawerViewport };
191
198
 
192
199
  //# sourceMappingURL=drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/overlays/drawer.tsx"],"sourcesContent":["import {\n\tDrawer as BaseDrawer,\n\ttype DrawerCloseProps as BaseDrawerCloseProps,\n\ttype DrawerPopupProps as BaseDrawerPopupProps,\n\ttype DrawerBackdropProps,\n\ttype DrawerContentProps,\n\ttype DrawerDescriptionProps,\n\ttype DrawerPortalProps,\n\ttype DrawerRootProps,\n\ttype DrawerSwipeAreaProps,\n\ttype DrawerTitleProps,\n\ttype DrawerTriggerProps,\n\ttype DrawerViewportProps\n} from \"@base-ui/react/drawer\";\nimport { XIcon } from \"@phosphor-icons/react/dist/csr/X\";\nimport { forwardRef, type HTMLAttributes, type JSX, type RefAttributes } from \"react\";\n\nimport { mergeClassName } from \"./class-names\";\n\nexport type { DrawerRootChangeEventDetails } from \"@base-ui/react/drawer\";\n\nfunction CloseGlyph(): JSX.Element {\n\treturn <XIcon aria-hidden=\"true\" className=\"lyds-overlayClose__glyph\" weight=\"bold\" />;\n}\n\nexport function DrawerRoot<Payload = unknown>({ swipeDirection = \"right\", ...props }: DrawerRootProps<Payload>): JSX.Element {\n\treturn <BaseDrawer.Root {...props} swipeDirection={swipeDirection} />;\n}\n\nexport function DrawerTrigger<Payload = unknown>({ className, ...props }: DrawerTriggerProps<Payload> & RefAttributes<HTMLElement>): JSX.Element {\n\treturn <BaseDrawer.Trigger {...props} className={mergeClassName(\"lyds-drawer__trigger\", className)} />;\n}\n\nexport const DrawerPortal = forwardRef<HTMLDivElement, DrawerPortalProps>(function DrawerPortal(props, ref) {\n\treturn <BaseDrawer.Portal {...props} ref={ref} />;\n});\n\nexport const DrawerBackdrop = forwardRef<HTMLDivElement, DrawerBackdropProps>(function DrawerBackdrop({ className, ...props }, ref) {\n\treturn <BaseDrawer.Backdrop {...props} ref={ref} className={mergeClassName(\"lyds-drawer__backdrop\", className)} />;\n});\n\nexport const DrawerViewport = forwardRef<HTMLDivElement, DrawerViewportProps>(function DrawerViewport({ className, ...props }, ref) {\n\treturn <BaseDrawer.Viewport {...props} ref={ref} className={mergeClassName(\"lyds-drawer__viewport\", className)} />;\n});\n\nexport interface DrawerPopupProps extends BaseDrawerPopupProps {\n\t/** 內建關閉控制項的無障礙標籤。 */\n\tcloseLabel?: string;\n\t/** 傳給內建關閉控制項的屬性。 */\n\tcloseProps?: Omit<DrawerCloseProps, \"children\">;\n\t/** 僅在彈出內容另有可存取的 Drawer.Close 時設定。 */\n\thasCustomClose?: boolean;\n}\n\nexport const DrawerPopup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup({ children, className, closeLabel = \"關閉側欄\", closeProps, hasCustomClose = false, ...props }, ref) {\n\treturn (\n\t\t<BaseDrawer.Popup {...props} ref={ref} className={mergeClassName(\"lyds-drawer__popup\", className)}>\n\t\t\t{children}\n\t\t\t{hasCustomClose ? null : <DrawerClose {...closeProps} aria-label={closeLabel} />}\n\t\t</BaseDrawer.Popup>\n\t);\n});\n\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(function DrawerContent({ className, ...props }, ref) {\n\treturn <BaseDrawer.Content {...props} ref={ref} className={mergeClassName(\"lyds-drawer__content\", className)} />;\n});\n\nexport const DrawerTitle = forwardRef<HTMLHeadingElement, DrawerTitleProps>(function DrawerTitle({ className, ...props }, ref) {\n\treturn <BaseDrawer.Title {...props} ref={ref} className={mergeClassName(\"lyds-drawer__title\", className)} />;\n});\n\nexport const DrawerDescription = forwardRef<HTMLParagraphElement, DrawerDescriptionProps>(function DrawerDescription({ className, ...props }, ref) {\n\treturn <BaseDrawer.Description {...props} ref={ref} className={mergeClassName(\"lyds-drawer__description\", className)} />;\n});\n\nexport interface DrawerCloseProps extends BaseDrawerCloseProps {\n\t/** 圖示控制項位於面板角落;動作控制項則參與內容排版。 */\n\tvariant?: \"icon\" | \"action\";\n}\n\nexport const DrawerClose = forwardRef<HTMLButtonElement, DrawerCloseProps>(function DrawerClose(\n\t{ \"aria-label\": ariaLabel, children, className, variant = children == null ? \"icon\" : \"action\", ...props },\n\tref\n) {\n\treturn (\n\t\t<BaseDrawer.Close\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel ?? (children == null ? \"關閉側欄\" : undefined)}\n\t\t\tclassName={mergeClassName(variant === \"icon\" ? \"lyds-overlayClose\" : \"lyds-overlayCloseAction\", className)}\n\t\t>\n\t\t\t{children ?? <CloseGlyph />}\n\t\t</BaseDrawer.Close>\n\t);\n});\n\nexport const DrawerSwipeArea = forwardRef<HTMLDivElement, DrawerSwipeAreaProps>(function DrawerSwipeArea({ className, ...props }, ref) {\n\treturn <BaseDrawer.SwipeArea {...props} ref={ref} className={mergeClassName(\"lyds-drawer__swipeArea\", className)} />;\n});\n\nexport type DrawerHeaderProps = HTMLAttributes<HTMLDivElement>;\n\nexport const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(function DrawerHeader({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__header ${className}` : \"lyds-drawer__header\"} />;\n});\n\nexport type DrawerBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const DrawerBody = forwardRef<HTMLDivElement, DrawerBodyProps>(function DrawerBody({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__body ${className}` : \"lyds-drawer__body\"} />;\n});\n\nexport type DrawerFooterProps = HTMLAttributes<HTMLDivElement>;\n\nexport const DrawerFooter = forwardRef<HTMLDivElement, DrawerFooterProps>(function DrawerFooter({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__footer ${className}` : \"lyds-drawer__footer\"} />;\n});\n\nexport const Drawer = {\n\tRoot: DrawerRoot,\n\tTrigger: DrawerTrigger,\n\tPortal: DrawerPortal,\n\tBackdrop: DrawerBackdrop,\n\tViewport: DrawerViewport,\n\tPopup: DrawerPopup,\n\tContent: DrawerContent,\n\tHeader: DrawerHeader,\n\tBody: DrawerBody,\n\tFooter: DrawerFooter,\n\tTitle: DrawerTitle,\n\tDescription: DrawerDescription,\n\tClose: DrawerClose,\n\tSwipeArea: DrawerSwipeArea,\n\tProvider: BaseDrawer.Provider,\n\tIndent: BaseDrawer.Indent,\n\tIndentBackground: BaseDrawer.IndentBackground,\n\tVirtualKeyboardProvider: BaseDrawer.VirtualKeyboardProvider,\n\tcreateHandle: BaseDrawer.createHandle,\n\tHandle: BaseDrawer.Handle\n} as const;\n\nexport type BottomSheetSnapPoint = number | `${number}rem`;\n\nexport interface BottomSheetRootProps<Payload = unknown> extends Omit<DrawerRootProps<Payload>, \"snapPoints\" | \"swipeDirection\"> {\n\t/** 響應式面板建議使用 0 至 1 的比例值或 rem 長度。 */\n\tsnapPoints?: BottomSheetSnapPoint[];\n\t/** 底部面板一律向下關閉。 */\n\tswipeDirection?: \"down\";\n}\n\nconst defaultBottomSheetSnapPoints: BottomSheetSnapPoint[] = [0.45, 0.92];\n\nexport function BottomSheetRoot<Payload = unknown>({ snapPoints = defaultBottomSheetSnapPoints, defaultSnapPoint, ...props }: BottomSheetRootProps<Payload>): JSX.Element {\n\tconst accessibleDefaultSnapPoint = snapPoints.at(-1) ?? null;\n\treturn <BaseDrawer.Root {...props} swipeDirection=\"down\" snapPoints={snapPoints} defaultSnapPoint={defaultSnapPoint ?? accessibleDefaultSnapPoint} />;\n}\n\nexport const BottomSheetPopup = forwardRef<HTMLDivElement, DrawerPopupProps>(function BottomSheetPopup(\n\t{ children, className, closeLabel = \"關閉底部面板\", closeProps, hasCustomClose = false, ...props },\n\tref\n) {\n\treturn (\n\t\t<BaseDrawer.Popup {...props} ref={ref} className={mergeClassName(\"lyds-drawer__popup lyds-bottomSheet__popup\", className)}>\n\t\t\t{children}\n\t\t\t{hasCustomClose ? null : <DrawerClose {...closeProps} aria-label={closeLabel} />}\n\t\t</BaseDrawer.Popup>\n\t);\n});\n\nexport type BottomSheetHandleProps = HTMLAttributes<HTMLDivElement>;\n\n/** 符合觸控尺寸的裝飾性操作提示;滑動行為仍由 Base UI 負責。 */\nexport const BottomSheetHandle = forwardRef<HTMLDivElement, BottomSheetHandleProps>(function BottomSheetHandle({ className, ...props }, ref) {\n\treturn (\n\t\t<div {...props} ref={ref} aria-hidden=\"true\" className={className ? `lyds-bottomSheet__handle ${className}` : \"lyds-bottomSheet__handle\"}>\n\t\t\t<span className=\"lyds-bottomSheet__handleBar\" />\n\t\t</div>\n\t);\n});\n\nexport const BottomSheetHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(function BottomSheetHeader({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__header lyds-bottomSheet__header ${className}` : \"lyds-drawer__header lyds-bottomSheet__header\"} />;\n});\n\nexport const BottomSheetBody = forwardRef<HTMLDivElement, DrawerBodyProps>(function BottomSheetBody({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__body lyds-bottomSheet__body ${className}` : \"lyds-drawer__body lyds-bottomSheet__body\"} />;\n});\n\nexport const BottomSheetFooter = forwardRef<HTMLDivElement, DrawerFooterProps>(function BottomSheetFooter({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={className ? `lyds-drawer__footer lyds-bottomSheet__footer ${className}` : \"lyds-drawer__footer lyds-bottomSheet__footer\"} />;\n});\n\nexport const BottomSheet = {\n\tRoot: BottomSheetRoot,\n\tTrigger: DrawerTrigger,\n\tPortal: DrawerPortal,\n\tBackdrop: DrawerBackdrop,\n\tViewport: DrawerViewport,\n\tPopup: BottomSheetPopup,\n\tContent: DrawerContent,\n\tHandle: BottomSheetHandle,\n\tHeader: BottomSheetHeader,\n\tBody: BottomSheetBody,\n\tFooter: BottomSheetFooter,\n\tTitle: DrawerTitle,\n\tDescription: DrawerDescription,\n\tClose: DrawerClose,\n\tSwipeArea: DrawerSwipeArea,\n\tcreateHandle: BaseDrawer.createHandle,\n\tImperativeHandle: BaseDrawer.Handle\n} as const;\n"],"mappings":";;;;;;AAqBA,SAAS,IAA0B;CAClC,OAAO,kBAAC,GAAD;EAAO,eAAY;EAAO,WAAU;EAA2B,QAAO;CAAQ,CAAA;AACtF;AAEA,SAAgB,EAA8B,EAAE,oBAAiB,SAAS,GAAG,KAAgD;CAC5H,OAAO,kBAAC,EAAW,MAAZ;EAAiB,GAAI;EAAuB;CAAiB,CAAA;AACrE;AAEA,SAAgB,EAAiC,EAAE,cAAW,GAAG,KAAgF;CAChJ,OAAO,kBAAC,EAAW,SAAZ;EAAoB,GAAI;EAAO,WAAW,EAAe,wBAAwB,CAAS;CAAI,CAAA;AACtG;AAEA,IAAa,IAAe,EAA8C,SAAsB,GAAO,GAAK;CAC3G,OAAO,kBAAC,EAAW,QAAZ;EAAmB,GAAI;EAAY;CAAM,CAAA;AACjD,CAAC,GAEY,IAAiB,EAAgD,SAAwB,EAAE,cAAW,GAAG,KAAS,GAAK;CACnI,OAAO,kBAAC,EAAW,UAAZ;EAAqB,GAAI;EAAY;EAAK,WAAW,EAAe,yBAAyB,CAAS;CAAI,CAAA;AAClH,CAAC,GAEY,IAAiB,EAAgD,SAAwB,EAAE,cAAW,GAAG,KAAS,GAAK;CACnI,OAAO,k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ACrF,GACC;CACD,OACC,kBAAC,EAAW,OAAZ;EAAkB,GAAI;EAAY;EAAK,WAAW,EAAe,8CAA8C,CAAS;EAAxH,UAAA,CACE,GACA,IAAiB,OAAO,kBAAC,GAAD;GAAa,GAAI;GAAY,cAAY;EAAa,CAAA,CAC9D;;AAEpB,CAAC,GAKY,IAAoB,EAAmD,SAA2B,EAAE,cAAW,GAAG,KAAS,GAAK;CAC5I,OACC,kBAAC,OAAD;EAAK,GAAI;EAAY;EAAK,eAAY;EAAO,WAAW,IAAY,4BAA4B,MAAc;EAC7G,UAAA,kBAAC,QAAD,EAAM,WAAU,8BAA+B,CAAA;CAC3C,CAAA;AAEP,CAAC,GAEY,IAAoB,EAA8C,SAA2B,EAAE,cAAW,GAAG,KAAS,GAAK;CACvI,OAAO,kBAAC,OAAD;EAAK,GAAI;EAAY;EAAK,WAAW,IAAY,gDAAgD,MAAc;CAAiD,CAAA;AACxK,CAAC,GAEY,IAAkB,EAA4C,SAAyB,EAAE,cAAW,GAAG,KAAS,GAAK;CACjI,OAAO,kBAAC,OAAD;EAAK,GAAI;EAAY;EAAK,WAAW,IAAY,4CAA4C,MAAc;CAA6C,CAAA;AAChK,CAAC,GAEY,IAAoB,EAA8C,SAA2B,EAAE,cAAW,GAAG,KAAS,GAAK;CACvI,OAAO,kBAAC,OAAD;EAAK,GAAI;EAAY;EAAK,WAAW,IAAY,gDAAgD,MAAc;CAAiD,CAAA;AACxK,CAAC,GAEY,IAAc;CAC1B,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,OAAO;CACP,aAAa;CACb,OAAO;CACP,WAAW;CACX,cAAc,EAAW;CACzB,kBAAkB,EAAW;AAC9B"}
1
+ {"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/overlays/drawer.tsx"],"sourcesContent":["import {\n\tDrawer as BaseDrawer,\n\ttype DrawerCloseProps as BaseDrawerCloseProps,\n\ttype DrawerPopupProps as BaseDrawerPopupProps,\n\ttype DrawerBackdropProps,\n\ttype DrawerContentProps,\n\ttype DrawerDescriptionProps,\n\ttype DrawerPortalProps,\n\ttype DrawerRootProps,\n\ttype DrawerSwipeAreaProps,\n\ttype DrawerTitleProps,\n\ttype DrawerTriggerProps,\n\ttype DrawerViewportProps\n} from \"@base-ui/react/drawer\";\nimport { XIcon } from \"@phosphor-icons/react/dist/csr/X\";\nimport { forwardRef, type HTMLAttributes, type JSX, type RefAttributes } from \"react\";\n\nimport { cx, withStateClassName } from \"@/internal\";\nimport { useMessages } from \"@/intl\";\n\nimport type { OverlayFooterAlign } from \"./dialog\";\nexport type { DrawerRootChangeEventDetails } from \"@base-ui/react/drawer\";\n\nfunction CloseGlyph(): JSX.Element {\n\treturn <XIcon aria-hidden=\"true\" className=\"lyds-overlayClose__glyph\" weight=\"bold\" />;\n}\n\nexport function DrawerRoot<Payload = unknown>({ swipeDirection = \"right\", ...props }: DrawerRootProps<Payload>): JSX.Element {\n\treturn <BaseDrawer.Root {...props} swipeDirection={swipeDirection} />;\n}\n\nexport function DrawerTrigger<Payload = unknown>({ className, ...props }: DrawerTriggerProps<Payload> & RefAttributes<HTMLElement>): JSX.Element {\n\treturn <BaseDrawer.Trigger {...props} className={withStateClassName(\"lyds-drawer__trigger\", className)} />;\n}\n\nexport const DrawerPortal = forwardRef<HTMLDivElement, DrawerPortalProps>(function DrawerPortal(props, ref) {\n\treturn <BaseDrawer.Portal {...props} ref={ref} />;\n});\n\nexport const DrawerBackdrop = forwardRef<HTMLDivElement, DrawerBackdropProps>(function DrawerBackdrop({ className, ...props }, ref) {\n\treturn <BaseDrawer.Backdrop {...props} ref={ref} className={withStateClassName(\"lyds-drawer__backdrop\", className)} />;\n});\n\nexport const DrawerViewport = forwardRef<HTMLDivElement, DrawerViewportProps>(function DrawerViewport({ className, ...props }, ref) {\n\treturn <BaseDrawer.Viewport {...props} ref={ref} className={withStateClassName(\"lyds-drawer__viewport\", className)} />;\n});\n\nexport interface DrawerPopupProps extends BaseDrawerPopupProps {\n\t/** 內建關閉控制項的無障礙標籤。 */\n\tcloseLabel?: string;\n\t/** 傳給內建關閉控制項的屬性。 */\n\tcloseProps?: Omit<DrawerCloseProps, \"children\">;\n\t/** Renders the built-in corner close control. */\n\tcloseButton?: boolean;\n\t/**\n\t * @deprecated Pass `closeButton={false}` instead. Kept so existing call sites keep working.\n\t */\n\thasCustomClose?: boolean;\n}\n\nexport const DrawerPopup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup({ children, className, closeButton, closeLabel, closeProps, hasCustomClose = false, ...props }, ref) {\n\tconst messages = useMessages();\n\tconst showCloseButton = closeButton ?? !hasCustomClose;\n\n\treturn (\n\t\t<BaseDrawer.Popup {...props} ref={ref} className={withStateClassName(\"lyds-drawer__popup\", className)}>\n\t\t\t{showCloseButton ? <DrawerClose {...closeProps} aria-label={closeLabel ?? messages.drawerClose} /> : null}\n\t\t\t{children}\n\t\t</BaseDrawer.Popup>\n\t);\n});\n\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(function DrawerContent({ className, ...props }, ref) {\n\treturn <BaseDrawer.Content {...props} ref={ref} className={withStateClassName(\"lyds-drawer__content\", className)} />;\n});\n\nexport const DrawerTitle = forwardRef<HTMLHeadingElement, DrawerTitleProps>(function DrawerTitle({ className, ...props }, ref) {\n\treturn <BaseDrawer.Title {...props} ref={ref} className={withStateClassName(\"lyds-drawer__title\", className)} />;\n});\n\nexport const DrawerDescription = forwardRef<HTMLParagraphElement, DrawerDescriptionProps>(function DrawerDescription({ className, ...props }, ref) {\n\treturn <BaseDrawer.Description {...props} ref={ref} className={withStateClassName(\"lyds-drawer__description\", className)} />;\n});\n\nexport interface DrawerCloseProps extends BaseDrawerCloseProps {\n\t/** 圖示控制項位於面板角落;動作控制項則參與內容排版。 */\n\tvariant?: \"icon\" | \"action\";\n}\n\nexport const DrawerClose = forwardRef<HTMLButtonElement, DrawerCloseProps>(function DrawerClose(\n\t{ \"aria-label\": ariaLabel, children, className, variant = children == null ? \"icon\" : \"action\", ...props },\n\tref\n) {\n\tconst messages = useMessages();\n\n\treturn (\n\t\t<BaseDrawer.Close\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel ?? (children == null ? messages.drawerClose : undefined)}\n\t\t\tclassName={withStateClassName(variant === \"icon\" ? \"lyds-overlayClose\" : \"lyds-overlayCloseAction\", className)}\n\t\t>\n\t\t\t{children ?? <CloseGlyph />}\n\t\t</BaseDrawer.Close>\n\t);\n});\n\nexport const DrawerSwipeArea = forwardRef<HTMLDivElement, DrawerSwipeAreaProps>(function DrawerSwipeArea({ className, ...props }, ref) {\n\treturn <BaseDrawer.SwipeArea {...props} ref={ref} className={withStateClassName(\"lyds-drawer__swipeArea\", className)} />;\n});\n\nexport type DrawerHeaderProps = HTMLAttributes<HTMLDivElement>;\n\nexport const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(function DrawerHeader({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={cx(\"lyds-drawer__header\", className)} />;\n});\n\nexport type DrawerBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const DrawerBody = forwardRef<HTMLDivElement, DrawerBodyProps>(function DrawerBody({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={cx(\"lyds-drawer__body\", className)} />;\n});\n\nexport interface DrawerFooterProps extends HTMLAttributes<HTMLDivElement> {\n\talign?: OverlayFooterAlign;\n}\n\nexport const DrawerFooter = forwardRef<HTMLDivElement, DrawerFooterProps>(function DrawerFooter({ align = \"stretch\", className, ...props }, ref) {\n\treturn <div {...props} ref={ref} data-align={align} className={cx(\"lyds-drawer__footer\", className)} />;\n});\n\nexport const Drawer = {\n\tRoot: DrawerRoot,\n\tTrigger: DrawerTrigger,\n\tPortal: DrawerPortal,\n\tBackdrop: DrawerBackdrop,\n\tViewport: DrawerViewport,\n\tPopup: DrawerPopup,\n\tContent: DrawerContent,\n\tHeader: DrawerHeader,\n\tBody: DrawerBody,\n\tFooter: DrawerFooter,\n\tTitle: DrawerTitle,\n\tDescription: DrawerDescription,\n\tClose: DrawerClose,\n\tSwipeArea: DrawerSwipeArea,\n\tProvider: BaseDrawer.Provider,\n\tIndent: BaseDrawer.Indent,\n\tIndentBackground: BaseDrawer.IndentBackground,\n\tVirtualKeyboardProvider: BaseDrawer.VirtualKeyboardProvider,\n\tcreateHandle: BaseDrawer.createHandle,\n\tHandle: BaseDrawer.Handle\n} as const;\n\nexport type BottomSheetSnapPoint = number | `${number}rem`;\n\nexport interface BottomSheetRootProps<Payload = unknown> extends Omit<DrawerRootProps<Payload>, \"snapPoints\" | \"swipeDirection\"> {\n\t/** 響應式面板建議使用 0 至 1 的比例值或 rem 長度。 */\n\tsnapPoints?: BottomSheetSnapPoint[];\n\t/** 底部面板一律向下關閉。 */\n\tswipeDirection?: \"down\";\n}\n\nconst defaultBottomSheetSnapPoints: BottomSheetSnapPoint[] = [0.45, 0.92];\n\nexport function BottomSheetRoot<Payload = unknown>({ snapPoints = defaultBottomSheetSnapPoints, defaultSnapPoint, ...props }: BottomSheetRootProps<Payload>): JSX.Element {\n\tconst accessibleDefaultSnapPoint = snapPoints.at(-1) ?? null;\n\treturn <BaseDrawer.Root {...props} swipeDirection=\"down\" snapPoints={snapPoints} defaultSnapPoint={defaultSnapPoint ?? accessibleDefaultSnapPoint} />;\n}\n\nexport const BottomSheetPopup = forwardRef<HTMLDivElement, DrawerPopupProps>(function BottomSheetPopup(\n\t{ children, className, closeButton, closeLabel, closeProps, hasCustomClose = false, ...props },\n\tref\n) {\n\tconst messages = useMessages();\n\tconst showCloseButton = closeButton ?? !hasCustomClose;\n\n\treturn (\n\t\t<BaseDrawer.Popup {...props} ref={ref} className={withStateClassName(\"lyds-drawer__popup lyds-bottomSheet__popup\", className)}>\n\t\t\t{showCloseButton ? <DrawerClose {...closeProps} aria-label={closeLabel ?? messages.bottomSheetClose} /> : null}\n\t\t\t{children}\n\t\t</BaseDrawer.Popup>\n\t);\n});\n\nexport type BottomSheetHandleProps = HTMLAttributes<HTMLDivElement>;\n\n/** 符合觸控尺寸的裝飾性操作提示;滑動行為仍由 Base UI 負責。 */\nexport const BottomSheetHandle = forwardRef<HTMLDivElement, BottomSheetHandleProps>(function BottomSheetHandle({ className, ...props }, ref) {\n\treturn (\n\t\t<div {...props} ref={ref} aria-hidden=\"true\" className={cx(\"lyds-bottomSheet__handle\", className)}>\n\t\t\t<span className=\"lyds-bottomSheet__handleBar\" />\n\t\t</div>\n\t);\n});\n\nexport const BottomSheetHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(function BottomSheetHeader({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={cx(\"lyds-drawer__header lyds-bottomSheet__header\", className)} />;\n});\n\nexport const BottomSheetBody = forwardRef<HTMLDivElement, DrawerBodyProps>(function BottomSheetBody({ className, ...props }, ref) {\n\treturn <div {...props} ref={ref} className={cx(\"lyds-drawer__body lyds-bottomSheet__body\", className)} />;\n});\n\nexport const BottomSheetFooter = forwardRef<HTMLDivElement, DrawerFooterProps>(function BottomSheetFooter({ align = \"stretch\", className, ...props }, ref) {\n\treturn <div {...props} ref={ref} data-align={align} className={cx(\"lyds-drawer__footer lyds-bottomSheet__footer\", className)} />;\n});\n\nexport const BottomSheet = {\n\tRoot: BottomSheetRoot,\n\tTrigger: DrawerTrigger,\n\tPortal: DrawerPortal,\n\tBackdrop: DrawerBackdrop,\n\tViewport: DrawerViewport,\n\tPopup: BottomSheetPopup,\n\tContent: DrawerContent,\n\tHandle: BottomSheetHandle,\n\tHeader: BottomSheetHeader,\n\tBody: BottomSheetBody,\n\tFooter: BottomSheetFooter,\n\tTitle: DrawerTitle,\n\tDescription: DrawerDescription,\n\tClose: DrawerClose,\n\tSwipeArea: DrawerSwipeArea,\n\tcreateHandle: BaseDrawer.createHandle,\n\tImperativeHandle: BaseDrawer.Handle\n} as const;\n"],"mappings":";;;;;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