@surflane/ui 0.9.0 → 0.10.1

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 (291) hide show
  1. package/README.md +4 -4
  2. package/dist/accordion.d.ts +33 -17
  3. package/dist/accordion.js +10 -11
  4. package/dist/alert-dialog.d.ts +8 -4
  5. package/dist/alert-dialog.js +3 -4
  6. package/dist/app-shell.d.ts +81 -44
  7. package/dist/app-shell.js +67 -29
  8. package/dist/autocomplete.d.ts +117 -61
  9. package/dist/autocomplete.js +8 -8
  10. package/dist/avatar.d.ts +34 -17
  11. package/dist/avatar.js +8 -9
  12. package/dist/badge.d.ts +6 -10
  13. package/dist/badge.js +5 -6
  14. package/dist/bottom-navigation.d.ts +11 -41
  15. package/dist/bottom-navigation.js +9 -10
  16. package/dist/breadcrumbs.d.ts +21 -5
  17. package/dist/breadcrumbs.js +12 -14
  18. package/dist/button.d.ts +15 -8
  19. package/dist/button.js +8 -9
  20. package/dist/card.d.ts +610 -35
  21. package/dist/card.js +12 -12
  22. package/dist/chart.d.ts +9 -32
  23. package/dist/chart.js +65 -26
  24. package/dist/checkbox-group.d.ts +4 -1
  25. package/dist/checkbox-group.js +3 -4
  26. package/dist/checkbox.d.ts +13 -4
  27. package/dist/checkbox.js +6 -6
  28. package/dist/choice-label.d.ts +3 -11
  29. package/dist/choice-label.js +4 -4
  30. package/dist/class-names.d.ts +6 -0
  31. package/dist/class-names.js +18 -0
  32. package/dist/code.d.ts +13 -10
  33. package/dist/code.js +8 -5
  34. package/dist/collapsible.d.ts +25 -12
  35. package/dist/collapsible.js +7 -8
  36. package/dist/combobox.d.ts +145 -73
  37. package/dist/combobox.js +27 -27
  38. package/dist/context-menu.d.ts +106 -54
  39. package/dist/context-menu.js +4 -5
  40. package/dist/css/accordion.css +1 -1
  41. package/dist/css/alert-dialog.css +2 -2
  42. package/dist/css/all.css +7 -5
  43. package/dist/css/app-shell.css +1 -1
  44. package/dist/css/autocomplete.css +1 -1
  45. package/dist/css/avatar.css +2 -2
  46. package/dist/css/badge.css +2 -2
  47. package/dist/css/bottom-navigation.css +1 -1
  48. package/dist/css/breadcrumbs.css +3 -3
  49. package/dist/css/button.css +1 -1
  50. package/dist/css/card.css +3 -3
  51. package/dist/css/chart.css +2 -2
  52. package/dist/css/checkbox-group.css +1 -1
  53. package/dist/css/checkbox.css +1 -1
  54. package/dist/css/choice-label.css +1 -1
  55. package/dist/css/code.css +2 -2
  56. package/dist/css/collapsible.css +1 -1
  57. package/dist/css/combobox.css +1 -1
  58. package/dist/css/context-menu.css +1 -1
  59. package/dist/css/date-picker.css +1 -1
  60. package/dist/css/dialog.css +2 -2
  61. package/dist/css/drawer.css +2 -2
  62. package/dist/css/empty-state.css +2 -2
  63. package/dist/css/field.css +1 -1
  64. package/dist/css/fieldset.css +1 -1
  65. package/dist/css/file-upload.css +2 -2
  66. package/dist/css/filter-bar.css +1 -1
  67. package/dist/css/form.css +1 -1
  68. package/dist/css/icon.css +1 -1
  69. package/dist/css/inline-message.css +2 -2
  70. package/dist/css/input.css +1 -1
  71. package/dist/css/layout.css +2 -2
  72. package/dist/css/link.css +2 -2
  73. package/dist/css/list.css +2 -2
  74. package/dist/css/markdown.css +4 -4
  75. package/dist/css/menu.css +1 -1
  76. package/dist/css/menubar.css +1 -1
  77. package/dist/css/meter.css +1 -1
  78. package/dist/css/native-select.css +1 -1
  79. package/dist/css/navigation-menu.css +1 -1
  80. package/dist/css/number-field.css +1 -1
  81. package/dist/css/otp-field.css +1 -1
  82. package/dist/css/page-header.css +3 -3
  83. package/dist/css/pagination.css +2 -2
  84. package/dist/css/popover.css +1 -1
  85. package/dist/css/preview-card.css +2 -2
  86. package/dist/css/progress.css +1 -1
  87. package/dist/css/radio-group.css +1 -1
  88. package/dist/css/rules/accordion.css +5 -5
  89. package/dist/css/rules/alert-dialog.css +9 -9
  90. package/dist/css/rules/app-shell.css +274 -82
  91. package/dist/css/rules/avatar.css +7 -7
  92. package/dist/css/rules/badge.css +6 -6
  93. package/dist/css/rules/bar.css +11 -11
  94. package/dist/css/rules/base.css +30 -30
  95. package/dist/css/rules/bottom-navigation.css +57 -56
  96. package/dist/css/rules/breadcrumbs.css +2 -2
  97. package/dist/css/rules/button.css +66 -65
  98. package/dist/css/rules/card.css +3 -3
  99. package/dist/css/rules/chart.css +134 -124
  100. package/dist/css/rules/checkbox.css +5 -5
  101. package/dist/css/rules/choice-label.css +19 -18
  102. package/dist/css/rules/choice.css +65 -60
  103. package/dist/css/rules/code.css +2 -2
  104. package/dist/css/rules/collapsible.css +2 -2
  105. package/dist/css/rules/combobox.css +87 -83
  106. package/dist/css/rules/context-menu.css +1 -1
  107. package/dist/css/rules/date-picker.css +150 -144
  108. package/dist/css/rules/dialog.css +85 -79
  109. package/dist/css/rules/disclosure.css +49 -47
  110. package/dist/css/rules/drawer.css +6 -6
  111. package/dist/css/rules/empty-state.css +2 -2
  112. package/dist/css/rules/field-control.css +51 -42
  113. package/dist/css/rules/field.css +26 -24
  114. package/dist/css/rules/fieldset.css +10 -8
  115. package/dist/css/rules/file-upload.css +73 -72
  116. package/dist/css/rules/filter-bar.css +19 -18
  117. package/dist/css/rules/form.css +3 -3
  118. package/dist/css/rules/gauge.css +22 -22
  119. package/dist/css/rules/icon.css +16 -11
  120. package/dist/css/rules/inline-message.css +3 -3
  121. package/dist/css/rules/input-group.css +50 -43
  122. package/dist/css/rules/input.css +11 -11
  123. package/dist/css/rules/item.css +7 -7
  124. package/dist/css/rules/link.css +2 -2
  125. package/dist/css/rules/list.css +3 -3
  126. package/dist/css/rules/markdown.css +27 -27
  127. package/dist/css/rules/menu.css +45 -42
  128. package/dist/css/rules/menubar.css +6 -6
  129. package/dist/css/rules/navigation-menu.css +69 -66
  130. package/dist/css/rules/number-field.css +22 -21
  131. package/dist/css/rules/otp-field.css +28 -27
  132. package/dist/css/rules/panel.css +105 -100
  133. package/dist/css/rules/popover.css +23 -20
  134. package/dist/css/rules/popup.css +15 -14
  135. package/dist/css/rules/preview-card.css +20 -19
  136. package/dist/css/rules/progress.css +3 -3
  137. package/dist/css/rules/radio-group.css +8 -8
  138. package/dist/css/rules/scroll-area.css +50 -39
  139. package/dist/css/rules/select.css +39 -36
  140. package/dist/css/rules/sizing.css +119 -116
  141. package/dist/css/rules/skeleton.css +18 -11
  142. package/dist/css/rules/slider.css +43 -43
  143. package/dist/css/rules/sparkline.css +21 -21
  144. package/dist/css/rules/spinner.css +9 -9
  145. package/dist/css/rules/stat.css +32 -32
  146. package/dist/css/rules/switch.css +28 -21
  147. package/dist/css/rules/syntax-highlighter.css +37 -36
  148. package/dist/css/rules/table.css +10 -10
  149. package/dist/css/rules/tabs.css +53 -52
  150. package/dist/css/rules/textarea.css +9 -7
  151. package/dist/css/rules/toast.css +94 -90
  152. package/dist/css/rules/toggle.css +12 -12
  153. package/dist/css/rules/toolbar.css +27 -27
  154. package/dist/css/rules/tooltip.css +14 -14
  155. package/dist/css/rules/tree.css +38 -38
  156. package/dist/css/scroll-area.css +1 -1
  157. package/dist/css/select.css +1 -1
  158. package/dist/css/separator.css +2 -2
  159. package/dist/css/sheet.css +2 -2
  160. package/dist/css/sizing.css +1 -1
  161. package/dist/css/skeleton.css +1 -1
  162. package/dist/css/slider.css +1 -1
  163. package/dist/css/sparkline.css +1 -1
  164. package/dist/css/spinner.css +1 -1
  165. package/dist/css/stat.css +1 -1
  166. package/dist/css/styles.css +17 -17
  167. package/dist/css/switch.css +1 -1
  168. package/dist/css/syntax-highlighter.css +1 -1
  169. package/dist/css/table.css +2 -2
  170. package/dist/css/tabs.css +1 -1
  171. package/dist/css/textarea.css +1 -1
  172. package/dist/css/toast.css +1 -1
  173. package/dist/css/toggle-group.css +1 -1
  174. package/dist/css/toggle.css +1 -1
  175. package/dist/css/toolbar.css +1 -1
  176. package/dist/css/tooltip.css +1 -1
  177. package/dist/css/tree.css +1 -1
  178. package/dist/css/typography.css +2 -2
  179. package/dist/date-picker.js +28 -8
  180. package/dist/dialog.d.ts +20 -8
  181. package/dist/dialog.js +11 -12
  182. package/dist/drawer.d.ts +12 -4
  183. package/dist/drawer.js +5 -5
  184. package/dist/element-part.d.ts +8 -0
  185. package/dist/element-part.js +21 -0
  186. package/dist/empty-state.d.ts +602 -24
  187. package/dist/empty-state.js +9 -9
  188. package/dist/field.d.ts +60 -36
  189. package/dist/field.js +6 -6
  190. package/dist/fieldset.d.ts +19 -11
  191. package/dist/fieldset.js +2 -2
  192. package/dist/file-upload.d.ts +8 -23
  193. package/dist/file-upload.js +23 -16
  194. package/dist/filter-bar.d.ts +30 -10
  195. package/dist/filter-bar.js +16 -18
  196. package/dist/form.js +1 -1
  197. package/dist/icon.d.ts +9 -2
  198. package/dist/icon.js +6 -6
  199. package/dist/index.d.ts +4 -4
  200. package/dist/index.js +2 -3
  201. package/dist/inline-message.d.ts +51 -27
  202. package/dist/inline-message.js +10 -11
  203. package/dist/input.d.ts +4 -2
  204. package/dist/input.js +3 -4
  205. package/dist/layout.d.ts +24 -12
  206. package/dist/layout.js +27 -27
  207. package/dist/link.d.ts +3 -1
  208. package/dist/link.js +3 -4
  209. package/dist/list.d.ts +43 -27
  210. package/dist/list.js +12 -13
  211. package/dist/markdown.d.ts +14 -6
  212. package/dist/markdown.js +28 -11
  213. package/dist/menu.d.ts +113 -57
  214. package/dist/menu.js +24 -25
  215. package/dist/menubar.d.ts +5 -3
  216. package/dist/menubar.js +1 -1
  217. package/dist/meter.d.ts +46 -26
  218. package/dist/meter.js +5 -5
  219. package/dist/native-select.d.ts +4 -2
  220. package/dist/native-select.js +2 -2
  221. package/dist/navigation-menu.d.ts +76 -40
  222. package/dist/navigation-menu.js +15 -16
  223. package/dist/number-field.d.ts +44 -19
  224. package/dist/number-field.js +12 -13
  225. package/dist/otp-field.d.ts +26 -9
  226. package/dist/otp-field.js +10 -11
  227. package/dist/page-header.js +3 -4
  228. package/dist/pagination.d.ts +11 -8
  229. package/dist/pagination.js +4 -5
  230. package/dist/panel.d.ts +3 -1
  231. package/dist/panel.js +5 -6
  232. package/dist/parts.d.ts +5 -7
  233. package/dist/parts.js +8 -16
  234. package/dist/popover.d.ts +20 -12
  235. package/dist/popover.js +3 -3
  236. package/dist/preview-card.d.ts +22 -10
  237. package/dist/preview-card.js +7 -8
  238. package/dist/progress.d.ts +46 -26
  239. package/dist/progress.js +5 -5
  240. package/dist/radio-group.d.ts +16 -8
  241. package/dist/radio-group.js +5 -5
  242. package/dist/scroll-area.d.ts +4 -2
  243. package/dist/scroll-area.js +6 -6
  244. package/dist/select.d.ts +3 -1
  245. package/dist/select.js +5 -5
  246. package/dist/separator.d.ts +5 -2
  247. package/dist/separator.js +3 -4
  248. package/dist/sheet.d.ts +12 -4
  249. package/dist/sheet.js +5 -5
  250. package/dist/size.d.ts +7 -0
  251. package/dist/size.js +9 -0
  252. package/dist/sizing.d.ts +8 -3
  253. package/dist/sizing.js +8 -10
  254. package/dist/skeleton.d.ts +3 -3
  255. package/dist/skeleton.js +4 -6
  256. package/dist/slider.d.ts +55 -31
  257. package/dist/slider.js +7 -7
  258. package/dist/sparkline.d.ts +5 -20
  259. package/dist/sparkline.js +5 -7
  260. package/dist/spinner.d.ts +4 -6
  261. package/dist/spinner.js +7 -8
  262. package/dist/stat.d.ts +34 -42
  263. package/dist/stat.js +9 -10
  264. package/dist/status.js +0 -1
  265. package/dist/switch.d.ts +17 -8
  266. package/dist/switch.js +4 -5
  267. package/dist/syntax-engine.js +9 -1
  268. package/dist/syntax-highlighter.d.ts +3 -7
  269. package/dist/syntax-highlighter.js +4 -4
  270. package/dist/syntax-highlighting.js +2 -2
  271. package/dist/table.d.ts +111 -75
  272. package/dist/table.js +32 -33
  273. package/dist/tabs.d.ts +46 -26
  274. package/dist/tabs.js +5 -5
  275. package/dist/textarea.d.ts +4 -2
  276. package/dist/textarea.js +3 -4
  277. package/dist/toast.d.ts +76 -42
  278. package/dist/toast.js +28 -28
  279. package/dist/toggle-group.js +1 -1
  280. package/dist/toggle.js +1 -1
  281. package/dist/tone-transition.d.ts +1 -1
  282. package/dist/tone-transition.js +9 -8
  283. package/dist/toolbar.d.ts +55 -31
  284. package/dist/toolbar.js +6 -6
  285. package/dist/tooltip.d.ts +4 -1
  286. package/dist/tooltip.js +2 -2
  287. package/dist/tree.d.ts +12 -1
  288. package/dist/tree.js +13 -9
  289. package/dist/typography.d.ts +3 -1
  290. package/dist/typography.js +6 -8
  291. package/package.json +6 -5
