@redvars/peacock 3.2.6 → 3.2.8

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.
Files changed (123) hide show
  1. package/dist/PeacockComponent-DMrFEGDh.js +80 -0
  2. package/dist/PeacockComponent-DMrFEGDh.js.map +1 -0
  3. package/dist/assets/components.css +2 -0
  4. package/dist/assets/components.css.map +1 -0
  5. package/dist/assets/styles.css +2 -0
  6. package/dist/assets/styles.css.map +1 -0
  7. package/dist/breadcrumb-item-DkhwoMAH.js +6879 -0
  8. package/dist/breadcrumb-item-DkhwoMAH.js.map +1 -0
  9. package/dist/button-BtpAXuLN.js +1180 -0
  10. package/dist/button-BtpAXuLN.js.map +1 -0
  11. package/dist/button-group.js +7 -6
  12. package/dist/button-group.js.map +1 -1
  13. package/dist/button.js +5 -0
  14. package/dist/button.js.map +1 -0
  15. package/dist/{class-map-BmCohX9p.js → class-map-CbncA34D.js} +2 -3
  16. package/dist/class-map-CbncA34D.js.map +1 -0
  17. package/dist/code-highlighter.js +9 -8
  18. package/dist/code-highlighter.js.map +1 -1
  19. package/dist/custom-elements-jsdocs.json +4 -4
  20. package/dist/custom-elements.json +296 -154
  21. package/dist/index.js +87 -35
  22. package/dist/index.js.map +1 -1
  23. package/dist/number-counter.js +7 -6
  24. package/dist/number-counter.js.map +1 -1
  25. package/dist/peacock-loader.js +1006 -535
  26. package/dist/peacock-loader.js.map +1 -1
  27. package/dist/src/CssLoader.d.ts +5 -0
  28. package/dist/src/PeacockComponent.d.ts +1 -0
  29. package/dist/src/avatar/avatar.d.ts +1 -1
  30. package/dist/src/button/button/button.d.ts +1 -1
  31. package/dist/{state-CV1fRmOT.js → state-CEVpI7Vv.js} +2 -2
  32. package/dist/{state-CV1fRmOT.js.map → state-CEVpI7Vv.js.map} +1 -1
  33. package/dist/{style-map-CdmclYgz.js → style-map-mOmZwsJT.js} +2 -3
  34. package/dist/style-map-mOmZwsJT.js.map +1 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/dist/{unsafe-html-BS8X6Gto.js → unsafe-html-Ca00SXpn.js} +2 -3
  37. package/dist/unsafe-html-Ca00SXpn.js.map +1 -0
  38. package/package.json +11 -5
  39. package/readme.md +2 -1
  40. package/scss/components.scss +3 -0
  41. package/scss/styles.scss +4 -0
  42. package/src/CssLoader.ts +66 -0
  43. package/src/PeacockComponent.ts +3 -0
  44. package/src/avatar/avatar.ts +1 -1
  45. package/src/button/button/button.ts +4 -2
  46. package/src/button/button-group/button-group.ts +2 -0
  47. package/src/code-highlighter/code-highlighter.ts +2 -0
  48. package/src/number-counter/number-counter.ts +2 -0
  49. package/src/peacock-loader.ts +14 -9
  50. package/dist/BaseButton.js +0 -209
  51. package/dist/BaseButton.js.map +0 -1
  52. package/dist/BaseInput.js +0 -27
  53. package/dist/BaseInput.js.map +0 -1
  54. package/dist/accordion-item.js +0 -191
  55. package/dist/accordion-item.js.map +0 -1
  56. package/dist/accordion.js +0 -142
  57. package/dist/accordion.js.map +0 -1
  58. package/dist/avatar.js +0 -106
  59. package/dist/avatar.js.map +0 -1
  60. package/dist/badge.js +0 -84
  61. package/dist/badge.js.map +0 -1
  62. package/dist/base-progress.js +0 -33
  63. package/dist/base-progress.js.map +0 -1
  64. package/dist/breadcrumb-item.js +0 -160
  65. package/dist/breadcrumb-item.js.map +0 -1
  66. package/dist/breadcrumb.js +0 -84
  67. package/dist/breadcrumb.js.map +0 -1
  68. package/dist/checkbox.js +0 -530
  69. package/dist/checkbox.js.map +0 -1
  70. package/dist/chip.js +0 -303
  71. package/dist/chip.js.map +0 -1
  72. package/dist/class-map-BmCohX9p.js.map +0 -1
  73. package/dist/clock.js +0 -83
  74. package/dist/clock.js.map +0 -1
  75. package/dist/container.js +0 -135
  76. package/dist/container.js.map +0 -1
  77. package/dist/directive-Cuw6h7YA.js +0 -9
  78. package/dist/directive-Cuw6h7YA.js.map +0 -1
  79. package/dist/divider.js +0 -126
  80. package/dist/divider.js.map +0 -1
  81. package/dist/elevation.js +0 -79
  82. package/dist/elevation.js.map +0 -1
  83. package/dist/empty-state.js +0 -171
  84. package/dist/empty-state.js.map +0 -1
  85. package/dist/field.js +0 -416
  86. package/dist/field.js.map +0 -1
  87. package/dist/focus-ring.js +0 -107
  88. package/dist/focus-ring.js.map +0 -1
  89. package/dist/icon.js +0 -183
  90. package/dist/icon.js.map +0 -1
  91. package/dist/link.js +0 -91
  92. package/dist/link.js.map +0 -1
  93. package/dist/lit-element-CA46RFZ_.js +0 -28
  94. package/dist/lit-element-CA46RFZ_.js.map +0 -1
  95. package/dist/menu-item.js +0 -232
  96. package/dist/menu-item.js.map +0 -1
  97. package/dist/menu-list.js +0 -108
  98. package/dist/menu-list.js.map +0 -1
  99. package/dist/menu.js +0 -117
  100. package/dist/menu.js.map +0 -1
  101. package/dist/property-DNVWDdPC.js +0 -45
  102. package/dist/property-DNVWDdPC.js.map +0 -1
  103. package/dist/query-QBcUV-L_.js +0 -15
  104. package/dist/query-QBcUV-L_.js.map +0 -1
  105. package/dist/ripple.js +0 -128
  106. package/dist/ripple.js.map +0 -1
  107. package/dist/skeleton.js +0 -113
  108. package/dist/skeleton.js.map +0 -1
  109. package/dist/spinner.js +0 -93
  110. package/dist/spinner.js.map +0 -1
  111. package/dist/spread-axRTFMoH.js +0 -32
  112. package/dist/spread-axRTFMoH.js.map +0 -1
  113. package/dist/style-map-CdmclYgz.js.map +0 -1
  114. package/dist/switch-CC-S5fbc.js +0 -2738
  115. package/dist/switch-CC-S5fbc.js.map +0 -1
  116. package/dist/tag.js +0 -323
  117. package/dist/tag.js.map +0 -1
  118. package/dist/tooltip.js +0 -1857
  119. package/dist/tooltip.js.map +0 -1
  120. package/dist/unsafe-html-BS8X6Gto.js.map +0 -1
  121. package/dist/utils.js +0 -277
  122. package/dist/utils.js.map +0 -1
  123. /package/{dist/assets/styles → scss}/tokens.css +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"divider.js","sources":["../../src/divider/divider.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './divider.scss';\nimport { observerSlotChangesWithCallback } from '../utils.js';\n\n/**\n * @label Divider\n * @tag base-divider\n * @rawTag divider\n *\n * @summary The divider component is used to visually separate content.\n * @overview\n * - Dividers are used to separate content into clear groups, making it easier for users to scan and understand the information presented.\n * - They can be oriented either vertically or horizontally, depending on the layout requirements.\n *\n * @cssprop --divider-color - Controls the color of the divider.\n * @cssprop --divider-padding - Controls the padding of the divider.\n *\n * @example\n * ```html\n * <base-divider style=\"width: 12rem;\">or</base-divider>\n * ```\n * @tags display\n */\nexport class Divider extends LitElement {\n static styles = [styles];\n\n @property({ type: Boolean, reflect: true }) vertical = false;\n\n @state()\n slotHasContent = false;\n\n firstUpdated() {\n observerSlotChangesWithCallback(\n this.renderRoot.querySelector('slot'),\n hasContent => {\n this.slotHasContent = hasContent;\n this.requestUpdate();\n },\n );\n }\n\n render() {\n return html`<div\n class=${classMap({\n divider: true,\n vertical: this.vertical,\n 'slot-has-content': this.slotHasContent,\n })}\n >\n <div class=\"line\"></div>\n <div class=\"slot-container\">\n <slot></slot>\n </div>\n <div class=\"line\"></div>\n </div>`;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;AAkBG;AACG,MAAO,OAAQ,SAAQA,GAAU,CAAA;AAAvC,IAAA,WAAA,GAAA;;QAG8C,IAAA,CAAA,QAAQ,GAAG,KAAK;QAG5D,IAAA,CAAA,cAAc,GAAG,KAAK;IA2BxB;IAzBE,YAAY,GAAA;AACV,QAAA,+BAA+B,CAC7B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,EACrC,UAAU,IAAG;AACX,YAAA,IAAI,CAAC,cAAc,GAAG,UAAU;YAChC,IAAI,CAAC,aAAa,EAAE;AACtB,QAAA,CAAC,CACF;IACH;IAEA,MAAM,GAAA;AACJ,QAAA,OAAOC,CAAI,CAAA,CAAA;AACD,YAAA,EAAAC,CAAQ,CAAC;AACf,YAAA,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,kBAAkB,EAAE,IAAI,CAAC,cAAc;SACxC,CAAC;;;;;;;WAOG;IACT;;AA/BO,OAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAEoB,UAAA,CAAA;IAA3CC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAmB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG7D,UAAA,CAAA;AADC,IAAAC,CAAK;AACiB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;;;;"}
