@gemologic/sheen 0.2.0 → 0.3.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 (214) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/ai.d.ts +8 -0
  4. package/dist/ai.js +5 -0
  5. package/dist/core.d.ts +11 -4
  6. package/dist/core.js +32 -28
  7. package/dist/formisch.js +1 -2
  8. package/dist/forms.d.ts +2 -0
  9. package/dist/forms.js +16 -15
  10. package/dist/index.d.ts +25 -5
  11. package/dist/index.js +86 -76
  12. package/dist/layout/Layout.js +1 -2
  13. package/dist/metadata.js +1 -2
  14. package/dist/navigation.d.ts +2 -1
  15. package/dist/navigation.js +16 -16
  16. package/dist/primitives/Accordion.js +9 -9
  17. package/dist/primitives/ActivityTimeline.js +57 -49
  18. package/dist/primitives/AlertDialog.js +1 -2
  19. package/dist/primitives/Avatar.js +16 -17
  20. package/dist/primitives/Board.d.ts +39 -0
  21. package/dist/primitives/Board.js +471 -0
  22. package/dist/primitives/Breadcrumb.js +1 -2
  23. package/dist/primitives/Button.js +38 -27
  24. package/dist/primitives/ButtonGroup.js +1 -2
  25. package/dist/primitives/Checkbox.js +1 -2
  26. package/dist/primitives/CheckboxGroup.js +11 -12
  27. package/dist/primitives/Collapsible.js +6 -6
  28. package/dist/primitives/Combobox.js +203 -201
  29. package/dist/primitives/CommandPalette.js +2 -4
  30. package/dist/primitives/ConfirmDialog.js +5 -6
  31. package/dist/primitives/ContextMenu.js +7 -8
  32. package/dist/primitives/Conversation.d.ts +17 -0
  33. package/dist/primitives/Conversation.js +107 -0
  34. package/dist/primitives/DescriptionList.js +1 -2
  35. package/dist/primitives/Dialog.js +101 -68
  36. package/dist/primitives/Drawer.js +12 -13
  37. package/dist/primitives/DropdownMenu.js +163 -157
  38. package/dist/primitives/EditableTextField.js +3 -8
  39. package/dist/primitives/EmptyState.js +1 -2
  40. package/dist/primitives/Field.js +1 -2
  41. package/dist/primitives/FileDropzone.js +19 -18
  42. package/dist/primitives/Form.d.ts +23 -0
  43. package/dist/primitives/Form.js +76 -0
  44. package/dist/primitives/Glyph.d.ts +40 -0
  45. package/dist/primitives/Glyph.js +65 -0
  46. package/dist/primitives/IconButton.js +5 -6
  47. package/dist/primitives/Input.js +1 -2
  48. package/dist/primitives/InputGroup.js +8 -9
  49. package/dist/primitives/Link.d.ts +9 -1
  50. package/dist/primitives/Link.js +23 -17
  51. package/dist/primitives/LinkTooltip.js +6 -7
  52. package/dist/primitives/List.d.ts +34 -0
  53. package/dist/primitives/List.js +135 -0
  54. package/dist/primitives/Message.d.ts +13 -0
  55. package/dist/primitives/Message.js +75 -0
  56. package/dist/primitives/NavList.js +15 -16
  57. package/dist/primitives/Notice.d.ts +15 -1
  58. package/dist/primitives/Notice.js +91 -43
  59. package/dist/primitives/NumberField.js +81 -81
  60. package/dist/primitives/NumberText.d.ts +4 -0
  61. package/dist/primitives/NumberText.js +50 -25
  62. package/dist/primitives/Pagination.js +81 -60
  63. package/dist/primitives/Popover.js +57 -57
  64. package/dist/primitives/Progress.js +1 -2
  65. package/dist/primitives/PromptInput.d.ts +23 -0
  66. package/dist/primitives/PromptInput.js +135 -0
  67. package/dist/primitives/RadioGroup.js +12 -17
  68. package/dist/primitives/Resizable.js +1 -2
  69. package/dist/primitives/ScrollArea.js +1 -2
  70. package/dist/primitives/SearchInput.js +45 -38
  71. package/dist/primitives/SegmentedControl.d.ts +2 -0
  72. package/dist/primitives/SegmentedControl.js +92 -78
  73. package/dist/primitives/Select.js +105 -100
  74. package/dist/primitives/Separator.js +1 -2
  75. package/dist/primitives/ShortcutPending.js +11 -12
  76. package/dist/primitives/ShortcutProvider.d.ts +5 -0
  77. package/dist/primitives/ShortcutProvider.js +71 -65
  78. package/dist/primitives/ShortcutScope.js +8 -9
  79. package/dist/primitives/ShortcutSheet.js +30 -24
  80. package/dist/primitives/Skeleton.js +1 -2
  81. package/dist/primitives/Slider.js +1 -2
  82. package/dist/primitives/SortableList.d.ts +19 -0
  83. package/dist/primitives/SortableList.js +235 -0
  84. package/dist/primitives/Spinner.js +1 -2
  85. package/dist/primitives/Status.js +14 -14
  86. package/dist/primitives/Stepper.js +54 -52
  87. package/dist/primitives/StreamingText.d.ts +12 -0
  88. package/dist/primitives/StreamingText.js +42 -0
  89. package/dist/primitives/Surface.js +1 -2
  90. package/dist/primitives/Switch.js +1 -2
  91. package/dist/primitives/Table.js +1 -2
  92. package/dist/primitives/Tabs.js +20 -17
  93. package/dist/primitives/TagInput.js +6 -9
  94. package/dist/primitives/Textarea.js +37 -63
  95. package/dist/primitives/Toast.js +42 -41
  96. package/dist/primitives/Toaster.js +27 -28
  97. package/dist/primitives/Tooltip.js +32 -32
  98. package/dist/primitives/Tree.js +1 -2
  99. package/dist/primitives/Typography.d.ts +6 -2
  100. package/dist/primitives/Typography.js +20 -12
  101. package/dist/primitives/boolean-input-state.js +3 -8
  102. package/dist/primitives/button-variants.js +2 -3
  103. package/dist/primitives/choice-options.js +1 -2
  104. package/dist/primitives/create-confirm.js +1 -2
  105. package/dist/primitives/create-toaster.js +1 -2
  106. package/dist/primitives/link-focus.js +1 -2
  107. package/dist/primitives/menu-focus.js +1 -2
  108. package/dist/primitives/sortable-core.d.ts +70 -0
  109. package/dist/primitives/sortable-core.js +109 -0
  110. package/dist/primitives/sortable-drag.d.ts +29 -0
  111. package/dist/primitives/sortable-drag.js +50 -0
  112. package/dist/primitives/tooltip-layer.js +26 -27
  113. package/dist/sortable.d.ts +6 -0
  114. package/dist/sortable.js +4 -0
  115. package/dist/theme/ThemeProvider.d.ts +6 -1
  116. package/dist/theme/ThemeProvider.js +65 -58
  117. package/dist/theme/intl.js +1 -2
  118. package/dist/theme/keyboard-script.js +1 -2
  119. package/dist/theme/layers.js +1 -2
  120. package/dist/theme/messages.d.ts +26 -0
  121. package/dist/theme/messages.js +9 -2
  122. package/dist/theme/number-format-cache.js +1 -2
  123. package/dist/theme/script.d.ts +1 -0
  124. package/dist/theme/script.js +3 -3
  125. package/dist/theme/state.d.ts +4 -4
  126. package/dist/theme/state.js +12 -13
  127. package/dist/utils/auto-resize.d.ts +6 -0
  128. package/dist/utils/auto-resize.js +31 -0
  129. package/dist/utils/browser-status.js +1 -2
  130. package/dist/utils/change-motion.d.ts +8 -0
  131. package/dist/utils/change-motion.js +19 -0
  132. package/dist/utils/cn.js +1 -2
  133. package/dist/utils/media-query.d.ts +10 -0
  134. package/dist/utils/media-query.js +16 -0
  135. package/dist/utils/optimistic.js +1 -2
  136. package/dist/utils/shortcut-platform.js +1 -2
  137. package/dist/utils/shortcut-registry.d.ts +5 -0
  138. package/dist/utils/shortcut-registry.js +61 -51
  139. package/dist/vite.js +3 -4
  140. package/package.json +23 -5
  141. package/src/ai.ts +8 -0
  142. package/src/core.ts +11 -4
  143. package/src/forms.ts +2 -0
  144. package/src/index.ts +25 -5
  145. package/src/navigation.ts +2 -1
  146. package/src/primitives/Accordion.tsx +1 -1
  147. package/src/primitives/ActivityTimeline.tsx +12 -7
  148. package/src/primitives/Board.tsx +406 -0
  149. package/src/primitives/Button.tsx +15 -4
  150. package/src/primitives/Collapsible.tsx +1 -1
  151. package/src/primitives/Combobox.tsx +2 -1
  152. package/src/primitives/CommandPalette.tsx +2 -2
  153. package/src/primitives/Conversation.tsx +108 -0
  154. package/src/primitives/Dialog.tsx +5 -1
  155. package/src/primitives/DropdownMenu.tsx +12 -6
  156. package/src/primitives/FileDropzone.tsx +2 -2
  157. package/src/primitives/Form.tsx +58 -0
  158. package/src/primitives/Glyph.tsx +55 -0
  159. package/src/primitives/Link.tsx +15 -6
  160. package/src/primitives/List.tsx +68 -0
  161. package/src/primitives/Message.tsx +40 -0
  162. package/src/primitives/Notice.tsx +45 -12
  163. package/src/primitives/NumberField.tsx +3 -2
  164. package/src/primitives/NumberText.tsx +31 -4
  165. package/src/primitives/Pagination.tsx +6 -5
  166. package/src/primitives/Popover.tsx +2 -1
  167. package/src/primitives/PromptInput.tsx +116 -0
  168. package/src/primitives/SearchInput.tsx +4 -3
  169. package/src/primitives/SegmentedControl.tsx +29 -4
  170. package/src/primitives/Select.tsx +3 -2
  171. package/src/primitives/ShortcutProvider.tsx +14 -1
  172. package/src/primitives/ShortcutSheet.tsx +1 -1
  173. package/src/primitives/SortableList.tsx +208 -0
  174. package/src/primitives/Status.tsx +1 -1
  175. package/src/primitives/Stepper.tsx +7 -7
  176. package/src/primitives/StreamingText.tsx +32 -0
  177. package/src/primitives/Tabs.tsx +2 -1
  178. package/src/primitives/TagInput.tsx +1 -1
  179. package/src/primitives/Textarea.tsx +3 -47
  180. package/src/primitives/Toast.tsx +2 -1
  181. package/src/primitives/Tooltip.tsx +4 -2
  182. package/src/primitives/Typography.tsx +11 -2
  183. package/src/primitives/button-variants.ts +1 -1
  184. package/src/primitives/sortable-core.ts +139 -0
  185. package/src/primitives/sortable-drag.ts +75 -0
  186. package/src/sortable.ts +6 -0
  187. package/src/styles/ai.css +57 -0
  188. package/src/styles/core.css +321 -0
  189. package/src/styles/forms.css +261 -0
  190. package/src/styles/navigation.css +137 -0
  191. package/src/styles/overlays.css +104 -0
  192. package/src/styles/sortable.css +87 -0
  193. package/src/styles.css +5 -658
  194. package/src/theme/ThemeProvider.tsx +20 -8
  195. package/src/theme/messages.ts +20 -1
  196. package/src/theme/script.ts +2 -2
  197. package/src/theme/state.ts +5 -5
  198. package/src/utils/auto-resize.ts +58 -0
  199. package/src/utils/change-motion.ts +28 -0
  200. package/src/utils/media-query.ts +26 -0
  201. package/src/utils/shortcut-registry.ts +19 -2
  202. package/src/vite.ts +3 -3
  203. package/vendor/integrity.json +13 -13
  204. package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
  205. package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
  206. package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
  207. package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
  208. package/vendor/origins.json +4 -4
  209. package/vendor/solid-web/dev.cjs +21 -17
  210. package/vendor/solid-web/dev.js +21 -17
  211. package/vendor/solid-web/server.cjs +1 -1
  212. package/vendor/solid-web/server.js +1 -1
  213. package/vendor/solid-web/web.cjs +21 -17
  214. package/vendor/solid-web/web.js +21 -17