@@ -1,19 +1,19 @@
1
- 'use client';
2
1
  import * as React from 'react';
3
- import { part, cx } from './parts.js';
4
- const EmptyTitle = /* @__PURE__ */ React.forwardRef(function EmptyTitle({ level = 3, className, ...props }, ref) {
2
+ import { cx } from './class-names.js';
3
+ import { elementPart } from './element-part.js';
4
+ const EmptyTitle = function EmptyTitle({ level = 3, className, ref, ...props }) {
5
5
  return React.createElement(`h${level}`, {
6
6
  ...props,
7
7
  ref,
8
- className: cx('pui-empty-title', className),
8
+ className: cx('surf-empty-title', className),
9
9
  });
10
- });
10
+ };
11
11
  export const EmptyState = {
12
- Root: /* @__PURE__ */ part('div', 'pui-empty'),
13
- Icon: /* @__PURE__ */ part('div', 'pui-empty-icon'),
12
+ Root: /* @__PURE__ */ elementPart('div', 'surf-empty'),
13
+ Icon: /* @__PURE__ */ elementPart('div', 'surf-empty-icon'),
14
14
  Title: EmptyTitle,
15
- Description: /* @__PURE__ */ part('p', 'pui-empty-description'),
16
- Actions: /* @__PURE__ */ part('div', 'pui-empty-actions'),
15
+ Description: /* @__PURE__ */ elementPart('p', 'surf-empty-description'),
16
+ Actions: /* @__PURE__ */ elementPart('div', 'surf-empty-actions'),
17
17
  };
