@tmorrow/cre8-wc 1.0.25 → 1.1.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/cdn/cre8-wc.esm.js +9082 -15604
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1231 -8308
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.d.ts +20 -2
- package/lib/cdn-entry.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +18 -64
- package/lib/components/accordion/accordion.styles.d.ts.map +1 -1
- package/lib/components/accordion-item/accordion-item.js +35 -238
- package/lib/components/accordion-item/accordion-item.styles.d.ts.map +1 -1
- package/lib/components/alert/alert.js +56 -221
- package/lib/components/alert/alert.styles.d.ts.map +1 -1
- package/lib/components/badge/badge.js +33 -164
- package/lib/components/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/band/band.js +15 -46
- package/lib/components/band/band.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.js +14 -33
- package/lib/components/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +10 -45
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.d.ts.map +1 -1
- package/lib/components/button/button.js +16 -16
- package/lib/components/button-group/button-group.js +19 -50
- package/lib/components/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/card/card.js +17 -130
- package/lib/components/card/card.styles.d.ts.map +1 -1
- package/lib/components/chart/chart.js +137 -223
- package/lib/components/chart/chart.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field/checkbox-field.js +26 -59
- package/lib/components/checkbox-field/checkbox-field.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field-item/checkbox-field-item.d.ts +0 -5
- package/lib/components/checkbox-field-item/checkbox-field-item.d.ts.map +1 -1
- package/lib/components/checkbox-field-item/checkbox-field-item.js +42 -212
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.d.ts.map +1 -1
- package/lib/components/contexts/form-internals-context.d.ts +30 -0
- package/lib/components/contexts/form-internals-context.d.ts.map +1 -0
- package/lib/components/cre8-form-element.d.ts +98 -24
- package/lib/components/cre8-form-element.d.ts.map +1 -1
- package/lib/components/cre8-form-element.js +221 -22
- package/lib/components/danger-button/danger-button.js +53 -582
- package/lib/components/danger-button/danger-button.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar/calendar.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/date-picker.js +262 -499
- package/lib/components/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/divider/divider.js +20 -61
- package/lib/components/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/dropdown/dropdown.js +34 -107
- package/lib/components/dropdown/dropdown.styles.d.ts.map +1 -1
- package/lib/components/dropdown-item/dropdown-item.js +18 -49
- package/lib/components/dropdown-item/dropdown-item.styles.d.ts.map +1 -1
- package/lib/components/feature/feature.js +19 -81
- package/lib/components/feature/feature.styles.d.ts.map +1 -1
- package/lib/components/field/field.js +12 -146
- package/lib/components/field/field.styles.d.ts.map +1 -1
- package/lib/components/field-note/field-note.js +22 -66
- package/lib/components/field-note/field-note.styles.d.ts.map +1 -1
- package/lib/components/footer/footer.js +10 -29
- package/lib/components/footer/footer.styles.d.ts.map +1 -1
- package/lib/components/global-nav/global-nav.js +20 -43
- package/lib/components/global-nav/global-nav.styles.d.ts.map +1 -1
- package/lib/components/global-nav-item/global-nav-item.js +26 -105
- package/lib/components/global-nav-item/global-nav-item.styles.d.ts.map +1 -1
- package/lib/components/grid/grid.js +15 -337
- package/lib/components/grid/grid.styles.d.ts.map +1 -1
- package/lib/components/grid-item/grid-item.js +7 -15
- package/lib/components/grid-item/grid-item.styles.d.ts.map +1 -1
- package/lib/components/header/header.js +17 -80
- package/lib/components/header/header.styles.d.ts.map +1 -1
- package/lib/components/heading/heading.js +16 -153
- package/lib/components/heading/heading.styles.d.ts.map +1 -1
- package/lib/components/hero/hero.js +17 -149
- package/lib/components/hero/hero.styles.d.ts.map +1 -1
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon.styles.d.ts.map +1 -1
- package/lib/components/inline-alert/inline-alert.js +53 -214
- package/lib/components/inline-alert/inline-alert.styles.d.ts.map +1 -1
- package/lib/components/layout/layout.js +20 -53
- package/lib/components/layout/layout.styles.d.ts.map +1 -1
- package/lib/components/layout-container/layout-container.js +20 -43
- package/lib/components/layout-container/layout-container.styles.d.ts.map +1 -1
- package/lib/components/layout-section/layout-section.js +20 -29
- package/lib/components/layout-section/layout-section.styles.d.ts.map +1 -1
- package/lib/components/linelength-container/linelength-container.js +7 -15
- package/lib/components/linelength-container/linelength-container.styles.d.ts.map +1 -1
- package/lib/components/link/link.js +33 -228
- package/lib/components/link/link.styles.d.ts.map +1 -1
- package/lib/components/link-list/link-list.js +23 -129
- package/lib/components/link-list/link-list.styles.d.ts.map +1 -1
- package/lib/components/link-list-item/link-list-item.js +19 -80
- package/lib/components/link-list-item/link-list-item.styles.d.ts.map +1 -1
- package/lib/components/list/list.js +17 -67
- package/lib/components/list/list.styles.d.ts.map +1 -1
- package/lib/components/list-item/list-item.js +11 -16
- package/lib/components/list-item/list-item.styles.d.ts.map +1 -1
- package/lib/components/loading-spinner/loading-spinner.js +13 -157
- package/lib/components/loading-spinner/loading-spinner.styles.d.ts.map +1 -1
- package/lib/components/logo/logo.js +20 -30
- package/lib/components/logo/logo.styles.d.ts.map +1 -1
- package/lib/components/main/main.js +18 -42
- package/lib/components/main/main.styles.d.ts.map +1 -1
- package/lib/components/modal/modal.js +50 -215
- package/lib/components/modal/modal.styles.d.ts.map +1 -1
- package/lib/components/multi-select/multi-select.js +57 -222
- package/lib/components/multi-select/multi-select.styles.d.ts.map +1 -1
- package/lib/components/nav-container/nav-container.js +5 -40
- package/lib/components/nav-container/nav-container.styles.d.ts.map +1 -1
- package/lib/components/page-header/page-header.js +19 -54
- package/lib/components/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/pagination/page-counter/page-counter.styles.d.ts.map +1 -1
- package/lib/components/pagination/pagination.js +102 -183
- package/lib/components/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/percent-bar/percent-bar.js +22 -50
- package/lib/components/percent-bar/percent-bar.styles.d.ts.map +1 -1
- package/lib/components/popover/popover.js +51 -220
- package/lib/components/popover/popover.styles.d.ts.map +1 -1
- package/lib/components/primary-nav/primary-nav.js +17 -51
- package/lib/components/primary-nav/primary-nav.styles.d.ts.map +1 -1
- package/lib/components/primary-nav-item/primary-nav-item.js +24 -191
- package/lib/components/primary-nav-item/primary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/progress-meter/progress-meter.js +23 -127
- package/lib/components/progress-meter/progress-meter.styles.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.styles.d.ts.map +1 -1
- package/lib/components/progress-steps-item/progress-steps-item.js +27 -118
- package/lib/components/progress-steps-item/progress-steps-item.styles.d.ts.map +1 -1
- package/lib/components/radio-field/radio-field.js +28 -64
- package/lib/components/radio-field/radio-field.styles.d.ts.map +1 -1
- package/lib/components/radio-field-item/radio-field-item.d.ts +0 -4
- package/lib/components/radio-field-item/radio-field-item.d.ts.map +1 -1
- package/lib/components/radio-field-item/radio-field-item.js +69 -207
- package/lib/components/radio-field-item/radio-field-item.styles.d.ts.map +1 -1
- package/lib/components/remove-tag/remove-tag.js +36 -129
- package/lib/components/remove-tag/remove-tag.styles.d.ts.map +1 -1
- package/lib/components/section/section.js +19 -50
- package/lib/components/section/section.styles.d.ts.map +1 -1
- package/lib/components/select/select.d.ts +6 -10
- package/lib/components/select/select.d.ts.map +1 -1
- package/lib/components/select/select.js +67 -135
- package/lib/components/select/select.styles.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.d.ts +0 -4
- package/lib/components/select-tile/select-tile.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.js +21 -448
- package/lib/components/select-tile/select-tile.styles.d.ts.map +1 -1
- package/lib/components/select-tile-list/select-tile-list.js +24 -62
- package/lib/components/select-tile-list/select-tile-list.styles.d.ts.map +1 -1
- package/lib/components/skeleton-loader/skeleton-loader.js +19 -73
- package/lib/components/skeleton-loader/skeleton-loader.styles.d.ts.map +1 -1
- package/lib/components/split-button/split-button.js +21 -37
- package/lib/components/split-button/split-button.styles.d.ts.map +1 -1
- package/lib/components/submenu/submenu.js +8 -18
- package/lib/components/submenu/submenu.styles.d.ts.map +1 -1
- package/lib/components/submenu-item/submenu-item.js +21 -42
- package/lib/components/submenu-item/submenu-item.styles.d.ts.map +1 -1
- package/lib/components/tab/tab.js +17 -100
- package/lib/components/tab/tab.styles.d.ts.map +1 -1
- package/lib/components/tab-panel/tab-panel.js +18 -52
- package/lib/components/tab-panel/tab-panel.styles.d.ts.map +1 -1
- package/lib/components/table/table.js +21 -73
- package/lib/components/table/table.styles.d.ts.map +1 -1
- package/lib/components/table-body/table-body.js +12 -24
- package/lib/components/table-body/table-body.styles.d.ts.map +1 -1
- package/lib/components/table-cell/table-cell.js +29 -69
- package/lib/components/table-cell/table-cell.styles.d.ts.map +1 -1
- package/lib/components/table-header/table-header.js +8 -39
- package/lib/components/table-header/table-header.styles.d.ts.map +1 -1
- package/lib/components/table-header-cell/table-header-cell.js +18 -37
- package/lib/components/table-header-cell/table-header-cell.styles.d.ts.map +1 -1
- package/lib/components/table-object/table-object.js +13 -32
- package/lib/components/table-object/table-object.styles.d.ts.map +1 -1
- package/lib/components/table-row/table-row.js +33 -139
- package/lib/components/table-row/table-row.styles.d.ts.map +1 -1
- package/lib/components/tabs/tabs.d.ts.map +1 -1
- package/lib/components/tabs/tabs.js +58 -159
- package/lib/components/tabs/tabs.styles.d.ts.map +1 -1
- package/lib/components/tag/tag.js +46 -161
- package/lib/components/tag/tag.styles.d.ts.map +1 -1
- package/lib/components/tag-list/tag-list.js +20 -51
- package/lib/components/tag-list/tag-list.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav/tertiary-nav.js +21 -54
- package/lib/components/tertiary-nav/tertiary-nav.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +18 -68
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/text-link/text-link.js +20 -85
- package/lib/components/text-link/text-link.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage-light-dom.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage.js +17 -189
- package/lib/components/text-passage/text-passage.styles.d.ts.map +1 -1
- package/lib/components/tooltip/tooltip.js +57 -248
- package/lib/components/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/utility-nav/utility-nav.js +23 -56
- package/lib/components/utility-nav/utility-nav.styles.d.ts.map +1 -1
- package/lib/components/utility-nav-item/utility-nav-item.js +28 -83
- package/lib/components/utility-nav-item/utility-nav-item.styles.d.ts.map +1 -1
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.d.ts.map +1 -1
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts +3 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts +2 -2
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.d.ts.map +1 -1
- package/lib/design-tokens/core/scss/theming/component.scss +6 -6
- package/lib/design-tokens/core/scss/theming/functions.scss +4 -0
- package/lib/design-tokens/core/scss/theming/spacing.scss +60 -60
- package/lib/design-tokens/core/scss/theming/variables.scss +11 -11
- package/lib/design-tokens/mixins/typography-usage.scss +277 -277
- package/lib/design-tokens/tokens_netflix.theme.d.ts.map +1 -1
- package/lib/{icon-DImqxDiW.js → icon-D22g8aWB.js} +35 -138
- package/lib/index.js +1 -1
- package/package.json +12 -5
|
@@ -1,93 +1,25 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { css as
|
|
3
|
-
import { ifDefined as
|
|
4
|
-
import { property as
|
|
5
|
-
import { nanoid as
|
|
6
|
-
import { Cre8FormElement as v } from "../cre8-form-element.js";
|
|
1
|
+
import { a as f } from "../../icon-D22g8aWB.js";
|
|
2
|
+
import { css as m, html as o, nothing as b } from "lit";
|
|
3
|
+
import { ifDefined as u } from "lit-html/directives/if-defined.js";
|
|
4
|
+
import { property as i, queryAll as y } from "lit/decorators.js";
|
|
5
|
+
import { nanoid as d } from "nanoid";
|
|
7
6
|
import "../field-note/field-note.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Select Label
|
|
20
|
-
*/
|
|
21
|
-
.cre8-c-select__label {
|
|
22
|
-
@include label-styles;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Select Body
|
|
27
|
-
* 1) The div that contains the input and icons
|
|
28
|
-
*/
|
|
29
|
-
.cre8-c-select__body {
|
|
30
|
-
position: relative;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Select Input
|
|
35
|
-
* 1) The html5 select element
|
|
36
|
-
*/
|
|
37
|
-
.cre8-c-select__input {
|
|
38
|
-
@include input-styles;
|
|
39
|
-
padding-inline-end: calc(8px * 5.5);
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Select Icon
|
|
45
|
-
* 1) The icons within the body container positioned absolutely over the input
|
|
46
|
-
*/
|
|
47
|
-
.cre8-c-select__icons {
|
|
48
|
-
position: absolute;
|
|
49
|
-
inset-block-start: 50%;
|
|
50
|
-
transform: translateY(-50%);
|
|
51
|
-
inset-inline-end: calc(8px * 1);
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: flex-end;
|
|
55
|
-
gap: calc(8px * 1);
|
|
56
|
-
pointer-events: none;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Select Arrow Icon
|
|
61
|
-
*/
|
|
62
|
-
.cre8-c-select__icon-arrow {
|
|
63
|
-
margin-right: calc(8px * 0.75);
|
|
64
|
-
width: calc(8px * 1.5);
|
|
65
|
-
height: calc(8px * 1.5);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Select field notes
|
|
70
|
-
*/
|
|
71
|
-
.cre8-c-select__field-note,
|
|
72
|
-
.cre8-c-select__field-note-success,
|
|
73
|
-
.cre8-c-select__field-note-error {
|
|
74
|
-
flex-basis: 100%;
|
|
75
|
-
}
|
|
76
|
-
`;
|
|
77
|
-
var N = Object.defineProperty, i = (p, t, r, c) => {
|
|
78
|
-
for (var l = void 0, a = p.length - 1, h; a >= 0; a--)
|
|
79
|
-
(h = p[a]) && (l = h(t, r, l) || l);
|
|
80
|
-
return l && N(t, r, l), l;
|
|
7
|
+
import { Cre8FormElement as v } from "../cre8-form-element.js";
|
|
8
|
+
const _ = m`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:inline-flex;flex-wrap:wrap}.cre8-c-select__label{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform);display:block;margin-bottom:0.5rem}.cre8-c-select__body{position:relative}.cre8-c-select__input{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);outline:var(--cre8-border-width-focus) solid rgba(0,0,0,0);outline-offset:0.125rem;-webkit-appearance:none;width:100%;border-width:var(--cre8-border-width-default);border-style:solid;border-color:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.75rem 0.5rem;color:var(--cre8-color-content-default);background-color:var(--cre8-color-bg-default);transition:outline-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),border-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),background-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),color var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-select__input:hover:not(:disabled),.cre8-c-select__input:focus:not(:disabled),.cre8-c-select__input:active:not(:disabled),.cre8-c-select__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-select__input:hover:not(:disabled),.cre8-is-error .cre8-c-select__input:focus:not(:disabled),.cre8-is-error .cre8-c-select__input:active:not(:disabled),.cre8-is-error .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input:hover:not(:disabled),.cre8-is-success .cre8-c-select__input:focus:not(:disabled),.cre8-is-success .cre8-c-select__input:active:not(:disabled),.cre8-is-success .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-select__input:disabled{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed}.cre8-c-select__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-select__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-select__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input{border-color:var(--cre8-color-border-success)}.cre8-c-select__input{padding-inline-end:2.75rem;cursor:pointer}.cre8-c-select__icons{position:absolute;inset-block-start:50%;transform:translateY(-50%);inset-inline-end:0.5rem;display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;pointer-events:none}.cre8-c-select__icon-arrow{margin-right:0.375rem;width:0.75rem;height:0.75rem}.cre8-c-select__field-note,.cre8-c-select__field-note-success,.cre8-c-select__field-note-error{flex-basis:100%}`;
|
|
9
|
+
var g = Object.defineProperty, t = (p, r, s, c) => {
|
|
10
|
+
for (var a = void 0, l = p.length - 1, h; l >= 0; l--)
|
|
11
|
+
(h = p[l]) && (a = h(r, s, a) || a);
|
|
12
|
+
return a && g(r, s, a), a;
|
|
81
13
|
};
|
|
82
|
-
const
|
|
14
|
+
const n = class n extends v {
|
|
83
15
|
constructor() {
|
|
84
|
-
super(...arguments), this.type = "select", this.items = [], this.label = "Label";
|
|
16
|
+
super(...arguments), this.type = "select", this.items = [], this.label = "Label", this.required = !1;
|
|
85
17
|
}
|
|
86
18
|
/**
|
|
87
19
|
* Initialize aria attributes
|
|
88
20
|
*/
|
|
89
21
|
_initializeAria() {
|
|
90
|
-
this.fieldId = this.fieldId ||
|
|
22
|
+
this.fieldId = this.fieldId || d(), (this.fieldNote || this.slotNotEmpty("fieldNote")) && (this.ariaDescribedBy = this.ariaDescribedBy || d()), (this.successNote || this.errorNote) && (this.validationAriaDescribedBy = this.validationAriaDescribedBy || d());
|
|
91
23
|
}
|
|
92
24
|
/**
|
|
93
25
|
* Aria describedby string based on field notes and error/success notes
|
|
@@ -100,6 +32,12 @@ const d = class d extends v {
|
|
|
100
32
|
_fieldNoteAria() {
|
|
101
33
|
return this.validationAriaDescribedBy && this.ariaDescribedBy ? `${this.ariaDescribedBy} ${this.validationAriaDescribedBy}` : this.validationAriaDescribedBy && !this.ariaDescribedBy ? this.validationAriaDescribedBy : this.ariaDescribedBy;
|
|
102
34
|
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback(), this.field.setAttribute("name", this.name ?? "");
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
}
|
|
103
41
|
/**
|
|
104
42
|
* First updatedLifecycle
|
|
105
43
|
* 1) Get the option in the items array with selected set to true. Set that as the selected item
|
|
@@ -107,9 +45,9 @@ const d = class d extends v {
|
|
|
107
45
|
* select the first item value like the native select.
|
|
108
46
|
*/
|
|
109
47
|
firstUpdated() {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}), this.defaultValue = this.selectedItem ? this.selectedItem : this._selectOptions[0].value, this._setFormData(), this._initializeAria(), this.updateField();
|
|
48
|
+
super.firstUpdated(), [...this._selectOptions].forEach((r) => {
|
|
49
|
+
r.selected === !0 && (this.selectedItem = r.value);
|
|
50
|
+
}), this.defaultValue = this.selectedItem ? this.selectedItem : this._selectOptions[0].value ?? "Select An Option", this._setFormData(), this._initializeAria(), this.updateField();
|
|
113
51
|
}
|
|
114
52
|
/**
|
|
115
53
|
* Set form data
|
|
@@ -117,16 +55,16 @@ const d = class d extends v {
|
|
|
117
55
|
* otherwise the default selected item is the first one
|
|
118
56
|
*/
|
|
119
57
|
_setFormData() {
|
|
120
|
-
return this.selectedItem ? this.
|
|
58
|
+
return this.selectedItem ? this._internals?.setFormValue(this.selectedItem) : this._internals?.setFormValue(this.defaultValue.toString());
|
|
121
59
|
}
|
|
122
60
|
/**
|
|
123
61
|
* Handle On Change
|
|
124
62
|
* 1. Set the value when the select is changed.
|
|
125
63
|
* 2. Fire the custom event with the current value.
|
|
126
64
|
*/
|
|
127
|
-
_handleOnChange(
|
|
128
|
-
const
|
|
129
|
-
this.value =
|
|
65
|
+
_handleOnChange(r) {
|
|
66
|
+
const s = r.target;
|
|
67
|
+
this.value = s.options[s.selectedIndex].value, this._internals.setFormValue(this.value);
|
|
130
68
|
const c = new CustomEvent("change", {
|
|
131
69
|
detail: {
|
|
132
70
|
name: this.name,
|
|
@@ -141,16 +79,16 @@ const d = class d extends v {
|
|
|
141
79
|
* Render the select options
|
|
142
80
|
*/
|
|
143
81
|
_renderSelectOptions() {
|
|
144
|
-
return this.items.map((
|
|
145
|
-
if ("options" in
|
|
146
|
-
const
|
|
82
|
+
return this.items.map((r) => {
|
|
83
|
+
if ("options" in r) {
|
|
84
|
+
const s = r.options.map((c) => o`
|
|
147
85
|
<option value="${c.value}">${c.label}</option>
|
|
148
86
|
`);
|
|
149
|
-
return o`<optgroup label="${
|
|
150
|
-
${
|
|
87
|
+
return o`<optgroup label="${r.optGroupLabel}">
|
|
88
|
+
${s}
|
|
151
89
|
</optgroup>`;
|
|
152
90
|
}
|
|
153
|
-
return o`<option value="${
|
|
91
|
+
return o`<option value="${r.value}">${r.label}</option>`;
|
|
154
92
|
});
|
|
155
93
|
}
|
|
156
94
|
/**
|
|
@@ -178,27 +116,27 @@ const d = class d extends v {
|
|
|
178
116
|
</cre8-field-note>` : null;
|
|
179
117
|
}
|
|
180
118
|
render() {
|
|
181
|
-
const
|
|
119
|
+
const r = this.componentClassNames("cre8-c-select", {
|
|
182
120
|
"cre8-is-error": this.isError,
|
|
183
121
|
"cre8-is-success": this.isSuccess
|
|
184
122
|
});
|
|
185
123
|
return o`
|
|
186
|
-
<div class="${
|
|
124
|
+
<div class="${r}">
|
|
187
125
|
<label class="cre8-c-select__label" for="${this.fieldId}">${this.label}</label>
|
|
188
126
|
<div class="cre8-c-select__body">
|
|
189
127
|
<select
|
|
190
128
|
class="cre8-c-select__input"
|
|
191
129
|
id=${this.fieldId}
|
|
192
|
-
name=${this.name}
|
|
130
|
+
name=${u(this.name)}
|
|
193
131
|
?required=${this.required}
|
|
194
132
|
?disabled=${this.disabled}
|
|
195
|
-
aria-describedby="${
|
|
133
|
+
aria-describedby="${u(this._fieldNoteAria())}"
|
|
196
134
|
@change=${this._handleOnChange}
|
|
197
135
|
>
|
|
198
136
|
${this._renderSelectOptions()}
|
|
199
137
|
</select>
|
|
200
138
|
<div class="cre8-c-select__icons">
|
|
201
|
-
<cre8-icon svg='${
|
|
139
|
+
<cre8-icon svg='${f}' rotate="180" class="cre8-c-select__icon-arrow" aria-hidden='true'>
|
|
202
140
|
</div>
|
|
203
141
|
</div>
|
|
204
142
|
</div>
|
|
@@ -206,57 +144,51 @@ const d = class d extends v {
|
|
|
206
144
|
<cre8-field-note
|
|
207
145
|
id=${this.ariaDescribedBy}
|
|
208
146
|
class="cre8-c-select__field-note"
|
|
209
|
-
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note>` :
|
|
147
|
+
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note>` : b}
|
|
210
148
|
${this._renderSuccessErrorFieldNote()}
|
|
211
149
|
`;
|
|
212
150
|
}
|
|
213
151
|
};
|
|
214
|
-
|
|
215
|
-
let e =
|
|
216
|
-
|
|
217
|
-
|
|
152
|
+
n.styles = [_];
|
|
153
|
+
let e = n;
|
|
154
|
+
t([
|
|
155
|
+
i({ type: Array })
|
|
218
156
|
], e.prototype, "items");
|
|
219
|
-
|
|
220
|
-
|
|
157
|
+
t([
|
|
158
|
+
i()
|
|
221
159
|
], e.prototype, "label");
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
], e.prototype, "name");
|
|
225
|
-
i([
|
|
226
|
-
s()
|
|
160
|
+
t([
|
|
161
|
+
i()
|
|
227
162
|
], e.prototype, "fieldId");
|
|
228
|
-
|
|
229
|
-
|
|
163
|
+
t([
|
|
164
|
+
i()
|
|
230
165
|
], e.prototype, "fieldNote");
|
|
231
|
-
|
|
232
|
-
|
|
166
|
+
t([
|
|
167
|
+
i()
|
|
233
168
|
], e.prototype, "ariaDescribedBy");
|
|
234
|
-
|
|
235
|
-
|
|
169
|
+
t([
|
|
170
|
+
i()
|
|
236
171
|
], e.prototype, "validationAriaDescribedBy");
|
|
237
|
-
|
|
238
|
-
|
|
172
|
+
t([
|
|
173
|
+
i({ type: Boolean, reflect: !0 })
|
|
239
174
|
], e.prototype, "required");
|
|
240
|
-
|
|
241
|
-
|
|
175
|
+
t([
|
|
176
|
+
i({ type: Boolean, reflect: !0 })
|
|
242
177
|
], e.prototype, "disabled");
|
|
243
|
-
|
|
244
|
-
|
|
178
|
+
t([
|
|
179
|
+
i({ type: Boolean, reflect: !0 })
|
|
245
180
|
], e.prototype, "isError");
|
|
246
|
-
|
|
247
|
-
|
|
181
|
+
t([
|
|
182
|
+
i()
|
|
248
183
|
], e.prototype, "errorNote");
|
|
249
|
-
|
|
250
|
-
|
|
184
|
+
t([
|
|
185
|
+
i({ type: Boolean, reflect: !0 })
|
|
251
186
|
], e.prototype, "isSuccess");
|
|
252
|
-
|
|
253
|
-
|
|
187
|
+
t([
|
|
188
|
+
i()
|
|
254
189
|
], e.prototype, "successNote");
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
], e.prototype, "field");
|
|
258
|
-
i([
|
|
259
|
-
b("option")
|
|
190
|
+
t([
|
|
191
|
+
y("option")
|
|
260
192
|
], e.prototype, "_selectOptions");
|
|
261
193
|
customElements.get("cre8-select") === void 0 && customElements.define("cre8-select", e);
|
|
262
194
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.styles.d.ts","sourceRoot":"","sources":["../../../components/select/select.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"select.styles.d.ts","sourceRoot":"","sources":["../../../components/select/select.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,yBAAkhK,CAAC;AAC/hK,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-tile.d.ts","sourceRoot":"","sources":["../../../components/select-tile/select-tile.ts"],"names":[],"mappings":"AACA,OAAO,EACS,cAAc,EAC7B,MAAM,KAAK,CAAC;AAKb,OAAO,EAAE,eAAe,EAAE,MA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