@grafctory/clay-widgets 0.0.0-stage → 0.5.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 (189) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +56 -2
  3. package/dist/content/empty.css +107 -0
  4. package/dist/content/empty.d.ts +40 -0
  5. package/dist/content/empty.d.ts.map +1 -0
  6. package/dist/content/empty.js +42 -0
  7. package/dist/content/empty.js.map +1 -0
  8. package/dist/content/heading.css +34 -0
  9. package/dist/content/heading.d.ts +45 -0
  10. package/dist/content/heading.d.ts.map +1 -0
  11. package/dist/content/heading.js +49 -0
  12. package/dist/content/heading.js.map +1 -0
  13. package/dist/content/image.css +198 -0
  14. package/dist/content/image.d.ts +77 -0
  15. package/dist/content/image.d.ts.map +1 -0
  16. package/dist/content/image.js +67 -0
  17. package/dist/content/image.js.map +1 -0
  18. package/dist/content/infobox.css +186 -0
  19. package/dist/content/infobox.d.ts +72 -0
  20. package/dist/content/infobox.d.ts.map +1 -0
  21. package/dist/content/infobox.js +63 -0
  22. package/dist/content/infobox.js.map +1 -0
  23. package/dist/content/pill.css +76 -0
  24. package/dist/content/pill.d.ts +57 -0
  25. package/dist/content/pill.d.ts.map +1 -0
  26. package/dist/content/pill.js +48 -0
  27. package/dist/content/pill.js.map +1 -0
  28. package/dist/content/text.css +44 -0
  29. package/dist/content/text.d.ts +30 -0
  30. package/dist/content/text.d.ts.map +1 -0
  31. package/dist/content/text.js +42 -0
  32. package/dist/content/text.js.map +1 -0
  33. package/dist/controls/button.css +469 -0
  34. package/dist/controls/button.d.ts +116 -0
  35. package/dist/controls/button.d.ts.map +1 -0
  36. package/dist/controls/button.js +61 -0
  37. package/dist/controls/button.js.map +1 -0
  38. package/dist/controls/checkbox.css +23 -0
  39. package/dist/controls/checkbox.d.ts +54 -0
  40. package/dist/controls/checkbox.d.ts.map +1 -0
  41. package/dist/controls/checkbox.js +49 -0
  42. package/dist/controls/checkbox.js.map +1 -0
  43. package/dist/controls/choice.css +288 -0
  44. package/dist/controls/choice.d.ts +63 -0
  45. package/dist/controls/choice.d.ts.map +1 -0
  46. package/dist/controls/choice.js +52 -0
  47. package/dist/controls/choice.js.map +1 -0
  48. package/dist/controls/fieldset.css +37 -0
  49. package/dist/controls/fieldset.d.ts +49 -0
  50. package/dist/controls/fieldset.d.ts.map +1 -0
  51. package/dist/controls/fieldset.js +51 -0
  52. package/dist/controls/fieldset.js.map +1 -0
  53. package/dist/controls/form.css +50 -0
  54. package/dist/controls/form.d.ts +64 -0
  55. package/dist/controls/form.d.ts.map +1 -0
  56. package/dist/controls/form.js +62 -0
  57. package/dist/controls/form.js.map +1 -0
  58. package/dist/controls/input.css +57 -0
  59. package/dist/controls/input.d.ts +129 -0
  60. package/dist/controls/input.d.ts.map +1 -0
  61. package/dist/controls/input.js +71 -0
  62. package/dist/controls/input.js.map +1 -0
  63. package/dist/controls/label.css +73 -0
  64. package/dist/controls/label.d.ts +76 -0
  65. package/dist/controls/label.d.ts.map +1 -0
  66. package/dist/controls/label.js +73 -0
  67. package/dist/controls/label.js.map +1 -0
  68. package/dist/controls/radio.css +23 -0
  69. package/dist/controls/radio.d.ts +60 -0
  70. package/dist/controls/radio.d.ts.map +1 -0
  71. package/dist/controls/radio.js +50 -0
  72. package/dist/controls/radio.js.map +1 -0
  73. package/dist/controls/select.css +37 -0
  74. package/dist/controls/select.d.ts +71 -0
  75. package/dist/controls/select.d.ts.map +1 -0
  76. package/dist/controls/select.js +59 -0
  77. package/dist/controls/select.js.map +1 -0
  78. package/dist/controls/switch.css +154 -0
  79. package/dist/controls/switch.d.ts +44 -0
  80. package/dist/controls/switch.d.ts.map +1 -0
  81. package/dist/controls/switch.js +48 -0
  82. package/dist/controls/switch.js.map +1 -0
  83. package/dist/controls/textarea.css +50 -0
  84. package/dist/controls/textarea.d.ts +106 -0
  85. package/dist/controls/textarea.d.ts.map +1 -0
  86. package/dist/controls/textarea.js +68 -0
  87. package/dist/controls/textarea.js.map +1 -0
  88. package/dist/glyphs/icon.core.d.ts +52 -0
  89. package/dist/glyphs/icon.core.d.ts.map +1 -0
  90. package/dist/glyphs/icon.core.js +67 -0
  91. package/dist/glyphs/icon.core.js.map +1 -0
  92. package/dist/glyphs/icon.css +32 -0
  93. package/dist/glyphs/icon.d.ts +152 -0
  94. package/dist/glyphs/icon.d.ts.map +1 -0
  95. package/dist/glyphs/icon.js +167 -0
  96. package/dist/glyphs/icon.js.map +1 -0
  97. package/dist/glyphs/icon.md +76 -0
  98. package/dist/glyphs/logo.css +73 -0
  99. package/dist/glyphs/logo.d.ts +27 -0
  100. package/dist/glyphs/logo.d.ts.map +1 -0
  101. package/dist/glyphs/logo.js +49 -0
  102. package/dist/glyphs/logo.js.map +1 -0
  103. package/dist/index.core.d.ts +18 -0
  104. package/dist/index.core.d.ts.map +1 -0
  105. package/dist/index.core.js +36 -0
  106. package/dist/index.core.js.map +1 -0
  107. package/dist/index.d.ts +65 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +95 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/layouts/card.css +190 -0
  112. package/dist/layouts/card.d.ts +75 -0
  113. package/dist/layouts/card.d.ts.map +1 -0
  114. package/dist/layouts/card.js +62 -0
  115. package/dist/layouts/card.js.map +1 -0
  116. package/dist/layouts/stack.css +58 -0
  117. package/dist/layouts/stack.d.ts +64 -0
  118. package/dist/layouts/stack.d.ts.map +1 -0
  119. package/dist/layouts/stack.js +69 -0
  120. package/dist/layouts/stack.js.map +1 -0
  121. package/dist/layouts/strip.css +58 -0
  122. package/dist/layouts/strip.d.ts +72 -0
  123. package/dist/layouts/strip.d.ts.map +1 -0
  124. package/dist/layouts/strip.js +73 -0
  125. package/dist/layouts/strip.js.map +1 -0
  126. package/dist/layouts/tabs.core.d.ts +73 -0
  127. package/dist/layouts/tabs.core.d.ts.map +1 -0
  128. package/dist/layouts/tabs.core.js +65 -0
  129. package/dist/layouts/tabs.core.js.map +1 -0
  130. package/dist/layouts/tabs.css +260 -0
  131. package/dist/layouts/tabs.d.ts +57 -0
  132. package/dist/layouts/tabs.d.ts.map +1 -0
  133. package/dist/layouts/tabs.js +128 -0
  134. package/dist/layouts/tabs.js.map +1 -0
  135. package/dist/layouts/tree.css +138 -0
  136. package/dist/layouts/tree.d.ts +46 -0
  137. package/dist/layouts/tree.d.ts.map +1 -0
  138. package/dist/layouts/tree.js +69 -0
  139. package/dist/layouts/tree.js.map +1 -0
  140. package/dist/navigation/link.css +229 -0
  141. package/dist/navigation/link.d.ts +89 -0
  142. package/dist/navigation/link.d.ts.map +1 -0
  143. package/dist/navigation/link.js +91 -0
  144. package/dist/navigation/link.js.map +1 -0
  145. package/dist/navigation/path.css +122 -0
  146. package/dist/navigation/path.d.ts +42 -0
  147. package/dist/navigation/path.d.ts.map +1 -0
  148. package/dist/navigation/path.js +49 -0
  149. package/dist/navigation/path.js.map +1 -0
  150. package/dist/navigation/toc.core.d.ts +111 -0
  151. package/dist/navigation/toc.core.d.ts.map +1 -0
  152. package/dist/navigation/toc.core.js +60 -0
  153. package/dist/navigation/toc.core.js.map +1 -0
  154. package/dist/navigation/toc.css +53 -0
  155. package/dist/navigation/toc.d.ts +112 -0
  156. package/dist/navigation/toc.d.ts.map +1 -0
  157. package/dist/navigation/toc.js +321 -0
  158. package/dist/navigation/toc.js.map +1 -0
  159. package/dist/scopes/guard.css +26 -0
  160. package/dist/scopes/guard.d.ts +37 -0
  161. package/dist/scopes/guard.d.ts.map +1 -0
  162. package/dist/scopes/guard.js +60 -0
  163. package/dist/scopes/guard.js.map +1 -0
  164. package/dist/scopes/style.css +26 -0
  165. package/dist/scopes/style.d.ts +68 -0
  166. package/dist/scopes/style.d.ts.map +1 -0
  167. package/dist/scopes/style.js +108 -0
  168. package/dist/scopes/style.js.map +1 -0
  169. package/dist/shells/tool.css +770 -0
  170. package/dist/shells/tool.d.ts +167 -0
  171. package/dist/shells/tool.d.ts.map +1 -0
  172. package/dist/shells/tool.js +286 -0
  173. package/dist/shells/tool.js.map +1 -0
  174. package/dist/signals/more.css +42 -0
  175. package/dist/signals/more.d.ts +28 -0
  176. package/dist/signals/more.d.ts.map +1 -0
  177. package/dist/signals/more.js +61 -0
  178. package/dist/signals/more.js.map +1 -0
  179. package/dist/signals/note.css +221 -0
  180. package/dist/signals/note.d.ts +83 -0
  181. package/dist/signals/note.d.ts.map +1 -0
  182. package/dist/signals/note.js +72 -0
  183. package/dist/signals/note.js.map +1 -0
  184. package/dist/signals/toasts.css +463 -0
  185. package/dist/signals/toasts.d.ts +68 -0
  186. package/dist/signals/toasts.d.ts.map +1 -0
  187. package/dist/signals/toasts.js +160 -0
  188. package/dist/signals/toasts.js.map +1 -0
  189. package/package.json +331 -4