18
18
  // Flat names for React Server Components, which cannot dot into client exports.
19
19
  export const { Root: EmptyStateRoot, Icon: EmptyStateIcon, Title: EmptyStateTitle, Description: EmptyStateDescription, Actions: EmptyStateActions, } = EmptyState;
package/dist/field.d.ts CHANGED
@@ -1,41 +1,65 @@
1
1
  import * as React from 'react';
2
- declare const FieldRoot: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
3
- size?: import("./sizing.js").ComponentSize;
4
- } & React.RefAttributes<HTMLDivElement>>;
5
- declare const FieldLabel: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
6
- size?: import("./sizing.js").ComponentSize;
7
- } & React.RefAttributes<HTMLElement>>;
8
- declare const FieldControl: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
9
- size?: import("./sizing.js").ComponentSize;
10
- } & React.RefAttributes<HTMLElement>>;
11
- declare const FieldDescription: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
12
- size?: import("./sizing.js").ComponentSize;
13
- } & React.RefAttributes<HTMLParagraphElement>>;
14
- declare const FieldError: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
15
- size?: import("./sizing.js").ComponentSize;
16
- } & React.RefAttributes<HTMLDivElement>>;
17
- declare const FieldItem: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
18
- size?: import("./sizing.js").ComponentSize;
19
- } & React.RefAttributes<HTMLDivElement>>;
2
+ declare const FieldRoot: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
3
+ size?: import("./size.js").ComponentSize;
4
+ } & {
5
+ ref?: React.Ref<HTMLDivElement> | undefined;
6
+ }) => React.JSX.Element;
7
+ declare const FieldLabel: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
8
+ size?: import("./size.js").ComponentSize;
9
+ } & {
10
+ ref?: React.Ref<HTMLElement> | undefined;
11
+ }) => React.JSX.Element;
12
+ declare const FieldControl: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
13
+ size?: import("./size.js").ComponentSize;
14
+ } & {
15
+ ref?: React.Ref<HTMLElement> | undefined;
16
+ }) => React.JSX.Element;
17
+ declare const FieldDescription: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
18
+ size?: import("./size.js").ComponentSize;
19
+ } & {
20
+ ref?: React.Ref<HTMLParagraphElement> | undefined;
21
+ }) => React.JSX.Element;
22
+ declare const FieldError: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
23
+ size?: import("./size.js").ComponentSize;
24
+ } & {
25
+ ref?: React.Ref<HTMLDivElement> | undefined;
26
+ }) => React.JSX.Element;
27
+ declare const FieldItem: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
28
+ size?: import("./size.js").ComponentSize;
29
+ } & {
30
+ ref?: React.Ref<HTMLDivElement> | undefined;
31
+ }) => React.JSX.Element;
20
32
  export declare const Field: {
21
- Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
22
- size?: import("./sizing.js").ComponentSize;
23
- } & React.RefAttributes<HTMLDivElement>>;
24
- Label: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
25
- size?: import("./sizing.js").ComponentSize;
26
- } & React.RefAttributes<HTMLElement>>;
27
- Control: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
28
- size?: import("./sizing.js").ComponentSize;
29
- } & React.RefAttributes<HTMLElement>>;
30
- Description: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
31
- size?: import("./sizing.js").ComponentSize;
32
- } & React.RefAttributes<HTMLParagraphElement>>;
33
- Error: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
34
- size?: import("./sizing.js").ComponentSize;
35
- } & React.RefAttributes<HTMLDivElement>>;
36
- Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
37
- size?: import("./sizing.js").ComponentSize;
38
- } & React.RefAttributes<HTMLDivElement>>;
33
+ Root: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
34
+ size?: import("./size.js").ComponentSize;
35
+ } & {
36
+ ref?: React.Ref<HTMLDivElement> | undefined;
37
+ }) => React.JSX.Element;
38
+ Label: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
39
+ size?: import("./size.js").ComponentSize;
40
+ } & {
41
+ ref?: React.Ref<HTMLElement> | undefined;
42
+ }) => React.JSX.Element;
43
+ Control: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
44
+ size?: import("./size.js").ComponentSize;
45
+ } & {
46
+ ref?: React.Ref<HTMLElement> | undefined;
47
+ }) => React.JSX.Element;
48
+ Description: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
49
+ size?: import("./size.js").ComponentSize;
50
+ } & {
51
+ ref?: React.Ref<HTMLParagraphElement> | undefined;
52
+ }) => React.JSX.Element;
53
+ Error: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
54
+ size?: import("./size.js").ComponentSize;
55
+ } & {
56
+ ref?: React.Ref<HTMLDivElement> | undefined;
57
+ }) => React.JSX.Element;
58
+ Item: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
59
+ size?: import("./size.js").ComponentSize;
60
+ } & {
61
+ ref?: React.Ref<HTMLDivElement> | undefined;
62
+ }) => React.JSX.Element;
39
63
  Validity: React.FC<import("@base-ui/react/field").FieldValidityProps>;
