@kubex/zinc 1.1.69 → 1.1.71
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/dist/custom-elements.json +307 -12
- package/dist/vscode.html-custom-data.json +13 -4
- package/dist/web-types.json +49 -11
- package/dist/zn.d.ts +75 -7
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +298 -245
- package/docs/pages/components/icon-picker.md +14 -0
- package/docs/pages/components/input.md +19 -1
- package/docs/pages/components/theme-editor.md +60 -18
- package/package.json +1 -1
- package/scss/_global-spacing.scss +7 -0
- package/src/components/button/button.scss +1 -1
- package/src/components/collapsible/collapsible.scss +0 -10
- package/src/components/file/file.component.ts +15 -0
- package/src/components/icon-picker/icon-picker.component.ts +150 -16
- package/src/components/icon-picker/icon-picker.scss +32 -0
- package/src/components/input/input.component.ts +44 -21
- package/src/components/input/input.scss +134 -42
- package/src/components/input/input.test.ts +45 -0
- package/src/components/theme-editor/theme-editor.component.ts +194 -35
- package/src/components/theme-editor/theme-editor.scss +47 -1
- package/src/components/theme-editor/theme-editor.test.ts +168 -0
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@kubex/zinc",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.71",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -3663,7 +3663,7 @@
|
|
|
3663
3663
|
},
|
|
3664
3664
|
{
|
|
3665
3665
|
"name": "zn-file",
|
|
3666
|
-
"description": "File controls allow selecting an arbitrary number of files for uploading.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the user confirms clearing the selected file or `src`.\n- **zn-error** - Emitted when multiple files are selected via drag and drop, without the `multiple` property being set.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n\n### **Methods:**\n - **checkValidity()** - Checks for validity but does not show a validation message.\nReturns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n- **focus(options: _FocusOptions_)** - Sets focus on the button or droparea.\n- **blur()** - Removes focus from the button or droparea.\n\n### **Slots:**\n - **label** - The file control's label. Alternatively, you can use the `label` attribute.\n- **help-text** - Text that describes how to use the file control. Alternatively, you can use the `help-text` attribute.\n- **trigger** - Optional content to be used as trigger instead of the default content. Opening the file dialog on click and as well as drag and drop will work for this content. Following attributes will no longer work: *label*, *droparea*, *help-text*, *size*, *hide-value*. Also if using the disabled attribute, the disabled styling will not be applied and must be taken care of yourself.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **button-wrapper** - The wrapper around the button and text value.\n- **button** - The zn-button acting as a file input.\n- **button__base** - The zn-button's exported `base` part.\n- **value** - The chosen files or placeholder text for the file input.\n- **droparea** - The element wrapping the drop zone.\n- **droparea-background** - The background of the drop zone.\n- **upload** - The upload button shown in the droparea when no file is selected.\n- **preview** - The image preview rendered in the droparea for previewable files.\n- **filename** - The filename label rendered in the droparea for non-previewable files.\n- **clear** - The clear button rendered in the droparea when a file is present.\n- **clear-confirm** - The confirmation dialog shown before clearing the file.\n- **link** - The current link anchor rendered when `show-link` is enabled.\n- **trigger** - The container that wraps the trigger.",
|
|
3666
|
+
"description": "File controls allow selecting an arbitrary number of files for uploading.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the user confirms clearing the selected file or `src`.\n- **zn-error** - Emitted when multiple files are selected via drag and drop, without the `multiple` property being set.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n\n### **Methods:**\n - **checkValidity()** - Checks for validity but does not show a validation message.\nReturns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n- **focus(options: _FocusOptions_)** - Sets focus on the button or droparea.\n- **blur()** - Removes focus from the button or droparea.\n- **clear()** - Programmatically clears the selected file and any external `src` without\nconfirmation. Unlike a user-initiated clear, this does not flag the control\nto submit an empty value.\n\n### **Slots:**\n - **label** - The file control's label. Alternatively, you can use the `label` attribute.\n- **help-text** - Text that describes how to use the file control. Alternatively, you can use the `help-text` attribute.\n- **trigger** - Optional content to be used as trigger instead of the default content. Opening the file dialog on click and as well as drag and drop will work for this content. Following attributes will no longer work: *label*, *droparea*, *help-text*, *size*, *hide-value*. Also if using the disabled attribute, the disabled styling will not be applied and must be taken care of yourself.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **button-wrapper** - The wrapper around the button and text value.\n- **button** - The zn-button acting as a file input.\n- **button__base** - The zn-button's exported `base` part.\n- **value** - The chosen files or placeholder text for the file input.\n- **droparea** - The element wrapping the drop zone.\n- **droparea-background** - The background of the drop zone.\n- **upload** - The upload button shown in the droparea when no file is selected.\n- **preview** - The image preview rendered in the droparea for previewable files.\n- **filename** - The filename label rendered in the droparea for non-previewable files.\n- **clear** - The clear button rendered in the droparea when a file is present.\n- **clear-confirm** - The confirmation dialog shown before clearing the file.\n- **link** - The current link anchor rendered when `show-link` is enabled.\n- **trigger** - The container that wraps the trigger.",
|
|
3667
3667
|
"doc-url": "",
|
|
3668
3668
|
"attributes": [
|
|
3669
3669
|
{
|
|
@@ -4445,7 +4445,10 @@
|
|
|
4445
4445
|
{ "name": "label", "value": { "type": "string", "default": "''" } },
|
|
4446
4446
|
{
|
|
4447
4447
|
"name": "library",
|
|
4448
|
-
"value": {
|
|
4448
|
+
"value": {
|
|
4449
|
+
"type": "string",
|
|
4450
|
+
"default": "'material-symbols-outlined'"
|
|
4451
|
+
}
|
|
4449
4452
|
},
|
|
4450
4453
|
{ "name": "color", "value": { "type": "string", "default": "''" } },
|
|
4451
4454
|
{
|
|
@@ -4468,6 +4471,18 @@
|
|
|
4468
4471
|
"name": "required",
|
|
4469
4472
|
"value": { "type": "boolean", "default": "false" }
|
|
4470
4473
|
},
|
|
4474
|
+
{
|
|
4475
|
+
"name": "trigger-submit",
|
|
4476
|
+
"value": { "type": "boolean", "default": "false" }
|
|
4477
|
+
},
|
|
4478
|
+
{
|
|
4479
|
+
"name": "allow-upload",
|
|
4480
|
+
"value": { "type": "boolean", "default": "false" }
|
|
4481
|
+
},
|
|
4482
|
+
{
|
|
4483
|
+
"name": "accept",
|
|
4484
|
+
"value": { "type": "string", "default": "'image/*'" }
|
|
4485
|
+
},
|
|
4471
4486
|
{ "name": "form", "value": { "type": "string" } }
|
|
4472
4487
|
],
|
|
4473
4488
|
"events": [],
|
|
@@ -4483,9 +4498,22 @@
|
|
|
4483
4498
|
{ "name": "helpText", "type": "string" },
|
|
4484
4499
|
{ "name": "disabled", "type": "boolean" },
|
|
4485
4500
|
{ "name": "required", "type": "boolean" },
|
|
4501
|
+
{ "name": "triggerSubmit", "type": "boolean" },
|
|
4502
|
+
{ "name": "allowUpload", "type": "boolean" },
|
|
4503
|
+
{ "name": "accept", "type": "string" },
|
|
4486
4504
|
{ "name": "form", "type": "string" },
|
|
4487
4505
|
{ "name": "defaultValue", "type": "string" },
|
|
4488
4506
|
{ "name": "value", "type": "string" },
|
|
4507
|
+
{
|
|
4508
|
+
"name": "file",
|
|
4509
|
+
"description": "The chosen file when the user uploaded an image instead of picking an icon.",
|
|
4510
|
+
"type": "File | null"
|
|
4511
|
+
},
|
|
4512
|
+
{
|
|
4513
|
+
"name": "isImageValue",
|
|
4514
|
+
"description": "True when the current value renders as an image (an uploaded file or a URL) rather than a library icon.",
|
|
4515
|
+
"type": "boolean"
|
|
4516
|
+
},
|
|
4489
4517
|
{ "name": "validity", "type": "ValidityState" },
|
|
4490
4518
|
{ "name": "validationMessage", "type": "string" }
|
|
4491
4519
|
],
|
|
@@ -4702,7 +4730,7 @@
|
|
|
4702
4730
|
},
|
|
4703
4731
|
{
|
|
4704
4732
|
"name": "zn-input",
|
|
4705
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the clear button is activated.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n- **zn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the input.\n- **blur()** - Removes focus from the input.\n- **select()** - Selects all the text in the input.\n- **setSelectionRange(selectionStart: _number_, selectionEnd: _number_, selectionDirection: _'forward' | 'backward' | 'none'_)** - Sets the start and end positions of the text selection (0-based).\n- **setRangeText(replacement: _string_, start: _number_, end: _number_, selectMode: _'select' | 'start' | 'end' | 'preserve'_)** - Replaces a range of text with a new string.\n- **showPicker()** - Displays the browser picker for an input element (only works if the browser supports it for the input type).\n- **stepUp()** - Increments the value of a numeric input type by the value of the step attribute.\n- **stepDown()** - Decrements the value of a numeric input type by the value of the step attribute.\n- **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - **label** - The input's label. Alternatively, you can use the `label` attribute.\n- **label-tooltip** - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.\n- **context-note** - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute.\n- **prefix** - Used to prepend a presentational icon or similar element to the input.\n- **suffix** - Used to append a presentational icon or similar element to the input.\n- **clear-icon** - An icon to use in lieu of the default clear icon.\n- **show-password-icon** - An icon to use in lieu of the default show password icon.\n- **hide-password-icon** - An icon to use in lieu of the default hide password icon.\n- **help-text** - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **input** - The internal `<input>` control.\n- **prefix** - The container that wraps the prefix.\n- **clear-button** - The clear button.\n- **password-toggle-button** - The password toggle button.\n- **suffix** - The container that wraps the suffix.",
|
|
4733
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the clear button is activated.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n- **zn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the input.\n- **blur()** - Removes focus from the input.\n- **select()** - Selects all the text in the input.\n- **setSelectionRange(selectionStart: _number_, selectionEnd: _number_, selectionDirection: _'forward' | 'backward' | 'none'_)** - Sets the start and end positions of the text selection (0-based).\n- **setRangeText(replacement: _string_, start: _number_, end: _number_, selectMode: _'select' | 'start' | 'end' | 'preserve'_)** - Replaces a range of text with a new string.\n- **showPicker()** - Displays the browser picker for an input element (only works if the browser supports it for the input type).\n- **stepUp()** - Increments the value of a numeric input type by the value of the step attribute.\n- **stepDown()** - Decrements the value of a numeric input type by the value of the step attribute.\n- **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - **label** - The input's label. Alternatively, you can use the `label` attribute.\n- **label-tooltip** - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.\n- **context-note** - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute. Range inputs display their live value here unless this is set.\n- **prefix** - Used to prepend a presentational icon or similar element to the input.\n- **suffix** - Used to append a presentational icon or similar element to the input.\n- **clear-icon** - An icon to use in lieu of the default clear icon.\n- **show-password-icon** - An icon to use in lieu of the default show password icon.\n- **hide-password-icon** - An icon to use in lieu of the default hide password icon.\n- **help-text** - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Properties:**\n - **--zn-range-track-height** - The height of a range input's track. _(default: undefined)_\n- **--zn-range-track-color** - The color of a range input's track. _(default: undefined)_\n- **--zn-range-thumb-size** - The diameter of a range input's thumb. _(default: undefined)_\n- **--zn-range-thumb-color** - The color of a range input's thumb. _(default: undefined)_\n- **--zn-range-thumb-ring-width** - The width of the ring drawn around a range input's thumb. _(default: undefined)_\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **input** - The internal `<input>` control.\n- **prefix** - The container that wraps the prefix.\n- **clear-button** - The clear button.\n- **password-toggle-button** - The password toggle button.\n- **suffix** - The container that wraps the suffix.",
|
|
4706
4734
|
"doc-url": "",
|
|
4707
4735
|
"attributes": [
|
|
4708
4736
|
{
|
|
@@ -4713,7 +4741,7 @@
|
|
|
4713
4741
|
"name": "type",
|
|
4714
4742
|
"description": "The type of input. Works the same as native `<input>` element. But only a subset of types is supported. Defaults\nto `text`",
|
|
4715
4743
|
"value": {
|
|
4716
|
-
"type": "'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' |\n 'search' | 'tel' | 'text' | 'time' | 'url'",
|
|
4744
|
+
"type": "'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' |\n 'range' | 'search' | 'tel' | 'text' | 'time' | 'url'",
|
|
4717
4745
|
"default": "'text'"
|
|
4718
4746
|
}
|
|
4719
4747
|
},
|
|
@@ -4813,6 +4841,11 @@
|
|
|
4813
4841
|
"default": "'hex'"
|
|
4814
4842
|
}
|
|
4815
4843
|
},
|
|
4844
|
+
{
|
|
4845
|
+
"name": "value-suffix",
|
|
4846
|
+
"description": "Appended to the value that range inputs display above the track, on the right, e.g. `rem`. Only applies when type\nis 'range' and no `context-note` is set.",
|
|
4847
|
+
"value": { "type": "string", "default": "''" }
|
|
4848
|
+
},
|
|
4816
4849
|
{
|
|
4817
4850
|
"name": "form",
|
|
4818
4851
|
"description": "By default, form-controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside a form and associate it with the form that has this `id`. The form must be\nin the same document or shadow root for this to work.",
|
|
@@ -4911,7 +4944,7 @@
|
|
|
4911
4944
|
},
|
|
4912
4945
|
{
|
|
4913
4946
|
"name": "context-note",
|
|
4914
|
-
"description": "Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute."
|
|
4947
|
+
"description": "Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute. Range inputs display their live value here unless this is set."
|
|
4915
4948
|
},
|
|
4916
4949
|
{
|
|
4917
4950
|
"name": "prefix",
|
|
@@ -4972,7 +5005,7 @@
|
|
|
4972
5005
|
{
|
|
4973
5006
|
"name": "type",
|
|
4974
5007
|
"description": "The type of input. Works the same as native `<input>` element. But only a subset of types is supported. Defaults\nto `text`",
|
|
4975
|
-
"type": "'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' |\n 'search' | 'tel' | 'text' | 'time' | 'url'"
|
|
5008
|
+
"type": "'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' |\n 'range' | 'search' | 'tel' | 'text' | 'time' | 'url'"
|
|
4976
5009
|
},
|
|
4977
5010
|
{
|
|
4978
5011
|
"name": "name",
|
|
@@ -5069,6 +5102,11 @@
|
|
|
5069
5102
|
"description": "The color format to display for color inputs. Only applies when type is 'color'. *",
|
|
5070
5103
|
"type": "'hex' | 'rgb' | 'hsl' | 'oklch'"
|
|
5071
5104
|
},
|
|
5105
|
+
{
|
|
5106
|
+
"name": "valueSuffix",
|
|
5107
|
+
"description": "Appended to the value that range inputs display above the track, on the right, e.g. `rem`. Only applies when type\nis 'range' and no `context-note` is set.",
|
|
5108
|
+
"type": "string"
|
|
5109
|
+
},
|
|
5072
5110
|
{
|
|
5073
5111
|
"name": "form",
|
|
5074
5112
|
"description": "By default, form-controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside a form and associate it with the form that has this `id`. The form must be\nin the same document or shadow root for this to work.",
|
|
@@ -9765,7 +9803,7 @@
|
|
|
9765
9803
|
},
|
|
9766
9804
|
{
|
|
9767
9805
|
"name": "zn-theme-editor",
|
|
9768
|
-
"description": "A theme editor: slotted form controls drive a live preview frame,\nwith a toolbar for the preview's light/dark mode and device width.\n---\n\n\n### **Events:**\n - **zn-theme-change** - Emitted when the values, mode or device change.\n- **zn-theme-submit** - Emitted on submit (button click), carrying the current values. With `action` set, only fires after a successful save.\n- **zn-error** - Emitted when a save fails. Also seen for preview render failures: the frame's zn-error is composed and not stopped, so it bubbles out through the editor too.\n\n### **Slots:**\n - _default_ - Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children.\n- **toolbar** - Actions in the toolbar, right-aligned beside the device controls. Where a save button belongs.\n- **footer** - Actions pinned beneath the controls. The built-in submit button lives in the toolbar, not here.\n\n### **CSS Properties:**\n - **--zn-theme-editor-controls-width** - Width of the controls column. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **controls** - The left-hand controls column, full height.\n- **controls-header** - The controls column's header row: `controls-caption` on the left, the light/dark mode toggle on the right.\n- **toolbar** - The preview column's header row: `preview-caption` on the left, the device switcher (and sources/submit) on the right. Spans the preview column only.\n- **section** - A rendered section's or group's collapsible (`section-layout=\"collapsible\"`, or any nested group).\n- **footer** - The footer wrapper beneath the controls.\n- **preview** - The preview column.\n- **error** - The inline error strip.\n- **preview__base** - The frame's base wrapper (forwarded from zn-preview-frame).\n- **preview__stage** - The frame's device-width wrapper (forwarded from zn-preview-frame).\n- **preview__iframe** - The frame's iframe (forwarded from zn-preview-frame).\n- **preview__error** - The frame's own error overlay (forwarded from zn-preview-frame).",
|
|
9806
|
+
"description": "A theme editor: slotted form controls drive a live preview frame,\nwith a toolbar for the preview's light/dark mode and device width.\n---\n\n\n### **Events:**\n - **zn-theme-change** - Emitted when the values, mode or device change.\n- **zn-theme-submit** - Emitted on submit (button click), carrying the current values. With `action` set, only fires after a successful save.\n- **zn-error** - Emitted when a save fails. Also seen for preview render failures: the frame's zn-error is composed and not stopped, so it bubbles out through the editor too.\n\n### **Slots:**\n - _default_ - Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children. With `sections` left unset, the structure is instead derived from the controls' own attributes: `group=\"<label>\"` becomes a tab and `category=\"<label>\"` a collapsible within it, and the control is slotted into that collapsible automatically. Either attribute works alone - a control with only `group` sits directly in its tab, and one with only `category` becomes its own top-level section. Setting `sections` explicitly disables the derivation entirely.\n- **toolbar** - Actions in the toolbar, right-aligned beside the device controls. Where a save button belongs.\n- **footer** - Actions pinned beneath the controls. The built-in submit button lives in the toolbar, not here.\n\n### **CSS Properties:**\n - **--zn-theme-editor-controls-width** - Width of the controls column. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **controls** - The left-hand controls column, full height.\n- **controls-header** - The controls column's header row: `controls-caption` on the left, the light/dark mode toggle on the right.\n- **toolbar** - The preview column's header row: `preview-caption` on the left, the device switcher (and sources/submit) on the right. Spans the preview column only.\n- **section** - A rendered section's or group's collapsible (`section-layout=\"collapsible\"`, or any nested group).\n- **footer** - The footer wrapper beneath the controls.\n- **preview** - The preview column.\n- **error** - The inline error strip.\n- **preview__base** - The frame's base wrapper (forwarded from zn-preview-frame).\n- **preview__stage** - The frame's device-width wrapper (forwarded from zn-preview-frame).\n- **preview__iframe** - The frame's iframe (forwarded from zn-preview-frame).\n- **preview__error** - The frame's own error overlay (forwarded from zn-preview-frame).",
|
|
9769
9807
|
"doc-url": "",
|
|
9770
9808
|
"attributes": [
|
|
9771
9809
|
{
|
|
@@ -9815,7 +9853,7 @@
|
|
|
9815
9853
|
},
|
|
9816
9854
|
{
|
|
9817
9855
|
"name": "sections",
|
|
9818
|
-
"description": "Groups controls into named sections. Empty/unset renders
|
|
9856
|
+
"description": "Groups controls into named sections. Empty/unset falls back to deriving the\nstructure from the controls' own `group`/`category` attributes, and renders\none ungrouped column when they carry neither. A section with a non-empty\n`groups` nests a collapsible per group inside a `zn-tabs` tab for that\nsection - see `groups` on `ThemeEditorSection`.",
|
|
9819
9857
|
"value": { "type": "ThemeEditorSection[]", "default": "[]" }
|
|
9820
9858
|
},
|
|
9821
9859
|
{
|
|
@@ -9865,7 +9903,7 @@
|
|
|
9865
9903
|
"slots": [
|
|
9866
9904
|
{
|
|
9867
9905
|
"name": "",
|
|
9868
|
-
"description": "Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children."
|
|
9906
|
+
"description": "Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children. With `sections` left unset, the structure is instead derived from the controls' own attributes: `group=\"<label>\"` becomes a tab and `category=\"<label>\"` a collapsible within it, and the control is slotted into that collapsible automatically. Either attribute works alone - a control with only `group` sits directly in its tab, and one with only `category` becomes its own top-level section. Setting `sections` explicitly disables the derivation entirely."
|
|
9869
9907
|
},
|
|
9870
9908
|
{
|
|
9871
9909
|
"name": "toolbar",
|
|
@@ -9939,7 +9977,7 @@
|
|
|
9939
9977
|
},
|
|
9940
9978
|
{
|
|
9941
9979
|
"name": "sections",
|
|
9942
|
-
"description": "Groups controls into named sections. Empty/unset renders
|
|
9980
|
+
"description": "Groups controls into named sections. Empty/unset falls back to deriving the\nstructure from the controls' own `group`/`category` attributes, and renders\none ungrouped column when they carry neither. A section with a non-empty\n`groups` nests a collapsible per group inside a `zn-tabs` tab for that\nsection - see `groups` on `ThemeEditorSection`.",
|
|
9943
9981
|
"type": "ThemeEditorSection[]"
|
|
9944
9982
|
},
|
|
9945
9983
|
{
|
package/dist/zn.d.ts
CHANGED
|
@@ -1880,7 +1880,7 @@ declare module "components/input/input.component" {
|
|
|
1880
1880
|
*
|
|
1881
1881
|
* @slot label - The input's label. Alternatively, you can use the `label` attribute.
|
|
1882
1882
|
* @slot label-tooltip - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.
|
|
1883
|
-
* @slot context-note - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute.
|
|
1883
|
+
* @slot context-note - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute. Range inputs display their live value here unless this is set.
|
|
1884
1884
|
* @slot prefix - Used to prepend a presentational icon or similar element to the input.
|
|
1885
1885
|
* @slot suffix - Used to append a presentational icon or similar element to the input.
|
|
1886
1886
|
* @slot clear-icon - An icon to use in lieu of the default clear icon.
|
|
@@ -1898,6 +1898,12 @@ declare module "components/input/input.component" {
|
|
|
1898
1898
|
* @csspart clear-button - The clear button.
|
|
1899
1899
|
* @csspart password-toggle-button - The password toggle button.
|
|
1900
1900
|
* @csspart suffix - The container that wraps the suffix.
|
|
1901
|
+
*
|
|
1902
|
+
* @cssproperty --zn-range-track-height - The height of a range input's track.
|
|
1903
|
+
* @cssproperty --zn-range-track-color - The color of a range input's track.
|
|
1904
|
+
* @cssproperty --zn-range-thumb-size - The diameter of a range input's thumb.
|
|
1905
|
+
* @cssproperty --zn-range-thumb-color - The color of a range input's thumb.
|
|
1906
|
+
* @cssproperty --zn-range-thumb-ring-width - The width of the ring drawn around a range input's thumb.
|
|
1901
1907
|
*/
|
|
1902
1908
|
export default class ZnInput extends ZincElement implements ZincFormControl {
|
|
1903
1909
|
static styles: import("lit").CSSResult;
|
|
@@ -1919,7 +1925,7 @@ declare module "components/input/input.component" {
|
|
|
1919
1925
|
* The type of input. Works the same as native `<input>` element. But only a subset of types is supported. Defaults
|
|
1920
1926
|
* to `text`
|
|
1921
1927
|
*/
|
|
1922
|
-
type: 'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url';
|
|
1928
|
+
type: 'color' | 'currency' | 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'range' | 'search' | 'tel' | 'text' | 'time' | 'url';
|
|
1923
1929
|
/** The name of the input, submitted as a name/value pair with form data. */
|
|
1924
1930
|
name: string;
|
|
1925
1931
|
/** The current value of the input, submitted as a name/value pair with form data. */
|
|
@@ -1965,6 +1971,11 @@ declare module "components/input/input.component" {
|
|
|
1965
1971
|
noSpinButtons: boolean;
|
|
1966
1972
|
/** The color format to display for color inputs. Only applies when type is 'color'. **/
|
|
1967
1973
|
colorFormat: 'hex' | 'rgb' | 'hsl' | 'oklch';
|
|
1974
|
+
/**
|
|
1975
|
+
* Appended to the value that range inputs display above the track, on the right, e.g. `rem`. Only applies when type
|
|
1976
|
+
* is 'range' and no `context-note` is set.
|
|
1977
|
+
*/
|
|
1978
|
+
valueSuffix: string;
|
|
1968
1979
|
/**
|
|
1969
1980
|
* By default, form-controls are associated with the nearest containing `<form>` element. This attribute allows you
|
|
1970
1981
|
* to place the form control outside a form and associate it with the form that has this `id`. The form must be
|
|
@@ -2046,6 +2057,7 @@ declare module "components/input/input.component" {
|
|
|
2046
2057
|
private handleColorSwatchClick;
|
|
2047
2058
|
private handleColorPickerChange;
|
|
2048
2059
|
private focusInput;
|
|
2060
|
+
protected firstUpdated(): void;
|
|
2049
2061
|
handleDisabledChange(): void;
|
|
2050
2062
|
handleStepChange(): void;
|
|
2051
2063
|
handleValueChange(): Promise<void>;
|
|
@@ -4697,6 +4709,9 @@ declare module "components/icon-picker/icon-picker.component" {
|
|
|
4697
4709
|
helpText: string;
|
|
4698
4710
|
disabled: boolean;
|
|
4699
4711
|
required: boolean;
|
|
4712
|
+
triggerSubmit: boolean;
|
|
4713
|
+
allowUpload: boolean;
|
|
4714
|
+
accept: string;
|
|
4700
4715
|
form: string;
|
|
4701
4716
|
defaultValue: string;
|
|
4702
4717
|
private _dialogOpen;
|
|
@@ -4706,9 +4721,19 @@ declare module "components/icon-picker/icon-picker.component" {
|
|
|
4706
4721
|
private _pendingIcon;
|
|
4707
4722
|
private _pendingLibrary;
|
|
4708
4723
|
private _pendingColor;
|
|
4724
|
+
private _pendingFile;
|
|
4725
|
+
private _pendingFileUrl;
|
|
4726
|
+
private _mode;
|
|
4727
|
+
private _file;
|
|
4728
|
+
private _fileUrl;
|
|
4709
4729
|
private _dialog;
|
|
4730
|
+
private _fileInput;
|
|
4710
4731
|
get value(): string;
|
|
4711
4732
|
set value(val: string);
|
|
4733
|
+
/** The chosen file when the user uploaded an image instead of picking an icon. */
|
|
4734
|
+
get file(): File | null;
|
|
4735
|
+
/** True when the current value renders as an image (an uploaded file or a URL) rather than a library icon. */
|
|
4736
|
+
get isImageValue(): boolean;
|
|
4712
4737
|
get validity(): ValidityState;
|
|
4713
4738
|
get validationMessage(): string;
|
|
4714
4739
|
checkValidity(): boolean;
|
|
@@ -4722,6 +4747,10 @@ declare module "components/icon-picker/icon-picker.component" {
|
|
|
4722
4747
|
private closeDialog;
|
|
4723
4748
|
private handleConfirm;
|
|
4724
4749
|
private handleCancel;
|
|
4750
|
+
private handleFileSelect;
|
|
4751
|
+
private discardPendingFile;
|
|
4752
|
+
private clearFile;
|
|
4753
|
+
disconnectedCallback(): void;
|
|
4725
4754
|
private handleSearchInput;
|
|
4726
4755
|
private filterIcons;
|
|
4727
4756
|
private handleIconSelect;
|
|
@@ -7267,6 +7296,12 @@ declare module "components/file/file.component" {
|
|
|
7267
7296
|
private handleClearClick;
|
|
7268
7297
|
/** Clear the current value after the user confirms. */
|
|
7269
7298
|
private confirmClear;
|
|
7299
|
+
/**
|
|
7300
|
+
* Programmatically clears the selected file and any external `src` without
|
|
7301
|
+
* confirmation. Unlike a user-initiated clear, this does not flag the control
|
|
7302
|
+
* to submit an empty value.
|
|
7303
|
+
*/
|
|
7304
|
+
clear(): void;
|
|
7270
7305
|
private updatePreview;
|
|
7271
7306
|
/**
|
|
7272
7307
|
* Returns the URL currently shown in the droparea — the locally-selected file's object URL
|
|
@@ -10524,7 +10559,7 @@ declare module "events/zn-error" {
|
|
|
10524
10559
|
}
|
|
10525
10560
|
}
|
|
10526
10561
|
declare module "components/theme-editor/theme-editor.component" {
|
|
10527
|
-
import { type CSSResultGroup } from 'lit';
|
|
10562
|
+
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
|
10528
10563
|
import ZincElement from "internal/zinc-element";
|
|
10529
10564
|
import ZnButton from "components/button/index";
|
|
10530
10565
|
import ZnCollapsible from "components/collapsible/index";
|
|
@@ -10583,6 +10618,14 @@ declare module "components/theme-editor/theme-editor.component" {
|
|
|
10583
10618
|
* `groups` entry) render inside that section/group instead. Harvesting and
|
|
10584
10619
|
* change detection walk every slot's full assigned subtree, not just direct
|
|
10585
10620
|
* children.
|
|
10621
|
+
*
|
|
10622
|
+
* With `sections` left unset, the structure is instead derived from the
|
|
10623
|
+
* controls' own attributes: `group="<label>"` becomes a tab and
|
|
10624
|
+
* `category="<label>"` a collapsible within it, and the control is slotted
|
|
10625
|
+
* into that collapsible automatically. Either attribute works alone - a
|
|
10626
|
+
* control with only `group` sits directly in its tab, and one with only
|
|
10627
|
+
* `category` becomes its own top-level section. Setting `sections`
|
|
10628
|
+
* explicitly disables the derivation entirely.
|
|
10586
10629
|
* @slot toolbar - Actions in the toolbar, right-aligned beside the device
|
|
10587
10630
|
* controls. Where a save button belongs.
|
|
10588
10631
|
* @slot footer - Actions pinned beneath the controls. The built-in submit button
|
|
@@ -10634,10 +10677,11 @@ declare module "components/theme-editor/theme-editor.component" {
|
|
|
10634
10677
|
/** Debounce in ms between a control change and the save POST. */
|
|
10635
10678
|
saveDebounce: number;
|
|
10636
10679
|
/**
|
|
10637
|
-
* Groups controls into named sections. Empty/unset
|
|
10638
|
-
*
|
|
10639
|
-
*
|
|
10640
|
-
* `
|
|
10680
|
+
* Groups controls into named sections. Empty/unset falls back to deriving the
|
|
10681
|
+
* structure from the controls' own `group`/`category` attributes, and renders
|
|
10682
|
+
* one ungrouped column when they carry neither. A section with a non-empty
|
|
10683
|
+
* `groups` nests a collapsible per group inside a `zn-tabs` tab for that
|
|
10684
|
+
* section - see `groups` on `ThemeEditorSection`.
|
|
10641
10685
|
*/
|
|
10642
10686
|
sections: ThemeEditorSection[];
|
|
10643
10687
|
/**
|
|
@@ -10680,6 +10724,7 @@ declare module "components/theme-editor/theme-editor.component" {
|
|
|
10680
10724
|
private readonly _controlsObserver;
|
|
10681
10725
|
private _modeValues;
|
|
10682
10726
|
private _suppressDepth;
|
|
10727
|
+
private _openedInitialCollapsible;
|
|
10683
10728
|
/** The current per-mode value sets. Returns copies. */
|
|
10684
10729
|
get values(): {
|
|
10685
10730
|
light: Record<string, unknown>;
|
|
@@ -10732,6 +10777,23 @@ declare module "components/theme-editor/theme-editor.component" {
|
|
|
10732
10777
|
private readonly _onSourceChange;
|
|
10733
10778
|
private _sectionsSafe;
|
|
10734
10779
|
private _groupsFor;
|
|
10780
|
+
/** Whether any direct child carries the `group`/`category` structure attributes. */
|
|
10781
|
+
private _hasStructureAttributes;
|
|
10782
|
+
/** Attribute-derived structure applies only when `sections` is left unset. */
|
|
10783
|
+
private _usesDerivedSections;
|
|
10784
|
+
/**
|
|
10785
|
+
* Builds the tab/collapsible tree from the controls' own `group` (tab) and
|
|
10786
|
+
* `category` (collapsible) attributes, alongside the slot name each control
|
|
10787
|
+
* needs assigning to. Only direct children are considered, since `slot` only
|
|
10788
|
+
* works one level deep. Slot names are slugged from the labels and made
|
|
10789
|
+
* unique across the whole tree, so two tabs can each hold a "Colors"
|
|
10790
|
+
* category without their slots colliding.
|
|
10791
|
+
*/
|
|
10792
|
+
private _derive;
|
|
10793
|
+
/** Explicit `sections` when set, otherwise the attribute-derived tree. */
|
|
10794
|
+
private _effectiveSections;
|
|
10795
|
+
private _assignDerivedSlots;
|
|
10796
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
10735
10797
|
/** Whether any section has a populated `groups` - the switch to nested tabs+collapsibles. */
|
|
10736
10798
|
private _hasNestedGroups;
|
|
10737
10799
|
private _visibleGroups;
|
|
@@ -10739,6 +10801,12 @@ declare module "components/theme-editor/theme-editor.component" {
|
|
|
10739
10801
|
private _visibleSections;
|
|
10740
10802
|
private _renderSections;
|
|
10741
10803
|
private _renderGroups;
|
|
10804
|
+
/** Every collapsible inside a tab's panel, in document order. */
|
|
10805
|
+
private _tabCollapsibles;
|
|
10806
|
+
/** Expands the first collapsible, unless one is already open. */
|
|
10807
|
+
private _expandFirst;
|
|
10808
|
+
private _openFirstCollapsible;
|
|
10809
|
+
protected updated(changed: PropertyValues): void;
|
|
10742
10810
|
private _renderTabs;
|
|
10743
10811
|
render(): import("lit-html").TemplateResult<1>;
|
|
10744
10812
|
}
|