@neumorphism-ui/elements 0.0.0-stage → 1.0.0-next.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 +21 -0
- package/README.md +63 -2
- package/cdn/neu.min.js +205 -0
- package/custom-elements.json +1892 -0
- package/dist/all.d.ts +12 -0
- package/dist/all.js +12 -0
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.js +4 -0
- package/dist/badge.d.ts +3 -0
- package/dist/badge.js +4 -0
- package/dist/button-group.d.ts +3 -0
- package/dist/button-group.js +4 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +4 -0
- package/dist/components/avatar/avatar.d.ts +38 -0
- package/dist/components/avatar/avatar.def.d.ts +24 -0
- package/dist/components/avatar/avatar.def.js +33 -0
- package/dist/components/avatar/avatar.js +58 -0
- package/dist/components/avatar/avatar.styles.d.ts +1 -0
- package/dist/components/avatar/avatar.styles.js +13 -0
- package/dist/components/badge/badge.d.ts +17 -0
- package/dist/components/badge/badge.def.d.ts +12 -0
- package/dist/components/badge/badge.def.js +29 -0
- package/dist/components/badge/badge.js +5 -0
- package/dist/components/badge/badge.styles.d.ts +1 -0
- package/dist/components/badge/badge.styles.js +10 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.def.d.ts +28 -0
- package/dist/components/button/button.def.js +45 -0
- package/dist/components/button/button.js +87 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/button/button.styles.js +43 -0
- package/dist/components/button-group/button-group.d.ts +19 -0
- package/dist/components/button-group/button-group.def.d.ts +12 -0
- package/dist/components/button-group/button-group.def.js +25 -0
- package/dist/components/button-group/button-group.js +13 -0
- package/dist/components/button-group/button-group.styles.d.ts +7 -0
- package/dist/components/button-group/button-group.styles.js +19 -0
- package/dist/components/divider/divider.d.ts +14 -0
- package/dist/components/divider/divider.def.d.ts +8 -0
- package/dist/components/divider/divider.def.js +24 -0
- package/dist/components/divider/divider.js +13 -0
- package/dist/components/divider/divider.styles.d.ts +1 -0
- package/dist/components/divider/divider.styles.js +7 -0
- package/dist/components/icon/icon-drawer.d.ts +12 -0
- package/dist/components/icon/icon-drawer.js +38 -0
- package/dist/components/icon/icon-loader.d.ts +5 -0
- package/dist/components/icon/icon-loader.js +102 -0
- package/dist/components/icon/icon-registry.d.ts +11 -0
- package/dist/components/icon/icon-registry.js +26 -0
- package/dist/components/icon/icon.d.ts +25 -0
- package/dist/components/icon/icon.def.d.ts +15 -0
- package/dist/components/icon/icon.def.js +24 -0
- package/dist/components/icon/icon.js +23 -0
- package/dist/components/icon/icon.styles.d.ts +1 -0
- package/dist/components/icon/icon.styles.js +7 -0
- package/dist/components/icon/system-icons.d.ts +2 -0
- package/dist/components/icon/system-icons.js +17 -0
- package/dist/components/icon-button/icon-button.d.ts +51 -0
- package/dist/components/icon-button/icon-button.def.d.ts +40 -0
- package/dist/components/icon-button/icon-button.def.js +44 -0
- package/dist/components/icon-button/icon-button.js +21 -0
- package/dist/components/icon-button/icon-button.styles.d.ts +1 -0
- package/dist/components/icon-button/icon-button.styles.js +12 -0
- package/dist/components/spinner/spinner.d.ts +19 -0
- package/dist/components/spinner/spinner.def.d.ts +12 -0
- package/dist/components/spinner/spinner.def.js +25 -0
- package/dist/components/spinner/spinner.js +17 -0
- package/dist/components/spinner/spinner.styles.d.ts +1 -0
- package/dist/components/spinner/spinner.styles.js +13 -0
- package/dist/components/surface/surface.d.ts +33 -0
- package/dist/components/surface/surface.def.d.ts +26 -0
- package/dist/components/surface/surface.def.js +27 -0
- package/dist/components/surface/surface.js +5 -0
- package/dist/components/surface/surface.styles.d.ts +1 -0
- package/dist/components/surface/surface.styles.js +17 -0
- package/dist/components/switch/switch.d.ts +60 -0
- package/dist/components/switch/switch.def.d.ts +28 -0
- package/dist/components/switch/switch.def.js +33 -0
- package/dist/components/switch/switch.js +125 -0
- package/dist/components/switch/switch.styles.d.ts +1 -0
- package/dist/components/switch/switch.styles.js +29 -0
- package/dist/components/text-field/implicit-submit.d.ts +8 -0
- package/dist/components/text-field/implicit-submit.js +42 -0
- package/dist/components/text-field/text-field.d.ts +116 -0
- package/dist/components/text-field/text-field.def.d.ts +143 -0
- package/dist/components/text-field/text-field.def.js +63 -0
- package/dist/components/text-field/text-field.js +207 -0
- package/dist/components/text-field/text-field.styles.d.ts +1 -0
- package/dist/components/text-field/text-field.styles.js +39 -0
- package/dist/core/define.d.ts +33 -0
- package/dist/core/define.js +15 -0
- package/dist/core/dom.d.ts +21 -0
- package/dist/core/dom.js +51 -0
- package/dist/core/form-control.d.ts +35 -0
- package/dist/core/form-control.js +128 -0
- package/dist/core/html.d.ts +13 -0
- package/dist/core/html.js +35 -0
- package/dist/core/neu-element.d.ts +87 -0
- package/dist/core/neu-element.js +285 -0
- package/dist/core/props.d.ts +44 -0
- package/dist/core/props.js +52 -0
- package/dist/core/styles.d.ts +8 -0
- package/dist/core/styles.js +40 -0
- package/dist/core/validation.d.ts +4 -0
- package/dist/core/validation.js +26 -0
- package/dist/divider.d.ts +3 -0
- package/dist/divider.js +4 -0
- package/dist/icon-button.d.ts +3 -0
- package/dist/icon-button.js +4 -0
- package/dist/icon.d.ts +3 -0
- package/dist/icon.js +4 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +1 -0
- package/dist/spinner.d.ts +3 -0
- package/dist/spinner.js +4 -0
- package/dist/ssr.d.ts +11 -0
- package/dist/ssr.js +41 -0
- package/dist/surface.d.ts +3 -0
- package/dist/surface.js +4 -0
- package/dist/switch.d.ts +3 -0
- package/dist/switch.js +4 -0
- package/dist/text-field.d.ts +3 -0
- package/dist/text-field.js +4 -0
- package/package.json +104 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** `helpText` → `help-text`, unless the declaration names the attribute explicitly. */
|
|
2
|
+
export function attributeName(prop, decl) {
|
|
3
|
+
return decl.attribute ?? prop.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
|
|
4
|
+
}
|
|
5
|
+
/** Attribute text (null when absent) → prop value. Invalid input silently becomes the default. */
|
|
6
|
+
export function parseAttribute(decl, raw) {
|
|
7
|
+
switch (decl.type) {
|
|
8
|
+
case 'boolean':
|
|
9
|
+
return raw !== null;
|
|
10
|
+
case 'number': {
|
|
11
|
+
if (raw === null || raw.trim() === '')
|
|
12
|
+
return decl.default;
|
|
13
|
+
const parsed = Number(raw);
|
|
14
|
+
return Number.isFinite(parsed) ? parsed : decl.default;
|
|
15
|
+
}
|
|
16
|
+
case 'string': {
|
|
17
|
+
const fallback = decl.default ?? '';
|
|
18
|
+
if (raw === null)
|
|
19
|
+
return fallback;
|
|
20
|
+
if (decl.values && !decl.values.includes(raw))
|
|
21
|
+
return fallback;
|
|
22
|
+
return raw;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Value assigned through a JS property → prop value, with the same fallback rules. */
|
|
27
|
+
export function coerceProperty(decl, value) {
|
|
28
|
+
if (decl.type === 'boolean')
|
|
29
|
+
return Boolean(value);
|
|
30
|
+
if (decl.type === 'number' && typeof value === 'number') {
|
|
31
|
+
return Number.isFinite(value) ? value : decl.default;
|
|
32
|
+
}
|
|
33
|
+
return parseAttribute(decl, value === null || value === undefined ? null : String(value));
|
|
34
|
+
}
|
|
35
|
+
/** Prop value → attribute text for reflection and SSR; null means "remove the attribute". */
|
|
36
|
+
export function serializeAttribute(decl, value) {
|
|
37
|
+
switch (decl.type) {
|
|
38
|
+
case 'boolean':
|
|
39
|
+
return value ? '' : null;
|
|
40
|
+
case 'number':
|
|
41
|
+
return String(value);
|
|
42
|
+
case 'string':
|
|
43
|
+
return value === '' ? null : String(value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function parseProps(schema, read) {
|
|
47
|
+
const props = {};
|
|
48
|
+
for (const [key, decl] of Object.entries(schema)) {
|
|
49
|
+
props[key] = parseAttribute(decl, read(attributeName(key, decl)));
|
|
50
|
+
}
|
|
51
|
+
return props;
|
|
52
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DocEntry } from './define.js';
|
|
2
|
+
/**
|
|
3
|
+
* Re-declares the derived theme values on every host (spec §5.3). Fallbacks are the light
|
|
4
|
+
* defaults from @neumorphism-ui/tokens so components still look right without the tokens stylesheet;
|
|
5
|
+
* styles.test.ts keeps the two in sync.
|
|
6
|
+
*/
|
|
7
|
+
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[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-declares the derived theme values on every host (spec §5.3). Fallbacks are the light
|
|
3
|
+
* defaults from @neumorphism-ui/tokens so components still look right without the tokens stylesheet;
|
|
4
|
+
* styles.test.ts keeps the two in sync.
|
|
5
|
+
*/
|
|
6
|
+
export const hostTheme = `
|
|
7
|
+
:host {
|
|
8
|
+
--_neu-bg: var(--neu-bg, #e0e5ec);
|
|
9
|
+
--_neu-accent-c: var(--neu-accent, #6d5dfc);
|
|
10
|
+
--_neu-d: var(--neu-distance, 6px);
|
|
11
|
+
--_neu-k: var(--neu-intensity, 1);
|
|
12
|
+
--_neu-r: var(--neu-radius, 12px);
|
|
13
|
+
--_neu-danger: var(--neu-danger, #e5484d);
|
|
14
|
+
--_neu-dur: var(--neu-duration, 150ms);
|
|
15
|
+
--_neu-sd: var(--neu-shadow-dark, color-mix(in oklab, var(--_neu-bg), black min(100%, calc(var(--_neu-shade, 18%) * var(--_neu-k)))));
|
|
16
|
+
--_neu-sl: var(--neu-shadow-light, color-mix(in oklab, var(--_neu-bg), white min(100%, calc(var(--_neu-light, 100%) * var(--_neu-k)))));
|
|
17
|
+
--_neu-fg: var(--neu-fg, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-mix, 32%)));
|
|
18
|
+
--_neu-fg-muted: var(--neu-fg-muted, color-mix(in oklab, var(--_neu-bg), var(--_neu-ink, black) var(--_neu-fg-muted-mix, 18%)));
|
|
19
|
+
--_neu-accent-soft: color-mix(in oklab, var(--_neu-accent-c) 25%, var(--_neu-bg));
|
|
20
|
+
--_neu-focus: 0 0 0 3px color-mix(in oklab, var(--_neu-accent-c) 45%, transparent);
|
|
21
|
+
--_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);
|
|
22
|
+
--_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);
|
|
23
|
+
--_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);
|
|
24
|
+
--_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);
|
|
25
|
+
font-family: var(--neu-font);
|
|
26
|
+
color: var(--_neu-fg);
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
:host(:not(:defined)) { visibility: inherit !important; min-block-size: auto !important; }
|
|
30
|
+
:host([hidden]) { display: none !important; }
|
|
31
|
+
:host(:focus) { outline: none; }
|
|
32
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
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
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The browser's own, localised "please check this box" message, borrowed from a native checkbox. */
|
|
2
|
+
export declare function requiredCheckboxMessage(): string;
|
|
3
|
+
/** Copies a native input's validity so the host can report the same errors. */
|
|
4
|
+
export declare function copyValidity(validity: ValidityState): ValidityStateFlags;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
let checkboxMessage;
|
|
2
|
+
/** The browser's own, localised "please check this box" message, borrowed from a native checkbox. */
|
|
3
|
+
export function requiredCheckboxMessage() {
|
|
4
|
+
if (checkboxMessage === undefined) {
|
|
5
|
+
const probe = document.createElement('input');
|
|
6
|
+
probe.type = 'checkbox';
|
|
7
|
+
probe.required = true;
|
|
8
|
+
checkboxMessage = probe.validationMessage || 'Please check this box if you want to proceed.';
|
|
9
|
+
}
|
|
10
|
+
return checkboxMessage;
|
|
11
|
+
}
|
|
12
|
+
/** Copies a native input's validity so the host can report the same errors. */
|
|
13
|
+
export function copyValidity(validity) {
|
|
14
|
+
return {
|
|
15
|
+
badInput: validity.badInput,
|
|
16
|
+
customError: validity.customError,
|
|
17
|
+
patternMismatch: validity.patternMismatch,
|
|
18
|
+
rangeOverflow: validity.rangeOverflow,
|
|
19
|
+
rangeUnderflow: validity.rangeUnderflow,
|
|
20
|
+
stepMismatch: validity.stepMismatch,
|
|
21
|
+
tooLong: validity.tooLong,
|
|
22
|
+
tooShort: validity.tooShort,
|
|
23
|
+
typeMismatch: validity.typeMismatch,
|
|
24
|
+
valueMissing: validity.valueMissing,
|
|
25
|
+
};
|
|
26
|
+
}
|
package/dist/divider.js
ADDED
package/dist/icon.d.ts
ADDED
package/dist/icon.js
ADDED
package/dist/icons.d.ts
ADDED
package/dist/icons.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registerIconLibrary } from './components/icon/icon-registry.js';
|
package/dist/spinner.js
ADDED
package/dist/ssr.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentDef } from './core/define.js';
|
|
2
|
+
export type { ComponentDef, ComponentDocs, DocEntry, FormDef } from './core/define.js';
|
|
3
|
+
export { formDefaultProp } from './core/define.js';
|
|
4
|
+
export type { InferProps, PropDecl, PropsSchema, PropValue } from './core/props.js';
|
|
5
|
+
export { attributeName, coerceProperty, parseAttribute, parseProps, serializeAttribute, } from './core/props.js';
|
|
6
|
+
/** Every component definition by tag. DOM-free: safe to import in Node. */
|
|
7
|
+
export declare const definitions: ReadonlyMap<string, ComponentDef>;
|
|
8
|
+
/** Inner HTML of a declarative shadow root: inline styles, then the template. */
|
|
9
|
+
export declare function renderShadowContents(def: ComponentDef, attrs: Readonly<Record<string, string>>): string;
|
|
10
|
+
/** The `<template shadowrootmode>` for one element, or '' for tags this library does not own. */
|
|
11
|
+
export declare function renderDSD(tag: string, attrs: Readonly<Record<string, string>>): string;
|
package/dist/ssr.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { avatarDef } from './components/avatar/avatar.def.js';
|
|
2
|
+
import { badgeDef } from './components/badge/badge.def.js';
|
|
3
|
+
import { buttonDef } from './components/button/button.def.js';
|
|
4
|
+
import { buttonGroupDef } from './components/button-group/button-group.def.js';
|
|
5
|
+
import { dividerDef } from './components/divider/divider.def.js';
|
|
6
|
+
import { iconDef } from './components/icon/icon.def.js';
|
|
7
|
+
import { iconButtonDef } from './components/icon-button/icon-button.def.js';
|
|
8
|
+
import { spinnerDef } from './components/spinner/spinner.def.js';
|
|
9
|
+
import { surfaceDef } from './components/surface/surface.def.js';
|
|
10
|
+
import { switchDef } from './components/switch/switch.def.js';
|
|
11
|
+
import { textFieldDef } from './components/text-field/text-field.def.js';
|
|
12
|
+
import { parseProps } from './core/props.js';
|
|
13
|
+
export { formDefaultProp } from './core/define.js';
|
|
14
|
+
export { attributeName, coerceProperty, parseAttribute, parseProps, serializeAttribute, } from './core/props.js';
|
|
15
|
+
/** Every component definition by tag. DOM-free: safe to import in Node. */
|
|
16
|
+
export const definitions = /* @__PURE__ */ new Map([
|
|
17
|
+
[avatarDef.tag, avatarDef],
|
|
18
|
+
[badgeDef.tag, badgeDef],
|
|
19
|
+
[buttonDef.tag, buttonDef],
|
|
20
|
+
[buttonGroupDef.tag, buttonGroupDef],
|
|
21
|
+
[dividerDef.tag, dividerDef],
|
|
22
|
+
[iconDef.tag, iconDef],
|
|
23
|
+
[iconButtonDef.tag, iconButtonDef],
|
|
24
|
+
[spinnerDef.tag, spinnerDef],
|
|
25
|
+
[surfaceDef.tag, surfaceDef],
|
|
26
|
+
[switchDef.tag, switchDef],
|
|
27
|
+
[textFieldDef.tag, textFieldDef],
|
|
28
|
+
]);
|
|
29
|
+
/** Inner HTML of a declarative shadow root: inline styles, then the template. */
|
|
30
|
+
export function renderShadowContents(def, attrs) {
|
|
31
|
+
const props = parseProps(def.props, (name) => (Object.hasOwn(attrs, name) ? attrs[name] : null));
|
|
32
|
+
return `<style data-neu-ssr>${def.styles}</style>${def.template(props).value}`;
|
|
33
|
+
}
|
|
34
|
+
/** The `<template shadowrootmode>` for one element, or '' for tags this library does not own. */
|
|
35
|
+
export function renderDSD(tag, attrs) {
|
|
36
|
+
const def = definitions.get(tag.toLowerCase());
|
|
37
|
+
if (!def)
|
|
38
|
+
return '';
|
|
39
|
+
const delegates = def.delegatesFocus ? ' shadowrootdelegatesfocus' : '';
|
|
40
|
+
return `<template shadowrootmode="open"${delegates}>${renderShadowContents(def, attrs)}</template>`;
|
|
41
|
+
}
|
package/dist/surface.js
ADDED
package/dist/switch.d.ts
ADDED
package/dist/switch.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neumorphism-ui/elements",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-next.1",
|
|
4
|
+
"description": "Neumorphism UI web components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/hunghdvn/neumorphism-ui.git",
|
|
10
|
+
"directory": "packages/elements"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"cdn",
|
|
15
|
+
"custom-elements.json"
|
|
16
|
+
],
|
|
17
|
+
"customElements": "custom-elements.json",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./avatar.js": {
|
|
20
|
+
"types": "./dist/avatar.d.ts",
|
|
21
|
+
"default": "./dist/avatar.js"
|
|
22
|
+
},
|
|
23
|
+
"./badge.js": {
|
|
24
|
+
"types": "./dist/badge.d.ts",
|
|
25
|
+
"default": "./dist/badge.js"
|
|
26
|
+
},
|
|
27
|
+
"./button.js": {
|
|
28
|
+
"types": "./dist/button.d.ts",
|
|
29
|
+
"default": "./dist/button.js"
|
|
30
|
+
},
|
|
31
|
+
"./button-group.js": {
|
|
32
|
+
"types": "./dist/button-group.d.ts",
|
|
33
|
+
"default": "./dist/button-group.js"
|
|
34
|
+
},
|
|
35
|
+
"./icon-button.js": {
|
|
36
|
+
"types": "./dist/icon-button.d.ts",
|
|
37
|
+
"default": "./dist/icon-button.js"
|
|
38
|
+
},
|
|
39
|
+
"./divider.js": {
|
|
40
|
+
"types": "./dist/divider.d.ts",
|
|
41
|
+
"default": "./dist/divider.js"
|
|
42
|
+
},
|
|
43
|
+
"./icon.js": {
|
|
44
|
+
"types": "./dist/icon.d.ts",
|
|
45
|
+
"default": "./dist/icon.js"
|
|
46
|
+
},
|
|
47
|
+
"./icons.js": {
|
|
48
|
+
"types": "./dist/icons.d.ts",
|
|
49
|
+
"default": "./dist/icons.js"
|
|
50
|
+
},
|
|
51
|
+
"./spinner.js": {
|
|
52
|
+
"types": "./dist/spinner.d.ts",
|
|
53
|
+
"default": "./dist/spinner.js"
|
|
54
|
+
},
|
|
55
|
+
"./surface.js": {
|
|
56
|
+
"types": "./dist/surface.d.ts",
|
|
57
|
+
"default": "./dist/surface.js"
|
|
58
|
+
},
|
|
59
|
+
"./switch.js": {
|
|
60
|
+
"types": "./dist/switch.d.ts",
|
|
61
|
+
"default": "./dist/switch.js"
|
|
62
|
+
},
|
|
63
|
+
"./text-field.js": {
|
|
64
|
+
"types": "./dist/text-field.d.ts",
|
|
65
|
+
"default": "./dist/text-field.js"
|
|
66
|
+
},
|
|
67
|
+
"./all.js": {
|
|
68
|
+
"types": "./dist/all.d.ts",
|
|
69
|
+
"default": "./dist/all.js"
|
|
70
|
+
},
|
|
71
|
+
"./ssr.js": {
|
|
72
|
+
"types": "./dist/ssr.d.ts",
|
|
73
|
+
"default": "./dist/ssr.js"
|
|
74
|
+
},
|
|
75
|
+
"./cdn/neu.min.js": "./cdn/neu.min.js",
|
|
76
|
+
"./custom-elements.json": "./custom-elements.json",
|
|
77
|
+
"./package.json": "./package.json"
|
|
78
|
+
},
|
|
79
|
+
"sideEffects": [
|
|
80
|
+
"./dist/avatar.js",
|
|
81
|
+
"./dist/badge.js",
|
|
82
|
+
"./dist/button.js",
|
|
83
|
+
"./dist/button-group.js",
|
|
84
|
+
"./dist/divider.js",
|
|
85
|
+
"./dist/icon.js",
|
|
86
|
+
"./dist/icon-button.js",
|
|
87
|
+
"./dist/spinner.js",
|
|
88
|
+
"./dist/surface.js",
|
|
89
|
+
"./dist/switch.js",
|
|
90
|
+
"./dist/text-field.js",
|
|
91
|
+
"./dist/all.js",
|
|
92
|
+
"./cdn/neu.min.js"
|
|
93
|
+
],
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public",
|
|
96
|
+
"provenance": true
|
|
97
|
+
},
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"axe-core": "4.13.0",
|
|
100
|
+
"esbuild": "0.28.2"
|
|
101
|
+
},
|
|
102
|
+
"scripts": {
|
|
103
|
+
"build": "tsc -p tsconfig.build.json && node scripts/build-cdn.mjs",
|
|
104
|
+
"test": "vitest run",
|
|
105
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
106
|
+
}
|
|
6
107
|
}
|