40
64
  };
41
65
  export { FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldRoot, };
package/dist/field.js CHANGED
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import { Field as BaseField } from '@base-ui/react/field';
3
3
  import { part } from './parts.js';
4
- const FieldRoot = /* @__PURE__ */ part(BaseField.Root, 'pui-field');
5
- const FieldLabel = /* @__PURE__ */ part(BaseField.Label, 'pui-field-label');
6
- const FieldControl = /* @__PURE__ */ part(BaseField.Control, 'pui-input');
7
- const FieldDescription = /* @__PURE__ */ part(BaseField.Description, 'pui-field-description');
8
- const FieldError = /* @__PURE__ */ part(BaseField.Error, 'pui-field-error');
9
- const FieldItem = /* @__PURE__ */ part(BaseField.Item, 'pui-field-item');
4
+ const FieldRoot = /* @__PURE__ */ part(BaseField.Root, 'surf-field');
5
+ const FieldLabel = /* @__PURE__ */ part(BaseField.Label, 'surf-field-label');
6
+ const FieldControl = /* @__PURE__ */ part(BaseField.Control, 'surf-input');
7
+ const FieldDescription = /* @__PURE__ */ part(BaseField.Description, 'surf-field-description');
8
+ const FieldError = /* @__PURE__ */ part(BaseField.Error, 'surf-field-error');
9
+ const FieldItem = /* @__PURE__ */ part(BaseField.Item, 'surf-field-item');
10
10
  export const Field = {
11
11
  ...BaseField,
12
12
  Root: FieldRoot,
@@ -1,14 +1,22 @@
1
1
  import * as React from 'react';
2
2
  export declare const Fieldset: {
3
- Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
4
- size?: import("./sizing.js").ComponentSize;
5
- } & React.RefAttributes<HTMLElement>>;
6
- Legend: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
7
- size?: import("./sizing.js").ComponentSize;
8
- } & React.RefAttributes<HTMLDivElement>>;
3
+ Root: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
4
+ size?: import("./size.js").ComponentSize;
5
+ } & {
6
+ ref?: React.Ref<HTMLElement> | undefined;
7
+ }) => React.JSX.Element;
8
+ Legend: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
9
+ size?: import("./size.js").ComponentSize;
10
+ } & {
11
+ ref?: React.Ref<HTMLDivElement> | undefined;
12
+ }) => React.JSX.Element;
9
13
  };
10
- export declare const FieldsetLegend: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
11
- size?: import("./sizing.js").ComponentSize;
12
- } & React.RefAttributes<HTMLDivElement>>, FieldsetRoot: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
13
- size?: import("./sizing.js").ComponentSize;
14
- } & React.RefAttributes<HTMLElement>>;
14
+ export declare const FieldsetLegend: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
15
+ size?: import("./size.js").ComponentSize;
16
+ } & {
17
+ ref?: React.Ref<HTMLDivElement> | undefined;
18
+ }) => React.JSX.Element, FieldsetRoot: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
19
+ size?: import("./size.js").ComponentSize;
20
+ } & {
21
+ ref?: React.Ref<HTMLElement> | undefined;
22
+ }) => React.JSX.Element;
package/dist/fieldset.js CHANGED
@@ -3,8 +3,8 @@ import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';
3
3
  import { part } from './parts.js';
4
4
  export const Fieldset = {
5
5
  ...BaseFieldset,
6
- Root: /* @__PURE__ */ part(BaseFieldset.Root, 'pui-fieldset'),
7
- Legend: /* @__PURE__ */ part(BaseFieldset.Legend, 'pui-fieldset-legend'),
6
+ Root: /* @__PURE__ */ part(BaseFieldset.Root, 'surf-fieldset'),
7
+ Legend: /* @__PURE__ */ part(BaseFieldset.Legend, 'surf-fieldset-legend'),
8
8
  };