package/dist/elevation.js DELETED
@@ -1,79 +0,0 @@
1
- import { i, a as i$1, b } from './lit-element-CA46RFZ_.js';
2
-
3
- var css_248z = i`/**
4
- * Derived from Material Design Elevation
5
- * https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
6
- */
7
- :host,
8
- .shadow,
9
- .shadow::before,
10
- .shadow::after {
11
- border-start-start-radius: var(--elevation-container-shape-start-start, var(--elevation-container-shape));
12
- border-start-end-radius: var(--elevation-container-shape-start-end, var(--elevation-container-shape));
13
- border-end-start-radius: var(--elevation-container-shape-end-start, var(--elevation-container-shape));
14
- border-end-end-radius: var(--elevation-container-shape-end-end, var(--elevation-container-shape));
15
- corner-shape: var(--elevation-container-shape-variant);
16
- inset: 0;
17
- position: absolute;
18
- transition-duration: inherit;
19
- transition-property: inherit;
20
- transition-timing-function: inherit;
21
- }
22
-
23
- :host {
24
- display: flex;
25
- pointer-events: none;
26
- transition-property: box-shadow, opacity;
27
- --elevation-level: 0;
28
- --elevation-color: var(--elevation-color-default, black);
29
- }
30
-
31
- .shadow::before,
32
- .shadow::after {
33
- content: "";
34
- transition-property: box-shadow, opacity;
35
- --_level: var(--elevation-level);
36
- --_shadow-color: var(--elevation-color);
37
- }
38
-
39
- .shadow::before {
40
- box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 3, 1) + 2 * clamp(0, var(--_level) - 4, 1))) calc(1px * (2 * clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 2, 1) + clamp(0, var(--_level) - 4, 1))) 0 var(--_shadow-color);
41
- opacity: 0.3;
42
- }
43
-
44
- .shadow::after {
45
- box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 1, 1) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (3 * clamp(0, var(--_level), 2) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (clamp(0, var(--_level), 4) + 2 * clamp(0, var(--_level) - 4, 1))) var(--_shadow-color);
46
- opacity: 0.15;
47
- }`;
48
-
49
- /**
50
- * @label Elevation
51
- * @tag base-elevation
52
- * @rawTag elevation
53
- *
54
- * @summary Adds elevation to an element.
55
- * @overview
56
- * - Elevation adds a shadow effect to an element to give it depth.
57
- * - It can be used to create a sense of hierarchy or to draw attention to a particular element.
58
- *
59
- * @cssprop --elevation-level - Controls the elevation level of the shadow.
60
- * @cssprop --elevation-color - Controls the color of the shadow.
61
- *
62
- * @example
63
- * ```html
64
- * <div style="position: relative; padding: var(--spacing-200);">
65
- * <base-elevation style='--elevation-level: 2; --elevation-container-shape: var(--shape-corner-extra-small);'></base-elevation>
66
- * Level 2
67
- * </div>
68
- * ```
69
- * @tags display
70
- */
71
- class Elevation extends i$1 {
72
- render() {
73
- return b `<span class="shadow"></span>`;
74
- }
75
- }
76
- Elevation.styles = [css_248z];
77
-
78
- export { Elevation };
79
- //# sourceMappingURL=elevation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elevation.js","sources":["../../src/elevation/elevation.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport styles from './elevation.scss';\n\n/**\n * @label Elevation\n * @tag base-elevation\n * @rawTag elevation\n *\n * @summary Adds elevation to an element.\n * @overview\n * - Elevation adds a shadow effect to an element to give it depth.\n * - It can be used to create a sense of hierarchy or to draw attention to a particular element.\n *\n * @cssprop --elevation-level - Controls the elevation level of the shadow.\n * @cssprop --elevation-color - Controls the color of the shadow.\n *\n * @example\n * ```html\n * <div style=\"position: relative; padding: var(--spacing-200);\">\n * <base-elevation style='--elevation-level: 2; --elevation-container-shape: var(--shape-corner-extra-small);'></base-elevation>\n * Level 2\n * </div>\n * ```\n * @tags display\n */\nexport class Elevation extends LitElement {\n static styles = [styles];\n\n render() {\n return html`<span class=\"shadow\"></span>`;\n }\n}\n"],"names":["LitElement","html","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACG,MAAO,SAAU,SAAQA,GAAU,CAAA;IAGvC,MAAM,GAAA;QACJ,OAAOC,CAAI,CAAA,CAAA,4BAAA,CAA8B;IAC3C;;AAJO,SAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;;;;"}
@@ -1,171 +0,0 @@
1
- import { _ as __decorate, n } from './property-DNVWDdPC.js';
2
- import { i, a as i$1, A, b } from './lit-element-CA46RFZ_.js';
3
- import { r } from './state-CV1fRmOT.js';
4
- import { e } from './class-map-BmCohX9p.js';
5
- import './directive-Cuw6h7YA.js';
6
-
7
- var css_248z = i`* {
8
- box-sizing: border-box;
9
- }
10
-
11
- .screen-reader-only {
12
- display: none !important;
13
- }
14
-
15
- :host {
16
- display: block;
17
- }
18
-
19
- .empty-state {
20
- container: emptystate/inline-size;
21
- padding: var(--spacing-100);
22
- height: 100%;
23
- max-width: var(--container-lg);
24
- margin: auto;
25
- }
26
-
27
- .empty-state-container {
28
- display: flex;
29
- height: 100%;
30
- justify-content: center;
31
- gap: var(--spacing-500);
32
- align-items: center;
33
- }
34
-
35
- .illustration {
36
- height: 100%;
37
- display: flex;
38
- }
39
- .illustration base-icon {
40
- --icon-size: 100%;
41
- }
42
-
43
- .content {
44
- display: flex;
45
- flex-direction: column;
46
- justify-content: center;
47
- }
48
- .content .title {
49
- font-family: var(--typography-headline-medium-emphasized-font-family) !important;
50
- font-size: var(--typography-headline-medium-emphasized-font-size) !important;
51
- font-weight: var(--typography-headline-medium-emphasized-font-weight) !important;
52
- line-height: var(--typography-headline-medium-emphasized-line-height) !important;
53
- letter-spacing: var(--typography-headline-medium-emphasized-letter-spacing) !important;
54
- margin-bottom: var(--spacing-200);
55
- color: var(--color-on-surface);
56
- }
57
- .content .description {
58
- font-family: var(--typography-body-medium-font-family) !important;
59
- font-size: var(--typography-body-medium-font-size) !important;
60
- font-weight: var(--typography-body-medium-font-weight) !important;
61
- line-height: var(--typography-body-medium-line-height) !important;
62
- letter-spacing: var(--typography-body-medium-letter-spacing) !important;
63
- margin-bottom: var(--spacing-400);
64
- color: var(--color-on-surface-variant);
65
- }
66
-
67
- :host(.content-center) .content {
68
- align-items: center;
69
- }
70
-
71
- @container emptystate (min-width: 672px) {
72
- .empty-state .illustration {
73
- width: 50%;
74
- }
75
- .empty-state .content {
76
- width: 50%;
77
- }
78
- }
79
- @container emptystate (max-width: 671px) {
80
- .empty-state .empty-state-container {
81
- flex-direction: column;
82
- gap: var(--spacing-200);
83
- }
84
- .empty-state .empty-state-container .illustration {
85
- height: auto;
86
- width: 100%;
87
- justify-content: center;
88
- }
89
- }`;
90
-
91
- /**
92
- * @label Empty State
93
- * @name empty-state
94
- * @description A message that displays when there is no information to display.
95
- */
96
- class EmptyState extends i$1 {
97
- constructor() {
98
- super(...arguments);
99
- this.illustration = 'no-document';
100
- this.headline = '';
101
- this.description = '';
102
- this.vertical = false;
103
- this.handleResize = () => {
104
- // Logic equivalent to Stencil's clientWidth check
105
- this.vertical = this.offsetWidth < 768;
106
- };
107
- }
108
- connectedCallback() {
109
- // eslint-disable-next-line wc/guard-super-call
110
- super.connectedCallback();
111
- window.addEventListener('resize', this.handleResize);
112
- // Initial check
113
- this.handleResize();
114
- }
115
- disconnectedCallback() {
116
- window.removeEventListener('resize', this.handleResize);
117
- // eslint-disable-next-line wc/guard-super-call
118
- super.disconnectedCallback();
119
- }
120
- __renderTitle() {
121
- if (!this.headline)
122
- return A;
123
- return b `<div class="title">${this.headline}</div>`;
124
- }
125
- __renderDescription() {
126
- if (!this.description)
127
- return A;
128
- return b `<div class="description">${this.description}</div>`;
129
- }
130
- render() {
131
- const classes = {
132
- 'empty-state': true,
133
- vertical: this.vertical,
134
- };
135
- // Resolving asset paths in Lit typically uses import.meta.url or absolute paths
136
- const illustrationPath = new URL(`./assets/images/empty-state/${this.illustration}.svg`, import.meta.url).href;
137
- return b `
138
- <div class="${e(classes)}">
139
- <div class="empty-state-container">
140
- <div class="illustration">
141
- <base-icon src="${illustrationPath}"></base-icon>
142
- </div>
143
-
144
- <div class="content">
145
- ${this.__renderTitle()} ${this.__renderDescription()}
146
- <div class="actions">
147
- <slot name="actions"></slot>
148
- </div>
149
- </div>
150
- </div>
151
- </div>
152
- `;
153
- }
154
- }
155
- // Lit handles styles in a static property for better performance
156
- EmptyState.styles = [css_248z];
157
- __decorate([
158
- n({ type: String, reflect: true })
159
- ], EmptyState.prototype, "illustration", void 0);
160
- __decorate([
161
- n({ type: String, reflect: true })
162
- ], EmptyState.prototype, "headline", void 0);
163
- __decorate([
164
- n({ type: String, reflect: true })
165
- ], EmptyState.prototype, "description", void 0);
166
- __decorate([
167
- r()
168
- ], EmptyState.prototype, "vertical", void 0);
169
-
170
- export { EmptyState };
171
- //# sourceMappingURL=empty-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"empty-state.js","sources":["../../src/empty-state/empty-state.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './empty-state.scss';\n\n/**\n * @label Empty State\n * @name empty-state\n * @description A message that displays when there is no information to display.\n */\nexport class EmptyState extends LitElement {\n // Lit handles styles in a static property for better performance\n static styles = [styles];\n\n @property({ type: String, reflect: true })\n illustration: 'no-document' | 'page' | 'search' = 'no-document';\n\n @property({ type: String, reflect: true })\n headline = '';\n\n @property({ type: String, reflect: true })\n description = '';\n\n @state()\n private vertical = false;\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n window.addEventListener('resize', this.handleResize);\n // Initial check\n this.handleResize();\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n // eslint-disable-next-line wc/guard-super-call\n super.disconnectedCallback();\n }\n\n private handleResize = () => {\n // Logic equivalent to Stencil's clientWidth check\n this.vertical = this.offsetWidth < 768;\n };\n\n __renderTitle() {\n if (!this.headline) return nothing;\n return html`<div class=\"title\">${this.headline}</div>`;\n }\n\n __renderDescription() {\n if (!this.description) return nothing;\n return html`<div class=\"description\">${this.description}</div>`;\n }\n\n protected render() {\n const classes = {\n 'empty-state': true,\n vertical: this.vertical,\n };\n\n // Resolving asset paths in Lit typically uses import.meta.url or absolute paths\n const illustrationPath = new URL(\n `./assets/images/empty-state/${this.illustration}.svg`,\n import.meta.url,\n ).href;\n\n return html`\n <div class=\"${classMap(classes)}\">\n <div class=\"empty-state-container\">\n <div class=\"illustration\">\n <base-icon src=\"${illustrationPath}\"></base-icon>\n </div>\n\n <div class=\"content\">\n ${this.__renderTitle()} ${this.__renderDescription()}\n <div class=\"actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","nothing","html","classMap","styles","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;AAIG;AACG,MAAO,UAAW,SAAQA,GAAU,CAAA;AAA1C,IAAA,WAAA,GAAA;;QAKE,IAAA,CAAA,YAAY,GAAsC,aAAa;QAG/D,IAAA,CAAA,QAAQ,GAAG,EAAE;QAGb,IAAA,CAAA,WAAW,GAAG,EAAE;QAGR,IAAA,CAAA,QAAQ,GAAG,KAAK;QAgBhB,IAAA,CAAA,YAAY,GAAG,MAAK;;YAE1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,GAAG;AACxC,QAAA,CAAC;IAyCH;IA1DE,iBAAiB,GAAA;;QAEf,KAAK,CAAC,iBAAiB,EAAE;QACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC;;QAEpD,IAAI,CAAC,YAAY,EAAE;IACrB;IAEA,oBAAoB,GAAA;QAClB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC;;QAEvD,KAAK,CAAC,oBAAoB,EAAE;IAC9B;IAOA,aAAa,GAAA;QACX,IAAI,CAAC,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAOC,CAAO;AAClC,QAAA,OAAOC,CAAI,CAAA,CAAA,mBAAA,EAAsB,IAAI,CAAC,QAAQ,QAAQ;IACxD;IAEA,mBAAmB,GAAA;QACjB,IAAI,CAAC,IAAI,CAAC,WAAW;AAAE,YAAA,OAAOD,CAAO;AACrC,QAAA,OAAOC,CAAI,CAAA,CAAA,yBAAA,EAA4B,IAAI,CAAC,WAAW,QAAQ;IACjE;IAEU,MAAM,GAAA;AACd,QAAA,MAAM,OAAO,GAAG;AACd,YAAA,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;;AAGD,QAAA,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,CAAA,4BAAA,EAA+B,IAAI,CAAC,YAAY,MAAM,EACtD,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC,IAAI;AAEN,QAAA,OAAOA,CAAI,CAAA;oBACKC,CAAQ,CAAC,OAAO,CAAC,CAAA;;;8BAGP,gBAAgB,CAAA;;;;AAIhC,YAAA,EAAA,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE;;;;;;;KAO3D;IACH;;AAxEA;AACO,UAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAGxB,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACuB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAGhE,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AAC3B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGd,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACxB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGT,UAAA,CAAA;AADP,IAAAC,CAAK;AACmB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;;;;"}
package/dist/field.js DELETED
@@ -1,416 +0,0 @@
1
- import { _ as __decorate, n } from './property-DNVWDdPC.js';
2
- import { i, a as i$1, b, A } from './lit-element-CA46RFZ_.js';
3
- import { r } from './state-CV1fRmOT.js';
4
- import { e } from './class-map-BmCohX9p.js';
5
- import { observerSlotChangesWithCallback } from './utils.js';
6
- import './directive-Cuw6h7YA.js';
7
-
8
- var css_248z = i`* {
9
- box-sizing: border-box;
10
- }
11
-
12
- .screen-reader-only {
13
- display: none !important;
14
- }
15
-
16
- :host {
17
- --field-height: unset;
18
- --field-padding-block: unset;
19
- }
20
-
21
- .field {
22
- position: relative;
23
- display: flex;
24
- flex-direction: column;
25
- --_container-shape-start-start: var(--field-container-shape-start-start, var(--shape-corner-extra-small));
26
- --_container-shape-start-end: var(--field-container-shape-start-end, var(--shape-corner-extra-small));
27
- --_container-shape-end-start: var(--field-container-shape-end-start, var(--shape-corner-extra-small));
28
- --_container-shape-end-end: var(--field-container-shape-end-end, var(--shape-corner-extra-small));
29
- --_container-color: var(--field-container-color);
30
- --_outline-width: var(--field-outline-width, 0.0675rem);
31
- --_outline-color: var(--field-outline-color, var(--color-outline));
32
- --_input-text-color: var(--field-label-text-color, var(--color-on-surface));
33
- --_helper-text-color: var(--field-helper-text-color, var(--color-on-surface-variant));
34
- --_helper-text-opacity: unset;
35
- --_label-text-color: var(--field-label-text-color, var(--color-primary));
36
- }
37
- .field .field-header {
38
- display: flex;
39
- align-items: center;
40
- margin-block-end: var(--spacing-100);
41
- justify-content: space-between;
42
- gap: var(--spacing-100);
43
- }
44
- .field .field-header .label {
45
- position: relative;
46
- font-family: var(--typography-body-small-font-family) !important;
47
- font-size: var(--typography-body-small-font-size) !important;
48
- font-weight: var(--typography-body-small-font-weight) !important;
49
- line-height: var(--typography-body-small-line-height) !important;
50
- letter-spacing: var(--typography-body-small-letter-spacing) !important;
51
- color: var(--_label-text-color);
52
- overflow: hidden;
53
- white-space: nowrap;
54
- text-overflow: ellipsis;
55
- }
56
- .field .field-header .label .required {
57
- color: var(--color-error);
58
- padding-inline-start: var(--spacing-025);
59
- }
60
- .field .field-body {
61
- position: relative;
62
- display: flex;
63
- cursor: text;
64
- }
65
- .field .field-body .outline {
66
- position: absolute;
67
- z-index: 2;
68
- left: 0;
69
- width: 100%;
70
- height: 100%;
71
- pointer-events: none;
72
- border: var(--_outline-width) solid var(--_outline-color);
73
- opacity: var(--_outline-opacity, 1);
74
- border-start-start-radius: var(--_container-shape-start-start);
75
- border-start-end-radius: var(--_container-shape-start-end);
76
- border-end-start-radius: var(--_container-shape-end-start);
77
- border-end-end-radius: var(--_container-shape-end-end);
78
- }
79
- .field .field-body .background {
80
- position: absolute;
81
- z-index: 0;
82
- left: 0;
83
- width: 100%;
84
- height: 100%;
85
- pointer-events: none;
86
- background-color: var(--_container-color);
87
- opacity: var(--_container-opacity, 1);
88
- border-start-start-radius: var(--_container-shape-start-start);
89
- border-start-end-radius: var(--_container-shape-start-end);
90
- border-end-start-radius: var(--_container-shape-end-start);
91
- border-end-end-radius: var(--_container-shape-end-end);
92
- }
93
- .field .field-body .field-content {
94
- display: flex;
95
- align-items: center;
96
- flex: 1;
97
- height: var(--field-height, 3.5rem);
98
- padding-block: var(--field-padding-block);
99
- z-index: 1;
100
- }
101
- .field .field-body .field-content .input-wrapper {
102
- flex: 1;
103
- padding-inline: var(--spacing-200);
104
- position: relative;
105
- }
106
- .field .field-body .field-content .input-wrapper .outlined-label {
107
- position: absolute;
108
- top: 0;
109
- left: 0;
110
- align-items: center;
111
- height: 100%;
112
- width: 100%;
113
- padding-inline: var(--spacing-200);
114
- font-family: var(--typography-body-large-font-family) !important;
115
- font-size: var(--typography-body-large-font-size) !important;
116
- font-weight: var(--typography-body-large-font-weight) !important;
117
- line-height: var(--typography-body-large-line-height) !important;
118
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
119
- color: var(--_input-text-color);
120
- background-color: var(--_container-color);
121
- opacity: var(--_container-opacity, 1);
122
- }
123
- .field .field-body .field-content .input-wrapper .outlined-slot-container {
124
- opacity: 0;
125
- }
126
- .field .field-body .field-content slot::slotted(*) {
127
- font-family: var(--typography-body-large-font-family) !important;
128
- font-size: var(--typography-body-large-font-size) !important;
129
- font-weight: var(--typography-body-large-font-weight) !important;
130
- line-height: var(--typography-body-large-line-height) !important;
131
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
132
- color: var(--_input-text-color);
133
- --icon-size: 1.25rem;
134
- --icon-color: var(--_input-text-color);
135
- }
136
- .field .field-body .field-content slot::slotted(input::placeholder) {
137
- color: var(--color-on-surface-variant);
138
- }
139
- .field .field-body .field-content .slot-start-wrapper.has-content {
140
- margin-inline-start: 0.75rem;
141
- display: flex;
142
- align-items: center;
143
- gap: 0.5rem;
144
- }
145
- .field .field-body .field-content .slot-end-wrapper.has-content {
146
- margin-inline-end: 0.75rem;
147
- display: flex;
148
- align-items: center;
149
- gap: 0.5rem;
150
- }
151
- .field .field-footer {
152
- display: flex;
153
- align-items: center;
154
- justify-content: space-between;
155
- gap: var(--spacing-200);
156
- margin-block-start: var(--spacing-050);
157
- padding-inline: var(--spacing-200);
158
- }
159
- .field .field-footer .helper, .field .field-footer .text-count {
160
- position: relative;
161
- font-family: var(--typography-body-large-font-family) !important;
162
- font-size: var(--typography-body-large-font-size) !important;
163
- font-weight: var(--typography-body-large-font-weight) !important;
164
- line-height: var(--typography-body-large-line-height) !important;
165
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
166
- color: var(--_helper-text-color);
167
- opacity: var(--_helper-text-opacity);
168
- }
169
- .field.focused {
170
- --_outline-color: var(--color-primary);
171
- --_outline-width: 0.125rem;
172
- }
173
- .field.has-error {
174
- --_label-text-color: var(--color-error);
175
- --_outline-color: var(--color-error);
176
- --_helper-text-color: var(--color-error);
177
- --_input-text-color: var(--color-error);
178
- }
179
- .field.has-warning {
180
- --_label-text-color: var(--color-warning);
181
- --_outline-color: var(--color-warning);
182
- --_helper-text-color: var(--color-warning);
183
- --_input-text-color: var(--color-warning);
184
- }
185
- .field.disabled .label {
186
- opacity: 0.38;
187
- }
188
- .field.disabled {
189
- --_input-text-color: var(--color-on-surface-variant);
190
- --_outline-opacity: 0.38;
191
- --_helper-text-opacity: 0.38;
192
- --_container-color: var(--color-on-surface);
193
- --_container-opacity: 0.1;
194
- cursor: not-allowed;
195
- }
196
- .field.readonly {
197
- cursor: initial;
198
- --_input-text-color: var(--color-on-surface-variant);
199
- --_outline-opacity: 0.38;
200
- --_helper-text-opacity: 0.38;
201
- --_container-color: var(--color-on-surface);
202
- --_container-opacity: 0.38;
203
- }
204
- .field.show-skeleton .skeleton {
205
- display: block;
206
- }
207
-
208
- .skeleton {
209
- display: none;
210
- width: 100%;
211
- height: 100%;
212
- z-index: 2;
213
- position: absolute;
214
- top: 0;
215
- left: 0;
216
- --skeleton-shape-start-start: var(--shape-corner-extra-small);
217
- --skeleton-shape-start-end: var(--shape-corner-extra-small);
218
- --skeleton-shape-end-start: var(--shape-corner-extra-small);
219
- --skeleton-shape-end-end: var(--shape-corner-extra-small);
220
- }`;
221
-
222
- class Field extends i$1 {
223
- constructor() {
224
- super(...arguments);
225
- this.label = '';
226
- this.help = '';
227
- this.required = false;
228
- this.disabled = false;
229
- this.readonly = false;
230
- this.skeleton = false;
231
- this.helperText = '';
232
- this.error = false;
233
- this.errorText = '';
234
- this.warning = false;
235
- this.warningText = '';
236
- this.textCount = '';
237
- this.focused = false;
238
- this.populated = false;
239
- this.variant = 'default';
240
- this.slotStartHasContent = false;
241
- this.slotEndHasContent = false;
242
- }
243
- firstUpdated() {
244
- observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-start-wrapper slot'), hasContent => {
245
- this.slotStartHasContent = hasContent;
246
- this.requestUpdate();
247
- });
248
- observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-end-wrapper slot'), hasContent => {
249
- this.slotEndHasContent = hasContent;
250
- this.requestUpdate();
251
- });
252
- }
253
- __handleClick() {
254
- // @ts-ignore
255
- this.host?.focus?.();
256
- }
257
- __renderInputSlot() {
258
- if (this.variant === 'outlined') {
259
- if (this.populated || this.focused)
260
- return b `<slot></slot>`;
261
- return b `
262
- <label class="outlined-label">${this.label}</label>
263
- <div class="outlined-slot-container">
264
- <slot></slot>
265
- </div>
266
- `;
267
- }
268
- return b `<slot></slot>`;
269
- }
270
- __renderFieldHeader() {
271
- if (!this.label)
272
- return A;
273
- if (this.variant === 'outlined' && !this.populated && !this.focused) {
274
- return A;
275
- }
276
- return b `<div class="field-header">
277
- <label class="label">
278
- ${this.label}${this.required
279
- ? b `<span class="required">*</span>`
280
- : A}
281
- <base-skeleton class="skeleton"></base-skeleton>
282
- </label>
283
- </div>`;
284
- }
285
- render() {
286
- const classes = {
287
- field: true,
288
- required: this.required,
289
- disabled: this.disabled,
290
- 'show-skeleton': this.skeleton,
291
- 'has-error': this.error,
292
- 'has-warning': this.warning,
293
- focused: this.focused,
294
- readonly: this.readonly,
295
- [`variant-${this.variant}`]: true,
296
- populated: this.populated,
297
- };
298
- return b `
299
- <div class=${e(classes)}>
300
- ${this.__renderFieldHeader()}
301
-
302
- <div class="field-body" @click=${this.__handleClick}>
303
- <div class="outline"></div>
304
- <div class="background"></div>
305
- <base-skeleton class="skeleton"></base-skeleton>
306
-
307
- <div class="field-content">
308
- <div
309
- class=${e({
310
- 'slot-start-wrapper': true,
311
- 'has-content': this.slotStartHasContent,
312
- })}
313
- >
314
- <slot name="field-start"></slot>
315
- </div>
316
-
317
- <div class="input-wrapper">${this.__renderInputSlot()}</div>
318
-
319
- <div
320
- class=${e({
321
- 'slot-end-wrapper': true,
322
- 'has-content': this.slotEndHasContent,
323
- })}
324
- >
325
- <slot name="field-end"></slot>
326
- </div>
327
- </div>
328
- </div>
329
-
330
- ${this.__renderFieldFooter()}
331
- </div>
332
- `;
333
- }
334
- __renderFieldFooter() {
335
- if (!this.textCount &&
336
- !this.helperText &&
337
- !this.errorText &&
338
- !this.warningText)
339
- return A;
340
- return b `<div class="field-footer">
341
- ${this.__renderHelperText()} ${this.__renderWordCount()}
342
- </div>`;
343
- }
344
- __renderHelperText() {
345
- if (this.error)
346
- return b `<div class="helper">${this.errorText}</div>`;
347
- if (this.warning)
348
- return b `<div class="helper">${this.warningText}</div>`;
349
- if (this.helperText || this.helperText === '')
350
- return b `<div class="helper">${this.helperText}</div>`;
351
- return A;
352
- }
353
- __renderWordCount() {
354
- if (!this.textCount)
355
- return A;
356
- return b `<div class="text-count">${this.textCount}</div>`;
357
- }
358
- }
359
- Field.styles = [css_248z];
360
- __decorate([
361
- n({ type: String })
362
- ], Field.prototype, "label", void 0);
363
- __decorate([
364
- n({ type: String })
365
- ], Field.prototype, "help", void 0);
366
- __decorate([
367
- n({ type: Boolean })
368
- ], Field.prototype, "required", void 0);
369
- __decorate([
370
- n({ type: Boolean, reflect: true })
371
- ], Field.prototype, "disabled", void 0);
372
- __decorate([
373
- n({ type: Boolean, reflect: true })
374
- ], Field.prototype, "readonly", void 0);
375
- __decorate([
376
- n({ type: Boolean })
377
- ], Field.prototype, "skeleton", void 0);
378
- __decorate([
379
- n({ type: String, attribute: 'helper-text' })
380
- ], Field.prototype, "helperText", void 0);
381
- __decorate([
382
- n({ type: Boolean })
383
- ], Field.prototype, "error", void 0);
384
- __decorate([
385
- n({ type: String, attribute: 'error-text' })
386
- ], Field.prototype, "errorText", void 0);
387
- __decorate([
388
- n({ type: Boolean })
389
- ], Field.prototype, "warning", void 0);
390
- __decorate([
391
- n({ type: String, attribute: 'warning-text' })
392
- ], Field.prototype, "warningText", void 0);
393
- __decorate([
394
- n({ type: String, attribute: 'text-count' })
395
- ], Field.prototype, "textCount", void 0);
396
- __decorate([
397
- n({ type: Boolean })
398
- ], Field.prototype, "focused", void 0);
399
- __decorate([
400
- n({ type: Boolean })
401
- ], Field.prototype, "populated", void 0);
402
- __decorate([
403
- n({ type: String })
404
- ], Field.prototype, "variant", void 0);
405
- __decorate([
406
- n({ type: Object })
407
- ], Field.prototype, "host", void 0);
408
- __decorate([
409
- r()
410
- ], Field.prototype, "slotStartHasContent", void 0);
411
- __decorate([
412
- r()
413
- ], Field.prototype, "slotEndHasContent", void 0);
414
-
415
- export { Field };
416
- //# sourceMappingURL=field.js.map