@kubex/zinc 1.0.25 → 1.0.98
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/.claude/project.md +556 -0
- package/.github/workflows/js_build_and_deploy.yaml +9 -10
- package/dist/custom-elements.json +13431 -8728
- package/dist/vscode.html-custom-data.json +571 -37
- package/dist/web-types.json +1439 -181
- package/dist/zn.d.ts +1642 -661
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1406 -891
- package/docs/_utilities/code-previews.cjs +10 -1
- package/docs/assets/scripts/docs.js +42 -18
- package/docs/data/data-table.json +229 -66
- package/docs/data/empty.json +6 -0
- package/docs/data/products-table.json +41 -193
- package/docs/pages/components/action-bar.md +121 -6
- package/docs/pages/components/alert.md +118 -15
- package/docs/pages/components/animated-button.md +299 -0
- package/docs/pages/components/audio-select.md +534 -0
- package/docs/pages/components/bulk-actions.md +79 -5
- package/docs/pages/components/button-group.md +235 -27
- package/docs/pages/components/button.md +139 -1
- package/docs/pages/components/chart.md +365 -9
- package/docs/pages/components/checkbox.md +387 -58
- package/docs/pages/components/chip.md +253 -33
- package/docs/pages/components/collapsible.md +393 -46
- package/docs/pages/components/cols.md +152 -30
- package/docs/pages/components/confirm.md +182 -16
- package/docs/pages/components/copy-button.md +169 -6
- package/docs/pages/components/data-select.md +194 -15
- package/docs/pages/components/data-table-filter.md +96 -5
- package/docs/pages/components/data-table-search.md +451 -0
- package/docs/pages/components/data-table-sort.md +66 -5
- package/docs/pages/components/data-table.md +727 -66
- package/docs/pages/components/datepicker.md +402 -7
- package/docs/pages/components/defined-label.md +120 -5
- package/docs/pages/components/dialog.md +339 -59
- package/docs/pages/components/dropdown.md +366 -11
- package/docs/pages/components/editor.md +604 -7
- package/docs/pages/components/empty-state.md +315 -16
- package/docs/pages/components/expanding-action.md +212 -28
- package/docs/pages/components/file.md +421 -12
- package/docs/pages/components/filter-container.md +158 -5
- package/docs/pages/components/filter-wrapper.md +167 -6
- package/docs/pages/components/form-group.md +383 -6
- package/docs/pages/components/hover-container.md +237 -6
- package/docs/pages/components/icon-picker.md +121 -0
- package/docs/pages/components/icon.md +454 -48
- package/docs/pages/components/inline-edit.md +787 -19
- package/docs/pages/components/input-group.md +207 -13
- package/docs/pages/components/input.md +194 -0
- package/docs/pages/components/key-container.md +115 -0
- package/docs/pages/components/key.md +101 -0
- package/docs/pages/components/menu.md +512 -6
- package/docs/pages/components/note.md +239 -36
- package/docs/pages/components/opt-group.md +107 -0
- package/docs/pages/components/pagination.md +332 -6
- package/docs/pages/components/pane.md +222 -6
- package/docs/pages/components/panel.md +213 -26
- package/docs/pages/components/popup.md +1354 -6
- package/docs/pages/components/priority-list.md +233 -0
- package/docs/pages/components/progress-bar.md +387 -6
- package/docs/pages/components/radio-group.md +242 -5
- package/docs/pages/components/radio.md +474 -6
- package/docs/pages/components/rating.md +331 -7
- package/docs/pages/components/reveal.md +524 -6
- package/docs/pages/components/scroll-container.md +552 -6
- package/docs/pages/components/select.md +762 -160
- package/docs/pages/components/skeleton.md +473 -30
- package/docs/pages/components/slideout.md +261 -5
- package/docs/pages/components/sp.md +99 -41
- package/docs/pages/components/split-button.md +347 -9
- package/docs/pages/components/split-pane.md +445 -6
- package/docs/pages/components/stat.md +549 -9
- package/docs/pages/components/status-indicator.md +230 -1
- package/docs/pages/components/stepper.md +563 -6
- package/docs/pages/components/tabs.md +439 -13
- package/docs/pages/components/textarea.md +415 -17
- package/docs/pages/components/tile.md +385 -26
- package/docs/pages/components/toggle.md +424 -6
- package/docs/pages/components/tooltip.md +367 -0
- package/docs/pages/components/translation-group.md +210 -0
- package/docs/pages/components/translations.md +319 -19
- package/docs/pages/components/vertical-stepper.md +401 -8
- package/docs/pages/components/well.md +300 -3
- package/docs/pages/getting-started/form-controls.md +162 -0
- package/docs/pages/index.md +116 -15
- package/package.json +5 -6
- package/scss/_global-spacing.scss +4 -0
- package/scss/_root.scss +2 -2
- package/scss/boot.scss +19 -0
- package/scss/shared/layout.scss +5 -0
- package/scss/themes/_light.scss +3 -3
- package/src/components/alert/alert.scss +1 -0
- package/src/components/animated-button/README.md +306 -0
- package/src/components/animated-button/animated-button.component.ts +229 -0
- package/src/components/animated-button/animated-button.scss +228 -0
- package/src/components/animated-button/animated-button.test.ts +143 -0
- package/src/components/animated-button/index.ts +12 -0
- package/src/components/button/button.component.ts +5 -0
- package/src/components/button-group/button-group.component.ts +25 -13
- package/src/components/button-group/button-group.scss +6 -0
- package/src/components/checkbox/checkbox.component.ts +4 -0
- package/src/components/checkbox/checkbox.scss +7 -4
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/chip/chip.component.ts +7 -2
- package/src/components/chip/chip.scss +16 -2
- package/src/components/collapsible/collapsible.component.ts +27 -20
- package/src/components/cols/cols.component.ts +14 -2
- package/src/components/cols/cols.scss +6 -12
- package/src/components/confirm/confirm.component.ts +7 -0
- package/src/components/copy-button/copy-button.component.ts +12 -11
- package/src/components/data-select/data-select.component.ts +215 -44
- package/src/components/data-select/data-select.scss +66 -6
- package/src/components/data-select/providers/currency-data-provider.ts +20 -6
- package/src/components/data-select/providers/provider.ts +1 -0
- package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
- package/src/components/data-table/data-table.component.ts +81 -22
- package/src/components/data-table-search/data-table-search.component.ts +184 -0
- package/src/components/data-table-search/data-table-search.scss +17 -0
- package/src/components/data-table-search/data-table-search.test.ts +11 -0
- package/src/components/data-table-search/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +347 -13
- package/src/components/dialog/dialog.component.ts +1 -1
- package/src/components/empty-state/empty-state.scss +6 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/icon/icon.component.ts +23 -1
- package/src/components/icon/icon.scss +23 -0
- package/src/components/icon-picker/brand-icons.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +407 -0
- package/src/components/icon-picker/icon-picker.scss +205 -0
- package/src/components/icon-picker/index.ts +12 -0
- package/src/components/icon-picker/line-icons.ts +612 -0
- package/src/components/icon-picker/material-icons.ts +14543 -0
- package/src/components/inline-edit/inline-edit.component.ts +190 -46
- package/src/components/inline-edit/inline-edit.scss +29 -0
- package/src/components/inline-edit/inline-edit.test.ts +314 -1
- package/src/components/input/input.component.ts +324 -5
- package/src/components/input/input.scss +87 -0
- package/src/components/input-group/input-group.component.ts +28 -7
- package/src/components/input-group/input-group.scss +48 -10
- package/src/components/item/item.component.ts +11 -2
- package/src/components/item/item.scss +7 -0
- package/src/components/key/index.ts +12 -0
- package/src/components/key/key.component.ts +47 -0
- package/src/components/key/key.scss +38 -0
- package/src/components/key-container/index.ts +12 -0
- package/src/components/key-container/key-container.component.ts +142 -0
- package/src/components/key-container/key-container.scss +33 -0
- package/src/components/menu-item/menu-item.component.ts +20 -0
- package/src/components/menu-item/menu-item.scss +69 -2
- package/src/components/navbar/navbar.component.ts +103 -11
- package/src/components/navbar/navbar.scss +6 -1
- package/src/components/opt-group/index.ts +12 -0
- package/src/components/opt-group/opt-group.component.ts +74 -0
- package/src/components/opt-group/opt-group.scss +37 -0
- package/src/components/opt-group/opt-group.test.ts +27 -0
- package/src/components/option/option.component.ts +1 -16
- package/src/components/option/option.scss +4 -0
- package/src/components/panel/panel.component.ts +10 -8
- package/src/components/panel/panel.scss +20 -0
- package/src/components/priority-list/index.ts +12 -0
- package/src/components/priority-list/priority-list.component.ts +611 -0
- package/src/components/priority-list/priority-list.scss +185 -0
- package/src/components/priority-list/priority-list.test.ts +139 -0
- package/src/components/progress-bar/progress-bar.component.ts +22 -16
- package/src/components/radio/radio.scss +10 -3
- package/src/components/select/select.component.ts +812 -72
- package/src/components/select/select.scss +108 -2
- package/src/components/select/select.test.ts +147 -2
- package/src/components/settings-container/settings-container.component.ts +44 -19
- package/src/components/settings-container/settings-container.scss +1 -1
- package/src/components/skeleton/skeleton.component.ts +6 -1
- package/src/components/slideout/slideout.scss +8 -3
- package/src/components/sp/sp.component.ts +3 -1
- package/src/components/sp/sp.scss +19 -0
- package/src/components/stepper/stepper.component.ts +16 -10
- package/src/components/textarea/textarea.scss +0 -4
- package/src/components/tile/tile.component.ts +12 -3
- package/src/components/tile/tile.scss +1 -1
- package/src/components/timer/timer.component.ts +15 -2
- package/src/components/toggle/toggle.component.ts +29 -26
- package/src/components/toggle/toggle.scss +13 -1
- package/src/components/translation-group/index.ts +12 -0
- package/src/components/translation-group/translation-group.component.ts +207 -0
- package/src/components/translation-group/translation-group.scss +8 -0
- package/src/components/translations/translations.component.ts +90 -44
- package/src/components/translations/translations.scss +4 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
- package/src/events/events.ts +12 -7
- package/src/events/zn-language-change.ts +7 -0
- package/src/events/zn-purchase.ts +11 -0
- package/src/events/zn-redirect.ts +7 -0
- package/src/events/zn-reorder.ts +7 -0
- package/src/events/zn-search-change.ts +11 -0
- package/src/events/zn-submit.ts +1 -1
- package/src/form-control.scss +4 -0
- package/src/internal/form-navigation.ts +510 -0
- package/src/internal/form.ts +6 -0
- package/src/zinc.ts +91 -83
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {type CSSResultGroup, html, unsafeCSS} from 'lit';
|
|
2
|
+
import {property} from 'lit/decorators.js';
|
|
3
|
+
import {watch} from '../../internal/watch';
|
|
4
|
+
import ZincElement from '../../internal/zinc-element';
|
|
5
|
+
|
|
6
|
+
import styles from './opt-group.scss';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @summary Groups options within a `<zn-select>` under a labeled header, similar to `<optgroup>` in native HTML.
|
|
10
|
+
* @documentation https://zinc.style/components/opt-group
|
|
11
|
+
* @status experimental
|
|
12
|
+
* @since 1.0
|
|
13
|
+
*
|
|
14
|
+
* @slot - The default slot for `<zn-option>` elements.
|
|
15
|
+
*
|
|
16
|
+
* @csspart base - The component's base wrapper.
|
|
17
|
+
* @csspart label - The group label element.
|
|
18
|
+
*/
|
|
19
|
+
export default class ZnOptGroup extends ZincElement {
|
|
20
|
+
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
21
|
+
|
|
22
|
+
/** The label for the opt-group, displayed as a non-selectable header above the grouped options. */
|
|
23
|
+
@property() label = '';
|
|
24
|
+
|
|
25
|
+
/** Disables all options within the group. */
|
|
26
|
+
@property({type: Boolean, reflect: true}) disabled = false;
|
|
27
|
+
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
this.setAttribute('role', 'group');
|
|
31
|
+
this.setAttribute('aria-label', this.label);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@watch('label')
|
|
35
|
+
handleLabelChange() {
|
|
36
|
+
this.setAttribute('aria-label', this.label);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@watch('disabled')
|
|
40
|
+
handleDisabledChange() {
|
|
41
|
+
this.propagateDisabled();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @internal - Updates visibility of the group based on whether any child options are visible. */
|
|
45
|
+
updateVisibility() {
|
|
46
|
+
const options = [...this.querySelectorAll('zn-option')];
|
|
47
|
+
this.hidden = options.length > 0 && options.every(option => option.hidden);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
return html`
|
|
52
|
+
<div part="base" class="opt-group">
|
|
53
|
+
<div part="label" class="opt-group__label" aria-hidden="true">
|
|
54
|
+
${this.label}
|
|
55
|
+
</div>
|
|
56
|
+
<div class="opt-group__options" role="none">
|
|
57
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private handleSlotChange() {
|
|
64
|
+
if (this.disabled) {
|
|
65
|
+
this.propagateDisabled();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private propagateDisabled() {
|
|
70
|
+
this.querySelectorAll('zn-option').forEach(option => {
|
|
71
|
+
option.disabled = this.disabled;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@use "../../wc";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([hidden]) {
|
|
8
|
+
display: none !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.opt-group__label {
|
|
12
|
+
font-family: var(--zn-font-sans);
|
|
13
|
+
font-size: var(--zn-font-size-x-small);
|
|
14
|
+
font-weight: var(--zn-font-weight-semibold);
|
|
15
|
+
line-height: var(--zn-line-height-normal);
|
|
16
|
+
letter-spacing: var(--zn-letter-spacing-normal);
|
|
17
|
+
color: var(--zn-color-neutral-500);
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
padding-block: var(--zn-spacing-2x-small);
|
|
20
|
+
padding-inline: var(--zn-spacing-large);
|
|
21
|
+
user-select: none;
|
|
22
|
+
-webkit-user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:not(:first-of-type)) .opt-group__label {
|
|
26
|
+
border-block-start: solid var(--zn-panel-border-width) var(--zn-panel-border-color);
|
|
27
|
+
margin-block-start: var(--zn-spacing-x-small);
|
|
28
|
+
padding-block-start: var(--zn-spacing-small);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.opt-group__options {
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([disabled]) {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import '../../../dist/zn.min.js';
|
|
2
|
+
import {expect, fixture, html} from '@open-wc/testing';
|
|
3
|
+
|
|
4
|
+
describe('<zn-opt-group>', () => {
|
|
5
|
+
it('should render a component', async () => {
|
|
6
|
+
const el = await fixture(html`
|
|
7
|
+
<zn-opt-group></zn-opt-group> `);
|
|
8
|
+
|
|
9
|
+
expect(el).to.exist;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should display a label', async () => {
|
|
13
|
+
const el = await fixture(html`
|
|
14
|
+
<zn-opt-group label="Group Label"></zn-opt-group> `);
|
|
15
|
+
const label = el.shadowRoot!.querySelector('.opt-group__label');
|
|
16
|
+
|
|
17
|
+
expect(label).to.exist;
|
|
18
|
+
expect(label!.textContent!.trim()).to.equal('Group Label');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should have role="group"', async () => {
|
|
22
|
+
const el = await fixture(html`
|
|
23
|
+
<zn-opt-group label="Test"></zn-opt-group> `);
|
|
24
|
+
|
|
25
|
+
expect(el.getAttribute('role')).to.equal('group');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -43,8 +43,7 @@ export default class ZnOption extends ZincElement {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The option's value. When selected, the containing form control will receive this value. The value must be unique
|
|
46
|
-
* from other options in the same group. Values may
|
|
47
|
-
* multiple values.
|
|
46
|
+
* from other options in the same group. Values may contain spaces when using JSON array syntax on the parent select.
|
|
48
47
|
*/
|
|
49
48
|
@property({ reflect: true }) value = '';
|
|
50
49
|
|
|
@@ -93,20 +92,6 @@ export default class ZnOption extends ZincElement {
|
|
|
93
92
|
this.setAttribute('aria-selected', this.selected ? 'true' : 'false');
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
@watch('value')
|
|
97
|
-
handleValueChange() {
|
|
98
|
-
// Ensure the value is a string. This ensures the next line doesn't error and allows framework users to pass numbers
|
|
99
|
-
// instead of requiring them to cast the value to a string.
|
|
100
|
-
if (typeof this.value !== 'string') {
|
|
101
|
-
this.value = String(this.value);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (this.value.includes(' ')) {
|
|
105
|
-
console.error(`Option values cannot include a space. All spaces have been replaced with underscores.`, this);
|
|
106
|
-
this.value = this.value.replace(/ /g, '_');
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
95
|
/** Returns a plain text label based on the option's content. */
|
|
111
96
|
getTextLabel() {
|
|
112
97
|
const nodes = this.childNodes;
|
|
@@ -8,18 +8,18 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
8
8
|
import styles from './panel.scss';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @summary
|
|
11
|
+
* @summary Panels are versatile containers that provide structure for organizing content with optional headers and footers.
|
|
12
12
|
* @documentation https://zinc.style/components/panel
|
|
13
13
|
* @status experimental
|
|
14
14
|
* @since 1.0
|
|
15
15
|
*
|
|
16
|
-
* @slot - The
|
|
17
|
-
* @slot actions -
|
|
18
|
-
* @slot footer -
|
|
16
|
+
* @slot - The panel's main content.
|
|
17
|
+
* @slot actions - Actions displayed in the panel header (buttons, chips, etc).
|
|
18
|
+
* @slot footer - Content displayed in the panel footer.
|
|
19
19
|
*
|
|
20
20
|
* @csspart base - The component's base wrapper.
|
|
21
21
|
*
|
|
22
|
-
* @cssproperty --
|
|
22
|
+
* @cssproperty --zn-panel-basis - The flex-basis of the panel. Can be set using the basis-px attribute.
|
|
23
23
|
*/
|
|
24
24
|
export default class ZnPanel extends ZincElement {
|
|
25
25
|
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
@@ -92,7 +92,7 @@ export default class ZnPanel extends ZincElement {
|
|
|
92
92
|
'panel--has-footer': hasFooterSlot,
|
|
93
93
|
'panel--has-header': hasHeader,
|
|
94
94
|
'panel--cosmic': this.cosmic,
|
|
95
|
-
'panel--shadow': this.shadow
|
|
95
|
+
'panel--shadow': this.shadow,
|
|
96
96
|
})}">
|
|
97
97
|
|
|
98
98
|
<div class="panel__inner">
|
|
@@ -109,8 +109,10 @@ export default class ZnPanel extends ZincElement {
|
|
|
109
109
|
<slot name="actions" slot="actions" class="panel__header__actions"></slot>` : null}
|
|
110
110
|
</zn-header>` : null}
|
|
111
111
|
|
|
112
|
-
<div class="
|
|
113
|
-
<
|
|
112
|
+
<div class="panel__content">
|
|
113
|
+
<div class="panel__body">
|
|
114
|
+
<slot></slot>
|
|
115
|
+
</div>
|
|
114
116
|
</div>
|
|
115
117
|
|
|
116
118
|
${hasFooterSlot ? html`
|
|
@@ -33,13 +33,32 @@
|
|
|
33
33
|
flex-grow: 1;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
&__content {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-grow: 1;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
36
44
|
&__header {
|
|
37
45
|
padding: var(--zn-spacing-x-small) var(--zn-spacing-medium);
|
|
38
46
|
|
|
47
|
+
// background-color: rgba(var(--zn-panel-highlight), 0.6);
|
|
48
|
+
// border-bottom: 1px solid rgb(var(--zn-border-color));
|
|
49
|
+
|
|
39
50
|
&::part(base) {
|
|
40
51
|
border-bottom: 0;
|
|
41
52
|
}
|
|
42
53
|
|
|
54
|
+
&::part(header-caption) {
|
|
55
|
+
font-size: var(--zn-font-size-large);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--inline {
|
|
59
|
+
border-bottom: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
43
62
|
&--underline {
|
|
44
63
|
border-bottom: 1px solid rgb(var(--zn-border-color));
|
|
45
64
|
}
|
|
@@ -144,4 +163,5 @@
|
|
|
144
163
|
&--shadow {
|
|
145
164
|
box-shadow: 0 6px 20px 10px rgba(0, 0, 0, 0.25);
|
|
146
165
|
}
|
|
166
|
+
|
|
147
167
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ZnPriorityList from './priority-list.component';
|
|
2
|
+
|
|
3
|
+
export * from './priority-list.component';
|
|
4
|
+
export default ZnPriorityList;
|
|
5
|
+
|
|
6
|
+
ZnPriorityList.define('zn-priority-list');
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'zn-priority-list': ZnPriorityList;
|
|
11
|
+
}
|
|
12
|
+
}
|