9
9
  // Flat names for React Server Components, which cannot dot into client exports.
10
10
  export const { Legend: FieldsetLegend, Root: FieldsetRoot } = Fieldset;
@@ -31,6 +31,11 @@ export type FileUploadLabels = {
31
31
  progress: (file: File) => string;
32
32
  /** Shown when an upload fails and getUploadError gives no message. */
33
33
  uploadError: string;
34
+ /** A file's size, as the list shows it. */
35
+ size: (bytes: number) => string;
36
+ /** A file's action button name, given the action's text and the file, so a
37
+ * language can put the file name first. */
38
+ fileAction: (action: string, file: File) => string;
34
39
  };
35
40
  export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<typeof Field.Root>, 'children' | 'name' | 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop'> & Pick<React.HTMLAttributes<HTMLDivElement>, 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop'> & {
36
41
  label: React.ReactNode;
@@ -54,26 +59,6 @@ export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<typeof Field.R
54
59
  };
55
60
  };
56
61
  /** Native selection/validation and a cancellable transport adapter; no network request is built in. */
57
- export declare const FileUpload: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<import("@base-ui/react").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
58
- size?: import("./sizing.js").ComponentSize;
59
- } & React.RefAttributes<HTMLDivElement>, "ref">, "children" | "name" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & Pick<React.HTMLAttributes<HTMLDivElement>, "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
60
- label: React.ReactNode;
61
- description?: React.ReactNode;
62
- name?: string;
63
- form?: string;
64
- capture?: React.InputHTMLAttributes<HTMLInputElement>["capture"];
65
- accept?: string;
66
- multiple?: boolean;
67
- required?: boolean;
68
- maxFiles?: number;
69
- maxFileSize?: number;
70
- files?: readonly File[];
71
- defaultFiles?: readonly File[];
72
- onFilesChange?: (files: File[], details: FileChangeDetails) => void;
73
- onReject?: (rejections: FileRejection[]) => void;
74
- transport?: UploadTransport;
75
- getUploadError?: (error: unknown) => string;
76
- labels?: Partial<Omit<FileUploadLabels, "status">> & {
77
- status?: Partial<FileUploadLabels["status"]>;
78
- };
79
- } & React.RefAttributes<HTMLDivElement>>;
62
+ export declare const FileUpload: ({ label, description, name, form, accept, capture, multiple, required, maxFiles, maxFileSize, files: controlled, defaultFiles, onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled, className, onDragEnter, onDragLeave, onDragOver, onDrop, ref: forwardedRef, ...props }: FileUploadProps & {
63
+ ref?: React.Ref<HTMLDivElement>;
64
+ }) => React.JSX.Element;
@@ -30,6 +30,11 @@ const labelsDefault = {
30
30
  reset: 'Files reset.',
31
31
  progress: (file) => `${file.name} upload progress`,
32
32
  uploadError: 'Upload failed. Try again.',
33
+ size: (bytes) => {
34
+ const unit = bytes >= 1024 * 1024 ? 'MB' : bytes >= 1024 ? 'KB' : 'B';
35
+ return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / (unit === 'MB' ? 1024 * 1024 : unit === 'KB' ? 1024 : 1))} ${unit}`;
36
+ },
37
+ fileAction: (action, file) => `${action} ${file.name}`,
33
38
  };
34
39
  function signature(file) {
35
40
  return JSON.stringify([file.name, file.size, file.type, file.lastModified]);
@@ -46,14 +51,12 @@ function accepts(file, accept) {
46
51
  ? file.type.toLowerCase().startsWith(rule.slice(0, -1))
47
52
  : file.type.toLowerCase() === rule));
48
53
  }
49
- function sizeLabel(bytes) {
50
- const unit = bytes >= 1024 * 1024 ? 'MB' : bytes >= 1024 ? 'KB' : 'B';
51
- return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / (unit === 'MB' ? 1024 * 1024 : unit === 'KB' ? 1024 : 1))} ${unit}`;
52
- }
53
54
  /** Native selection/validation and a cancellable transport adapter; no network request is built in. */
54
- export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({ label, description, name, form, accept = '', capture, multiple = false, required = false, maxFiles = Infinity, maxFileSize = Infinity, files: controlled, defaultFiles = [], onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled = false, className, onDragEnter, onDragLeave, onDragOver, onDrop, ...props }, forwardedRef) {
55
+ export const FileUpload = function FileUpload({ label, description, name, form, accept = '', capture, multiple = false, required = false, maxFiles = Infinity, maxFileSize = Infinity, files: controlled, defaultFiles = [], onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled = false, className, onDragEnter, onDragLeave, onDragOver, onDrop, ref: forwardedRef, ...props }) {
55
56
  const labels = {
56
57
  ...labelsDefault,
58
+ // A field that takes one file says so.
59
+ ...(!multiple && { choose: 'Choose file', drop: 'or drop a file here' }),
57
60
  ...customLabels,
58
61
  status: { ...labelsDefault.status, ...customLabels?.status },
59
62
  };
@@ -270,7 +273,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
270
273
  }
271
274
  }
272
275
  const hasFiles = (event) => Array.from(event.dataTransfer.types).includes('Files');