@@ -0,0 +1,160 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ /*
3
+ * Copyright © 2026 Metreeca srl
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Transient notices.
19
+ *
20
+ * Offers the stack of notices telling a reader how the operations under way are going and how they ended, floating
21
+ * over the screen without moving anything on it, and read out to assistive technology as they change.
22
+ *
23
+ * @module toasts
24
+ */
25
+ import { useBoard, usePosts } from "@grafctory/clay/board";
26
+ import { createElement } from "preact";
27
+ import { useEffect, useState } from "preact/hooks";
28
+ import { Button } from "../controls/button.js";
29
+ import { Icon } from "../glyphs/icon.js";
30
+ import "./toasts.css";
31
+ /**
32
+ * Creates a toast stack.
33
+ *
34
+ * Floats the posts standing on the enclosing {@link @grafctory/clay!board.Board Board} over an edge of the screen,
35
+ * one toast each, newest nearest the edge, each marked by a glyph telling its status, so an interface tells the reader
36
+ * how its operations are going without laying out room for them. A post updated on the board is updated where it
37
+ * stands, a post put up slides in, and a post cleared fades out while the others stay put.
38
+ *
39
+ * Where given a `timeout`, a toast telling of nothing more pressing than a plain or completed post is taken away on
40
+ * its own once it is up, while the post stays on the board for any other reader. Any other toast stays until whoever
41
+ * put its post up clears it, or until the reader deals with it: by dismissing it through the quiet control beside the
42
+ * message, hinted as it is pointed at, or by following the message of an actionable post where an `onAction` handler
43
+ * is given. Either way the post is cleared from the board for every reader. The stack takes the pointer over the whole
44
+ * of its glass, so a click falling between its toasts never lands on what lies beneath it.
45
+ *
46
+ * Every toast takes the same width, so the stack reads as one column, a long message wrapping rather than widening
47
+ * its toast; the width is retuned through the `--clay-toasts-width` custom property, `24rem` unless restated, and
48
+ * gives way to the whole width of a narrow screen.
49
+ *
50
+ * Every post put up or updated is read out to assistive technology without moving the focus. The stack is to be
51
+ * rendered once, near the root of the interface, as it is the page region announcements come from; outside any board
52
+ * it shows nothing.
53
+ *
54
+ * @param options The widget configuration
55
+ *
56
+ * @returns The toast stack
57
+ */
58
+ export function Toasts({ position = "top", timeout = 0, onAction } = {}) {
59
+ const board = useBoard();
60
+ const posts = usePosts();
61
+ /*
62
+ * A cleared post has left the board but has yet to fade out, so the stack keeps what it shows and works out what to
63
+ * show next from it whenever the board changes, during the render that sees the change; a cleared post is let go
64
+ * only once its fade is over. The stack also keeps the posts whose toasts timed out, as they stood then, so a post
65
+ * updated since is shown again.
66
+ */
67
+ const [last, setLast] = useState(() => refreshed({ posts: [], shown: [], expired: [] }, posts));
68
+ const stack = last.posts === posts ? last : refreshed(last, posts);
69
+ if (stack !== last) {
70
+ setLast(stack);
71
+ }
72
+ const { shown, expired } = stack;
73
+ const expire = (post) => setLast(last => ({ ...last, expired: [...last.expired, post] }));
74
+ const drop = (post) => setLast(last => ({ ...last, shown: last.shown.filter(shown => shown !== post) }));
75
+ /*
76
+ * A post shown but no longer standing is on its way out. The region stays in the page whatever stands, as a live
77
+ * region has to be there before its content changes for the change to be read out. It is polite, so a post is
78
+ * read out once the reader is idle rather than cutting them short, and a hidden toast is never read out again.
79
+ */
80
+ const standing = new Set(posts.map(({ instance }) => instance));
81
+ const gone = (post) => !standing.has(post.instance);
82
+ const hidden = (post) => gone(post) || expired.includes(post);
83
+ const visible = shown.filter(post => !hidden(post));
84
+ const [edge, side] = typeof position === "string" ? [position, "center"] : position;
85
+ return createElement("clay-toasts", { role: "status", edge, side }, _jsxs(_Fragment, { children: [" ", shown.map(post => _jsx(Item, { hidden: hidden(post), post: post, timeout: timeout, onDismiss: () => board.clear(post), onExpire: () => expire(post), onAction: post.actionable && onAction ? () => {
86
+ board.clear(post);
87
+ onAction(post);
88
+ } : undefined, onFaded: gone(post) ? () => drop(post) : undefined }, post.instance)), visible.length > 1 && _jsx("footer", { children: _jsx(Button, { name: "Dismiss all", icon: _jsx(Icon.Dismiss, {}), title: "Dismiss all", look: "subtle", onClick: () => board.clear(visible) }) })] }));
89
+ }
90
+ /**
91
+ * Creates a toast.
92
+ *
93
+ * @param options The toast configuration
94
+ *
95
+ * @returns The toast telling `post`, hidden if `hidden`. It notifies `onAction` when its message is activated and
96
+ * `onFaded` once it has faded out while hidden. For a plain or completed post still shown and offered for no action,
97
+ * it also notifies `onExpire` once `timeout` is up, so the toast is taken away while the post stays on the board
98
+ */
99
+ function Item({ hidden, post, timeout, onDismiss, onExpire, onAction, onFaded }) {
100
+ useEffect(() => {
101
+ const expiring = !hidden && timeout > 0 && !onAction && (post.status === "normal" || post.status === "success");
102
+ const timer = expiring ? setTimeout(onExpire, timeout) : undefined;
103
+ return () => clearTimeout(timer);
104
+ }, [post, hidden, timeout, !onAction]); // whether the post is offered for action, as the handler is new each render
105
+ /*
106
+ * The toast sits in a slot of its own, which the stylesheet closes as the toast fades, so the toasts below move up
107
+ * along with it rather than all at once once it is gone; the bare wrapper between the two is what the slot sizes
108
+ * on, as a grid never closes a track below the padding of what it holds. The fade is over once the opacity of the slot itself has
109
+ * run its course, a transition ending on what the toast carries bubbling up as well.
110
+ */
111
+ return createElement("div", {
112
+ status: post.status,
113
+ hidden: hidden || undefined,
114
+ onTransitionEnd: ({ target, currentTarget, propertyName }) => hidden && target === currentTarget && propertyName === "opacity" && onFaded?.()
115
+ }, _jsx("div", { children: _jsxs("div", { children: [glyph(post.status), _jsx("span", { children: onAction
116
+ ? _jsx("button", { type: "button", onClick: onAction, children: post.message })
117
+ : post.message }), _jsx("div", { children: _jsx(Button, { name: "Dismiss", icon: _jsx(Icon.Dismiss, {}), title: "Dismiss", look: "subtle", onClick: onDismiss }) })] }) }));
118
+ }
119
+ /**
120
+ * Works out what the stack shows as the board changes.
121
+ *
122
+ * Posts put up since the stack last looked come first, newest first. The posts it already showed follow, each where
123
+ * it stood. A post still standing is shown as it now stands. A cleared post is shown as it last stood, until its toast
124
+ * has faded out. A cleared post whose toast had already timed out is let go at once, as a hidden toast has no fade
125
+ * left.
126
+ *
127
+ * @param stack The stack as it last stood
128
+ * @param posts The posts now standing on the board
129
+ *
130
+ * @returns The stack as it stands over `posts`, keeping as timed out only the posts still standing
131
+ */
132
+ function refreshed({ shown, expired }, posts) {
133
+ const known = new Set(shown.map(({ instance }) => instance));
134
+ const current = new Map(posts.map(post => [post.instance, post]));
135
+ return {
136
+ posts,
137
+ shown: [
138
+ ...posts.filter(({ instance }) => !known.has(instance)).reverse(), // the filter hands back a fresh array
139
+ ...shown.map(post => current.get(post.instance) ?? post)
140
+ ].filter(post => posts.includes(post) || !expired.includes(post)),
141
+ expired: expired.filter(post => posts.includes(post))
142
+ };
143
+ }
144
+ /**
145
+ * Picks the glyph marking a status.
146
+ *
147
+ * @param status The status of a post
148
+ *
149
+ * @returns The glyph for `status`: the mark of the matching note level, a pause for `paused`, or a bug for a `defect`
150
+ */
151
+ function glyph(status) {
152
+ return status === "pending" ? _jsx(Icon.RefreshCw, {})
153
+ : status === "success" ? _jsx(Icon.CircleCheck, {})
154
+ : status === "paused" ? _jsx(Icon.CirclePause, {})
155
+ : status === "warning" ? _jsx(Icon.Alert, {})
156
+ : status === "failure" ? _jsx(Icon.CircleAlert, {})
157
+ : status === "defect" ? _jsx(Icon.Bug, {})
158
+ : _jsx(Icon.Info, {});
159
+ }
160
+ //# sourceMappingURL=toasts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toasts.js","sourceRoot":"","sources":["../../src/signals/toasts.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAA0B,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,cAAc,CAAC;AAGtB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,MAAM,CAAC,EAEtB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,CAAC,EAEX,QAAQ,KAgCL,EAAE;IAEL,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB;;;;;OAKG;IAEH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAQ,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvG,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC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AAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,CAAC,WAAW,KAAE;gBAC1C,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,IAAI,CAAC,KAAK,KAAE;oBACrC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,IAAI,CAAC,WAAW,KAAE;wBAC3C,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,CAAC,GAAG,KAAE;4BAClC,CAAC,CAAC,KAAC,IAAI,CAAC,IAAI,KAAE,CAAC;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,333 @@
1
1
  {
2
2
  "name": "@grafctory/clay-widgets",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.5.0",
4
+ "description": "Preact interface components for @grafctory/clay.",
5
+ "keywords": [
6
+ "typescript",
7
+ "preact",
8
+ "ui"
9
+ ],
10
+ "homepage": "https://grafctory.github.io/clay/",
11
+ "bugs": {
12
+ "url": "https://github.com/grafctory/clay/issues",
13
+ "email": "info@grafctory.dev"
14
+ },
15
+ "license": "Apache-2.0",
16
+ "author": {
17
+ "name": "Metreeca",
18
+ "email": "info@metreeca.com",
19
+ "url": "https://www.metreeca.com/"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/grafctory/clay.git",
24
+ "directory": "packages/clay-widgets"
25
+ },
26
+ "type": "module",
27
+ "sideEffects": [
28
+ "*.css",
29
+ "./dist/glyphs/icon.js"
30
+ ],
31
+ "exports": {
32
+ ".": {
33
+ "@grafctory/source": "./src/index.ts",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "./icon": {
37
+ "@grafctory/source": "./src/glyphs/icon.ts",
38
+ "default": "./dist/glyphs/icon.js"
39
+ },
40
+ "./icon.css": {
41
+ "@grafctory/source": "./src/glyphs/icon.css",
42
+ "default": "./dist/glyphs/icon.css"
43
+ },
44
+ "./logo": {
45
+ "@grafctory/source": "./src/glyphs/logo.tsx",
46
+ "default": "./dist/glyphs/logo.js"
47
+ },
48
+ "./logo.css": {
49
+ "@grafctory/source": "./src/glyphs/logo.css",
50
+ "default": "./dist/glyphs/logo.css"
51
+ },
52
+ "./button": {
53
+ "@grafctory/source": "./src/controls/button.tsx",
54
+ "default": "./dist/controls/button.js"
55
+ },
56
+ "./button.css": {
57
+ "@grafctory/source": "./src/controls/button.css",
58
+ "default": "./dist/controls/button.css"
59
+ },
60
+ "./checkbox": {
61
+ "@grafctory/source": "./src/controls/checkbox.tsx",
62
+ "default": "./dist/controls/checkbox.js"
63
+ },
64
+ "./checkbox.css": {
65
+ "@grafctory/source": "./src/controls/checkbox.css",
66
+ "default": "./dist/controls/checkbox.css"
67
+ },
68
+ "./choice": {
69
+ "@grafctory/source": "./src/controls/choice.tsx",
70
+ "default": "./dist/controls/choice.js"
71
+ },
72
+ "./choice.css": {
73
+ "@grafctory/source": "./src/controls/choice.css",
74
+ "default": "./dist/controls/choice.css"
75
+ },
76
+ "./fieldset": {
77
+ "@grafctory/source": "./src/controls/fieldset.tsx",
78
+ "default": "./dist/controls/fieldset.js"
79
+ },
80
+ "./fieldset.css": {
81
+ "@grafctory/source": "./src/controls/fieldset.css",
82
+ "default": "./dist/controls/fieldset.css"
83
+ },
84
+ "./form": {
85
+ "@grafctory/source": "./src/controls/form.tsx",
86
+ "default": "./dist/controls/form.js"
87
+ },
88
+ "./form.css": {
89
+ "@grafctory/source": "./src/controls/form.css",
90
+ "default": "./dist/controls/form.css"
91
+ },
92
+ "./input": {
93
+ "@grafctory/source": "./src/controls/input.tsx",
94
+ "default": "./dist/controls/input.js"
95
+ },
96
+ "./input.css": {
97
+ "@grafctory/source": "./src/controls/input.css",
98
+ "default": "./dist/controls/input.css"
99
+ },
100
+ "./label": {
101
+ "@grafctory/source": "./src/controls/label.tsx",
102
+ "default": "./dist/controls/label.js"
103
+ },
104
+ "./label.css": {
105
+ "@grafctory/source": "./src/controls/label.css",
106
+ "default": "./dist/controls/label.css"
107
+ },
108
+ "./radio": {
109
+ "@grafctory/source": "./src/controls/radio.tsx",
110
+ "default": "./dist/controls/radio.js"
111
+ },
112
+ "./radio.css": {
113
+ "@grafctory/source": "./src/controls/radio.css",
114
+ "default": "./dist/controls/radio.css"
115
+ },
116
+ "./select": {
117
+ "@grafctory/source": "./src/controls/select.tsx",
118
+ "default": "./dist/controls/select.js"
119
+ },
120
+ "./select.css": {
121
+ "@grafctory/source": "./src/controls/select.css",
122
+ "default": "./dist/controls/select.css"
123
+ },
124
+ "./switch": {
125
+ "@grafctory/source": "./src/controls/switch.tsx",
126
+ "default": "./dist/controls/switch.js"
127
+ },
128
+ "./switch.css": {
129
+ "@grafctory/source": "./src/controls/switch.css",
130
+ "default": "./dist/controls/switch.css"
131
+ },
132
+ "./textarea": {
133
+ "@grafctory/source": "./src/controls/textarea.tsx",
134
+ "default": "./dist/controls/textarea.js"
135
+ },
136
+ "./textarea.css": {
137
+ "@grafctory/source": "./src/controls/textarea.css",
138
+ "default": "./dist/controls/textarea.css"
139
+ },
140
+ "./tool": {
141
+ "@grafctory/source": "./src/shells/tool.tsx",
142
+ "default": "./dist/shells/tool.js"
143
+ },
144
+ "./tool.css": {
145
+ "@grafctory/source": "./src/shells/tool.css",
146
+ "default": "./dist/shells/tool.css"
147
+ },
148
+ "./stack": {
149
+ "@grafctory/source": "./src/layouts/stack.tsx",
150
+ "default": "./dist/layouts/stack.js"
151
+ },
152
+ "./stack.css": {
153
+ "@grafctory/source": "./src/layouts/stack.css",
154
+ "default": "./dist/layouts/stack.css"
155
+ },
156
+ "./strip": {
157
+ "@grafctory/source": "./src/layouts/strip.tsx",
158
+ "default": "./dist/layouts/strip.js"
159
+ },
160
+ "./strip.css": {
161
+ "@grafctory/source": "./src/layouts/strip.css",
162
+ "default": "./dist/layouts/strip.css"
163
+ },
164
+ "./tabs": {
165
+ "@grafctory/source": "./src/layouts/tabs.tsx",
166
+ "default": "./dist/layouts/tabs.js"
167
+ },
168
+ "./tabs.css": {
169
+ "@grafctory/source": "./src/layouts/tabs.css",
170
+ "default": "./dist/layouts/tabs.css"
171
+ },
172
+ "./tree": {
173
+ "@grafctory/source": "./src/layouts/tree.tsx",
174
+ "default": "./dist/layouts/tree.js"
175
+ },
176
+ "./tree.css": {
177
+ "@grafctory/source": "./src/layouts/tree.css",
178
+ "default": "./dist/layouts/tree.css"
179
+ },
180
+ "./card": {
181
+ "@grafctory/source": "./src/layouts/card.tsx",
182
+ "default": "./dist/layouts/card.js"
183
+ },
184
+ "./card.css": {
185
+ "@grafctory/source": "./src/layouts/card.css",
186
+ "default": "./dist/layouts/card.css"
187
+ },
188
+ "./heading": {
189
+ "@grafctory/source": "./src/content/heading.tsx",
190
+ "default": "./dist/content/heading.js"
191
+ },
192
+ "./heading.css": {
193
+ "@grafctory/source": "./src/content/heading.css",
194
+ "default": "./dist/content/heading.css"
195
+ },
196
+ "./image": {
197
+ "@grafctory/source": "./src/content/image.tsx",
198
+ "default": "./dist/content/image.js"
199
+ },
200
+ "./image.css": {
201
+ "@grafctory/source": "./src/content/image.css",
202
+ "default": "./dist/content/image.css"
203
+ },
204
+ "./empty": {
205
+ "@grafctory/source": "./src/content/empty.tsx",
206
+ "default": "./dist/content/empty.js"
207
+ },
208
+ "./empty.css": {
209
+ "@grafctory/source": "./src/content/empty.css",
210
+ "default": "./dist/content/empty.css"
211
+ },
212
+ "./infobox": {
213
+ "@grafctory/source": "./src/content/infobox.tsx",
214
+ "default": "./dist/content/infobox.js"
215
+ },
216
+ "./infobox.css": {
217
+ "@grafctory/source": "./src/content/infobox.css",
218
+ "default": "./dist/content/infobox.css"
219
+ },
220
+ "./text": {
221
+ "@grafctory/source": "./src/content/text.tsx",
222
+ "default": "./dist/content/text.js"
223
+ },
224
+ "./text.css": {
225
+ "@grafctory/source": "./src/content/text.css",
226
+ "default": "./dist/content/text.css"
227
+ },
228
+ "./pill": {
229
+ "@grafctory/source": "./src/content/pill.tsx",
230
+ "default": "./dist/content/pill.js"
231
+ },
232
+ "./pill.css": {
233
+ "@grafctory/source": "./src/content/pill.css",
234
+ "default": "./dist/content/pill.css"
235
+ },
236
+ "./link": {
237
+ "@grafctory/source": "./src/navigation/link.tsx",
238
+ "default": "./dist/navigation/link.js"
239
+ },
240
+ "./link.css": {
241
+ "@grafctory/source": "./src/navigation/link.css",
242
+ "default": "./dist/navigation/link.css"
243
+ },
244
+ "./path": {
245
+ "@grafctory/source": "./src/navigation/path.tsx",
246
+ "default": "./dist/navigation/path.js"
247
+ },
248
+ "./path.css": {
249
+ "@grafctory/source": "./src/navigation/path.css",
250
+ "default": "./dist/navigation/path.css"
251
+ },
252
+ "./toc": {
253
+ "@grafctory/source": "./src/navigation/toc.tsx",
254
+ "default": "./dist/navigation/toc.js"
255
+ },
256
+ "./toc.css": {
257
+ "@grafctory/source": "./src/navigation/toc.css",
258
+ "default": "./dist/navigation/toc.css"
259
+ },
260
+ "./more": {
261
+ "@grafctory/source": "./src/signals/more.tsx",
262
+ "default": "./dist/signals/more.js"
263
+ },
264
+ "./more.css": {
265
+ "@grafctory/source": "./src/signals/more.css",
266
+ "default": "./dist/signals/more.css"
267
+ },
268
+ "./note": {
269
+ "@grafctory/source": "./src/signals/note.tsx",
270
+ "default": "./dist/signals/note.js"
271
+ },
272
+ "./note.css": {
273
+ "@grafctory/source": "./src/signals/note.css",
274
+ "default": "./dist/signals/note.css"
275
+ },
276
+ "./toasts": {
277
+ "@grafctory/source": "./src/signals/toasts.tsx",
278
+ "default": "./dist/signals/toasts.js"
279
+ },
280
+ "./toasts.css": {
281
+ "@grafctory/source": "./src/signals/toasts.css",
282
+ "default": "./dist/signals/toasts.css"
283
+ },
284
+ "./guard": {
285
+ "@grafctory/source": "./src/scopes/guard.tsx",
286
+ "default": "./dist/scopes/guard.js"
287
+ },
288
+ "./guard.css": {
289
+ "@grafctory/source": "./src/scopes/guard.css",
290
+ "default": "./dist/scopes/guard.css"
291
+ },
292
+ "./style": {
293
+ "@grafctory/source": "./src/scopes/style.tsx",
294
+ "default": "./dist/scopes/style.js"
295
+ },
296
+ "./style.css": {
297
+ "@grafctory/source": "./src/scopes/style.css",
298
+ "default": "./dist/scopes/style.css"
299
+ },
300
+ "./*.core": null
301
+ },
302
+ "files": [
303
+ "README.md",
304
+ "LICENSE",
305
+ "dist"
306
+ ],
307
+ "engines": {
308
+ "node": ">=22.22.0"
309
+ },
310
+ "scripts": {
311
+ "clean": "ush rm dist docs node_modules '*.tsbuildinfo'",
312
+ "build": "tsc -b tsconfig.build.json && ush cp dist 'src/**/*.css' 'src/**/*.md'",
313
+ "check": "npx vitest --config ../../vitest.config.ts --root . --typecheck --passWithNoTests run"
314
+ },
315
+ "dependencies": {
316
+ "@grafctory/core": "^0.14.0",
317
+ "@grafctory/skin": "^0.3.0"
318
+ },
319
+ "devDependencies": {
320
+ "@grafctory/clay": "^0.5.0",
321
+ "happy-dom": "^21.0.4",
322
+ "lucide-preact": "^1.47.0",
323
+ "preact": "^10.29.8",
324
+ "typescript": "^6.0.3",
325
+ "vite": "^8.3.5",
326
+ "vitest": "^5.0.5"
327
+ },
328
+ "peerDependencies": {
329
+ "@grafctory/clay": "^0.5.0",
330
+ "lucide-preact": "^1.47.0",
331
+ "preact": "^10.27.2"
332
+ }
333
+ }