@@ -1,4 +1,5 @@
1
1
  import * as Primitive from "#sheen-kobalte/dropdown-menu";
2
+ import { Glyph } from "./Glyph.tsx";
2
3
  import { useMenuContext } from "#sheen-kobalte/menu";
3
4
  import { For, Show, createEffect, createMemo, createSignal, createUniqueId, onCleanup } from "solid-js";
4
5
  import type { JSX } from "solid-js";
@@ -7,7 +8,7 @@ import { Kbd } from "./Typography.tsx";
7
8
  import { useTheme } from "../theme/ThemeProvider.tsx";
8
9
  import { cn } from "../utils/cn.ts";
9
10
  import { createMenuFocusRecovery } from "./menu-focus.ts";
10
- import { useShortcutKeyboardOwner } from "./ShortcutProvider.tsx";
11
+ import { useShortcutKeyboardOwner, useShortcutLabel } from "./ShortcutProvider.tsx";
11
12
 
12
13
  interface MenuLabel {
13
14
  readonly id: string;
@@ -62,6 +63,11 @@ export interface DropdownMenuProps {
62
63
  class?: string;
63
64
  }
64
65
 
66
+
67
+ function MenuShortcut(props: { readonly keys: string }): JSX.Element {
68
+ const label = useShortcutLabel(() => props.keys);
69
+ return <Kbd class="sheen-menu-shortcut" aria-hidden="true">{label()}</Kbd>;
70
+ }
65
71
  function indexItems<T extends { readonly id: string }>(items: readonly T[]): Map<string, T> {
66
72
  const result = new Map<string, T>();
67
73
  for (const item of items) {
@@ -98,7 +104,7 @@ function RadioItems(props: { group: MenuRadioGroup }): JSX.Element {
98
104
  <For each={[...options().keys()]}>{id => <Show when={options().get(id)}>{option =>
99
105
  <Primitive.RadioItem class="sheen-menu-item" value={id} textValue={option().label} disabled={option().disabled ?? false} closeOnSelect={false}
100
106
  aria-label={option().description ? `${option().label}, ${option().description}` : undefined}>
101
- <span class="sheen-menu-indicator" aria-hidden="true"><Primitive.ItemIndicator>●</Primitive.ItemIndicator></span>
107
+ <span class="sheen-menu-indicator" aria-hidden="true"><Primitive.ItemIndicator><Glyph name="dot" /></Primitive.ItemIndicator></span>
102
108
  <MenuItemIcon icon={option().icon} />
103
109
  <Primitive.ItemLabel><span class="sheen-menu-item-copy"><span>{option().label}</span><Show when={option().description}>{description => <small>{description()}</small>}</Show></span></Primitive.ItemLabel>
104
110
  </Primitive.RadioItem>
@@ -122,7 +128,7 @@ function Submenu(props: { item: MenuSubmenu }): JSX.Element {
122
128
  const layer = createMemo<number>(previous => open() ? theme.layers.zIndex(id) : previous ?? 100);
123
129
  return <Primitive.Sub open={open()} onOpenChange={setOpen} gutter={4}>
124
130
  <Primitive.SubTrigger ref={trigger} class="sheen-menu-item" disabled={props.item.disabled ?? false} textValue={props.item.label}>
125
- <span class="sheen-menu-indicator" aria-hidden="true"><MenuItemIcon icon={props.item.icon} /></span>{props.item.label}<span class="sheen-menu-sub-arrow" dir="ltr" data-direction={theme.state().direction} aria-hidden="true">›</span>
131
+ <span class="sheen-menu-indicator" aria-hidden="true"><MenuItemIcon icon={props.item.icon} /></span>{props.item.label}<Glyph class="sheen-menu-sub-arrow" name="chevron-right" />
126
132
  </Primitive.SubTrigger>
127
133
  <Show when={theme.portal()}>{target => <Primitive.Portal mount={target()}>
128
134
  <Primitive.SubContent ref={setContent} class="sheen-menu" data-kb-top-layer="true" aria-hidden={!open() || undefined} inert={!open()} style={{ "z-index": layer() }}
@@ -155,11 +161,11 @@ export function MenuItems(props: { items: readonly MenuItem[] }): JSX.Element {
155
161
  return <>
156
162
  <Show when={action()}>{item => <Primitive.Item class="sheen-menu-item" textValue={item().label} disabled={item().disabled ?? false} onSelect={() => item().onSelect()}>
157
163
  <span class="sheen-menu-indicator" aria-hidden="true"><MenuItemIcon icon={item().icon} /></span><Primitive.ItemLabel>{item().label}</Primitive.ItemLabel>
158
- <Show when={item().shortcut}>{shortcut => <Kbd class="sheen-menu-shortcut" aria-hidden="true">{shortcut()}</Kbd>}</Show>
164
+ <Show when={item().shortcut}>{shortcut => <MenuShortcut keys={shortcut()} />}</Show>
159
165
  </Primitive.Item>}</Show>
160
166
  <Show when={checkbox()}>{item => <Primitive.CheckboxItem class="sheen-menu-item" textValue={item().label} disabled={item().disabled ?? false} checked={item().checked} onChange={checked => item().onCheckedChange(checked)} closeOnSelect={false}>
161
- <span class="sheen-menu-indicator" aria-hidden="true"><Primitive.ItemIndicator>✓</Primitive.ItemIndicator></span><MenuItemIcon icon={item().icon} /><Primitive.ItemLabel>{item().label}</Primitive.ItemLabel>
162
- <Show when={item().shortcut}>{shortcut => <Kbd class="sheen-menu-shortcut" aria-hidden="true">{shortcut()}</Kbd>}</Show>
167
+ <span class="sheen-menu-indicator" aria-hidden="true"><Primitive.ItemIndicator><Glyph name="check" /></Primitive.ItemIndicator></span><MenuItemIcon icon={item().icon} /><Primitive.ItemLabel>{item().label}</Primitive.ItemLabel>
168
+ <Show when={item().shortcut}>{shortcut => <MenuShortcut keys={shortcut()} />}</Show>
163
169
  </Primitive.CheckboxItem>}</Show>
164
170
  <Show when={radio()}>{item => <RadioItems group={item()} />}</Show>
165
171
  <Show when={submenu()}>{item => <Submenu item={item()} />}</Show>
@@ -180,8 +180,8 @@ export function FileDropzone(props: FileDropzoneProps): JSX.Element {
180
180
  <div class="sheen-file-dropzone-item-copy" dir="auto"><strong>{current().name}</strong><span>{formatSize(current().size)}<Show when={current().type}> · {current().type}</Show></span></div>
181
181
  <span class="sheen-file-dropzone-status" data-status={current().status} dir="auto">{current().statusLabel}</span>
182
182
  <Show when={current().status === "uploading"}><Progress label={theme.messages().uploadProgress.replaceAll("{name}", current().name)} {...(current().progress === undefined ? {} : { value: current().progress })} /></Show>
183
- <div class="sheen-file-dropzone-actions"><Show when={current().status === "error" && local.onRetry}><Button size="xs" disabled={local.disabled} aria-disabled={local.readOnly || undefined} aria-label={`${theme.messages().retry} ${current().name}`} onClick={() => run(local.onRetry, id)}>{theme.messages().retry}</Button></Show>
184
- <Show when={local.onRemove}><Button size="xs" disabled={local.disabled} aria-disabled={local.readOnly || undefined} aria-label={`${theme.messages().remove} ${current().name}`} onClick={() => run(local.onRemove, id)}>{theme.messages().remove}</Button></Show></div>
183
+ <div class="sheen-file-dropzone-actions"><Show when={current().status === "error" && local.onRetry}><Button variant="ghost" size="xs" disabled={local.disabled} aria-disabled={local.readOnly || undefined} aria-label={`${theme.messages().retry} ${current().name}`} onClick={() => run(local.onRetry, id)}>{theme.messages().retry}</Button></Show>
184
+ <Show when={local.onRemove}><Button variant="ghost" size="xs" disabled={local.disabled} aria-disabled={local.readOnly || undefined} aria-label={`${theme.messages().remove} ${current().name}`} onClick={() => run(local.onRemove, id)}>{theme.messages().remove}</Button></Show></div>
185
185
  </li>}</Show>;
186
186
  }}</For></ul></Show>
187
187
  <span class="sheen-file-dropzone-announcer" role="status" aria-live="polite" aria-atomic="true">{dragActive() ? (local.dropLabel ?? theme.messages().dropFilesHere) : ""}</span>
@@ -0,0 +1,58 @@
1
+ import { Show, children, createSignal, splitProps } from "solid-js";
2
+ import type { JSX } from "solid-js";
3
+ import { cn } from "../utils/cn.ts";
4
+
5
+ export interface FormProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
6
+ /**
7
+ * Receives the native form data. The default submission is prevented; return a promise to mark
8
+ * the form busy until it settles. Native constraint validation runs first.
9
+ */
10
+ onSubmit?: (data: FormData, event: SubmitEvent) => void | Promise<void>;
11
+ }
12
+
13
+ /** A native form that stacks sections and fields on the token rhythm and reports pending submissions. */
14
+ export function Form(props: FormProps): JSX.Element {
15
+ const [local, others] = splitProps(props, ["onSubmit", "class", "children"]);
16
+ const [pending, setPending] = createSignal(false);
17
+ const submit = (event: SubmitEvent & { currentTarget: HTMLFormElement }): void => {
18
+ if (!local.onSubmit) return;
19
+ event.preventDefault();
20
+ if (pending()) return;
21
+ const result = local.onSubmit(new FormData(event.currentTarget), event);
22
+ if (result instanceof Promise) {
23
+ setPending(true);
24
+ void result.finally(() => setPending(false));
25
+ }
26
+ };
27
+ return <form {...others} class={cn("sheen-form", local.class)} aria-busy={pending() || undefined} data-pending={pending() || undefined} onSubmit={submit}>{local.children}</form>;
28
+ }
29
+
30
+ export interface FormSectionProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "title"> {
31
+ title: string;
32
+ description?: JSX.Element;
33
+ }
34
+
35
+ /** A titled group of related fields. Wide containers put the title beside the fields. */
36
+ export function FormSection(props: FormSectionProps): JSX.Element {
37
+ const [local, others] = splitProps(props, ["title", "description", "class", "children"]);
38
+ const description = children(() => local.description);
39
+ return <section {...others} class={cn("sheen-form-section", local.class)}>
40
+ <header class="sheen-form-section-header">
41
+ <h2 class="sheen-form-section-title">{local.title}</h2>
42
+ <Show when={description()}><p class="sheen-form-section-description">{description()}</p></Show>
43
+ </header>
44
+ <div class="sheen-form-section-fields">{local.children}</div>
45
+ </section>;
46
+ }
47
+
48
+ export interface FormActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
49
+ /** Keep the actions visible at the bottom of the scrolling container. */
50
+ sticky?: boolean;
51
+ align?: "start" | "end" | "between";
52
+ }
53
+
54
+ /** The submit/cancel row that ends a form. Put the primary action last. */
55
+ export function FormActions(props: FormActionsProps): JSX.Element {
56
+ const [local, others] = splitProps(props, ["sticky", "align", "class", "children"]);
57
+ return <div {...others} class={cn("sheen-form-actions", local.class)} data-sticky={local.sticky || undefined} data-align={local.align ?? "end"}>{local.children}</div>;
58
+ }
@@ -0,0 +1,55 @@
1
+ import { splitProps } from "solid-js";
2
+ import type { JSX } from "solid-js";
3
+ import { cn } from "../utils/cn.ts";
4
+
5
+ const paths = {
6
+ "chevron-down": "M4 6l4 4 4-4",
7
+ "chevron-up": "M4 10l4-4 4 4",
8
+ "chevron-left": "M10 4 6 8l4 4",
9
+ "chevron-right": "M6 4l4 4-4 4",
10
+ "chevrons-left": "M8.5 4 4.5 8l4 4M12.5 4l-4 4 4 4",
11
+ "chevrons-right": "M3.5 4l4 4-4 4M7.5 4l4 4-4 4",
12
+ close: "M4.5 4.5l7 7M11.5 4.5l-7 7",
13
+ check: "M3.5 8.5l3 3 6-7",
14
+ plus: "M8 3.5v9M3.5 8h9",
15
+ minus: "M3.5 8h9",
16
+ dot: "M8 6.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z",
17
+ alert: "M8 4.5v4.25M8 11.25v.25",
18
+ calendar: "M3 4.5h10v8.5H3zM3 7h10M5.5 3v3M10.5 3v3",
19
+ search: "M7 3a4 4 0 1 1 0 8 4 4 0 0 1 0-8zM10 10l3 3",
20
+ bell: "M4.5 11V7.5a3.5 3.5 0 0 1 7 0V11l1 1.25h-9zM6.75 13.5h2.5",
21
+ "trend-up": "M3 11l3.5-3.5 2.5 2.5L13 6M10 6h3v3",
22
+ "trend-down": "M3 5l3.5 3.5L9 6l4 4M10 10h3V7",
23
+ "trend-flat": "M3 8h10M10 5l3 3-3 3",
24
+ more: "M3.5 8h.01M8 8h.01M12.5 8h.01",
25
+ grip: "M6 4h.01M10 4h.01M6 8h.01M10 8h.01M6 12h.01M10 12h.01",
26
+ "status-info": "M14.25 8A6.25 6.25 0 1 1 1.75 8a6.25 6.25 0 0 1 12.5 0zM8 7.25v3.5M8 5v.01",
27
+ "status-success": "M14.25 8A6.25 6.25 0 1 1 1.75 8a6.25 6.25 0 0 1 12.5 0zM5.25 8.25l1.75 1.75 3.75-4",
28
+ "status-warning": "M8 2.25 14.25 13.25H1.75zM8 6.25v3M8 11.25v.01",
29
+ "status-danger": "M14.25 8A6.25 6.25 0 1 1 1.75 8a6.25 6.25 0 0 1 12.5 0zM8 4.75v3.75M8 11v.01",
30
+ } satisfies Record<string, string>;
31
+
32
+ export type GlyphName = keyof typeof paths;
33
+ export const glyphNames: readonly GlyphName[] = Object.freeze(Object.keys(paths).filter((name): name is GlyphName => Object.hasOwn(paths, name)));
34
+
35
+ /** Directional glyphs point toward the logical start or end, so they mirror in right-to-left scopes. */
36
+ const directional = new Set<GlyphName>(["chevron-left", "chevron-right", "chevrons-left", "chevrons-right", "trend-up", "trend-down", "trend-flat"]);
37
+ /** Glyphs drawn as filled marks rather than strokes. */
38
+ const filled = new Set<GlyphName>(["dot"]);
39
+
40
+ export interface GlyphProps extends Omit<JSX.SvgSVGAttributes<SVGSVGElement>, "children"> {
41
+ /** One of the closed set of component-chrome glyphs. */
42
+ readonly name: GlyphName;
43
+ }
44
+
45
+ /**
46
+ * Small decorative stroke glyphs for component chrome (chevrons, close, check, steppers, trends).
47
+ * They inherit the current text color and are always hidden from assistive technology; name the
48
+ * owning control instead. Applications use `@gemologic/sheen-icons` for content imagery.
49
+ */
50
+ export function Glyph(props: GlyphProps): JSX.Element {
51
+ const [local, others] = splitProps(props, ["name", "class"]);
52
+ return <svg {...others} class={cn("sheen-glyph", local.class)} data-glyph={local.name} data-mirror={directional.has(local.name) || undefined} viewBox="0 0 16 16" aria-hidden="true">
53
+ <path d={paths[local.name]} fill={filled.has(local.name) ? "currentColor" : "none"} stroke="currentColor" stroke-width={local.name === "more" || local.name === "grip" ? "2.25" : "1.5"} stroke-linecap="round" stroke-linejoin="round" />
54
+ </svg>;
55
+ }
@@ -2,18 +2,27 @@ import { splitProps } from "solid-js";
2
2
  import type { JSX } from "solid-js";
3
3
  import { cn } from "../utils/cn.ts";
4
4
  import { buttonVariants } from "./button-variants.ts";
5
+ import type { ButtonVariantProps } from "./button-variants.ts";
5
6
 
6
7
  export interface LinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
7
8
  href: string;
8
- variant?: "text" | "button";
9
+ /** `quiet` drops the resting underline; use it only where position already marks links, such as table cells and lists. */
10
+ variant?: "text" | "quiet" | "button";
11
+ /** Button treatment when `variant="button"`; matches Button's `variant`. */
12
+ appearance?: NonNullable<ButtonVariantProps["variant"]>;
13
+ /** Button tone when `variant="button"`. */
14
+ tone?: NonNullable<ButtonVariantProps["tone"]>;
15
+ /** Button size when `variant="button"`. */
16
+ size?: NonNullable<ButtonVariantProps["size"]>;
9
17
  }
10
18
 
11
19
  /** A destination, even when styled like an action. Browser navigation stays native. */
12
20
  export function Link(props: LinkProps): JSX.Element {
13
- const [local, others] = splitProps(props, ["variant", "class", "children"]);
14
- return <a {...others} class={cn("sheen-link", local.variant === "button" && buttonVariants(), local.class)}
21
+ const [local, others] = splitProps(props, ["variant", "appearance", "tone", "size", "class", "children"]);
22
+ const button = (): boolean => local.variant === "button";
23
+ return <a {...others} class={cn("sheen-link", button() && buttonVariants({ variant: local.appearance, tone: local.tone, size: local.size }), local.class)}
15
24
  data-link-variant={local.variant ?? "text"}
16
- data-variant={local.variant === "button" ? "ghost" : undefined}
17
- data-tone={local.variant === "button" ? "neutral" : undefined}
18
- data-size={local.variant === "button" ? "md" : undefined}>{local.children}</a>;
25
+ data-variant={button() ? local.appearance ?? "outline" : undefined}
26
+ data-tone={button() ? local.tone ?? "neutral" : undefined}
27
+ data-size={button() ? local.size ?? "md" : undefined}>{local.children}</a>;
19
28
  }
@@ -0,0 +1,68 @@
1
+ import { Show, children, splitProps } from "solid-js";
2
+ import type { JSX } from "solid-js";
3
+ import { cn } from "../utils/cn.ts";
4
+ import { Link } from "./Link.tsx";
5
+
6
+ export interface ListProps extends JSX.HTMLAttributes<HTMLUListElement> {
7
+ /** Accessible name when the surrounding heading does not already name the list. */
8
+ label?: string;
9
+ /** Draw separators between rows. */
10
+ dividers?: boolean;
11
+ /** Row padding. */
12
+ density?: "compact" | "default" | "comfortable";
13
+ /** Wrap the rows in a raised, bordered surface. */
14
+ inset?: boolean;
15
+ }
16
+
17
+ /** A vertical list of rows. Rows are links, actions, or static content; it is not a selection widget. */
18
+ export function List(props: ListProps): JSX.Element {
19
+ const [local, others] = splitProps(props, ["label", "dividers", "density", "inset", "class", "children"]);
20
+ return <ul {...others} role="list" aria-label={local.label} class={cn("sheen-list", local.class)}
21
+ data-dividers={local.dividers || undefined} data-density={local.density ?? "default"} data-inset={local.inset || undefined}>{local.children}</ul>;
22
+ }
23
+
24
+ export interface ListItemProps extends Omit<JSX.LiHTMLAttributes<HTMLLIElement>, "title" | "onSelect"> {
25
+ /** Primary row text. */
26
+ title: JSX.Element;
27
+ /** Secondary text under the title. */
28
+ description?: JSX.Element;
29
+ /** Leading visual such as an icon or Avatar; decorative unless it carries its own name. */
30
+ leading?: JSX.Element;
31
+ /** Trailing content such as a Badge, metadata, or a count. */
32
+ trailing?: JSX.Element;
33
+ /** Makes the row a link. */
34
+ href?: string;
35
+ /** Makes the row a button. Ignored when `href` is set. */
36
+ onSelect?: () => void;
37
+ /** Marks a link row as the current page. */
38
+ current?: boolean;
39
+ /** Visual selected state for rows that drive a detail view. */
40
+ selected?: boolean;
41
+ disabled?: boolean;
42
+ }
43
+
44
+ /** One row of a List with leading, title, description, and trailing slots. */
45
+ export function ListItem(props: ListItemProps): JSX.Element {
46
+ const [local, others] = splitProps(props, ["title", "description", "leading", "trailing", "href", "onSelect", "current", "selected", "disabled", "class"]);
47
+ // Slots are JSX getters: resolve each once so a Show condition and its content share one node.
48
+ const leading = children(() => local.leading);
49
+ const title = children(() => local.title);
50
+ const description = children(() => local.description);
51
+ const trailing = children(() => local.trailing);
52
+ const content = (): JSX.Element => <>
53
+ <Show when={leading()}><span class="sheen-list-item-leading" aria-hidden="true">{leading()}</span></Show>
54
+ <span class="sheen-list-item-copy">
55
+ <span class="sheen-list-item-title">{title()}</span>
56
+ <Show when={description()}><span class="sheen-list-item-description">{description()}</span></Show>
57
+ </span>
58
+ <Show when={trailing()}><span class="sheen-list-item-trailing">{trailing()}</span></Show>
59
+ </>;
60
+ return <li {...others} class={cn("sheen-list-item", local.class)} data-selected={local.selected || undefined} data-disabled={local.disabled || undefined}
61
+ data-interactive={local.href !== undefined || local.onSelect !== undefined || undefined}>
62
+ <Show when={local.href} fallback={<Show when={local.onSelect} fallback={<div class="sheen-list-item-row">{content()}</div>}>
63
+ {select => <button type="button" class="sheen-list-item-row" disabled={local.disabled} onClick={() => select()()}>{content()}</button>}
64
+ </Show>}>
65
+ {href => <Link variant="quiet" class="sheen-list-item-row" href={href()} aria-current={local.current ? "page" : undefined}>{content()}</Link>}
66
+ </Show>
67
+ </li>;
68
+ }
@@ -0,0 +1,40 @@
1
+ import { Show, children, createUniqueId, splitProps } from "solid-js";
2
+ import type { JSX } from "solid-js";
3
+ import { cn } from "../utils/cn.ts";
4
+
5
+ export type MessageFrom = "user" | "assistant" | "system";
6
+
7
+ export interface MessageProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "ref"> {
8
+ ref?: HTMLElement | ((element: HTMLElement) => void);
9
+ from: MessageFrom;
10
+ author?: JSX.Element;
11
+ avatar?: JSX.Element;
12
+ timestamp?: string;
13
+ timeLabel?: string;
14
+ actions?: JSX.Element;
15
+ }
16
+
17
+ /** One conversation turn: optional avatar and author header, the content, and an actions row. */
18
+ export function Message(props: MessageProps): JSX.Element {
19
+ const [local, others] = splitProps(props, ["ref", "from", "author", "avatar", "timestamp", "timeLabel", "actions", "class", "children"]);
20
+ const authorId = createUniqueId();
21
+ const avatar = children(() => local.avatar);
22
+ const author = children(() => local.author);
23
+ const actions = children(() => local.actions);
24
+ const content = children(() => local.children);
25
+ const hasAuthor = () => author.toArray().length > 0;
26
+ return <article {...others} ref={element => { if (typeof local.ref === "function") local.ref(element); }} class={cn("sheen-message", local.class)} data-from={local.from}
27
+ aria-labelledby={others["aria-labelledby"] ?? (hasAuthor() ? authorId : undefined)}>
28
+ <Show when={avatar.toArray().length > 0}><div class="sheen-message-avatar">{avatar()}</div></Show>
29
+ <div class="sheen-message-body">
30
+ <Show when={hasAuthor() || local.timeLabel}>
31
+ <header class="sheen-message-header">
32
+ <Show when={hasAuthor()}><span class="sheen-message-author" id={authorId}>{author()}</span></Show>
33
+ <Show when={local.timeLabel}>{label => <time class="sheen-message-time" dateTime={local.timestamp}>{label()}</time>}</Show>
34
+ </header>
35
+ </Show>
36
+ <div class="sheen-message-content">{content()}</div>
37
+ <Show when={actions.toArray().length > 0}><div class="sheen-message-actions">{actions()}</div></Show>
38
+ </div>
39
+ </article>;
40
+ }
@@ -1,25 +1,58 @@
1
- import { Show, splitProps } from "solid-js";
1
+ import { Show, children, splitProps } from "solid-js";
2
2
  import type { JSX } from "solid-js";
3
3
  import { cn } from "../utils/cn.ts";
4
+ import { useTheme } from "../theme/ThemeProvider.tsx";
5
+ import { Button } from "./Button.tsx";
6
+ import { Glyph } from "./Glyph.tsx";
7
+
8
+ export type NoticeTone = "info" | "success" | "warning" | "danger";
4
9
 
5
10
  export interface CalloutProps extends JSX.HTMLAttributes<HTMLDivElement> {
6
- tone?: "info" | "success" | "warning" | "danger";
11
+ tone?: NoticeTone;
7
12
  heading?: string;
13
+ /** Leading icon. Defaults to the tone's status glyph; `false` removes it. */
14
+ icon?: JSX.Element | false;
15
+ /** Follow-up actions such as a Button or Link, placed after the message. */
16
+ actions?: JSX.Element;
17
+ /** Shows a dismiss button. The owner removes the notice in response. */
18
+ onDismiss?: () => void;
19
+ /** Accessible name for the dismiss button. */
20
+ dismissLabel?: string;
8
21
  }
9
22
  export type AlertProps = CalloutProps;
23
+ export type BannerProps = CalloutProps;
10
24
 
11
- export function Callout(props: CalloutProps): JSX.Element {
12
- const [local, others] = splitProps(props, ["class", "tone", "heading", "children"]);
13
- return <div {...others} class={cn("sheen-notice", local.class)} data-tone={local.tone ?? "info"} role="note">
14
- <Show when={local.heading}><strong class="sheen-notice-heading">{local.heading}</strong></Show>
15
- <div class="sheen-notice-content">{local.children}</div>
25
+ const glyphs = { info: "status-info", success: "status-success", warning: "status-warning", danger: "status-danger" } as const;
26
+
27
+ function NoticeFrame(props: CalloutProps & { readonly kind: "callout" | "alert" | "banner"; readonly fallbackTone: NoticeTone; readonly role: "note" | "alert" | "region" }): JSX.Element {
28
+ const theme = useTheme();
29
+ const [local, others] = splitProps(props, ["kind", "fallbackTone", "role", "class", "tone", "heading", "icon", "actions", "onDismiss", "dismissLabel", "children"]);
30
+ const tone = (): NoticeTone => local.tone ?? local.fallbackTone;
31
+ const icon = children(() => local.icon === false ? undefined : local.icon ?? <Glyph name={glyphs[tone()]} />);
32
+ const actions = children(() => local.actions);
33
+ return <div {...others} class={cn("sheen-notice", local.kind === "banner" && "sheen-banner", local.class)} data-tone={tone()} role={local.role}
34
+ aria-atomic={local.role === "alert" ? "true" : undefined} aria-label={local.role === "region" ? local.heading ?? theme.messages().announcement : undefined}>
35
+ <Show when={local.icon !== false}><span class="sheen-notice-icon" aria-hidden="true">{icon()}</span></Show>
36
+ <div class="sheen-notice-body">
37
+ <Show when={local.heading}><strong class="sheen-notice-heading">{local.heading}</strong></Show>
38
+ <div class="sheen-notice-content">{local.children}</div>
39
+ <Show when={actions()}><div class="sheen-notice-actions">{actions()}</div></Show>
40
+ </div>
41
+ <Show when={local.onDismiss}>{dismiss => <Button variant="ghost" size="sm" class="sheen-notice-dismiss" aria-label={local.dismissLabel ?? theme.messages().dismiss} onClick={() => dismiss()()}><Glyph name="close" /></Button>}</Show>
16
42
  </div>;
17
43
  }
18
44
 
45
+ /** Static, contextual information in the flow of a page. */
46
+ export function Callout(props: CalloutProps): JSX.Element {
47
+ return <NoticeFrame {...props} kind="callout" fallbackTone="info" role="note" />;
48
+ }
49
+
50
+ /** A live, assertive message for something the user must notice now. */
19
51
  export function Alert(props: AlertProps): JSX.Element {
20
- const [local, others] = splitProps(props, ["class", "tone", "heading", "children"]);
21
- return <div {...others} class={cn("sheen-notice", local.class)} data-tone={local.tone ?? "danger"} role="alert" aria-atomic="true">
22
- <Show when={local.heading}><strong class="sheen-notice-heading">{local.heading}</strong></Show>
23
- <div class="sheen-notice-content">{local.children}</div>
24
- </div>;
52
+ return <NoticeFrame {...props} kind="alert" fallbackTone="danger" role="alert" />;
53
+ }
54
+
55
+ /** A full-width announcement at the top of a page or app shell, such as maintenance or billing state. */
56
+ export function Banner(props: BannerProps): JSX.Element {
57
+ return <NoticeFrame {...props} kind="banner" fallbackTone="info" role="region" />;
25
58
  }
@@ -1,4 +1,5 @@
1
1
  import { createSignal, createUniqueId, onMount, splitProps } from "solid-js";
2
+ import { Glyph } from "./Glyph.tsx";
2
3
  import type { JSX } from "solid-js";
3
4
  import { useTheme } from "../theme/ThemeProvider.tsx";
4
5
  import { cn } from "../utils/cn.ts";
@@ -157,8 +158,8 @@ export function NumberField(props: NumberFieldProps): JSX.Element {
157
158
  else if (event.key === "End" && !local.readOnly) { event.preventDefault(); publish(maximum(), true); }
158
159
  }} />
159
160
  <div class="sheen-number-field-steps">
160
- <button type="button" class="sheen-number-field-step" aria-label={message(theme.messages().decreaseValue, local.label)} disabled={local.disabled || local.readOnly} onClick={() => vary(-increment())}><span aria-hidden="true">−</span></button>
161
- <button type="button" class="sheen-number-field-step" aria-label={message(theme.messages().increaseValue, local.label)} disabled={local.disabled || local.readOnly} onClick={() => vary(increment())}><span aria-hidden="true">+</span></button>
161
+ <button type="button" class="sheen-number-field-step" aria-label={message(theme.messages().decreaseValue, local.label)} disabled={local.disabled || local.readOnly} onClick={() => vary(-increment())}><Glyph name="minus" /></button>
162
+ <button type="button" class="sheen-number-field-step" aria-label={message(theme.messages().increaseValue, local.label)} disabled={local.disabled || local.readOnly} onClick={() => vary(increment())}><Glyph name="plus" /></button>
162
163
  </div>
163
164
  </div>
164
165
  {local.name ? <input type="hidden" name={local.name} form={local.form} value={current() ?? ""} /> : null}
@@ -1,34 +1,61 @@
1
- import { Index, Show, createMemo, splitProps, useContext } from "solid-js";
1
+ import { Index, Show, createEffect, createMemo, createSignal, on, onCleanup, splitProps, useContext } from "solid-js";
2
2
  import type { JSX } from "solid-js";
3
3
  import { useTheme } from "../theme/ThemeProvider.tsx";
4
4
  import { cn } from "../utils/cn.ts";
5
5
  import { NumberFormatContext } from "../theme/number-format-cache.ts";
6
+ import { flashChange, motionDuration } from "../utils/change-motion.ts";
6
7
 
7
8
  export interface NumberTextProps extends Omit<JSX.HTMLAttributes<HTMLSpanElement>, "children"> {
8
9
  value: number;
9
10
  format?: Intl.NumberFormatOptions;
11
+ /** Tint the number up or down when the value changes after the first render. */
12
+ flash?: boolean;
13
+ /** Count from the previous value to the next one when the value changes after the first render. */
14
+ tween?: boolean;
10
15
  }
11
16
 
12
17
  const quietParts = new Set<Intl.NumberFormatPartTypes>(["decimal", "fraction", "unit", "percentSign", "currency", "compact"]);
13
18
 
14
19
  /** Keep locale ordering and punctuation intact while quieting fractional digits and units. */
15
20
  export function NumberText(props: NumberTextProps): JSX.Element {
16
- const [local, others] = splitProps(props, ["value", "format", "class"]);
21
+ const [local, others] = splitProps(props, ["value", "format", "class", "flash", "tween", "ref"]);
17
22
  const theme = useTheme();
18
23
  const numberFormat = useContext(NumberFormatContext);
19
24
  const locale = createMemo(() => theme.state().locale);
20
25
  const formatter = createMemo(() => numberFormat ? numberFormat(locale(), local.format) : new Intl.NumberFormat(locale(), local.format));
26
+ let host: HTMLSpanElement | undefined;
27
+ let frame = 0;
28
+ const [tweened, setTweened] = createSignal(local.value);
29
+ const shown = (): number => local.tween ? tweened() : local.value;
30
+ createEffect(on(() => local.value, (next, previous) => {
31
+ if (frame) cancelAnimationFrame(frame);
32
+ if (!host || previous === undefined || next === previous || !Number.isFinite(next)) { setTweened(next); return; }
33
+ if (local.flash) flashChange(host, next > previous ? "up" : "down");
34
+ const duration = local.tween ? motionDuration(host) * 2 : 0;
35
+ if (duration === 0) { setTweened(next); return; }
36
+ const from = tweened(), start = performance.now();
37
+ const step = (now: number): void => {
38
+ const progress = Math.min(1, (now - start) / duration);
39
+ setTweened(progress === 1 ? next : from + (next - from) * (1 - (1 - progress) ** 3));
40
+ if (progress < 1) frame = requestAnimationFrame(step);
41
+ };
42
+ frame = requestAnimationFrame(step);
43
+ }, { defer: true }));
44
+ onCleanup(() => { if (frame) cancelAnimationFrame(frame); });
21
45
  const parts = createMemo(() => {
22
46
  if (!Number.isFinite(local.value)) throw new Error("NumberText requires a finite value");
23
47
  const rendered: Intl.NumberFormatPart[] = [];
24
- for (const part of formatter().formatToParts(local.value)) {
48
+ for (const part of formatter().formatToParts(shown())) {
25
49
  const previous = rendered.at(-1);
26
50
  if (!quietParts.has(part.type) && previous?.type === "literal") previous.value += part.value;
27
51
  else rendered.push(quietParts.has(part.type) ? part : { type: "literal", value: part.value });
28
52
  }
29
53
  return rendered;
30
54
  });
31
- return <span {...others} class={cn("sheen-number-text", local.class)}><Index each={parts()}>{part =>
55
+ return <span {...others} ref={element => {
56
+ host = element;
57
+ if (typeof local.ref === "function") local.ref(element);
58
+ }} class={cn("sheen-number-text", local.class)}><Index each={parts()}>{part =>
32
59
  <Show when={quietParts.has(part().type)} fallback={part().value}>
33
60
  <span data-number-part={part().type}>{part().value}</span>
34
61
  </Show>
@@ -4,6 +4,7 @@ import { Button } from "./Button.tsx";
4
4
  import { useTheme } from "../theme/ThemeProvider.tsx";
5
5
  import { useNumberFormatter } from "../theme/intl.ts";
6
6
  import { cn } from "../utils/cn.ts";
7
+ import { Glyph } from "./Glyph.tsx";
7
8
 
8
9
  export interface PaginationProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children" | "onChange"> {
9
10
  pageIndex: number;
@@ -54,11 +55,11 @@ export function Pagination(props: PaginationProps): JSX.Element {
54
55
  .replaceAll("{page}", format().format(state().count ? state().index + 1 : 0))
55
56
  .replaceAll("{pages}", format().format(state().count));
56
57
  return <nav {...others} ref={element => { root = element; if (typeof local.ref === "function") local.ref(element); }} class={cn("sheen-pagination", local.class)} aria-label={local.label ?? theme.messages().pagination} aria-busy={local.pending || undefined} aria-disabled={local.disabled || undefined} data-pending={local.pending ? "" : undefined}>
57
- <Button aria-disabled={unavailable(0) || undefined} onClick={() => request(0)}>{theme.messages().firstPage}</Button>
58
- <Button aria-disabled={unavailable(state().index - 1) || undefined} onClick={() => request(state().index - 1)}>{theme.messages().previousPage}</Button>
59
- <For each={pages()}>{index => <Button aria-label={pageLabel(index)} aria-current={index === state().index ? "page" : undefined} aria-disabled={unavailable(index) || undefined} onClick={() => request(index)}>{format().format(index + 1)}</Button>}</For>
60
- <Button aria-disabled={unavailable(state().index + 1) || undefined} onClick={() => request(state().index + 1)}>{theme.messages().nextPage}</Button>
61
- <Button aria-disabled={unavailable(state().count - 1) || undefined} onClick={() => request(state().count - 1)}>{theme.messages().lastPage}</Button>
58
+ <Button variant="ghost" class="sheen-pagination-step" aria-label={theme.messages().firstPage} aria-disabled={unavailable(0) || undefined} onClick={() => request(0)}><Glyph name="chevrons-left" /></Button>
59
+ <Button variant="ghost" class="sheen-pagination-step" aria-label={theme.messages().previousPage} aria-disabled={unavailable(state().index - 1) || undefined} onClick={() => request(state().index - 1)}><Glyph name="chevron-left" /></Button>
60
+ <For each={pages()}>{index => <Button variant="ghost" aria-label={pageLabel(index)} aria-current={index === state().index ? "page" : undefined} aria-disabled={unavailable(index) || undefined} onClick={() => request(index)}>{format().format(index + 1)}</Button>}</For>
61
+ <Button variant="ghost" class="sheen-pagination-step" aria-label={theme.messages().nextPage} aria-disabled={unavailable(state().index + 1) || undefined} onClick={() => request(state().index + 1)}><Glyph name="chevron-right" /></Button>
62
+ <Button variant="ghost" class="sheen-pagination-step" aria-label={theme.messages().lastPage} aria-disabled={unavailable(state().count - 1) || undefined} onClick={() => request(state().count - 1)}><Glyph name="chevrons-right" /></Button>
62
63
  <output aria-live="polite" aria-atomic="true">{summary()}</output>
63
64
  </nav>;
64
65
  }
@@ -4,6 +4,7 @@ import type { JSX, ParentProps } from "solid-js";
4
4
  import { Button } from "./Button.tsx";
5
5
  import { useTheme } from "../theme/ThemeProvider.tsx";
6
6
  import { cn } from "../utils/cn.ts";
7
+ import { Glyph } from "./Glyph.tsx";
7
8
 
8
9
  export interface PopoverProps extends ParentProps {
9
10
  trigger: JSX.Element;
@@ -45,7 +46,7 @@ export function Popover(props: PopoverProps): JSX.Element {
45
46
  <Show when={props.description}><Primitive.Description>{props.description}</Primitive.Description></Show>
46
47
  </div>
47
48
  <div class="sheen-dialog-body">{props.children}</div>
48
- <div class="sheen-dialog-footer"><Primitive.CloseButton as={Button} aria-label={theme.messages().close}>{theme.messages().close}</Primitive.CloseButton></div>
49
+ <Primitive.CloseButton as={Button} variant="ghost" class="sheen-dialog-close" size="sm" aria-label={theme.messages().close}><Glyph name="close" /></Primitive.CloseButton>
49
50
  </Primitive.Content>
50
51
  </Primitive.Portal>}</Show>
51
52
  </Primitive.Root>;