273
- return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('pui-field pui-file-upload', className), "data-dragging": dragging || undefined, children: [_jsx(Field.Label, { children: label }), description != null && description !== false && (_jsx(Field.Description, { children: description })), _jsxs("div", { className: 'pui-file-dropzone', onDragEnter: (event) => {
276
+ return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('surf-file-upload', className), "data-dragging": dragging || undefined, children: [_jsx(Field.Label, { children: label }), description != null && description !== false && (_jsx(Field.Description, { children: description })), _jsxs("div", { className: 'surf-file-dropzone', onDragEnter: (event) => {
274
277
  onDragEnter?.(event);
275
278
  if (!event.defaultPrevented && hasFiles(event) && !disabled) {
276
279
  event.preventDefault();
@@ -296,7 +299,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
296
299
  event.preventDefault();
297
300
  select(Array.from(event.dataTransfer.files), 'drop');
298
301
  }
299
- }, children: [_jsxs("div", { className: 'pui-file-picker', children: [_jsx(Field.Control, { ref: input, id: inputId, name: name, form: form, type: 'file', accept: accept, capture: capture, multiple: multiple, required: required, disabled: disabled, className: 'pui-file-native', "aria-describedby": errorId, onKeyDown: (event) => {
302
+ }, children: [_jsxs("div", { className: 'surf-file-picker', children: [_jsx(Field.Control, { ref: input, id: inputId, name: name, form: form, type: 'file', accept: accept, capture: capture, multiple: multiple, required: required, disabled: disabled, className: 'surf-file-native', "aria-describedby": errorId, onKeyDown: (event) => {
300
303
  if (event.key === 'Enter')
301
304
  event.preventBaseUIHandler();
302
305
  }, onChange: (event) => {
@@ -304,7 +307,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
304
307
  event.preventBaseUIHandler();
305
308
  select(Array.from(event.currentTarget.files ?? []), 'select');
306
309
  }
307
- } }), _jsxs("label", { htmlFor: inputId, className: 'pui-button pui-file-trigger', "data-variant": 'outline', "data-disabled": disabled || undefined, children: [_jsx(Icon, { name: 'upload' }), labels.choose] }), _jsx("p", { className: 'pui-file-drop-hint', children: labels.drop })] }), files.length > 0 && (_jsx("ul", { className: 'pui-file-list', role: 'list', children: files.map((file) => {
310
+ } }), _jsxs("label", { htmlFor: inputId, className: 'surf-button surf-file-trigger', "data-variant": 'outline', "data-disabled": disabled || undefined, children: [_jsx(Icon, { name: 'upload' }), labels.choose] }), _jsx("p", { className: 'surf-file-drop-hint', children: labels.drop })] }), files.length > 0 && (_jsx("ul", { className: 'surf-file-list', role: 'list', children: files.map((file) => {
308
311
  const state = metadata.get(file) ?? {
309
312
  status: 'ready',
310
313
  progress: null,
@@ -312,18 +315,22 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
312
315
  if (!identities.current.has(file))
313
316
  identities.current.set(file, `${uid}-${++nextId.current}`);
314
317
  const itemId = identities.current.get(file);
315
- return (_jsxs("li", { className: 'pui-file-item', children: [_jsxs("div", { className: 'pui-file-info', children: [_jsx("strong", { children: file.name }), _jsx("span", { children: sizeLabel(file.size) }), _jsx(StatusBadge, { tone: state.status === 'success'
318
+ return (_jsxs("li", { className: 'surf-file-item', children: [_jsxs("div", { className: 'surf-file-info', children: [_jsx("strong", { children: file.name }), _jsx("span", { children: labels.size(file.size) }), _jsx(StatusBadge, { tone: state.status === 'success'
316
319
  ? 'success'
317
320
  : state.status === 'error'
318
321
  ? 'danger'
319
322
  : state.status === 'uploading'
320
323
  ? 'progress'
321
- : 'neutral', children: labels.status[state.status] })] }), _jsxs("div", { className: 'pui-file-actions', children: [transport && state.status !== 'success' && (_jsx(Button, { ref: (node) => {
324
+ : 'neutral', children: labels.status[state.status] })] }), _jsxs("div", { className: 'surf-file-actions', children: [transport && state.status !== 'success' && (_jsx(Button, { ref: (node) => {
322
325
  if (node)
323
326
  primaryButtons.current.set(file, node);
324
327
  else
325
328
  primaryButtons.current.delete(file);
326
- }, type: 'button', size: 'sm', variant: 'outline', disabled: disabled, "aria-describedby": state.error ? `${itemId}-error` : undefined, "aria-label": `${state.status === 'uploading' ? labels.cancel : state.status === 'ready' ? labels.upload : labels.retry} ${file.name}`, onClick: () => {
329
+ }, type: 'button', size: 'small', variant: 'outline', disabled: disabled, "aria-describedby": state.error ? `${itemId}-error` : undefined, "aria-label": labels.fileAction(state.status === 'uploading'
330
+ ? labels.cancel
331
+ : state.status === 'ready'
332
+ ? labels.upload
333
+ : labels.retry, file), onClick: () => {
327
334
  if (state.status === 'uploading')
328
335
  cancel(file);
329
336
  else
@@ -332,15 +339,15 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
332
339
  ? labels.cancel
333
340
  : state.status === 'ready'
334
341
  ? labels.upload
335
- : labels.retry })), _jsx(Button, { type: 'button', size: 'sm', variant: 'ghost', ref: (node) => {
342
+ : labels.retry })), _jsx(Button, { type: 'button', size: 'small', variant: 'ghost', ref: (node) => {
336
343
  if (node)
337
344
  removeButtons.current.set(file, node);
338
345
  else
339
346
  removeButtons.current.delete(file);
340
- }, disabled: disabled, "aria-label": `${labels.remove} ${file.name}`, onClick: () => {
347
+ }, disabled: disabled, "aria-label": labels.fileAction(labels.remove, file), onClick: () => {
341
348
  setRejections([]);
342
349
  if (commit(files.filter((current) => current !== file), 'remove'))
343
350
  focusPicker.current = file;
344
- }, children: labels.remove })] }), state.status === 'uploading' && (_jsx(Progress.Root, { value: state.progress, "aria-label": labels.progress(file), children: _jsx(Progress.Track, { children: _jsx(Progress.Indicator, {}) }) })), state.error && (_jsx("p", { id: `${itemId}-error`, className: 'pui-file-upload-error', children: state.error }))] }, itemId));
345
- }) }))] }), _jsx("div", { id: errorId, role: 'alert', className: 'pui-file-errors', children: rejections.length > 0 && (_jsx("ul", { children: rejections.map((rejection, index) => (_jsx("li", { children: labels.rejection(rejection) }, index))) })) }), _jsx(Field.Error, {}), _jsx("span", { className: 'pui-feedback-sr', role: 'status', children: announcement })] }));
346
- });
351
+ }, children: labels.remove })] }), state.status === 'uploading' && (_jsx(Progress.Root, { value: state.progress, "aria-label": labels.progress(file), children: _jsx(Progress.Track, { children: _jsx(Progress.Indicator, {}) }) })), state.error && (_jsx("p", { id: `${itemId}-error`, className: 'surf-file-upload-error', children: state.error }))] }, itemId));
352
+ }) }))] }), _jsx("div", { id: errorId, role: 'alert', className: 'surf-file-errors', children: rejections.length > 0 && (_jsx("ul", { children: rejections.map((rejection, index) => (_jsx("li", { children: labels.rejection(rejection) }, index))) })) }), _jsx(Field.Error, {}), _jsx("span", { className: 'surf-feedback-sr', role: 'status', children: announcement })] }));
353
+ };
@@ -1,17 +1,37 @@
1
1
  import * as React from 'react';
