@neumorphism-ui/elements 1.0.0-next.2 → 1.0.0-next.3
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/cdn/neu.min.js +31 -39
- package/custom-elements.json +495 -248
- package/dist/components/avatar/avatar.d.ts +0 -3
- package/dist/components/avatar/avatar.def.d.ts +0 -3
- package/dist/components/avatar/avatar.def.js +4 -18
- package/dist/components/avatar/avatar.docs.d.ts +2 -0
- package/dist/components/avatar/avatar.docs.js +22 -0
- package/dist/components/avatar/avatar.js +7 -1
- package/dist/components/badge/badge.d.ts +0 -2
- package/dist/components/badge/badge.def.d.ts +0 -2
- package/dist/components/badge/badge.def.js +1 -14
- package/dist/components/badge/badge.docs.d.ts +2 -0
- package/dist/components/badge/badge.docs.js +17 -0
- package/dist/components/button/button.def.d.ts +0 -5
- package/dist/components/button/button.def.js +3 -25
- package/dist/components/button/button.docs.d.ts +2 -0
- package/dist/components/button/button.docs.js +29 -0
- package/dist/components/button-group/button-group.d.ts +0 -2
- package/dist/components/button-group/button-group.def.d.ts +0 -2
- package/dist/components/button-group/button-group.def.js +1 -10
- package/dist/components/button-group/button-group.docs.d.ts +2 -0
- package/dist/components/button-group/button-group.docs.js +13 -0
- package/dist/components/checkbox/checkbox.d.ts +1 -5
- package/dist/components/checkbox/checkbox.def.d.ts +1 -5
- package/dist/components/checkbox/checkbox.def.js +6 -22
- package/dist/components/checkbox/checkbox.docs.d.ts +2 -0
- package/dist/components/checkbox/checkbox.docs.js +27 -0
- package/dist/components/divider/divider.d.ts +0 -1
- package/dist/components/divider/divider.def.d.ts +0 -1
- package/dist/components/divider/divider.def.js +0 -9
- package/dist/components/divider/divider.docs.d.ts +2 -0
- package/dist/components/divider/divider.docs.js +12 -0
- package/dist/components/icon/icon.d.ts +0 -3
- package/dist/components/icon/icon.def.d.ts +0 -3
- package/dist/components/icon/icon.def.js +3 -10
- package/dist/components/icon/icon.docs.d.ts +2 -0
- package/dist/components/icon/icon.docs.js +13 -0
- package/dist/components/icon/system-icons.d.ts +1 -1
- package/dist/components/icon/system-icons.js +3 -3
- package/dist/components/icon-button/icon-button.d.ts +0 -5
- package/dist/components/icon-button/icon-button.def.d.ts +0 -5
- package/dist/components/icon-button/icon-button.def.js +3 -17
- package/dist/components/icon-button/icon-button.docs.d.ts +2 -0
- package/dist/components/icon-button/icon-button.docs.js +26 -0
- package/dist/components/number-field/number-field.d.ts +0 -5
- package/dist/components/number-field/number-field.def.d.ts +0 -10
- package/dist/components/number-field/number-field.def.js +5 -27
- package/dist/components/number-field/number-field.docs.d.ts +2 -0
- package/dist/components/number-field/number-field.docs.js +45 -0
- package/dist/components/number-field/number-field.js +2 -2
- package/dist/components/number-field/number-field.styles.d.ts +1 -1
- package/dist/components/option/option.d.ts +0 -2
- package/dist/components/option/option.def.d.ts +0 -2
- package/dist/components/option/option.def.js +2 -9
- package/dist/components/option/option.docs.d.ts +2 -0
- package/dist/components/option/option.docs.js +12 -0
- package/dist/components/radio/radio.d.ts +0 -2
- package/dist/components/radio/radio.def.d.ts +0 -2
- package/dist/components/radio/radio.def.js +2 -15
- package/dist/components/radio/radio.docs.d.ts +2 -0
- package/dist/components/radio/radio.docs.js +18 -0
- package/dist/components/radio-group/radio-group.d.ts +3 -4
- package/dist/components/radio-group/radio-group.def.d.ts +0 -4
- package/dist/components/radio-group/radio-group.def.js +4 -19
- package/dist/components/radio-group/radio-group.docs.d.ts +2 -0
- package/dist/components/radio-group/radio-group.docs.js +37 -0
- package/dist/components/radio-group/radio-group.js +28 -4
- package/dist/components/radio-group/radio-group.styles.d.ts +1 -1
- package/dist/components/radio-group/radio-group.styles.js +3 -5
- package/dist/components/select/select.d.ts +1 -5
- package/dist/components/select/select.def.d.ts +0 -4
- package/dist/components/select/select.def.js +5 -29
- package/dist/components/select/select.docs.d.ts +2 -0
- package/dist/components/select/select.docs.js +65 -0
- package/dist/components/select/select.js +16 -10
- package/dist/components/select/select.styles.d.ts +1 -1
- package/dist/components/select/select.styles.js +1 -5
- package/dist/components/shared/field.styles.d.ts +1 -1
- package/dist/components/shared/field.styles.js +2 -4
- package/dist/components/slider/slider.d.ts +0 -2
- package/dist/components/slider/slider.def.d.ts +0 -2
- package/dist/components/slider/slider.def.js +2 -24
- package/dist/components/slider/slider.docs.d.ts +2 -0
- package/dist/components/slider/slider.docs.js +45 -0
- package/dist/components/spinner/spinner.d.ts +0 -1
- package/dist/components/spinner/spinner.def.d.ts +0 -1
- package/dist/components/spinner/spinner.def.js +1 -13
- package/dist/components/spinner/spinner.docs.d.ts +2 -0
- package/dist/components/spinner/spinner.docs.js +17 -0
- package/dist/components/surface/surface.d.ts +0 -4
- package/dist/components/surface/surface.def.d.ts +0 -4
- package/dist/components/surface/surface.def.js +3 -12
- package/dist/components/surface/surface.docs.d.ts +2 -0
- package/dist/components/surface/surface.docs.js +15 -0
- package/dist/components/switch/switch.d.ts +0 -5
- package/dist/components/switch/switch.def.d.ts +0 -5
- package/dist/components/switch/switch.def.js +5 -21
- package/dist/components/switch/switch.docs.d.ts +2 -0
- package/dist/components/switch/switch.docs.js +26 -0
- package/dist/components/text-field/text-field.d.ts +0 -6
- package/dist/components/text-field/text-field.def.d.ts +0 -12
- package/dist/components/text-field/text-field.def.js +5 -30
- package/dist/components/text-field/text-field.docs.d.ts +2 -0
- package/dist/components/text-field/text-field.docs.js +45 -0
- package/dist/components/text-field/text-field.js +2 -2
- package/dist/components/text-field/text-field.styles.d.ts +1 -1
- package/dist/components/textarea/textarea.d.ts +0 -6
- package/dist/components/textarea/textarea.def.d.ts +0 -12
- package/dist/components/textarea/textarea.def.js +5 -26
- package/dist/components/textarea/textarea.docs.d.ts +2 -0
- package/dist/components/textarea/textarea.docs.js +40 -0
- package/dist/components/textarea/textarea.styles.d.ts +1 -1
- package/dist/components/theme-docs.d.ts +3 -0
- package/dist/components/theme-docs.js +8 -0
- package/dist/core/define.d.ts +4 -1
- package/dist/core/dom.d.ts +4 -0
- package/dist/core/dom.js +7 -0
- package/dist/core/form-control.js +4 -1
- package/dist/core/neu-element.d.ts +2 -2
- package/dist/core/neu-element.js +10 -7
- package/dist/core/props.d.ts +13 -1
- package/dist/core/props.js +13 -3
- package/dist/core/styles.d.ts +0 -2
- package/dist/core/styles.js +0 -7
- package/dist/docs.d.ts +3 -0
- package/dist/docs.js +41 -0
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +1 -1
- package/package.json +5 -1
|
@@ -6,7 +6,6 @@ export declare class NeuTextarea extends TextControlElement {
|
|
|
6
6
|
};
|
|
7
7
|
readonly name: {
|
|
8
8
|
readonly type: "string";
|
|
9
|
-
readonly reflect: true;
|
|
10
9
|
};
|
|
11
10
|
readonly label: {
|
|
12
11
|
readonly type: "string";
|
|
@@ -22,15 +21,12 @@ export declare class NeuTextarea extends TextControlElement {
|
|
|
22
21
|
};
|
|
23
22
|
readonly required: {
|
|
24
23
|
readonly type: "boolean";
|
|
25
|
-
readonly reflect: true;
|
|
26
24
|
};
|
|
27
25
|
readonly disabled: {
|
|
28
26
|
readonly type: "boolean";
|
|
29
|
-
readonly reflect: true;
|
|
30
27
|
};
|
|
31
28
|
readonly readOnly: {
|
|
32
29
|
readonly type: "boolean";
|
|
33
|
-
readonly reflect: true;
|
|
34
30
|
readonly attribute: "readonly";
|
|
35
31
|
};
|
|
36
32
|
readonly minLength: {
|
|
@@ -58,13 +54,11 @@ export declare class NeuTextarea extends TextControlElement {
|
|
|
58
54
|
readonly type: "string";
|
|
59
55
|
readonly default: "vertical";
|
|
60
56
|
readonly values: readonly ["none", "vertical", "auto"];
|
|
61
|
-
readonly reflect: true;
|
|
62
57
|
};
|
|
63
58
|
readonly size: {
|
|
64
59
|
readonly type: "string";
|
|
65
60
|
readonly default: "md";
|
|
66
61
|
readonly values: readonly ["sm", "md", "lg"];
|
|
67
|
-
readonly reflect: true;
|
|
68
62
|
};
|
|
69
63
|
}>;
|
|
70
64
|
static extraProperties: string[];
|
|
@@ -5,7 +5,6 @@ declare const props: {
|
|
|
5
5
|
};
|
|
6
6
|
readonly name: {
|
|
7
7
|
readonly type: "string";
|
|
8
|
-
readonly reflect: true;
|
|
9
8
|
};
|
|
10
9
|
readonly label: {
|
|
11
10
|
readonly type: "string";
|
|
@@ -21,15 +20,12 @@ declare const props: {
|
|
|
21
20
|
};
|
|
22
21
|
readonly required: {
|
|
23
22
|
readonly type: "boolean";
|
|
24
|
-
readonly reflect: true;
|
|
25
23
|
};
|
|
26
24
|
readonly disabled: {
|
|
27
25
|
readonly type: "boolean";
|
|
28
|
-
readonly reflect: true;
|
|
29
26
|
};
|
|
30
27
|
readonly readOnly: {
|
|
31
28
|
readonly type: "boolean";
|
|
32
|
-
readonly reflect: true;
|
|
33
29
|
readonly attribute: "readonly";
|
|
34
30
|
};
|
|
35
31
|
readonly minLength: {
|
|
@@ -57,13 +53,11 @@ declare const props: {
|
|
|
57
53
|
readonly type: "string";
|
|
58
54
|
readonly default: "vertical";
|
|
59
55
|
readonly values: readonly ["none", "vertical", "auto"];
|
|
60
|
-
readonly reflect: true;
|
|
61
56
|
};
|
|
62
57
|
readonly size: {
|
|
63
58
|
readonly type: "string";
|
|
64
59
|
readonly default: "md";
|
|
65
60
|
readonly values: readonly ["sm", "md", "lg"];
|
|
66
|
-
readonly reflect: true;
|
|
67
61
|
};
|
|
68
62
|
};
|
|
69
63
|
export type TextareaProps = InferProps<typeof props>;
|
|
@@ -75,7 +69,6 @@ export declare const textareaDef: import("../../core/define.js").ComponentDef<{
|
|
|
75
69
|
};
|
|
76
70
|
readonly name: {
|
|
77
71
|
readonly type: "string";
|
|
78
|
-
readonly reflect: true;
|
|
79
72
|
};
|
|
80
73
|
readonly label: {
|
|
81
74
|
readonly type: "string";
|
|
@@ -91,15 +84,12 @@ export declare const textareaDef: import("../../core/define.js").ComponentDef<{
|
|
|
91
84
|
};
|
|
92
85
|
readonly required: {
|
|
93
86
|
readonly type: "boolean";
|
|
94
|
-
readonly reflect: true;
|
|
95
87
|
};
|
|
96
88
|
readonly disabled: {
|
|
97
89
|
readonly type: "boolean";
|
|
98
|
-
readonly reflect: true;
|
|
99
90
|
};
|
|
100
91
|
readonly readOnly: {
|
|
101
92
|
readonly type: "boolean";
|
|
102
|
-
readonly reflect: true;
|
|
103
93
|
readonly attribute: "readonly";
|
|
104
94
|
};
|
|
105
95
|
readonly minLength: {
|
|
@@ -127,13 +117,11 @@ export declare const textareaDef: import("../../core/define.js").ComponentDef<{
|
|
|
127
117
|
readonly type: "string";
|
|
128
118
|
readonly default: "vertical";
|
|
129
119
|
readonly values: readonly ["none", "vertical", "auto"];
|
|
130
|
-
readonly reflect: true;
|
|
131
120
|
};
|
|
132
121
|
readonly size: {
|
|
133
122
|
readonly type: "string";
|
|
134
123
|
readonly default: "md";
|
|
135
124
|
readonly values: readonly ["sm", "md", "lg"];
|
|
136
|
-
readonly reflect: true;
|
|
137
125
|
};
|
|
138
126
|
}>;
|
|
139
127
|
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { defineComponent } from '../../core/define.js';
|
|
2
2
|
import { html } from '../../core/html.js';
|
|
3
|
-
import { themeCssProperties } from '../../core/styles.js';
|
|
4
3
|
import { textareaStyles } from './textarea.styles.js';
|
|
5
4
|
const props = {
|
|
6
5
|
value: { type: 'string' },
|
|
7
|
-
name: { type: 'string'
|
|
6
|
+
name: { type: 'string' },
|
|
8
7
|
label: { type: 'string' },
|
|
9
8
|
placeholder: { type: 'string' },
|
|
10
9
|
helpText: { type: 'string' },
|
|
11
10
|
errorText: { type: 'string' },
|
|
12
|
-
required: { type: 'boolean'
|
|
13
|
-
disabled: { type: 'boolean'
|
|
14
|
-
readOnly: { type: 'boolean',
|
|
11
|
+
required: { type: 'boolean' },
|
|
12
|
+
disabled: { type: 'boolean' },
|
|
13
|
+
readOnly: { type: 'boolean', attribute: 'readonly' },
|
|
15
14
|
minLength: { type: 'number', default: -1, attribute: 'minlength' },
|
|
16
15
|
maxLength: { type: 'number', default: -1, attribute: 'maxlength' },
|
|
17
16
|
autocomplete: { type: 'string' },
|
|
@@ -21,9 +20,8 @@ const props = {
|
|
|
21
20
|
type: 'string',
|
|
22
21
|
default: 'vertical',
|
|
23
22
|
values: ['none', 'vertical', 'auto'],
|
|
24
|
-
reflect: true,
|
|
25
23
|
},
|
|
26
|
-
size: { type: 'string', default: 'md', values: ['sm', 'md', 'lg']
|
|
24
|
+
size: { type: 'string', default: 'md', values: ['sm', 'md', 'lg'] },
|
|
27
25
|
};
|
|
28
26
|
/** A row count the native textarea would also accept; anything else means the default of 3. */
|
|
29
27
|
export function rowsOf(rows) {
|
|
@@ -43,23 +41,4 @@ export const textareaDef = defineComponent({
|
|
|
43
41
|
// with a newline keeps it.
|
|
44
42
|
template: (p) => html `<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${p.label}</span></slot></label><div part="control" class="control"><textarea part="textarea" class="input" id="input" data-ref="input" rows="${rowsOf(p.rows)}" aria-describedby="help"${areaAttributes(p)}>
|
|
45
43
|
${p.value}</textarea></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${p.helpText}</span></slot><span class="error-text" data-ref="error-text">${p.errorText}</span></div></div>`,
|
|
46
|
-
docs: {
|
|
47
|
-
summary: 'A multi-line text input with an inset field. The value attribute is the default value; resize="auto" grows the field with its content.',
|
|
48
|
-
events: [
|
|
49
|
-
{ name: 'input', description: 'Fired on every edit (the native input event, composed).' },
|
|
50
|
-
{ name: 'change', description: 'Fired when an edit is committed, usually on blur.' },
|
|
51
|
-
],
|
|
52
|
-
slots: [
|
|
53
|
-
{ name: 'label', description: 'Rich label; replaces the label attribute.' },
|
|
54
|
-
{ name: 'help-text', description: 'Rich help text; replaces the help-text attribute.' },
|
|
55
|
-
],
|
|
56
|
-
parts: [
|
|
57
|
-
{ name: 'base', description: 'Outer wrapper.' },
|
|
58
|
-
{ name: 'label', description: 'The <label> element.' },
|
|
59
|
-
{ name: 'control', description: 'The inset field around the textarea.' },
|
|
60
|
-
{ name: 'textarea', description: 'The native <textarea>.' },
|
|
61
|
-
{ name: 'help-text', description: 'Help or error text area.' },
|
|
62
|
-
],
|
|
63
|
-
cssProperties: themeCssProperties,
|
|
64
|
-
},
|
|
65
44
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { themeCssProperties } from '../theme-docs.js';
|
|
2
|
+
export const textareaDocs = {
|
|
3
|
+
summary: 'A multi-line text input with an inset field. The value attribute is the default value; resize="auto" grows the field with its content.',
|
|
4
|
+
descriptions: {
|
|
5
|
+
value: 'The current text as typed or set by script.',
|
|
6
|
+
name: 'The name under which the text is submitted with a form.',
|
|
7
|
+
label: 'Visible label text; the label slot replaces it.',
|
|
8
|
+
placeholder: 'Hint shown while the field is empty.',
|
|
9
|
+
helpText: 'Guidance shown below the field; the help-text slot replaces it.',
|
|
10
|
+
errorText: "Shown in place of the browser's validation message once the field is invalid after user interaction; does not itself make the field invalid.",
|
|
11
|
+
required: 'Makes the form invalid while the field is empty.',
|
|
12
|
+
disabled: 'Prevents interaction and leaves the field out of form submission.',
|
|
13
|
+
readOnly: 'Keeps the text visible and submitted but not editable.',
|
|
14
|
+
minLength: 'The fewest characters the text must have; checked after user edits, like native, not on script-set values.',
|
|
15
|
+
maxLength: 'The most characters the text may have; checked after user edits, like native, not a hard limit on script-set values.',
|
|
16
|
+
autocomplete: "Hint for the browser's autofill, as for the native attribute.",
|
|
17
|
+
enterKeyHint: "Hint for the label of the virtual keyboard's Enter key.",
|
|
18
|
+
rows: 'The number of visible text lines; falls back to 3 for anything but a positive integer.',
|
|
19
|
+
resize: "How the user or the content can change the field's height.",
|
|
20
|
+
size: 'The field size.',
|
|
21
|
+
defaultValue: 'The text the field starts with, which a form reset restores; set by the value attribute.',
|
|
22
|
+
},
|
|
23
|
+
events: [
|
|
24
|
+
{ name: 'input', description: 'Fired on every edit (the native input event, composed).' },
|
|
25
|
+
{ name: 'change', description: 'Fired when an edit is committed, usually on blur.' },
|
|
26
|
+
],
|
|
27
|
+
slots: [
|
|
28
|
+
{ name: 'label', description: 'Rich label; replaces the label attribute.' },
|
|
29
|
+
{ name: 'help-text', description: 'Rich help text; replaces the help-text attribute.' },
|
|
30
|
+
],
|
|
31
|
+
parts: [
|
|
32
|
+
{ name: 'base', description: 'Outer wrapper.' },
|
|
33
|
+
{ name: 'label', description: 'The <label> element.' },
|
|
34
|
+
{ name: 'control', description: 'The inset field around the textarea.' },
|
|
35
|
+
{ name: 'textarea', description: 'The native <textarea>.' },
|
|
36
|
+
{ name: 'help-text', description: 'Help or error text area.' },
|
|
37
|
+
],
|
|
38
|
+
cssProperties: themeCssProperties,
|
|
39
|
+
keyboard: [],
|
|
40
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const textareaStyles = "\n:host {\n --_neu-bg: var(--neu-bg, #e0e5ec);\n --_neu-accent-c: var(--neu-accent, #6d5dfc);\n --_neu-d: var(--neu-distance, 6px);\n --_neu-k: var(--neu-intensity, 1);\n --_neu-r: var(--neu-radius, 12px);\n --_neu-danger: var(--neu-danger, #e5484d);\n --_neu-dur: var(--neu-duration, 150ms);\n --_neu-sd: var(--neu-shadow-dark, color-mix(in oklab, var(--_neu-bg), black min(100%, calc(var(--_neu-shade, 18%) * var(--_neu-k)))));\n --_neu-sl: var(--neu-shadow-light, color-mix(in oklab, var(--_neu-bg), white min(100%, calc(var(--_neu-light, 100%) * var(--_neu-k)))));\n --_neu-fg: var(--neu-fg, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-mix, 32%)));\n --_neu-fg-muted: var(--neu-fg-muted, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-muted-mix, 18%)));\n --_neu-accent-soft: color-mix(in oklab, var(--_neu-accent-c) 25%, var(--_neu-bg));\n --_neu-focus: 0 0 0 3px color-mix(in oklab, var(--_neu-accent-c) 45%, transparent);\n --_neu-raised: var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-raised-sm: calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n --_neu-inset: inset var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), inset calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-inset-sm: inset calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), inset calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n font-family: var(--neu-font);\n color: var(--_neu-fg);\n -webkit-tap-highlight-color: transparent;\n}\n:host(:not(:defined)) { visibility: inherit !important; min-block-size: auto !important; }\n:host([hidden]) { display: none !important; }\n:host(:focus) { outline: none; }\n*, *::before, *::after { box-sizing: border-box; }\n\n:host { display: block; }\n:host(:disabled), :host([disabled]) { cursor: not-allowed; }\n.base { display: flex; flex-direction: column; }\n.label
|
|
1
|
+
export declare const textareaStyles = "\n:host {\n --_neu-bg: var(--neu-bg, #e0e5ec);\n --_neu-accent-c: var(--neu-accent, #6d5dfc);\n --_neu-d: var(--neu-distance, 6px);\n --_neu-k: var(--neu-intensity, 1);\n --_neu-r: var(--neu-radius, 12px);\n --_neu-danger: var(--neu-danger, #e5484d);\n --_neu-dur: var(--neu-duration, 150ms);\n --_neu-sd: var(--neu-shadow-dark, color-mix(in oklab, var(--_neu-bg), black min(100%, calc(var(--_neu-shade, 18%) * var(--_neu-k)))));\n --_neu-sl: var(--neu-shadow-light, color-mix(in oklab, var(--_neu-bg), white min(100%, calc(var(--_neu-light, 100%) * var(--_neu-k)))));\n --_neu-fg: var(--neu-fg, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-mix, 32%)));\n --_neu-fg-muted: var(--neu-fg-muted, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-muted-mix, 18%)));\n --_neu-accent-soft: color-mix(in oklab, var(--_neu-accent-c) 25%, var(--_neu-bg));\n --_neu-focus: 0 0 0 3px color-mix(in oklab, var(--_neu-accent-c) 45%, transparent);\n --_neu-raised: var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-raised-sm: calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n --_neu-inset: inset var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), inset calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-inset-sm: inset calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), inset calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n font-family: var(--neu-font);\n color: var(--_neu-fg);\n -webkit-tap-highlight-color: transparent;\n}\n:host(:not(:defined)) { visibility: inherit !important; min-block-size: auto !important; }\n:host([hidden]) { display: none !important; }\n:host(:focus) { outline: none; }\n*, *::before, *::after { box-sizing: border-box; }\n\n:host { display: block; }\n:host(:disabled), :host([disabled]) { cursor: not-allowed; }\n.base { display: flex; flex-direction: column; }\n.label { font-size: 0.8125rem; font-weight: 600; line-height: 1rem; color: var(--_neu-fg-muted); }\n.label-text, ::slotted([slot='label']) { display: block; margin-block-end: 0.375rem; }\n.label-text:empty { display: none; }\n.control {\n display: flex; align-items: center; min-block-size: 2.75rem; padding-inline: 0.875rem;\n border-radius: var(--_neu-r); background: var(--_neu-bg); box-shadow: var(--_neu-inset);\n transition: box-shadow var(--_neu-dur) ease;\n}\n:host([size='sm']) .control { min-block-size: 2.25rem; padding-inline: 0.75rem; box-shadow: var(--_neu-inset-sm); }\n:host([size='lg']) .control { min-block-size: 3.25rem; padding-inline: 1rem; }\n:host(:focus-within) .control { box-shadow: var(--_neu-inset), var(--_neu-focus); }\n:host(:state(user-invalid)) .control {\n box-shadow:\n inset var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) color-mix(in oklab, var(--_neu-danger) 35%, var(--_neu-sd)),\n inset calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n}\n:host(:disabled) .control, :host([disabled]) .control { box-shadow: var(--_neu-inset-sm); opacity: 0.6; }\n.input {\n flex: 1; min-inline-size: 0; align-self: stretch; padding: 0; border: none; outline: none;\n background: transparent; color: inherit; font: inherit; font-size: 0.9375rem;\n}\n.input::placeholder { color: var(--_neu-fg-muted); opacity: 1; }\n.help { font-size: 0.75rem; color: var(--_neu-fg-muted); }\n.help-text, ::slotted([slot='help-text']) { display: block; margin-block-start: 0.375rem; }\n.help-text:empty { display: none; }\n.error-text { display: none; margin-block-start: 0.375rem; color: var(--_neu-danger); }\n:host(:state(user-invalid)) slot[name='help-text'] { display: none; }\n:host(:state(user-invalid)) .error-text:not(:empty) { display: block; }\n\n.control { align-items: stretch; }\n.input {\n display: block; box-sizing: border-box; padding-block: 0.625rem; line-height: 1.4; resize: vertical;\n}\n:host([resize='none']) .input { resize: none; }\n:host([resize='auto']) .input { resize: none; overflow: hidden; }\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The theme tokens every component documents; docs only, so it stays out of the core bundle. */
|
|
2
|
+
export const themeCssProperties = [
|
|
3
|
+
{ name: '--neu-bg', description: 'Surface colour; shadows and text are derived from it.' },
|
|
4
|
+
{ name: '--neu-accent', description: 'Accent colour.' },
|
|
5
|
+
{ name: '--neu-distance', description: 'Shadow distance for the md size.' },
|
|
6
|
+
{ name: '--neu-intensity', description: 'Shadow strength multiplier.' },
|
|
7
|
+
{ name: '--neu-radius', description: 'Corner radius for the md size.' },
|
|
8
|
+
];
|
package/dist/core/define.d.ts
CHANGED
|
@@ -6,10 +6,14 @@ export interface DocEntry {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ComponentDocs {
|
|
8
8
|
readonly summary: string;
|
|
9
|
+
/** One line per prop of the def, per key of def.properties, and per defaultValue/defaultChecked. */
|
|
10
|
+
readonly descriptions: Readonly<Record<string, string>>;
|
|
9
11
|
readonly events: readonly DocEntry[];
|
|
10
12
|
readonly slots: readonly DocEntry[];
|
|
11
13
|
readonly parts: readonly DocEntry[];
|
|
12
14
|
readonly cssProperties: readonly DocEntry[];
|
|
15
|
+
/** name: the keys as spec §7 writes them; description: what they do. */
|
|
16
|
+
readonly keyboard: readonly DocEntry[];
|
|
13
17
|
}
|
|
14
18
|
export interface FormDef {
|
|
15
19
|
/** The prop whose attribute holds the default value (spec §6.1). */
|
|
@@ -38,7 +42,6 @@ export interface ComponentDef<S extends PropsSchema = PropsSchema> {
|
|
|
38
42
|
readonly properties?: Readonly<Record<string, string>>;
|
|
39
43
|
/** Tag of the children a server renderer reads into `TemplateContext.options`. */
|
|
40
44
|
readonly optionsFrom?: string;
|
|
41
|
-
readonly docs: ComponentDocs;
|
|
42
45
|
}
|
|
43
46
|
export declare function defineComponent<const S extends PropsSchema>(def: ComponentDef<S>): ComponentDef<S>;
|
|
44
47
|
/**
|
package/dist/core/dom.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare function setOptionalAttribute(el: Element | null, name: string, v
|
|
|
7
7
|
* loses focus, which also fires blur on the element; it is false once focus moved elsewhere.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isActiveInRoot(el: Element): boolean;
|
|
10
|
+
/** True when `node` sits in a child of `host` assigned to a named slot (a rich label, help text). */
|
|
11
|
+
export declare function inSlotted(host: Element, node: Node): boolean;
|
|
12
|
+
/** An IME keystroke: WebKit ends the composition first, so the Enter that commits has keyCode 229. */
|
|
13
|
+
export declare const composing: (event: KeyboardEvent) => boolean;
|
|
10
14
|
/** Dispatches a bubbling, composed event from a host (spec §6.4). */
|
|
11
15
|
export declare function dispatch(target: EventTarget, type: string): void;
|
|
12
16
|
/**
|
package/dist/core/dom.js
CHANGED
|
@@ -19,6 +19,13 @@ export function setOptionalAttribute(el, name, value) {
|
|
|
19
19
|
export function isActiveInRoot(el) {
|
|
20
20
|
return el.getRootNode().activeElement === el;
|
|
21
21
|
}
|
|
22
|
+
/** True when `node` sits in a child of `host` assigned to a named slot (a rich label, help text). */
|
|
23
|
+
export function inSlotted(host, node) {
|
|
24
|
+
const slotted = (node instanceof Element ? node : node.parentElement)?.closest('[slot]');
|
|
25
|
+
return !!slotted && slotted !== host && host.contains(slotted);
|
|
26
|
+
}
|
|
27
|
+
/** An IME keystroke: WebKit ends the composition first, so the Enter that commits has keyCode 229. */
|
|
28
|
+
export const composing = (event) => event.isComposing || event.keyCode === 229;
|
|
22
29
|
/** Dispatches a bubbling, composed event from a host (spec §6.4). */
|
|
23
30
|
export function dispatch(target, type) {
|
|
24
31
|
target.dispatchEvent(new Event(type, { bubbles: true, composed: true }));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { composing } from './dom.js';
|
|
1
2
|
import { NeuElement } from './neu-element.js';
|
|
2
3
|
/** Forms the user is trying to submit during the current task (click on a submitter, or Enter). */
|
|
3
4
|
const submitAttempts = new WeakSet();
|
|
@@ -49,7 +50,9 @@ function watchSubmitAttempts() {
|
|
|
49
50
|
document.addEventListener('keydown', (event) => {
|
|
50
51
|
// Only a native input submits on Enter (neu text/number fields use their inner input); Enter
|
|
51
52
|
// in a textarea, select or switch is no attempt and must not reveal untouched fields.
|
|
52
|
-
if (event.key !== 'Enter' ||
|
|
53
|
+
if (event.key !== 'Enter' ||
|
|
54
|
+
composing(event) ||
|
|
55
|
+
!(event.composedPath()[0] instanceof HTMLInputElement))
|
|
53
56
|
return;
|
|
54
57
|
for (const node of event.composedPath()) {
|
|
55
58
|
// Not document or window: their named properties make `.form` a <form id|name="form">.
|
|
@@ -71,8 +71,8 @@ export declare abstract class NeuElement extends ServerSafeHTMLElement {
|
|
|
71
71
|
* While the document loads, the parser may still be writing this element's declarative shadow
|
|
72
72
|
* root (spec §8.1). Before the root exists, that is only possible while nothing has been parsed
|
|
73
73
|
* inside or after the element; one created by script in the middle of the page renders at once.
|
|
74
|
-
* Once it exists, its contents may still be streaming in: it is unfinished while
|
|
75
|
-
*
|
|
74
|
+
* Once it exists, its contents may still be streaming in: it is unfinished while one of the
|
|
75
|
+
* `refs` data-ref nodes is missing, and adopting it then would run rendered() without them.
|
|
76
76
|
*/
|
|
77
77
|
private parsing;
|
|
78
78
|
/**
|
package/dist/core/neu-element.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { attributeName, coerceProperty, parseAttribute, parseProps, serializeAttribute, } from './props.js';
|
|
1
|
+
import { attributeName, coerceProperty, parseAttribute, parseProps, reflects, serializeAttribute, } from './props.js';
|
|
2
2
|
/**
|
|
3
3
|
* HTMLElement does not exist in Node (SSR, React server rendering). Falling back to an empty
|
|
4
4
|
* class lets every module be imported there; nothing is ever constructed on the server.
|
|
@@ -139,7 +139,7 @@ export class NeuElement extends ServerSafeHTMLElement {
|
|
|
139
139
|
if (!decl || Object.is(this.props[key], value))
|
|
140
140
|
return;
|
|
141
141
|
this.props[key] = value;
|
|
142
|
-
if (!fromAttribute && decl.
|
|
142
|
+
if (!fromAttribute && reflects(key, decl, this.def))
|
|
143
143
|
this.reflect(key, decl, value);
|
|
144
144
|
this.propChanged(key);
|
|
145
145
|
}
|
|
@@ -221,8 +221,11 @@ export class NeuElement extends ServerSafeHTMLElement {
|
|
|
221
221
|
if (this.root)
|
|
222
222
|
return;
|
|
223
223
|
let root = this.internals.shadowRoot;
|
|
224
|
-
//
|
|
225
|
-
|
|
224
|
+
// The data-ref names the template renders. A root that lacks one is unfinished, or was rendered
|
|
225
|
+
// by another version of this component (a page cached before an upgrade).
|
|
226
|
+
const refs = root
|
|
227
|
+
? [...this.def.template(this.props).value.matchAll(/data-ref="([^"]+)"/g)].map((m) => m[1])
|
|
228
|
+
: [];
|
|
226
229
|
if (!loaded && document.readyState === 'loading' && this.parsing(root, refs)) {
|
|
227
230
|
this.waitForParser(root, refs);
|
|
228
231
|
return;
|
|
@@ -242,12 +245,12 @@ export class NeuElement extends ServerSafeHTMLElement {
|
|
|
242
245
|
* While the document loads, the parser may still be writing this element's declarative shadow
|
|
243
246
|
* root (spec §8.1). Before the root exists, that is only possible while nothing has been parsed
|
|
244
247
|
* inside or after the element; one created by script in the middle of the page renders at once.
|
|
245
|
-
* Once it exists, its contents may still be streaming in: it is unfinished while
|
|
246
|
-
*
|
|
248
|
+
* Once it exists, its contents may still be streaming in: it is unfinished while one of the
|
|
249
|
+
* `refs` data-ref nodes is missing, and adopting it then would run rendered() without them.
|
|
247
250
|
*/
|
|
248
251
|
parsing(root, refs) {
|
|
249
252
|
if (root)
|
|
250
|
-
return root.
|
|
253
|
+
return refs.some((name) => !root.querySelector(`[data-ref="${name}"]`));
|
|
251
254
|
if (this.firstChild !== null || this.nextSibling !== null)
|
|
252
255
|
return false;
|
|
253
256
|
for (let node = this.parentNode; node !== null; node = node.parentNode) {
|
package/dist/core/props.d.ts
CHANGED
|
@@ -34,11 +34,23 @@ export type InferProps<S extends PropsSchema> = {
|
|
|
34
34
|
};
|
|
35
35
|
/** `helpText` → `help-text`, unless the declaration names the attribute explicitly. */
|
|
36
36
|
export declare function attributeName(prop: string, decl: PropDecl): string;
|
|
37
|
+
/**
|
|
38
|
+
* Every prop reflects to its attribute, except the live value of a form control (the def's
|
|
39
|
+
* form.valueProp, whose attribute is only the default) and props that declare `reflect: false`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function reflects(key: string, decl: PropDecl, def: {
|
|
42
|
+
readonly form?: {
|
|
43
|
+
readonly valueProp: string;
|
|
44
|
+
};
|
|
45
|
+
}): boolean;
|
|
37
46
|
/** Attribute text (null when absent) → prop value. Invalid input silently becomes the default. */
|
|
38
47
|
export declare function parseAttribute(decl: PropDecl, raw: string | null): PropValue;
|
|
39
48
|
/** Value assigned through a JS property → prop value, with the same fallback rules. */
|
|
40
49
|
export declare function coerceProperty(decl: PropDecl, value: unknown): PropValue;
|
|
41
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Prop value → attribute text for reflection and SSR; null means "remove the attribute". The empty
|
|
52
|
+
* string is removed only when that parses back to it, i.e. when the default is empty too.
|
|
53
|
+
*/
|
|
42
54
|
export declare function serializeAttribute(decl: PropDecl, value: PropValue): string | null;
|
|
43
55
|
export declare function parseProps<S extends PropsSchema>(schema: S, read: (attribute: string) => string | null): InferProps<S>;
|
|
44
56
|
export {};
|
package/dist/core/props.js
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
export function attributeName(prop, decl) {
|
|
3
3
|
return decl.attribute ?? prop.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Every prop reflects to its attribute, except the live value of a form control (the def's
|
|
7
|
+
* form.valueProp, whose attribute is only the default) and props that declare `reflect: false`.
|
|
8
|
+
*/
|
|
9
|
+
export function reflects(key, decl, def) {
|
|
10
|
+
return decl.reflect ?? key !== def.form?.valueProp;
|
|
11
|
+
}
|
|
5
12
|
/** Attribute text (null when absent) → prop value. Invalid input silently becomes the default. */
|
|
6
13
|
export function parseAttribute(decl, raw) {
|
|
7
14
|
switch (decl.type) {
|
|
@@ -32,15 +39,18 @@ export function coerceProperty(decl, value) {
|
|
|
32
39
|
}
|
|
33
40
|
return parseAttribute(decl, value === null || value === undefined ? null : String(value));
|
|
34
41
|
}
|
|
35
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Prop value → attribute text for reflection and SSR; null means "remove the attribute". The empty
|
|
44
|
+
* string is removed only when that parses back to it, i.e. when the default is empty too.
|
|
45
|
+
*/
|
|
36
46
|
export function serializeAttribute(decl, value) {
|
|
37
47
|
switch (decl.type) {
|
|
38
48
|
case 'boolean':
|
|
39
49
|
return value ? '' : null;
|
|
40
50
|
case 'number':
|
|
41
|
-
return String(value);
|
|
51
|
+
return Number.isFinite(value) ? String(value) : null;
|
|
42
52
|
case 'string':
|
|
43
|
-
return value === '' ? null : String(value);
|
|
53
|
+
return value === '' && !decl.default ? null : String(value);
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
56
|
export function parseProps(schema, read) {
|
package/dist/core/styles.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { DocEntry } from './define.js';
|
|
2
1
|
/**
|
|
3
2
|
* Re-declares the derived theme values on every host (spec §5.3). Fallbacks are the light
|
|
4
3
|
* defaults from @neumorphism-ui/tokens so components still look right without the tokens stylesheet;
|
|
5
4
|
* styles.test.ts keeps the two in sync.
|
|
6
5
|
*/
|
|
7
6
|
export declare const hostTheme = "\n:host {\n --_neu-bg: var(--neu-bg, #e0e5ec);\n --_neu-accent-c: var(--neu-accent, #6d5dfc);\n --_neu-d: var(--neu-distance, 6px);\n --_neu-k: var(--neu-intensity, 1);\n --_neu-r: var(--neu-radius, 12px);\n --_neu-danger: var(--neu-danger, #e5484d);\n --_neu-dur: var(--neu-duration, 150ms);\n --_neu-sd: var(--neu-shadow-dark, color-mix(in oklab, var(--_neu-bg), black min(100%, calc(var(--_neu-shade, 18%) * var(--_neu-k)))));\n --_neu-sl: var(--neu-shadow-light, color-mix(in oklab, var(--_neu-bg), white min(100%, calc(var(--_neu-light, 100%) * var(--_neu-k)))));\n --_neu-fg: var(--neu-fg, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-mix, 32%)));\n --_neu-fg-muted: var(--neu-fg-muted, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-muted-mix, 18%)));\n --_neu-accent-soft: color-mix(in oklab, var(--_neu-accent-c) 25%, var(--_neu-bg));\n --_neu-focus: 0 0 0 3px color-mix(in oklab, var(--_neu-accent-c) 45%, transparent);\n --_neu-raised: var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-raised-sm: calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n --_neu-inset: inset var(--_neu-d) var(--_neu-d) calc(var(--_neu-d) * 2) var(--_neu-sd), inset calc(var(--_neu-d) * -1) calc(var(--_neu-d) * -1) calc(var(--_neu-d) * 2) var(--_neu-sl);\n --_neu-inset-sm: inset calc(var(--_neu-d) * 0.5) calc(var(--_neu-d) * 0.5) var(--_neu-d) var(--_neu-sd), inset calc(var(--_neu-d) * -0.5) calc(var(--_neu-d) * -0.5) var(--_neu-d) var(--_neu-sl);\n font-family: var(--neu-font);\n color: var(--_neu-fg);\n -webkit-tap-highlight-color: transparent;\n}\n:host(:not(:defined)) { visibility: inherit !important; min-block-size: auto !important; }\n:host([hidden]) { display: none !important; }\n:host(:focus) { outline: none; }\n*, *::before, *::after { box-sizing: border-box; }\n";
|
|
8
|
-
export declare const themeCssProperties: readonly DocEntry[];
|
package/dist/core/styles.js
CHANGED
|
@@ -31,10 +31,3 @@ export const hostTheme = `
|
|
|
31
31
|
:host(:focus) { outline: none; }
|
|
32
32
|
*, *::before, *::after { box-sizing: border-box; }
|
|
33
33
|
`;
|
|
34
|
-
export const themeCssProperties = [
|
|
35
|
-
{ name: '--neu-bg', description: 'Surface colour; shadows and text are derived from it.' },
|
|
36
|
-
{ name: '--neu-accent', description: 'Accent colour.' },
|
|
37
|
-
{ name: '--neu-distance', description: 'Shadow distance for the md size.' },
|
|
38
|
-
{ name: '--neu-intensity', description: 'Shadow strength multiplier.' },
|
|
39
|
-
{ name: '--neu-radius', description: 'Corner radius for the md size.' },
|
|
40
|
-
];
|
package/dist/docs.d.ts
ADDED
package/dist/docs.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { avatarDocs } from './components/avatar/avatar.docs.js';
|
|
2
|
+
import { badgeDocs } from './components/badge/badge.docs.js';
|
|
3
|
+
import { buttonDocs } from './components/button/button.docs.js';
|
|
4
|
+
import { buttonGroupDocs } from './components/button-group/button-group.docs.js';
|
|
5
|
+
import { checkboxDocs } from './components/checkbox/checkbox.docs.js';
|
|
6
|
+
import { dividerDocs } from './components/divider/divider.docs.js';
|
|
7
|
+
import { iconDocs } from './components/icon/icon.docs.js';
|
|
8
|
+
import { iconButtonDocs } from './components/icon-button/icon-button.docs.js';
|
|
9
|
+
import { numberFieldDocs } from './components/number-field/number-field.docs.js';
|
|
10
|
+
import { optionDocs } from './components/option/option.docs.js';
|
|
11
|
+
import { radioDocs } from './components/radio/radio.docs.js';
|
|
12
|
+
import { radioGroupDocs } from './components/radio-group/radio-group.docs.js';
|
|
13
|
+
import { selectDocs } from './components/select/select.docs.js';
|
|
14
|
+
import { sliderDocs } from './components/slider/slider.docs.js';
|
|
15
|
+
import { spinnerDocs } from './components/spinner/spinner.docs.js';
|
|
16
|
+
import { surfaceDocs } from './components/surface/surface.docs.js';
|
|
17
|
+
import { switchDocs } from './components/switch/switch.docs.js';
|
|
18
|
+
import { textFieldDocs } from './components/text-field/text-field.docs.js';
|
|
19
|
+
import { textareaDocs } from './components/textarea/textarea.docs.js';
|
|
20
|
+
/** The documentation of every component by tag, for tools. DOM-free; never part of the runtime bundles. */
|
|
21
|
+
export const componentDocs = new Map([
|
|
22
|
+
['neu-avatar', avatarDocs],
|
|
23
|
+
['neu-badge', badgeDocs],
|
|
24
|
+
['neu-button', buttonDocs],
|
|
25
|
+
['neu-button-group', buttonGroupDocs],
|
|
26
|
+
['neu-checkbox', checkboxDocs],
|
|
27
|
+
['neu-divider', dividerDocs],
|
|
28
|
+
['neu-icon', iconDocs],
|
|
29
|
+
['neu-icon-button', iconButtonDocs],
|
|
30
|
+
['neu-number-field', numberFieldDocs],
|
|
31
|
+
['neu-option', optionDocs],
|
|
32
|
+
['neu-radio', radioDocs],
|
|
33
|
+
['neu-radio-group', radioGroupDocs],
|
|
34
|
+
['neu-select', selectDocs],
|
|
35
|
+
['neu-slider', sliderDocs],
|
|
36
|
+
['neu-spinner', spinnerDocs],
|
|
37
|
+
['neu-surface', surfaceDocs],
|
|
38
|
+
['neu-switch', switchDocs],
|
|
39
|
+
['neu-text-field', textFieldDocs],
|
|
40
|
+
['neu-textarea', textareaDocs],
|
|
41
|
+
]);
|
package/dist/ssr.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { ComponentDef, ComponentDocs, DocEntry, FormDef, OptionData, Templa
|
|
|
3
3
|
export { formDefaultProp } from './core/define.js';
|
|
4
4
|
export { optionLabel } from './components/option/option-data.js';
|
|
5
5
|
export type { InferProps, PropDecl, PropsSchema, PropValue } from './core/props.js';
|
|
6
|
-
export { attributeName, coerceProperty, parseAttribute, parseProps, serializeAttribute, } from './core/props.js';
|
|
6
|
+
export { attributeName, coerceProperty, parseAttribute, parseProps, reflects, serializeAttribute, } from './core/props.js';
|
|
7
7
|
/** Every component definition by tag. DOM-free: safe to import in Node. */
|
|
8
8
|
export declare const definitions: ReadonlyMap<string, ComponentDef>;
|
|
9
9
|
/** Inner HTML of a declarative shadow root: inline styles, then the template. */
|
package/dist/ssr.js
CHANGED
|
@@ -20,7 +20,7 @@ import { textareaDef } from './components/textarea/textarea.def.js';
|
|
|
20
20
|
import { parseProps } from './core/props.js';
|
|
21
21
|
export { formDefaultProp } from './core/define.js';
|
|
22
22
|
export { optionLabel } from './components/option/option-data.js';
|
|
23
|
-
export { attributeName, coerceProperty, parseAttribute, parseProps, serializeAttribute, } from './core/props.js';
|
|
23
|
+
export { attributeName, coerceProperty, parseAttribute, parseProps, reflects, serializeAttribute, } from './core/props.js';
|
|
24
24
|
/** Every component definition by tag. DOM-free: safe to import in Node. */
|
|
25
25
|
export const definitions = /* @__PURE__ */ new Map([
|
|
26
26
|
[avatarDef.tag, avatarDef],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neumorphism-ui/elements",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.3",
|
|
4
4
|
"description": "Neumorphism UI web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"types": "./dist/all.d.ts",
|
|
101
101
|
"default": "./dist/all.js"
|
|
102
102
|
},
|
|
103
|
+
"./docs.js": {
|
|
104
|
+
"types": "./dist/docs.d.ts",
|
|
105
|
+
"default": "./dist/docs.js"
|
|
106
|
+
},
|
|
103
107
|
"./ssr.js": {
|
|
104
108
|
"types": "./dist/ssr.d.ts",
|
|
105
109
|
"default": "./dist/ssr.js"
|