@grafctory/clay-widgets 0.0.0-stage → 0.4.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.
- package/LICENSE +201 -0
- package/README.md +46 -2
- package/dist/content/empty.css +107 -0
- package/dist/content/empty.d.ts +40 -0
- package/dist/content/empty.d.ts.map +1 -0
- package/dist/content/empty.js +42 -0
- package/dist/content/empty.js.map +1 -0
- package/dist/content/heading.css +34 -0
- package/dist/content/heading.d.ts +45 -0
- package/dist/content/heading.d.ts.map +1 -0
- package/dist/content/heading.js +49 -0
- package/dist/content/heading.js.map +1 -0
- package/dist/content/image.css +176 -0
- package/dist/content/image.d.ts +71 -0
- package/dist/content/image.d.ts.map +1 -0
- package/dist/content/image.js +63 -0
- package/dist/content/image.js.map +1 -0
- package/dist/content/infobox.css +186 -0
- package/dist/content/infobox.d.ts +72 -0
- package/dist/content/infobox.d.ts.map +1 -0
- package/dist/content/infobox.js +63 -0
- package/dist/content/infobox.js.map +1 -0
- package/dist/content/pill.css +76 -0
- package/dist/content/pill.d.ts +57 -0
- package/dist/content/pill.d.ts.map +1 -0
- package/dist/content/pill.js +48 -0
- package/dist/content/pill.js.map +1 -0
- package/dist/content/text.css +44 -0
- package/dist/content/text.d.ts +30 -0
- package/dist/content/text.d.ts.map +1 -0
- package/dist/content/text.js +42 -0
- package/dist/content/text.js.map +1 -0
- package/dist/controls/button.css +469 -0
- package/dist/controls/button.d.ts +116 -0
- package/dist/controls/button.d.ts.map +1 -0
- package/dist/controls/button.js +61 -0
- package/dist/controls/button.js.map +1 -0
- package/dist/controls/checkbox.css +23 -0
- package/dist/controls/checkbox.d.ts +54 -0
- package/dist/controls/checkbox.d.ts.map +1 -0
- package/dist/controls/checkbox.js +49 -0
- package/dist/controls/checkbox.js.map +1 -0
- package/dist/controls/choice.css +288 -0
- package/dist/controls/choice.d.ts +63 -0
- package/dist/controls/choice.d.ts.map +1 -0
- package/dist/controls/choice.js +52 -0
- package/dist/controls/choice.js.map +1 -0
- package/dist/controls/fieldset.css +37 -0
- package/dist/controls/fieldset.d.ts +49 -0
- package/dist/controls/fieldset.d.ts.map +1 -0
- package/dist/controls/fieldset.js +51 -0
- package/dist/controls/fieldset.js.map +1 -0
- package/dist/controls/form.css +50 -0
- package/dist/controls/form.d.ts +64 -0
- package/dist/controls/form.d.ts.map +1 -0
- package/dist/controls/form.js +62 -0
- package/dist/controls/form.js.map +1 -0
- package/dist/controls/input.css +57 -0
- package/dist/controls/input.d.ts +120 -0
- package/dist/controls/input.d.ts.map +1 -0
- package/dist/controls/input.js +78 -0
- package/dist/controls/input.js.map +1 -0
- package/dist/controls/label.css +73 -0
- package/dist/controls/label.d.ts +76 -0
- package/dist/controls/label.d.ts.map +1 -0
- package/dist/controls/label.js +73 -0
- package/dist/controls/label.js.map +1 -0
- package/dist/controls/radio.css +23 -0
- package/dist/controls/radio.d.ts +60 -0
- package/dist/controls/radio.d.ts.map +1 -0
- package/dist/controls/radio.js +50 -0
- package/dist/controls/radio.js.map +1 -0
- package/dist/controls/select.css +37 -0
- package/dist/controls/select.d.ts +62 -0
- package/dist/controls/select.d.ts.map +1 -0
- package/dist/controls/select.js +59 -0
- package/dist/controls/select.js.map +1 -0
- package/dist/controls/switch.css +154 -0
- package/dist/controls/switch.d.ts +44 -0
- package/dist/controls/switch.d.ts.map +1 -0
- package/dist/controls/switch.js +48 -0
- package/dist/controls/switch.js.map +1 -0
- package/dist/controls/textarea.css +50 -0
- package/dist/controls/textarea.d.ts +97 -0
- package/dist/controls/textarea.d.ts.map +1 -0
- package/dist/controls/textarea.js +75 -0
- package/dist/controls/textarea.js.map +1 -0
- package/dist/glyphs/icon.core.d.ts +52 -0
- package/dist/glyphs/icon.core.d.ts.map +1 -0
- package/dist/glyphs/icon.core.js +67 -0
- package/dist/glyphs/icon.core.js.map +1 -0
- package/dist/glyphs/icon.css +32 -0
- package/dist/glyphs/icon.d.ts +152 -0
- package/dist/glyphs/icon.d.ts.map +1 -0
- package/dist/glyphs/icon.js +167 -0
- package/dist/glyphs/icon.js.map +1 -0
- package/dist/glyphs/icon.md +76 -0
- package/dist/glyphs/logo.css +73 -0
- package/dist/glyphs/logo.d.ts +27 -0
- package/dist/glyphs/logo.d.ts.map +1 -0
- package/dist/glyphs/logo.js +49 -0
- package/dist/glyphs/logo.js.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/card.css +166 -0
- package/dist/layouts/card.d.ts +69 -0
- package/dist/layouts/card.d.ts.map +1 -0
- package/dist/layouts/card.js +57 -0
- package/dist/layouts/card.js.map +1 -0
- package/dist/layouts/stack.css +58 -0
- package/dist/layouts/stack.d.ts +64 -0
- package/dist/layouts/stack.d.ts.map +1 -0
- package/dist/layouts/stack.js +69 -0
- package/dist/layouts/stack.js.map +1 -0
- package/dist/layouts/strip.css +58 -0
- package/dist/layouts/strip.d.ts +72 -0
- package/dist/layouts/strip.d.ts.map +1 -0
- package/dist/layouts/strip.js +73 -0
- package/dist/layouts/strip.js.map +1 -0
- package/dist/layouts/tabs.core.d.ts +73 -0
- package/dist/layouts/tabs.core.d.ts.map +1 -0
- package/dist/layouts/tabs.core.js +65 -0
- package/dist/layouts/tabs.core.js.map +1 -0
- package/dist/layouts/tabs.css +260 -0
- package/dist/layouts/tabs.d.ts +57 -0
- package/dist/layouts/tabs.d.ts.map +1 -0
- package/dist/layouts/tabs.js +128 -0
- package/dist/layouts/tabs.js.map +1 -0
- package/dist/layouts/tree.css +138 -0
- package/dist/layouts/tree.d.ts +46 -0
- package/dist/layouts/tree.d.ts.map +1 -0
- package/dist/layouts/tree.js +69 -0
- package/dist/layouts/tree.js.map +1 -0
- package/dist/navigation/link.css +229 -0
- package/dist/navigation/link.d.ts +89 -0
- package/dist/navigation/link.d.ts.map +1 -0
- package/dist/navigation/link.js +91 -0
- package/dist/navigation/link.js.map +1 -0
- package/dist/navigation/path.css +122 -0
- package/dist/navigation/path.d.ts +42 -0
- package/dist/navigation/path.d.ts.map +1 -0
- package/dist/navigation/path.js +49 -0
- package/dist/navigation/path.js.map +1 -0
- package/dist/navigation/toc.core.d.ts +111 -0
- package/dist/navigation/toc.core.d.ts.map +1 -0
- package/dist/navigation/toc.core.js +60 -0
- package/dist/navigation/toc.core.js.map +1 -0
- package/dist/navigation/toc.css +53 -0
- package/dist/navigation/toc.d.ts +112 -0
- package/dist/navigation/toc.d.ts.map +1 -0
- package/dist/navigation/toc.js +321 -0
- package/dist/navigation/toc.js.map +1 -0
- package/dist/scopes/guard.css +26 -0
- package/dist/scopes/guard.d.ts +37 -0
- package/dist/scopes/guard.d.ts.map +1 -0
- package/dist/scopes/guard.js +60 -0
- package/dist/scopes/guard.js.map +1 -0
- package/dist/scopes/style.css +26 -0
- package/dist/scopes/style.d.ts +68 -0
- package/dist/scopes/style.d.ts.map +1 -0
- package/dist/scopes/style.js +108 -0
- package/dist/scopes/style.js.map +1 -0
- package/dist/shells/tool.css +778 -0
- package/dist/shells/tool.d.ts +164 -0
- package/dist/shells/tool.d.ts.map +1 -0
- package/dist/shells/tool.js +251 -0
- package/dist/shells/tool.js.map +1 -0
- package/dist/signals/more.css +42 -0
- package/dist/signals/more.d.ts +28 -0
- package/dist/signals/more.d.ts.map +1 -0
- package/dist/signals/more.js +61 -0
- package/dist/signals/more.js.map +1 -0
- package/dist/signals/note.css +221 -0
- package/dist/signals/note.d.ts +83 -0
- package/dist/signals/note.d.ts.map +1 -0
- package/dist/signals/note.js +72 -0
- package/dist/signals/note.js.map +1 -0
- package/dist/signals/toasts.css +463 -0
- package/dist/signals/toasts.d.ts +68 -0
- package/dist/signals/toasts.d.ts.map +1 -0
- package/dist/signals/toasts.js +160 -0
- package/dist/signals/toasts.js.map +1 -0
- package/package.json +331 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* A text area is drawn as the design system draws every native field, standing wherever the layout places it. */
|
|
18
|
+
|
|
19
|
+
clay-textarea {
|
|
20
|
+
|
|
21
|
+
display: contents;
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* The area expands to fit the text typed into it, where the browser sizes fields to their content, and never stands
|
|
25
|
+
* shorter than the lines the widget sets inline, inside its padding and border, so an empty area still reads as a
|
|
26
|
+
* place to write a paragraph in rather than as a field waiting for a short value.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Sizing to the content applies across the line as well, which would leave an empty area a sliver wide; the area
|
|
31
|
+
* spans the column a label stacks it in instead, growing downwards only, as a paragraph does.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
& > textarea {
|
|
35
|
+
align-self: stretch;
|
|
36
|
+
field-sizing: content;
|
|
37
|
+
min-block-size: calc(var(--clay-textarea-rows, 3) * 1lh + 2 * (var(--skin--spacing-050) + var(--skin--border-width)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* A growing area takes the height its column leaves on top of what its text asks for, and never shrinks below
|
|
42
|
+
* that text, so a text running past the room taken lengthens the column rather than scrolling inside the area. An
|
|
43
|
+
* area wrapped by a growing label fills the room the label takes alike, whether told to grow or not.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
&[grow] > textarea, clay-label[grow] > label > & > textarea {
|
|
47
|
+
flex: 1 0 auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "./textarea.css";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a multi-line field.
|
|
4
|
+
*
|
|
5
|
+
* Takes its value on a native text area, so the editing keys and the checking of every constraint come from the
|
|
6
|
+
* platform; `Enter` starts a new line rather than submitting the {@link form!Form Form} around it. The field
|
|
7
|
+
* stands at least `rows` lines tall, and expands to fit the text typed into it where the browser supports it.
|
|
8
|
+
*
|
|
9
|
+
* A field told to grow also takes the height its column leaves, letting a single long text fill the body of a screen.
|
|
10
|
+
* The column is the {@link stack!Stack Stack} or the growing {@link form!Form Form} holding the field, directly or
|
|
11
|
+
* through a growing {@link label!Label Label}, which fills it with the field, keeping the field below its text.
|
|
12
|
+
*
|
|
13
|
+
* The value is either held by the caller, which shows `value` and is handed each edit through `onChange`, or left to
|
|
14
|
+
* the field where `value` is omitted, the field then keeping whatever the reader types.
|
|
15
|
+
*
|
|
16
|
+
* @param options The widget configuration
|
|
17
|
+
*
|
|
18
|
+
* @returns The field
|
|
19
|
+
*
|
|
20
|
+
* @see [HTML: The textarea element][textarea]
|
|
21
|
+
*
|
|
22
|
+
* [textarea]: https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
|
|
23
|
+
*/
|
|
24
|
+
export declare function Textarea({ name, id, description, disabled, readonly, required, minLength, maxLength, error, grow, rows, placeholder, value, onChange }: {
|
|
25
|
+
/**
|
|
26
|
+
* The accessible name, required where no {@link label!Label Label} names the field.
|
|
27
|
+
*/
|
|
28
|
+
name?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The id a split {@link label!Label Label} names the field by; no id if omitted.
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The id of the element describing the field, such as a hint on the text expected, which assistive technology
|
|
35
|
+
* reads out along with the accessible name whenever the field takes focus; none if omitted. The id has to resolve
|
|
36
|
+
* to a rendered element, or the field is described by nothing at all and the hint reaches sighted readers only.
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the field takes no input, greyed and out of the tab order; editable if omitted.
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the field shows its value without taking edits, while staying in the tab order; editable if omitted.
|
|
45
|
+
*/
|
|
46
|
+
readonly?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the field fails its constraints while empty; optional if omitted.
|
|
49
|
+
*/
|
|
50
|
+
required?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The least number of characters a non-empty value holds; no floor if omitted.
|
|
53
|
+
*/
|
|
54
|
+
minLength?: number;
|
|
55
|
+
/**
|
|
56
|
+
* The greatest number of characters the field takes, typing past it being refused; no ceiling if omitted.
|
|
57
|
+
*/
|
|
58
|
+
maxLength?: number;
|
|
59
|
+
/**
|
|
60
|
+
* The message reported while the field fails its constraints, stating the rule a valid value follows, such as
|
|
61
|
+
* `Describe the issue in at least 20 characters` for a field held to `minLength`; the platform message if omitted.
|
|
62
|
+
* It takes the place of the platform message wherever the platform shows one, and never changes whether the field
|
|
63
|
+
* or the {@link form!Form Form} around it is valid, which the constraints alone decide.
|
|
64
|
+
*/
|
|
65
|
+
error?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the field takes the height its column leaves; sized to its lines if omitted. A growing field never stands
|
|
68
|
+
* shorter than `rows` lines, and a longer text still expands it, lengthening the column around it. A field wrapped
|
|
69
|
+
* in a {@link label!Label Label} fills the room the label takes instead, and so takes the height its column
|
|
70
|
+
* leaves only where the label is told to grow as well, whatever the field itself is told.
|
|
71
|
+
*/
|
|
72
|
+
grow?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The least number of lines the field stands tall, such as `8` for a report running over several paragraphs; 3
|
|
75
|
+
* lines if omitted. The field expands past them to fit the text typed into it, where the browser supports it, so
|
|
76
|
+
* that a long text stays in view as a whole, with no scroll bar of its own hiding the lines typed first.
|
|
77
|
+
*/
|
|
78
|
+
rows?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The hint shown in the field while it is empty, such as an example of the value expected. It disappears as soon
|
|
81
|
+
* as the reader types, so it never stands in for a {@link label!Label Label}; no hint if omitted.
|
|
82
|
+
*/
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The value shown in the field, held by the caller; left to the field if omitted.
|
|
86
|
+
*/
|
|
87
|
+
value?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Receives the value of the field on every edit, as the reader types it.
|
|
90
|
+
*
|
|
91
|
+
* @param value The value the field now holds
|
|
92
|
+
*/
|
|
93
|
+
onChange?: (value: string) => void;
|
|
94
|
+
}): import("preact").VNode<{
|
|
95
|
+
grow: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/controls/textarea.tsx"],"names":[],"mappings":"AA2BA,OAAO,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,EAExB,IAAI,EACJ,EAAE,EACF,WAAW,EAEX,QAAQ,EACR,QAAQ,EACR,QAAQ,EAER,SAAS,EACT,SAAS,EACT,KAAK,EAEL,IAAY,EACZ,IAAI,EAEJ,WAAW,EACX,KAAK,EAEL,QAAQ,EAER,EAAE;IAEF;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAElC;;GA4CA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx } 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
|
+
* Multi-line field.
|
|
19
|
+
*
|
|
20
|
+
* Takes a value running over several lines, such as a description or a note, expanding to fit the text so that what
|
|
21
|
+
* was typed stays in view without a scroll bar of its own wherever the browser supports it.
|
|
22
|
+
*
|
|
23
|
+
* @module textarea
|
|
24
|
+
*/
|
|
25
|
+
import { createElement } from "preact";
|
|
26
|
+
import { useLayoutEffect, useRef } from "preact/hooks";
|
|
27
|
+
import "./textarea.css";
|
|
28
|
+
/**
|
|
29
|
+
* Creates a multi-line field.
|
|
30
|
+
*
|
|
31
|
+
* Takes its value on a native text area, so the editing keys and the checking of every constraint come from the
|
|
32
|
+
* platform; `Enter` starts a new line rather than submitting the {@link form!Form Form} around it. The field
|
|
33
|
+
* stands at least `rows` lines tall, and expands to fit the text typed into it where the browser supports it.
|
|
34
|
+
*
|
|
35
|
+
* A field told to grow also takes the height its column leaves, letting a single long text fill the body of a screen.
|
|
36
|
+
* The column is the {@link stack!Stack Stack} or the growing {@link form!Form Form} holding the field, directly or
|
|
37
|
+
* through a growing {@link label!Label Label}, which fills it with the field, keeping the field below its text.
|
|
38
|
+
*
|
|
39
|
+
* The value is either held by the caller, which shows `value` and is handed each edit through `onChange`, or left to
|
|
40
|
+
* the field where `value` is omitted, the field then keeping whatever the reader types.
|
|
41
|
+
*
|
|
42
|
+
* @param options The widget configuration
|
|
43
|
+
*
|
|
44
|
+
* @returns The field
|
|
45
|
+
*
|
|
46
|
+
* @see [HTML: The textarea element][textarea]
|
|
47
|
+
*
|
|
48
|
+
* [textarea]: https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
|
|
49
|
+
*/
|
|
50
|
+
export function Textarea({ name, id, description, disabled, readonly, required, minLength, maxLength, error, grow = false, rows, placeholder, value, onChange }) {
|
|
51
|
+
/*
|
|
52
|
+
* The platform takes a custom message only through setCustomValidity, with no attribute standing for it, so the
|
|
53
|
+
* message is set on the element after every render, catching a value or an error changed by the caller, and on
|
|
54
|
+
* every edit, before the form around the field reads its validity and hands it over to its own validation handler.
|
|
55
|
+
*/
|
|
56
|
+
const field = useRef(null);
|
|
57
|
+
useLayoutEffect(() => {
|
|
58
|
+
if (field.current) {
|
|
59
|
+
report(field.current, error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return createElement("clay-textarea", { grow }, _jsx("textarea", { ref: field, id: id, disabled: disabled, readOnly: readonly, required: required, "aria-label": name, "aria-describedby": description, minLength: minLength, maxLength: maxLength, style: rows === undefined ? undefined : `--clay-textarea-rows: ${rows}`, placeholder: placeholder, value: value, onInput: event => {
|
|
63
|
+
report(event.currentTarget, error);
|
|
64
|
+
onChange?.(event.currentTarget.value);
|
|
65
|
+
} }));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sets the custom message of a field to the error given while the field fails its own constraints, and clears it
|
|
69
|
+
* otherwise, so the message names the rule a failing value breaks but never decides whether the field is valid.
|
|
70
|
+
*/
|
|
71
|
+
function report(field, error) {
|
|
72
|
+
field.setCustomValidity("");
|
|
73
|
+
field.setCustomValidity(error === undefined || field.validity.valid ? "" : error);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/controls/textarea.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,QAAQ,CAAC,EAExB,IAAI,EACJ,EAAE,EACF,WAAW,EAEX,QAAQ,EACR,QAAQ,EACR,QAAQ,EAER,SAAS,EACT,SAAS,EACT,KAAK,EAEL,IAAI,GAAG,KAAK,EACZ,IAAI,EAEJ,WAAW,EACX,KAAK,EAEL,QAAQ,EAuFR;IAEA;;;;OAIG;IAEH,MAAM,KAAK,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEhD,eAAe,CAAC,GAAG,EAAE;QACpB,IAAK,KAAK,CAAC,OAAO,EAAG,CAAC;YACrB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,EAAE,mBAE/C,GAAG,EAAE,KAAK,EAEV,EAAE,EAAE,EAAE,EAEN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,gBAEN,IAAI,sBACE,WAAW,EAE7B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EAEpB,KAAK,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB,IAAI,EAAE,EAEvE,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EAEZ,OAAO,EAAE,KAAK,CAAC,EAAE;YAChB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;YACnC,QAAQ,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC,GAEA,CAAC,CAAC;AAEL,CAAC;AAGD;;;GAGG;AACH,SAAS,MAAM,CAAC,KAA0B,EAAE,KAAyB;IACpE,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC5B,KAAK,CAAC,iBAAiB,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon catalogue.
|
|
3
|
+
*
|
|
4
|
+
* Collects the glyphs and the roles `icon.ts` hands out as the `Icon` namespace: a role names the glyph it stands
|
|
5
|
+
* for, and a lucide name resolves to the glyph lucide draws, save for `Link`, the chain link lucide calls `Link2`.
|
|
6
|
+
*
|
|
7
|
+
* @module icon.core
|
|
8
|
+
*/
|
|
9
|
+
export * from "lucide-preact";
|
|
10
|
+
export { LogIn, LogOut } from "lucide-preact";
|
|
11
|
+
export { Link2 as Link } from "lucide-preact";
|
|
12
|
+
export { ChevronRight as Open } from "lucide-preact";
|
|
13
|
+
export { ChevronLeft as Back } from "lucide-preact";
|
|
14
|
+
export { ChevronRight as Expand } from "lucide-preact";
|
|
15
|
+
export { ChevronDown as Collapse } from "lucide-preact";
|
|
16
|
+
export { ChevronDown as Unfold } from "lucide-preact";
|
|
17
|
+
export { ChevronUp as Fold } from "lucide-preact";
|
|
18
|
+
export { ChevronsUpDown as UnfoldAll } from "lucide-preact";
|
|
19
|
+
export { ChevronsDownUp as FoldAll } from "lucide-preact";
|
|
20
|
+
export { Search } from "lucide-preact";
|
|
21
|
+
export { X as Clear } from "lucide-preact";
|
|
22
|
+
export { XCircle as Reset } from "lucide-preact";
|
|
23
|
+
export { SquareCheckBig as Options } from "lucide-preact";
|
|
24
|
+
export { ChevronsUpDown as Sort } from "lucide-preact";
|
|
25
|
+
export { ChevronDown as Increasing } from "lucide-preact";
|
|
26
|
+
export { ChevronUp as Decreasing } from "lucide-preact";
|
|
27
|
+
export { Plus as Insert } from "lucide-preact";
|
|
28
|
+
export { X as Remove } from "lucide-preact";
|
|
29
|
+
export { Plus as Create } from "lucide-preact";
|
|
30
|
+
export { Edit as Update } from "lucide-preact";
|
|
31
|
+
export { Save } from "lucide-preact";
|
|
32
|
+
export { Trash2 as Delete } from "lucide-preact";
|
|
33
|
+
export { RefreshCw as Reload } from "lucide-preact";
|
|
34
|
+
export { Check as Accept } from "lucide-preact";
|
|
35
|
+
export { X as Cancel } from "lucide-preact";
|
|
36
|
+
export { X as Close } from "lucide-preact";
|
|
37
|
+
export { X as Dismiss } from "lucide-preact";
|
|
38
|
+
export { GripVertical as Grip } from "lucide-preact";
|
|
39
|
+
export { Ellipsis as More } from "lucide-preact";
|
|
40
|
+
export { Menu } from "lucide-preact";
|
|
41
|
+
export { X as Done } from "lucide-preact";
|
|
42
|
+
export { RefreshCw as Busy } from "lucide-preact";
|
|
43
|
+
export { Heart as About } from "lucide-preact";
|
|
44
|
+
export { Info } from "lucide-preact";
|
|
45
|
+
export { AlertTriangle as Alert } from "lucide-preact";
|
|
46
|
+
export { HelpCircle as Help } from "lucide-preact";
|
|
47
|
+
export { Lock as Unauthorized } from "lucide-preact";
|
|
48
|
+
export { Ban as Forbidden } from "lucide-preact";
|
|
49
|
+
export { HeartCrack as NotFound } from "lucide-preact";
|
|
50
|
+
export { Ghost as Gone } from "lucide-preact";
|
|
51
|
+
export { HeartPulse as Error } from "lucide-preact";
|
|
52
|
+
//# sourceMappingURL=icon.core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.core.d.ts","sourceRoot":"","sources":["../../src/glyphs/icon.core.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Icon catalogue.
|
|
18
|
+
*
|
|
19
|
+
* Collects the glyphs and the roles `icon.ts` hands out as the `Icon` namespace: a role names the glyph it stands
|
|
20
|
+
* for, and a lucide name resolves to the glyph lucide draws, save for `Link`, the chain link lucide calls `Link2`.
|
|
21
|
+
*
|
|
22
|
+
* @module icon.core
|
|
23
|
+
*/
|
|
24
|
+
export * from "lucide-preact";
|
|
25
|
+
export { LogIn, LogOut } from "lucide-preact";
|
|
26
|
+
export { Link2 as Link } from "lucide-preact";
|
|
27
|
+
export { ChevronRight as Open } from "lucide-preact";
|
|
28
|
+
export { ChevronLeft as Back } from "lucide-preact";
|
|
29
|
+
export { ChevronRight as Expand } from "lucide-preact";
|
|
30
|
+
export { ChevronDown as Collapse } from "lucide-preact";
|
|
31
|
+
export { ChevronDown as Unfold } from "lucide-preact";
|
|
32
|
+
export { ChevronUp as Fold } from "lucide-preact";
|
|
33
|
+
export { ChevronsUpDown as UnfoldAll } from "lucide-preact";
|
|
34
|
+
export { ChevronsDownUp as FoldAll } from "lucide-preact";
|
|
35
|
+
export { Search } from "lucide-preact";
|
|
36
|
+
export { X as Clear } from "lucide-preact";
|
|
37
|
+
export { XCircle as Reset } from "lucide-preact";
|
|
38
|
+
export { SquareCheckBig as Options } from "lucide-preact";
|
|
39
|
+
export { ChevronsUpDown as Sort } from "lucide-preact";
|
|
40
|
+
export { ChevronDown as Increasing } from "lucide-preact";
|
|
41
|
+
export { ChevronUp as Decreasing } from "lucide-preact";
|
|
42
|
+
export { Plus as Insert } from "lucide-preact";
|
|
43
|
+
export { X as Remove } from "lucide-preact";
|
|
44
|
+
export { Plus as Create } from "lucide-preact";
|
|
45
|
+
export { Edit as Update } from "lucide-preact";
|
|
46
|
+
export { Save } from "lucide-preact";
|
|
47
|
+
export { Trash2 as Delete } from "lucide-preact";
|
|
48
|
+
export { RefreshCw as Reload } from "lucide-preact";
|
|
49
|
+
export { Check as Accept } from "lucide-preact";
|
|
50
|
+
export { X as Cancel } from "lucide-preact";
|
|
51
|
+
export { X as Close } from "lucide-preact";
|
|
52
|
+
export { X as Dismiss } from "lucide-preact";
|
|
53
|
+
export { GripVertical as Grip } from "lucide-preact";
|
|
54
|
+
export { Ellipsis as More } from "lucide-preact";
|
|
55
|
+
export { Menu } from "lucide-preact";
|
|
56
|
+
export { X as Done } from "lucide-preact";
|
|
57
|
+
export { RefreshCw as Busy } from "lucide-preact";
|
|
58
|
+
export { Heart as About } from "lucide-preact";
|
|
59
|
+
export { Info } from "lucide-preact";
|
|
60
|
+
export { AlertTriangle as Alert } from "lucide-preact";
|
|
61
|
+
export { HelpCircle as Help } from "lucide-preact";
|
|
62
|
+
export { Lock as Unauthorized } from "lucide-preact";
|
|
63
|
+
export { Ban as Forbidden } from "lucide-preact";
|
|
64
|
+
export { HeartCrack as NotFound } from "lucide-preact";
|
|
65
|
+
export { Ghost as Gone } from "lucide-preact";
|
|
66
|
+
export { HeartPulse as Error } from "lucide-preact";
|
|
67
|
+
//# sourceMappingURL=icon.core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.core.js","sourceRoot":"","sources":["../../src/glyphs/icon.core.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* An icon rides with the text it sits in, so a control marked with one needs no measure of its own. The rule is keyed
|
|
20
|
+
* by the class lucide puts on every glyph, there being no element of ours to key it by.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
.lucide {
|
|
24
|
+
|
|
25
|
+
display: inline-block;
|
|
26
|
+
|
|
27
|
+
width: var(--skin--scaling-100);
|
|
28
|
+
height: var(--skin--scaling-100);
|
|
29
|
+
|
|
30
|
+
stroke-width: var(--skin--stroke-width);
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role-named glyphs.
|
|
3
|
+
*
|
|
4
|
+
* Provides the glyph a control is marked with under the name of the role it stands for: a screen asks for
|
|
5
|
+
* `Icon.Create` rather than for a plus sign, so retuning what a role looks like across an interface is a change to
|
|
6
|
+
* this module alone. The whole Lucide catalogue hangs off the same namespace, for a glyph no role covers:
|
|
7
|
+
* `<Icon.Rocket/>` costs a bundle no more than a direct import does, while a member picked at run time, `Icon[name]`,
|
|
8
|
+
* takes every glyph Lucide draws along with it.
|
|
9
|
+
*
|
|
10
|
+
* > [!NOTE]
|
|
11
|
+
* >
|
|
12
|
+
* > Glyphs are provided by Lucide under the ISC and MIT licences. Redistribution, including within a bundled
|
|
13
|
+
* > application, must preserve the copyright and permission notices reproduced in [Notices](./icon.md).
|
|
14
|
+
*
|
|
15
|
+
* An icon is hidden from assistive technology unless given a `role`, a `title` or an `aria-*` attribute: the control
|
|
16
|
+
* it marks carries the accessible name, and a glyph read out beside it would only name the control a second time.
|
|
17
|
+
*
|
|
18
|
+
* > [!IMPORTANT]
|
|
19
|
+
* >
|
|
20
|
+
* > An icon standing on its own, with no label beside it, states the accessible name itself, which is also what
|
|
21
|
+
* > brings it into the accessibility tree:
|
|
22
|
+
* >
|
|
23
|
+
* > ```tsx
|
|
24
|
+
* > <button onClick={close}><Icon.Close aria-label="Close"/></button>
|
|
25
|
+
* > ```
|
|
26
|
+
*
|
|
27
|
+
* **Standard Glyphs**
|
|
28
|
+
*
|
|
29
|
+
* Import the namespace once, then mark a control with any glyph Lucide draws, under the name Lucide gives it.
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* import { Icon } from "@grafctory/clay-widgets/icon";
|
|
33
|
+
*
|
|
34
|
+
* <button onClick={launch}><Icon.Rocket/> Deploy</button>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* **Role Glyphs**
|
|
38
|
+
*
|
|
39
|
+
* Alongside them, the namespace carries role names, standing for what a control does rather than for what it draws.
|
|
40
|
+
* A control takes the role that matches its action, not the glyph that looks right: every control creating an item
|
|
41
|
+
* takes `Create`, wherever it appears, so one screen never says with a plus what another says with a pencil, and
|
|
42
|
+
* repointing a role at a different glyph restyles all of them at once. An action no role covers takes a standard
|
|
43
|
+
* glyph until a role is added for it, and then switches to that role along with every other control sharing it.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <button onClick={create}><Icon.Create/> New Item</button> // creating, wherever it appears
|
|
47
|
+
* <button onClick={insert}><Icon.Insert/> Add Member</button> // adding to a set, a role of its own
|
|
48
|
+
* <button onClick={launch}><Icon.Rocket/> Deploy</button> // no role covers deploying, yet
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* The roles on offer, under the area each one belongs to:
|
|
52
|
+
*
|
|
53
|
+
* | Role | Meaning |
|
|
54
|
+
* |------------------|--------------------------------------------------------------|
|
|
55
|
+
* | **Session** | who the reader is to the app |
|
|
56
|
+
* | `LogIn` | opens a session |
|
|
57
|
+
* | `LogOut` | ends the current one |
|
|
58
|
+
* | **Navigation** | where a control leads |
|
|
59
|
+
* | `Link` | marks an address, whether it leads inside the app or out |
|
|
60
|
+
* | `Open` | steps into an item |
|
|
61
|
+
* | `Back` | returns to the step before |
|
|
62
|
+
* | **Disclosure** | how much of a tree or a section is on show |
|
|
63
|
+
* | `Expand` | reveals the entries nested under an item, as in a tree |
|
|
64
|
+
* | `Collapse` | hides them again |
|
|
65
|
+
* | `Unfold` | reveals the content folded away below a control, in place |
|
|
66
|
+
* | `Fold` | folds it back |
|
|
67
|
+
* | `UnfoldAll` | reveals all the content folded away in a list or table |
|
|
68
|
+
* | `FoldAll` | folds it all back |
|
|
69
|
+
* | **Search** | narrowing what is on show |
|
|
70
|
+
* | `Search` | submits a query, or opens the field it is typed in |
|
|
71
|
+
* | `Clear` | empties that field |
|
|
72
|
+
* | `Reset` | withdraws every criterion the reader set to narrow a list |
|
|
73
|
+
* | `Options` | marks a facet narrowing by the values the reader picks |
|
|
74
|
+
* | **Ordering** | the sequence entries are shown in |
|
|
75
|
+
* | `Sort` | offers an order the reader has yet to choose |
|
|
76
|
+
* | `Increasing` | states the order in force, smallest first |
|
|
77
|
+
* | `Decreasing` | states it the other way about |
|
|
78
|
+
* | **Collections** | what a set holds |
|
|
79
|
+
* | `Insert` | adds an entry to a collection |
|
|
80
|
+
* | `Remove` | takes one out again |
|
|
81
|
+
* | **Records** | the life of a single item |
|
|
82
|
+
* | `Create` | brings a new item into being |
|
|
83
|
+
* | `Update` | edits the item on show |
|
|
84
|
+
* | `Save` | writes the edits back |
|
|
85
|
+
* | `Delete` | destroys it |
|
|
86
|
+
* | `Reload` | retrieves it again, after a failure or a change |
|
|
87
|
+
* | **Confirmation** | what becomes of what was entered |
|
|
88
|
+
* | `Accept` | commits it |
|
|
89
|
+
* | `Cancel` | abandons it, leaving things as they stood |
|
|
90
|
+
* | `Close` | dismisses what is on show, deciding nothing |
|
|
91
|
+
* | `Dismiss` | sets aside a notice or a failure, returning to the screen |
|
|
92
|
+
* | **Items** | acting on a single entry |
|
|
93
|
+
* | `Grip` | moves an entry, dragged or pressed for the moves open to it |
|
|
94
|
+
* | `More` | opens the actions an entry offers |
|
|
95
|
+
* | **Modes** | entering and leaving a way of working |
|
|
96
|
+
* | `Menu` | opens what a screen keeps out of the way until asked |
|
|
97
|
+
* | `Done` | leaves a mode, whatever it was entered for |
|
|
98
|
+
* | **Progress** | what the app is still working on |
|
|
99
|
+
* | `Busy` | stands while the app works on what the reader asked for |
|
|
100
|
+
* | **Notices** | what the app has to say unprompted |
|
|
101
|
+
* | `About` | tells the reader about the app itself |
|
|
102
|
+
* | `Info` | carries an aside the reader may skip |
|
|
103
|
+
* | `Alert` | warns of a consequence worth weighing first |
|
|
104
|
+
* | `Help` | offers guidance on the task at hand |
|
|
105
|
+
* | **Failures** | why what was asked for did not come back |
|
|
106
|
+
* | `Unauthorized` | stands where the reader has yet to identify themselves |
|
|
107
|
+
* | `Forbidden` | stands where they have, and are still not allowed in |
|
|
108
|
+
* | `NotFound` | stands where what was asked for does not exist |
|
|
109
|
+
* | `Gone` | stands where it existed and has since been withdrawn |
|
|
110
|
+
* | `Error` | stands where the server failed to answer at all |
|
|
111
|
+
*
|
|
112
|
+
* **Styling**
|
|
113
|
+
*
|
|
114
|
+
* A glyph is drawn at `--skin--scaling-100`, in the colour of the text around it and at `--skin--stroke-width`, so a
|
|
115
|
+
* control restyles its icon by restyling itself and a theme carries every icon along; the `size` prop plays no part,
|
|
116
|
+
* the stylesheet overriding it. A one-off takes a `class`, which Lucide merges into the `lucide lucide-<name>` list
|
|
117
|
+
* it already carries, or a `style`, which lands on the element and outranks both the stylesheet and the attributes
|
|
118
|
+
* Lucide sets:
|
|
119
|
+
*
|
|
120
|
+
* ```tsx
|
|
121
|
+
* <button style={{ fontSize: "1.5em" }}><Icon.Rocket/> Deploy</button> // the glyph follows the label
|
|
122
|
+
* <Icon.Alert class="urgent"/> // joins `lucide lucide-triangle-alert`
|
|
123
|
+
* <Icon.Sort style={{ strokeWidth: 1.5 }}/> // overrides the stroke-width attribute
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* From a stylesheet, a glyph is reached either through a class of its own or through the ones Lucide writes, `lucide`
|
|
127
|
+
* on every glyph and `lucide-<name>` on each, and takes its measures from the design system rather than from
|
|
128
|
+
* literals. The rule sizing an icon is unlayered at a single class of specificity, so a consumer rule wins by naming
|
|
129
|
+
* an ancestor, whatever order the two sheets are emitted in:
|
|
130
|
+
*
|
|
131
|
+
* ```css
|
|
132
|
+
* .urgent {
|
|
133
|
+
* color: var(--skin--color-fail);
|
|
134
|
+
* }
|
|
135
|
+
*
|
|
136
|
+
* clay-toolbar .lucide {
|
|
137
|
+
* width: var(--skin--scaling-150);
|
|
138
|
+
* height: var(--skin--scaling-150);
|
|
139
|
+
* stroke-width: var(--skin--stroke-width);
|
|
140
|
+
* }
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @document ./icon.md
|
|
144
|
+
*
|
|
145
|
+
* @see {@link https://lucide.dev/icons/ Lucide: icon catalogue}
|
|
146
|
+
* @see {@link https://lucide.dev/license Lucide: licence}
|
|
147
|
+
*
|
|
148
|
+
* @module icon
|
|
149
|
+
*/
|
|
150
|
+
import "./icon.css";
|
|
151
|
+
export * as Icon from "./icon.core.js";
|
|
152
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/glyphs/icon.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoJG;AAEH,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC"}
|