2
2
  export declare const FilterBar: {
3
- Root: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
3
+ Root: ({ label, className, ref, ...props }: React.ComponentPropsWithoutRef<"form"> & {
4
4
  label: string;
5
- } & React.RefAttributes<HTMLFormElement>>;
6
- Controls: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
- Field: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
5
+ } & {
6
+ ref?: React.Ref<HTMLFormElement>;
7
+ }) => React.JSX.Element;
8
+ Controls: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
9
+ ref?: React.Ref<HTMLDivElement>;
10
+ }) => React.JSX.Element;
11
+ Field: ({ width, className, ref, ...props }: React.ComponentPropsWithoutRef<"label"> & {
8
12
  width?: "search" | "filter";
9
- } & React.RefAttributes<HTMLLabelElement>>;
10
- Actions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- Summary: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ } & {
14
+ ref?: React.Ref<HTMLLabelElement>;
15
+ }) => React.JSX.Element;
16
+ Actions: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
17
+ ref?: React.Ref<HTMLDivElement>;
18
+ }) => React.JSX.Element;
19
+ Summary: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
20
+ ref?: React.Ref<HTMLDivElement>;
21
+ }) => React.JSX.Element;
12
22
  };
13
- export declare const FilterBarRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
23
+ export declare const FilterBarRoot: ({ label, className, ref, ...props }: React.ComponentPropsWithoutRef<"form"> & {
14
24
  label: string;
15
- } & React.RefAttributes<HTMLFormElement>>, FilterBarControls: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>, FilterBarField: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
25
+ } & {
26
+ ref?: React.Ref<HTMLFormElement>;
27
+ }) => React.JSX.Element, FilterBarControls: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
28
+ ref?: React.Ref<HTMLDivElement>;
29
+ }) => React.JSX.Element, FilterBarField: ({ width, className, ref, ...props }: React.ComponentPropsWithoutRef<"label"> & {
16
30
  width?: "search" | "filter";
17
- } & React.RefAttributes<HTMLLabelElement>>, FilterBarActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>, FilterBarSummary: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
+ } & {
32
+ ref?: React.Ref<HTMLLabelElement>;
33
+ }) => React.JSX.Element, FilterBarActions: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
34
+ ref?: React.Ref<HTMLDivElement>;
35
+ }) => React.JSX.Element, FilterBarSummary: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
36
+ ref?: React.Ref<HTMLDivElement>;
37
+ }) => React.JSX.Element;
@@ -1,23 +1,21 @@
1
- 'use client';
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { cx } from './parts.js';
2
+ import { cx } from './class-names.js';
5
3
  /** Layout only: filtering, routing and async results remain controlled by the caller. */
6
- const Root = /* @__PURE__ */ React.forwardRef(function FilterBarRoot({ label, className, ...props }, ref) {
7
- return (_jsx("form", { ...props, ref: ref, role: 'search', "aria-label": label, className: cx('pui-filter-bar', className) }));
8
- });
9
- const Controls = /* @__PURE__ */ React.forwardRef(function FilterBarControls({ className, ...props }, ref) {
10
- return (_jsx("div", { ...props, ref: ref, className: cx('pui-filter-bar-controls', className) }));
11
- });
12
- const Field = /* @__PURE__ */ React.forwardRef(function FilterBarField({ width = 'filter', className, ...props }, ref) {
13
- return (_jsx("label", { ...props, ref: ref, "data-width": width, className: cx('pui-filter-bar-field', className) }));
14
- });
15
- const Actions = /* @__PURE__ */ React.forwardRef(function FilterBarActions({ className, ...props }, ref) {
16
- return (_jsx("div", { ...props, ref: ref, className: cx('pui-filter-bar-actions', className) }));
17
- });
18
- const Summary = /* @__PURE__ */ React.forwardRef(function FilterBarSummary({ className, ...props }, ref) {
19
- return (_jsx("div", { role: 'status', "aria-atomic": 'true', ...props, ref: ref, className: cx('pui-filter-bar-summary', className) }));
20
- });
4
+ const Root = function FilterBarRoot({ label, className, ref, ...props }) {
5
+ return (_jsx("form", { ...props, ref: ref, role: 'search', "aria-label": label, className: cx('surf-filter-bar', className) }));
6
+ };
7
+ const Controls = function FilterBarControls({ className, ref, ...props }) {
8
+ return (_jsx("div", { ...props, ref: ref, className: cx('surf-filter-bar-controls', className) }));
9
+ };
10
+ const Field = function FilterBarField({ width = 'filter', className, ref, ...props }) {
11
+ return (_jsx("label", { ...props, ref: ref, "data-width": width, className: cx('surf-filter-bar-field', className) }));
12
+ };
13
+ const Actions = function FilterBarActions({ className, ref, ...props }) {
14
+ return (_jsx("div", { ...props, ref: ref, className: cx('surf-filter-bar-actions', className) }));
15
+ };
16
+ const Summary = function FilterBarSummary({ className, ref, ...props }) {
17
+ return (_jsx("div", { role: 'status', "aria-atomic": 'true', ...props, ref: ref, className: cx('surf-filter-bar-summary', className) }));
18
+ };
21
19
  export const FilterBar = { Root, Controls, Field, Actions, Summary };
22
20
  // Flat names for React Server Components, which cannot dot into client exports.
23
21
  export const { Root: FilterBarRoot, Controls: FilterBarControls, Field: FilterBarField, Actions: FilterBarActions, Summary: FilterBarSummary, } = FilterBar;
package/dist/form.js CHANGED
@@ -3,5 +3,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Form as BaseForm } from '@base-ui/react/form';
4
4
  import { skin } from './parts.js';
5
5
  export function Form({ className, ...props }) {
6
- return _jsx(BaseForm, { ...props, className: skin('pui-form', className) });
6
+ return (_jsx(BaseForm, { ...props, className: skin('surf-form', className) }));
7
7
  }
package/dist/icon.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { ComponentSize } from './size.js';
2
3
  declare const shapes: {
3
4
  search: React.JSX.Element;
4
5
  plus: React.JSX.Element;
@@ -42,8 +43,14 @@ type Semantics = {
42
43
  };
43
44
  export type IconProps = Omit<React.ComponentPropsWithoutRef<'svg'>, 'children' | 'name' | 'role' | 'aria-label' | 'aria-labelledby' | 'aria-hidden' | 'tabIndex' | 'focusable' | 'width' | 'height' | 'viewBox' | 'strokeWidth' | 'fill' | 'stroke' | 'title'> & Semantics & {
44
45
  name: IconName;
45
- size?: 'sm' | 'md' | 'lg';
46
+ /**
47
+ * 14, 16 or 20px; 16px when omitted. Deprecated, removed in a later minor: sm
48
+ * (16px, now default), md (20px, now large) and lg (24px, off the scale).
49
+ */
50
+ size?: ComponentSize | 'sm' | 'md' | 'lg';
46
51
  };
47
52
  /** Static SVG only. Actions, focus, accessible button names and hit targets belong to the parent control. */
48
- export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
53
+ export declare const Icon: ({ name, size, decorative, label, className, ref, ...props }: IconProps & {
54
+ ref?: React.Ref<SVGSVGElement>;
55
+ }) => React.JSX.Element;
49
56
  export {};
package/dist/icon.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use client';
2
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { cx } from './parts.js';
2
+ import { cx } from './class-names.js';
5
3
  const shapes = {
6
4
  search: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: '10.5', cy: '10.5', r: '6.5' }), _jsx("path", { d: 'm16 16 4 4' })] })),
7
5
  plus: _jsx("path", { d: 'M12 5v14M5 12h14' }),
@@ -41,7 +39,9 @@ const directional = new Set([
41
39
  'chevron-back',
42
40
  'arrow-back',
43
41
  ]);
42
+ // The short spellings map by pixel size: sm was 16px, which is now the default.
43
+ const iconSizes = { sm: 'default', md: 'large', lg: 'lg' };
44
44
  /** Static SVG only. Actions, focus, accessible button names and hit targets belong to the parent control. */
45
- export const Icon = /* @__PURE__ */ React.forwardRef(function Icon({ name, size = 'sm', decorative = true, label, className, ...props }, ref) {
46
- return (_jsx("svg", { ...props, ref: ref, className: cx('pui-icon', className), "data-size": size, "data-directional": directional.has(name) ? 'true' : undefined, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', focusable: 'false', "aria-hidden": decorative ? true : undefined, role: decorative ? undefined : 'img', "aria-label": decorative ? undefined : label, children: shapes[name] }));
47
- });
45
+ export const Icon = function Icon({ name, size, decorative = true, label, className, ref, ...props }) {
46
+ return (_jsx("svg", { ...props, ref: ref, className: cx('surf-icon', className), "data-size": size === 'sm' || size === 'md' || size === 'lg' ? iconSizes[size] : size, "data-directional": directional.has(name) ? 'true' : undefined, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', focusable: 'false', "aria-hidden": decorative ? true : undefined, role: decorative ? undefined : 'img', "aria-label": decorative ? undefined : label, children: shapes[name] }));
47
+ };
package/dist/index.d.ts CHANGED
@@ -36,13 +36,13 @@ export { NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, Navigation
36
36
  export { Menubar } from './menubar.js';
37
37
  export { Link, type LinkProps } from './link.js';
38
38
  export { Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './breadcrumbs.js';
39
- export { Pagination, type PaginationProps } from './pagination.js';
39
+ export { Pagination, type PaginationProps, type PaginationLabels, } from './pagination.js';
40
40
  export { BottomNavigation, BottomNavigationRoot, BottomNavigationItem, type BottomNavigationRootProps, type BottomNavigationItemProps, } from './bottom-navigation.js';
41
41
  export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
42
42
  export { Badge, StatusBadge, type BadgeProps, type StatusTone, } from './badge.js';
43
43
  export { Card, CardRoot, CardHeader, CardTitle, CardDescription, CardBody, CardFooter, } from './card.js';
44
- export { Table, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, type TableDensity, type TableSort, useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table.js';
45
- export { CodeBlock, type CodeBlockProps } from './code.js';
44
+ export { Table, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, type TableDensity, type TableVariant, type TableSort, useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table.js';
45
+ export { CodeBlock, type CodeBlockProps, type CodeBlockLabels } from './code.js';
46
46
  export { SyntaxHighlighter, syntaxLanguages, type SyntaxHighlighterProps, } from './syntax-highlighter.js';
47
47
  export { List, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, } from './list.js';
48
48
  export { Stat, StatRoot, StatLabel, StatValue, StatChange, StatCaption, type StatChangeProps, type StatDirection, } from './stat.js';
@@ -63,6 +63,6 @@ export { Icon, iconNames, type IconName, type IconProps } from './icon.js';
63
63
  export { SizeProvider, type ComponentSize, type ComponentSizeAlias, } from './sizing.js';
64
64
  export { DirectionProvider } from '@base-ui/react/direction-provider';
65
65
  export { Slot } from './slot.js';
66
- export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, type AppShellRootProps, type AppShellSidebarToggleProps, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
66
+ export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, type AppShellRootProps, type AppShellSidebarToggleProps, type AppShellSidebarToggleLabels, AppShellBrand, type AppShellBrandProps, AppShellNav, type AppShellNavProps, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, type AppShellLinkProps, } from './app-shell.js';
67
67
  export { PageHeader } from './page-header.js';
68
68
  export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use client';
2
1
  // One entry per catalog page: each module is also its own entry point, such as
3
2
  // @surflane/ui/checkbox. Chart, DatePicker, Markdown, Tree and syntax highlighting
4
3
  // need optional packages, so they live only on their own entry points:
@@ -46,7 +45,7 @@ export { NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, Navigation
46
45
  export { Menubar } from './menubar.js';
47
46
  export { Link } from './link.js';
48
47
  export { Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './breadcrumbs.js';
49
- export { Pagination } from './pagination.js';
48
+ export { Pagination, } from './pagination.js';
50
49
  export { BottomNavigation, BottomNavigationRoot, BottomNavigationItem, } from './bottom-navigation.js';
51
50
  // Data display
52
51
  export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
@@ -78,6 +77,6 @@ export { SizeProvider, } from './sizing.js';
78
77
  export { DirectionProvider } from '@base-ui/react/direction-provider';
79
78
  export { Slot } from './slot.js';
80
79
  // Patterns
81
- export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
80
+ export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, AppShellBrand, AppShellNav, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
82
81
  export { PageHeader } from './page-header.js';
83
82
  export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';