@ganpatiinfo/gids-core-web 3.0.0 → 4.0.0

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 (85) hide show
  1. package/dist/css/index.css +901 -0
  2. package/dist/css/index.css.map +1 -1
  3. package/dist/custom-elements.json +90 -0
  4. package/dist/gids-field.d.ts +11 -0
  5. package/dist/gids-field.js +1 -0
  6. package/dist/gids-icon.js +1 -1
  7. package/dist/gids-input.d.ts +11 -0
  8. package/dist/gids-input.js +1 -0
  9. package/dist/gids-notification.d.ts +11 -0
  10. package/dist/gids-notification.js +1 -0
  11. package/dist/gids-overlay-provider.d.ts +11 -0
  12. package/dist/gids-overlay-provider.js +1 -0
  13. package/dist/gids-password-field.d.ts +11 -0
  14. package/dist/gids-password-field.js +1 -0
  15. package/dist/gids-snackbar.d.ts +11 -0
  16. package/dist/gids-snackbar.js +1 -0
  17. package/dist/gids-text-field.d.ts +11 -0
  18. package/dist/gids-text-field.js +1 -0
  19. package/dist/gids-toggle-button.js +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/p-B2zUuNXz.js +1 -0
  22. package/dist/p-CVtNa0cL.js +1 -0
  23. package/dist/p-CWdkmFbc.js +1 -0
  24. package/dist/p-D4xtPT_U.js +1 -0
  25. package/dist/p-DijVkS9b.js +1 -0
  26. package/dist/p-DybsMR13.js +1 -0
  27. package/dist/p-RqpjvEHh.js +1 -0
  28. package/dist/p-ibikYq-w.js +1 -0
  29. package/dist/p-veoOgDXg.js +1 -0
  30. package/dist/types/components/html/GidsDismissButton/GidsDismissButton.d.ts +6 -0
  31. package/dist/types/components/html/GidsHeading/GidsHeading.d.ts +6 -0
  32. package/dist/types/components/html/GidsLogo/GidsLogo.d.ts +9 -0
  33. package/dist/types/components/html/GidsRequirementsMeter/GidsRequirementsMeter.d.ts +4 -0
  34. package/dist/types/components/html/GidsSearchBar/GidsSearchBar.d.ts +10 -0
  35. package/dist/types/components/html/GidsSegmentedControl/GidsSegmentedControl.d.ts +6 -0
  36. package/dist/types/components/html/GidsSegmentedTabItem/GidsSegmentedTabItem.d.ts +6 -0
  37. package/dist/types/components/html/GidsStatusTag/GidsStatusTag.d.ts +5 -0
  38. package/dist/types/components/html/GidsStepper/GidsStepper.d.ts +7 -0
  39. package/dist/types/components/html/GidsStrengthMeter/GidsStrengthMeter.d.ts +5 -0
  40. package/dist/types/components/html/GidsTopNavigation/GidsTopNavigation.d.ts +8 -0
  41. package/dist/types/components/html/_GidsNotificationContainer/GidsNotificationContainer.d.ts +7 -0
  42. package/dist/types/components/html/_GidsRequirementsMeterLabel/GidsRequirementsMeterLabel.d.ts +4 -0
  43. package/dist/types/components/html/_GidsSnackbarContainer/GidsSnackbarContainer.d.ts +6 -0
  44. package/dist/types/components/webComponents/GidsField/GidsField.d.ts +54 -0
  45. package/dist/types/components/webComponents/GidsInput/GidsInput.d.ts +27 -0
  46. package/dist/types/components/webComponents/GidsNotification/GidsNotification.d.ts +17 -0
  47. package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProvider.d.ts +23 -0
  48. package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProviderUtils.d.ts +8 -0
  49. package/dist/types/components/webComponents/GidsPasswordField/GidsPasswordField.d.ts +49 -0
  50. package/dist/types/components/webComponents/GidsSnackbar/GidsSnackbar.d.ts +15 -0
  51. package/dist/types/components/webComponents/GidsTextField/GidsTextField.d.ts +39 -0
  52. package/dist/types/components.d.ts +437 -4
  53. package/dist-bundled/es/gids-field.js +6 -0
  54. package/dist-bundled/es/gids-icon.js +16 -200
  55. package/dist-bundled/es/gids-input.js +6 -0
  56. package/dist-bundled/es/gids-notification.js +31 -0
  57. package/dist-bundled/es/gids-overlay-provider.js +209 -0
  58. package/dist-bundled/es/gids-password-field.js +221 -0
  59. package/dist-bundled/es/gids-snackbar.js +31 -0
  60. package/dist-bundled/es/gids-text-field.js +78 -0
  61. package/dist-bundled/es/gids-toggle-button.js +14 -55
  62. package/dist-bundled/es/index.js +8 -7
  63. package/dist-bundled/es/p-B2zUuNXz-BLBgQDu7.js +45 -0
  64. package/dist-bundled/es/p-CVtNa0cL-sSVeJsR3.js +15 -0
  65. package/dist-bundled/es/p-CWdkmFbc-D89ZE8Mi.js +24 -0
  66. package/dist-bundled/es/p-D4xtPT_U-04HkZiXU.js +181 -0
  67. package/dist-bundled/es/p-DijVkS9b-CtFkEtlE.js +35 -0
  68. package/dist-bundled/es/p-DybsMR13-DpmsG3Q1.js +31 -0
  69. package/dist-bundled/es/p-RqpjvEHh-BGGYsIBf.js +74 -0
  70. package/dist-bundled/es/p-ibikYq-w-BsGxk8ro.js +635 -0
  71. package/dist-bundled/es/p-veoOgDXg-DElc87c0.js +192 -0
  72. package/dist-bundled/umd/gids-field.umd.js +5 -0
  73. package/dist-bundled/umd/gids-icon.umd.js +5 -1
  74. package/dist-bundled/umd/gids-input.umd.js +5 -0
  75. package/dist-bundled/umd/gids-notification.umd.js +5 -0
  76. package/dist-bundled/umd/gids-overlay-provider.umd.js +5 -0
  77. package/dist-bundled/umd/gids-password-field.umd.js +5 -0
  78. package/dist-bundled/umd/gids-snackbar.umd.js +5 -0
  79. package/dist-bundled/umd/gids-text-field.umd.js +5 -0
  80. package/dist-bundled/umd/gids-toggle-button.umd.js +6 -2
  81. package/dist-bundled/umd/index.umd.js +5 -1
  82. package/dist-bundled/umd-complete/gids-core-web.umd.js +6 -2
  83. package/package.json +65 -9
  84. package/dist/p-CgujYzVX.js +0 -1
  85. package/dist-bundled/es/p-CgujYzVX-xo1axnk6.js +0 -465
@@ -0,0 +1,221 @@
1
+ import { C as S, f as P, V as v, N as x, R as i, L as T, H as h } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { i as C } from "./p-B2zUuNXz-BLBgQDu7.js";
3
+ import { n as L, o as O } from "./p-DijVkS9b-CtFkEtlE.js";
4
+ import { a as F } from "./p-CWdkmFbc-D89ZE8Mi.js";
5
+ import { g as k, d as j } from "./p-veoOgDXg-DElc87c0.js";
6
+ import { h as E } from "./p-D4xtPT_U-04HkZiXU.js";
7
+ import { r as G } from "./p-RqpjvEHh-BGGYsIBf.js";
8
+ import { c as g } from "./clsx-OuTLNxxd.js";
9
+ const f = /[A-Z]/, b = /[a-z]/, p = /[0-9]/, q = /[^A-Za-z0-9]/, z = ({ text: e, meterRules: t = [], textMinLength: s = 0 }) => {
10
+ if (!e || e === "")
11
+ return 0;
12
+ let n = 0;
13
+ return t.includes("1-uppercase") && f.test(e) && n++, t.includes("1-lowercase") && b.test(e) && n++, t.includes("1-digit") && p.test(e) && n++, t.includes("1-special-character") && q.test(e) && n++, t.includes("include-min-length") && s && s > 0 && e.length >= s && n++, n;
14
+ }, A = ({ textScore: e, maxScore: t }) => {
15
+ const s = t > 0 ? e / t * 100 : 0;
16
+ return s <= 20 ? "is-weak" : s <= 40 ? "is-medium" : s <= 60 ? "is-good-enough" : s <= 80 ? "is-good" : "is-strong";
17
+ }, B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18
+ __proto__: null,
19
+ getColorModifierByScore: A,
20
+ getStrengthMeterScore: z,
21
+ include1DigitReg: p,
22
+ include1LowercaseLetterReg: b,
23
+ include1SpecialCharReg: q,
24
+ include1UppercaseLetterReg: f
25
+ }, Symbol.toStringTag, { value: "Module" })), o = ({ requirementRule: e, textMinLength: t }) => e === "include-min-length" && t && t > 0, R = (e) => {
26
+ const t = [];
27
+ return e && e.length > 0 && e.map((s) => {
28
+ s?.requirementRule && t.push(s.requirementRule);
29
+ }), t;
30
+ }, I = ({ rule: e, textMinLength: t = 0, text: s }) => {
31
+ if (!s || s === "" || !e && !t)
32
+ return !1;
33
+ switch (e) {
34
+ case "1-uppercase":
35
+ return f.test(s);
36
+ case "1-lowercase":
37
+ return b.test(s);
38
+ case "1-digit":
39
+ return p.test(s);
40
+ case "1-special-character":
41
+ return q.test(s);
42
+ case "include-min-length":
43
+ return o({
44
+ requirementRule: "include-min-length",
45
+ textMinLength: t
46
+ }) === !0 && s.length >= t;
47
+ default:
48
+ return !1;
49
+ }
50
+ }, m = (e) => {
51
+ const t = [
52
+ {
53
+ requirementRule: "1-uppercase",
54
+ requirementText: "Password must contain atleast 1 uppercase letter."
55
+ },
56
+ {
57
+ requirementRule: "1-digit",
58
+ requirementText: "Password must contain atleast 1 digit."
59
+ },
60
+ {
61
+ requirementRule: "1-special-character",
62
+ requirementText: "Password must contain atleast 1 special character."
63
+ },
64
+ {
65
+ requirementRule: "1-lowercase",
66
+ requirementText: "Password must contain atleast 1 lowercase letter."
67
+ }
68
+ ];
69
+ return o({
70
+ requirementRule: "include-min-length",
71
+ textMinLength: e
72
+ }) && t.push({
73
+ requirementRule: "include-min-length",
74
+ requirementText: `Password must be of minimum ${e} characters long.`
75
+ }), {
76
+ defaultMeterRules: R(t),
77
+ defaultRequirementsMeterRules: t
78
+ };
79
+ }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
80
+ __proto__: null,
81
+ checkRequirementRuleSatisfied: I,
82
+ getDefaultRulesAndRequirementsForMeters: m,
83
+ getMeterRulesFromRequirements: R,
84
+ minLengthRuleCanBeApplied: o
85
+ }, Symbol.toStringTag, { value: "Module" })), V = (e) => {
86
+ switch (e) {
87
+ case "error":
88
+ return "danger";
89
+ case "information":
90
+ return "information";
91
+ case "warning":
92
+ return "warning";
93
+ case "success":
94
+ return "positive";
95
+ default:
96
+ return "globe";
97
+ }
98
+ }, $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
+ __proto__: null,
100
+ getRequirementsMeterLabelLeadingIcon: V
101
+ }, Symbol.toStringTag, { value: "Module" })), D = (e) => {
102
+ switch (e) {
103
+ case "error":
104
+ return "error";
105
+ case "success":
106
+ return "success";
107
+ default:
108
+ return "default";
109
+ }
110
+ }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
+ __proto__: null,
112
+ inputToGidsFieldStatusForPassword: D
113
+ }, Symbol.toStringTag, { value: "Module" })), U = (e) => g("gids-strength-meter", e), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
114
+ __proto__: null,
115
+ getGidsStrengthMeterClassNames: U
116
+ }, Symbol.toStringTag, { value: "Module" })), W = ({ status: e }, t) => g("gids-requirements-meter-label", {
117
+ "gids-requirements-meter-label--error": e === "error",
118
+ "gids-requirements-meter-label--information": e === "information",
119
+ "gids-requirements-meter-label--warning": e === "warning",
120
+ "gids-requirements-meter-label--success": e === "success"
121
+ }, t), J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
122
+ __proto__: null,
123
+ getGidsRequirementsMeterLabelClassNames: W
124
+ }, Symbol.toStringTag, { value: "Module" })), K = (e) => g("gids-requirements-meter", e), Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
125
+ __proto__: null,
126
+ getGidsRequirementsMeterClassNames: K
127
+ }, Symbol.toStringTag, { value: "Module" })), { inputToGidsFieldStatusForPassword: X } = H, Y = (e) => e === "implicit" || e === void 0 ? "implicit" : X(e), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
128
+ __proto__: null,
129
+ inputToGidsFieldStatusForPassword: Y
130
+ }, Symbol.toStringTag, { value: "Module" })), { getGidsStrengthMeterClassNames: te } = Z, { getStrengthMeterScore: se, getColorModifierByScore: re } = B, ie = ({ text: e, textMinLength: t, meterRules: s = ["1-uppercase", "1-lowercase", "1-digit", "1-special-character", "include-min-length"], class: n }) => {
131
+ const a = (r, l, u) => i("div", { key: r, class: ["gids-strength-meter__strength-" + r, u ? "is-active" : "", u ? l : ""].filter(Boolean).join(" ") });
132
+ return s.length > 0 ? i("div", { class: te(n) }, (() => {
133
+ const r = s.length, l = se({ text: e, textMinLength: t, meterRules: s }), u = re({ textScore: l, maxScore: r });
134
+ return Array.from({ length: r }, ((_, c) => {
135
+ const d = c + 1, w = d <= l;
136
+ return s[d] === "include-min-length" ? o({ requirementRule: "include-min-length", textMinLength: t }) ? a(d, u, w) : null : a(d, u, w);
137
+ }));
138
+ })()) : null;
139
+ }, { getGidsRequirementsMeterLabelClassNames: ne } = J, { getRequirementsMeterLabelLeadingIcon: le } = $, ae = (e) => {
140
+ const { label: t, status: s = "default", leadingIconVisible: n = !0, class: a } = e, r = le(s);
141
+ return i("div", { class: ne({ status: s }, a) }, n && s && r ? i(j, { name: r, size: "sm", appearance: "filled" }) : null, t && t !== "" ? i("span", null, t) : null);
142
+ }, { checkRequirementRuleSatisfied: ue } = N, { getGidsRequirementsMeterClassNames: de } = Q, oe = ({ requirements: e = [], text: t, textMinLength: s, class: n }) => {
143
+ const a = (r, l) => i(ae, { status: l ? "success" : "error", label: r.requirementText });
144
+ return i("div", { class: de(n) }, (console.log("requirements", e), e.map(((r) => {
145
+ if (r?.requirementText && r?.requirementRule) {
146
+ const l = ue({ rule: r.requirementRule, textMinLength: s, text: t });
147
+ return r.requirementRule === "include-min-length" ? o({ requirementRule: r.requirementRule, textMinLength: s }) ? a(r, l) : null : a(r, l);
148
+ }
149
+ return null;
150
+ }))));
151
+ }, { inputToGidsFieldStatusForPassword: ce } = ee, M = S(class extends P {
152
+ constructor(e) {
153
+ super(), e !== !1 && this.__registerHost(), this.gidsPasswordFieldClear = v(this, "gidsPasswordFieldClear"), this.gidsPasswordFieldRevealPassword = v(this, "gidsPasswordFieldRevealPassword"), this.isPasswordRevealed = !1, this.meterRules = [], this.requirementsMeterRequirements = [], this.requirements = [], this.#t = k(), this._handleDismiss = () => {
154
+ const t = this.#e?.querySelector("input.gids-input__control");
155
+ t && (t.value = "", t.dispatchEvent(new globalThis.Event("input", { bubbles: !0 }))), this.value = "", this.gidsPasswordFieldClear.emit();
156
+ }, this._handleRevealPassword = () => {
157
+ const t = this.#e?.querySelector("input.gids-input__control");
158
+ this.isPasswordRevealed = t?.value != null && t.value !== "" && this.isPasswordRevealed === !1, this._el.dispatchEvent(new CustomEvent("gidsPasswordFieldRevealPassword", { detail: { passwordRevealed: this.isPasswordRevealed }, bubbles: !0, composed: !0 }));
159
+ }, this._handleInput = (t) => {
160
+ this.value = t.target?.value;
161
+ }, this._handleInputFocusAndBlur = (t) => {
162
+ this._el.dispatchEvent(new FocusEvent(t.type, { relatedTarget: t.relatedTarget }));
163
+ }, this._isRequirementAndStrengthMeterVisible = () => {
164
+ const t = this.requirements;
165
+ return !!(t && t.length > 0);
166
+ }, this._handleRequirementsMeter = () => {
167
+ const t = this._isRequirementAndStrengthMeterVisible();
168
+ this.requirementsMeterRequirements = this.requirements && this.requirements.length > 0 ? this.requirements : [], this.meterRules = t ? R(this.requirements) : [];
169
+ };
170
+ }
171
+ _startSlotContentObserver() {
172
+ this._slotContentObserver = new MutationObserver((() => {
173
+ x(this);
174
+ })), this._slotContentObserver.observe(this._el, { childList: !0, subtree: !1, attributes: !0, attributeFilter: ["slot"] });
175
+ }
176
+ handleRequirementsChange(e) {
177
+ e === void 0 && (this.requirements = m(this.textMinLength).defaultRequirementsMeterRules), this._handleRequirementsMeter();
178
+ }
179
+ componentWillLoad() {
180
+ this.requirements || (this.requirements = m(this.textMinLength).defaultRequirementsMeterRules), this._handleRequirementsMeter();
181
+ }
182
+ connectedCallback() {
183
+ const e = C();
184
+ e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e), this._handleRequirementsMeter(), this._startSlotContentObserver();
185
+ }
186
+ disconnectedCallback() {
187
+ this._slotContentObserver?.disconnect(), this._slotContentObserver = void 0;
188
+ }
189
+ #t;
190
+ #e;
191
+ render() {
192
+ const { id: e, ...t } = this.inputProps ?? {}, s = e ?? this.#t, n = this.showClearButton && this.value !== void 0 && this.value.length > 0, a = this.showRevealPasswordButton, r = { ...t }, l = r?.placeholder && r.placeholder != "" ? r.placeholder : "Enter password", u = this.isPasswordRevealed, _ = this.meterRules, c = this.textMinLength !== void 0 ? this.textMinLength : 8;
193
+ return i(T, { key: "548bcf66b7ee93974d790e7b3a44ba764ace509f" }, i("gids-field", { key: "4e52e64a5ad558317cb35b72121be744befeab1b", disabled: this.disabled, count: void 0, helperText: this.helperText, statusText: this.statusText, status: ce(this.status) }, i(L, { key: "2b797611f9f104f9a99a9e0d4bdda31dee0839b4", slot: "label", disabled: this.disabled, info: i("slot", { name: "info" }), fieldRequirement: this.fieldRequirement, fieldRequirementOptionalText: this.fieldRequirementOptionalText, fieldRequirementRequiredText: this.fieldRequirementRequiredText, isLabelSentence: this.isLabelSentence, htmlFor: s }, this.label), i("gids-input", { key: "725f94aff51966525b640f1fe1e010c700c1ddc8", ref: (d) => this.#e = d, appearance: "default", status: this.status, loading: this.loading, value: this.value, defaultValue: this.defaultValue, name: this.name, required: this.required, disabled: this.disabled, readOnly: this.readOnly, leadingLabel: void 0, trailingLabel: void 0, onFocus: this._handleInputFocusAndBlur, onBlur: this._handleInputFocusAndBlur, onInput: this._handleInput, inputProps: { ...r, placeholder: l, type: u ? "text" : "password", id: s, maxLength: this.maxLength } }, i("slot", { key: "ef742cdd2cb00887f74589ad44304cb401194688", name: "leadingIcon" }), i("slot", { key: "6f38de10ddb3acd5ec39b72bea3e3b4b08aabc9e", name: "leadingAccessory" }), i("div", { key: "c607f812340a2a5e22323682d3a739b31d8fb66c", slot: "trailingAccessory", class: "gids-password-field__trailing-accessory" }, n && i(O, { key: "a12067b7e8b1cd30edd61fae71c980ad1c5f269a", label: "clear text", size: "lg", onPressDismiss: this._handleDismiss }), a && i(F, { key: "0b2a76bd61aba94d2fa17c2a97f87b28f99b2a0e", appearance: "default", size: "xs", width: "intrinsic", disabled: this.disabled, onClick: this._handleRevealPassword }, u ? "Hide" : "Show")))), i("div", { key: "9a6624d2963148db0c20713a565be4dcf6815f7b", class: "gids-password-field__meters-container" }, i(ie, { key: "f5edecbaf4438d0ca4cb457034fe8f59cd665a1d", meterRules: _, text: this.value, textMinLength: c }), i(oe, { key: "04d03abd215fbdcc966ccd9321942d7a25717fa1", requirements: this.requirementsMeterRequirements, text: this.value, textMinLength: c })));
194
+ }
195
+ get _el() {
196
+ return this;
197
+ }
198
+ static get watchers() {
199
+ return { requirements: [{ handleRequirementsChange: 0 }], textMinLength: [{ handleRequirementsChange: 0 }] };
200
+ }
201
+ }, [260, "gids-password-field", { label: [513], showClearButton: [516, "show-clear-button"], showRevealPasswordButton: [516, "show-reveal-password-button"], helperText: [513, "helper-text"], statusText: [513, "status-text"], status: [513], loading: [516], name: [513], required: [516], maxLength: [514, "maxlength"], value: [1], defaultValue: [513, "default-value"], disabled: [516], readOnly: [516, "readonly"], inputProps: [16], fieldRequirement: [513, "field-requirement"], fieldRequirementOptionalText: [1, "field-requirement-optional-text"], fieldRequirementRequiredText: [1, "field-requirement-required-text"], isLabelSentence: [16], textMinLength: [514, "text-min-length"], requirements: [16], isPasswordRevealed: [32], meterRules: [32], requirementsMeterRequirements: [32] }, void 0, { requirements: [{ handleRequirementsChange: 0 }], textMinLength: [{ handleRequirementsChange: 0 }] }]);
202
+ function y() {
203
+ typeof customElements < "u" && ["gids-password-field", "gids-field", "gids-input"].forEach(((e) => {
204
+ switch (e) {
205
+ case "gids-password-field":
206
+ customElements.get(h(e)) || customElements.define(h(e), M);
207
+ break;
208
+ case "gids-field":
209
+ customElements.get(h(e)) || E();
210
+ break;
211
+ case "gids-input":
212
+ customElements.get(h(e)) || G();
213
+ }
214
+ }));
215
+ }
216
+ y();
217
+ const _e = M, we = y;
218
+ export {
219
+ _e as GidsPasswordField,
220
+ we as defineCustomElement
221
+ };
@@ -0,0 +1,31 @@
1
+ import { C as a, f as o, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { e as i } from "./p-CVtNa0cL-sSVeJsR3.js";
3
+ const e = a(class extends o {
4
+ constructor(t) {
5
+ super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.appearance = "default", this.show = !1, this.position = "bottom-center";
6
+ }
7
+ async showSnackbar() {
8
+ const t = i(this._el);
9
+ t && this.show && t.queueComponent({ message: this.message, appearance: this.appearance, buttonLabel: this.buttonLabel, onButtonClick: this.onButtonClick, position: this.position, componentName: "snackbar", timerInMs: this.timerInMs }), this.onQueueSnackbar && this.onQueueSnackbar(), this.show = !1;
10
+ }
11
+ render() {
12
+ return null;
13
+ }
14
+ get _el() {
15
+ return this;
16
+ }
17
+ static get watchers() {
18
+ return { show: [{ showSnackbar: 0 }] };
19
+ }
20
+ }, [1, "gids-snackbar", { message: [513], appearance: [513], show: [516], onQueueSnackbar: [16], buttonLabel: [513, "button-label"], position: [513], timerInMs: [514, "timer-in-ms"], onButtonClick: [16] }, void 0, { show: [{ showSnackbar: 0 }] }]);
21
+ function n() {
22
+ typeof customElements < "u" && ["gids-snackbar"].forEach(((t) => {
23
+ t === "gids-snackbar" && (customElements.get(s(t)) || customElements.define(s(t), e));
24
+ }));
25
+ }
26
+ n();
27
+ const h = e, u = n;
28
+ export {
29
+ h as GidsSnackbar,
30
+ u as defineCustomElement
31
+ };
@@ -0,0 +1,78 @@
1
+ import { C as u, f as h, V as c, N as f, R as i, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { i as b } from "./p-B2zUuNXz-BLBgQDu7.js";
3
+ import { o as m, n as p } from "./p-DijVkS9b-CtFkEtlE.js";
4
+ import { h as g } from "./p-D4xtPT_U-04HkZiXU.js";
5
+ import { r as x } from "./p-RqpjvEHh-BGGYsIBf.js";
6
+ import { g as _ } from "./p-veoOgDXg-DElc87c0.js";
7
+ const v = (e, t) => {
8
+ if (!(e === void 0 || t === void 0))
9
+ return `${e} / ${Math.max(t, 0)}`;
10
+ }, T = (e) => {
11
+ switch (e) {
12
+ case "error":
13
+ return "error";
14
+ case "success":
15
+ return "success";
16
+ default:
17
+ return "default";
18
+ }
19
+ }, a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20
+ __proto__: null,
21
+ formatCharCount: v,
22
+ inputToGidsFieldStatus: T
23
+ }, Symbol.toStringTag, { value: "Module" })), { inputToGidsFieldStatus: y } = a, q = (e) => e === "implicit" || e === void 0 ? "implicit" : y(e), C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24
+ __proto__: null,
25
+ inputToGidsFieldStatus: q
26
+ }, Symbol.toStringTag, { value: "Module" })), { formatCharCount: F } = a, { inputToGidsFieldStatus: O } = C, n = u(class extends h {
27
+ constructor(e) {
28
+ super(), e !== !1 && this.__registerHost(), this.gidsTextFieldClear = c(this, "gidsTextFieldClear"), this.#e = _(), this._handleDismiss = () => {
29
+ const t = this.#t?.querySelector("input.gids-input__control");
30
+ t && (t.value = "", t.dispatchEvent(new globalThis.Event("input", { bubbles: !0 }))), this.value = "", this.gidsTextFieldClear.emit();
31
+ }, this._handleInput = (t) => {
32
+ this.value = t.target?.value;
33
+ }, this._handleInputFocusAndBlur = (t) => {
34
+ this._el.dispatchEvent(new FocusEvent(t.type, { relatedTarget: t.relatedTarget }));
35
+ };
36
+ }
37
+ _startSlotContentObserver() {
38
+ this._slotContentObserver = new MutationObserver((() => {
39
+ f(this);
40
+ })), this._slotContentObserver.observe(this._el, { childList: !0, subtree: !1, attributes: !0, attributeFilter: ["slot"] });
41
+ }
42
+ connectedCallback() {
43
+ const e = b();
44
+ e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e), this._startSlotContentObserver();
45
+ }
46
+ disconnectedCallback() {
47
+ this._slotContentObserver?.disconnect(), this._slotContentObserver = void 0;
48
+ }
49
+ #e;
50
+ #t;
51
+ render() {
52
+ const { id: e, ...t } = this.inputProps ?? {}, l = e ?? this.#e, d = this.showClearButton && this.value !== void 0 && this.value.length > 0;
53
+ return i("gids-field", { key: "cc94d948b69f9a9cfeee2b9df2a06d8985448963", disabled: this.disabled, count: F(this.value?.length, this.maxLength), helperText: this.helperText, statusText: this.statusText, status: O(this.status) }, i(p, { key: "16ed76aa12c2a256cd7ca7d2862b552e444f57c7", slot: "label", disabled: this.disabled, info: i("slot", { name: "info" }), fieldRequirement: this.fieldRequirement, fieldRequirementOptionalText: this.fieldRequirementOptionalText, fieldRequirementRequiredText: this.fieldRequirementRequiredText, isLabelSentence: this.isLabelSentence, htmlFor: l }, this.label), i("gids-input", { key: "2b5ac45e1c828db13394d003cec5acfef2d02f82", ref: (o) => this.#t = o, appearance: this.appearance, status: this.status, loading: this.loading, value: this.value, defaultValue: this.defaultValue, name: this.name, required: this.required, disabled: this.disabled, readOnly: this.readOnly, leadingLabel: this.leadingLabel, trailingLabel: this.trailingLabel, onFocus: this._handleInputFocusAndBlur, onBlur: this._handleInputFocusAndBlur, onInput: this._handleInput, inputProps: { ...t, type: this.type, id: l, maxLength: this.maxLength } }, i("slot", { key: "e36107774a78bf7162d88784474b9dc77aa4fffa", name: "leadingIcon" }), i("slot", { key: "0c8d888dc3f46d2d49be0e55e1833604e703724c", name: "leadingAccessory" }), d && i(m, { key: "06804811547b79a273271a467cc3020e49b66ea6", label: "clear text", slot: "trailingAccessory", size: "lg", onPressDismiss: this._handleDismiss }), i("slot", { key: "d05029b11a4aa635123da84611e671edbfb925c6", name: "trailingIcon" })));
54
+ }
55
+ get _el() {
56
+ return this;
57
+ }
58
+ }, [260, "gids-text-field", { label: [513], showClearButton: [516, "show-clear-button"], helperText: [513, "helper-text"], statusText: [513, "status-text"], appearance: [513], status: [513], leadingLabel: [513, "leading-label"], trailingLabel: [513, "trailing-label"], loading: [516], type: [513], name: [513], required: [516], maxLength: [514, "maxlength"], value: [1], defaultValue: [513, "default-value"], disabled: [516], readOnly: [516, "readonly"], inputProps: [16], fieldRequirement: [513, "field-requirement"], fieldRequirementOptionalText: [1, "field-requirement-optional-text"], fieldRequirementRequiredText: [1, "field-requirement-required-text"], isLabelSentence: [16] }]);
59
+ function r() {
60
+ typeof customElements < "u" && ["gids-text-field", "gids-field", "gids-input"].forEach(((e) => {
61
+ switch (e) {
62
+ case "gids-text-field":
63
+ customElements.get(s(e)) || customElements.define(s(e), n);
64
+ break;
65
+ case "gids-field":
66
+ customElements.get(s(e)) || g();
67
+ break;
68
+ case "gids-input":
69
+ customElements.get(s(e)) || x();
70
+ }
71
+ }));
72
+ }
73
+ r();
74
+ const I = n, G = r;
75
+ export {
76
+ I as GidsTextField,
77
+ G as defineCustomElement
78
+ };
@@ -1,48 +1,7 @@
1
- import { u as O, c as M, _ as $, g as j, E as s, x as B, p } from "./p-CgujYzVX-xo1axnk6.js";
2
- import { c as _ } from "./clsx-OuTLNxxd.js";
3
- const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-control", {
4
- "gids-spinner-control--xs": e === "xs",
5
- "gids-spinner-control--sm": e === "sm",
6
- // 'gids-spinner-control--md': size === 'md',
7
- "gids-spinner-control--lg": e === "lg",
8
- "gids-spinner-control--xl": e === "xl",
9
- "gids-spinner-control--2xl": e === "2xl",
10
- "gids-spinner-control--determinate": t === !1
11
- }, n, i), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12
- __proto__: null,
13
- getGidsSpinnerControlClassNames: z
14
- }, Symbol.toStringTag, { value: "Module" })), G = ({ appearance: e, size: t, width: n, destructive: i, loading: l }, o, a) => _("gids-button", {
15
- "gids-button--primary": e === "primary",
16
- "gids-button--subtle": e === "subtle",
17
- "gids-button--xs": t === "xs",
18
- "gids-button--sm": t === "sm",
19
- // 'gids-button--md': size === 'md',
20
- "gids-button--lg": t === "lg",
21
- "gids-button--full-width": n === "full",
22
- "gids-button--destructive": i,
23
- "gids-button--icon-only": o,
24
- "gids-button--loading": l
25
- }, a), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26
- __proto__: null,
27
- getGidsButtonClassNames: G
28
- }, Symbol.toStringTag, { value: "Module" })), r = 64, y = 10, x = r / 2 - y / 2, L = r / 2, u = 2 * Math.PI * x, P = `0 0 ${r} ${r}`, T = (e = 0, t) => {
29
- const n = typeof t == "number" && t > 0 ? t : 1, l = Math.max(0, Math.min(n, e)) / n * 100, o = (u * l / 100).toFixed(2), a = (u - parseFloat(o)).toFixed(2);
30
- return `${o} ${a}`;
31
- }, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
32
- __proto__: null,
33
- calculateStrokeDasharray: T,
34
- centerPosition: L,
35
- circumference: u,
36
- radius: x,
37
- thickness: y,
38
- viewBox: P
39
- }, Symbol.toStringTag, { value: "Module" })), b = (e) => e !== void 0 && (!Array.isArray(e) || e.length > 0), { getGidsSpinnerControlClassNames: F } = D, { calculateStrokeDasharray: H, thickness: f, radius: m, centerPosition: c, viewBox: V } = A, R = ({ size: e, indeterminate: t, value: n, max: i, ...l }) => {
40
- let o;
41
- return t || (o = { strokeDashArray: H(n, i || 0), strokeDashoffset: "0" }), s("svg", { class: F({ size: e, indeterminate: t, value: n }), viewBox: V, ...l }, s("circle", { class: "gids-spinner-control__track", cx: c, cy: c, r: m, "stroke-width": f }), s("circle", { style: o, class: "gids-spinner-control__progress", cx: c, cy: c, r: m, "stroke-width": f }));
42
- }, { getGidsButtonClassNames: q } = N, J = ({ appearance: e, size: t, destructive: n, loading: i, width: l, leadingIcon: o, trailingIcon: a, as: w, disabled: S, class: I, forceIconOnly: C = !1, ...d }, h) => {
43
- const g = w || "button", E = t === "lg" || t === void 0 ? "md" : t;
44
- return g !== "button" || "type" in d || (d.type = "button"), s(g, { class: q({ appearance: e, size: t, destructive: n, loading: i, width: l }, C || h.length === 0 && b(o) && !b(a), I), disabled: g === "button" ? S : void 0, ...d }, s("span", { class: "gids-button__content" }, o, h), i && s(R, { size: E, indeterminate: !0 }), a);
45
- }, v = O(class extends M {
1
+ import { C as l, f as n, V as d, R as t, D as a, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { a as c } from "./p-CWdkmFbc-D89ZE8Mi.js";
3
+ import { i as h } from "./p-B2zUuNXz-BLBgQDu7.js";
4
+ const i = l(class extends n {
46
5
  get selected() {
47
6
  return this.#e ?? this.defaultSelected;
48
7
  }
@@ -50,11 +9,11 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
50
9
  this.#e = e === void 0 ? void 0 : !!e;
51
10
  }
52
11
  constructor(e) {
53
- super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.select = $(this, "select"), this._toggle = this._toggle.bind(this);
12
+ super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.select = d(this, "select"), this._toggle = this._toggle.bind(this);
54
13
  }
55
14
  #e;
56
15
  connectedCallback() {
57
- const e = j();
16
+ const e = h();
58
17
  e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e);
59
18
  }
60
19
  _toggle() {
@@ -62,9 +21,9 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
62
21
  this._el.selected = e, this.select?.emit(e);
63
22
  }
64
23
  render() {
65
- return s(B, { key: "222a7976cfa0daa12d2db51e405d8f3e894209d9" }, s("style", { key: "04b1d2f9a184e830b949691e789deaaaea987303" }, `:host {
24
+ return t(a, { key: "0f65cdb9d34f2cb5db90104964b7d76f63b7546c" }, t("style", { key: "410fa1ed0c7f2ee1fa431e639adae9b09643635b" }, `:host {
66
25
  display: ${this.width === "full" ? "block" : "inline-block"}
67
- }`), s(J, { key: "18ef39dcc5b3a532a347e530784ec4915719f914", appearance: this.appearance, size: this.size, width: this.width, disabled: this.disabled, onClick: this._toggle, "aria-pressed": this.selected ? "true" : "false", leadingIcon: s("slot", { name: "leadingIcon" }), trailingIcon: s("slot", { name: "trailingIcon" }), forceIconOnly: this._onlyHasLeadingIcon() }, s("slot", { key: "f82ab35082be6b10d0fb76b11c8250cd6ab374a4" })));
26
+ }`), t(c, { key: "c60640620902451f4c635b802d1cd298f218772f", appearance: this.appearance, size: this.size, width: this.width, disabled: this.disabled, onClick: this._toggle, "aria-pressed": this.selected ? "true" : "false", leadingIcon: t("slot", { name: "leadingIcon" }), trailingIcon: t("slot", { name: "trailingIcon" }), forceIconOnly: this._onlyHasLeadingIcon() }, t("slot", { key: "7904b661a3eb9be25e25a0a9668580462ebfc393" })));
68
27
  }
69
28
  _onlyHasLeadingIcon() {
70
29
  const e = this._el.childNodes;
@@ -74,14 +33,14 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
74
33
  return this;
75
34
  }
76
35
  }, [257, "gids-toggle-button", { disabled: [516], appearance: [513], size: [513], width: [513], defaultSelected: [516, "default-selected"], selected: [6660] }]);
77
- function k() {
36
+ function o() {
78
37
  typeof customElements < "u" && ["gids-toggle-button"].forEach(((e) => {
79
- e === "gids-toggle-button" && (customElements.get(p(e)) || customElements.define(p(e), v));
38
+ e === "gids-toggle-button" && (customElements.get(s(e)) || customElements.define(s(e), i));
80
39
  }));
81
40
  }
82
- k();
83
- const U = v, W = k;
41
+ o();
42
+ const b = i, u = o;
84
43
  export {
85
- U as GidsToggleButton,
86
- W as defineCustomElement
44
+ b as GidsToggleButton,
45
+ u as defineCustomElement
87
46
  };
@@ -1,4 +1,5 @@
1
- import { a as n, g as f, $ as P, h as A, w as G, b as c, f as l } from "./p-CgujYzVX-xo1axnk6.js";
1
+ import { w as n, a as f, j as P, F as A, b as G } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { i as l, n as m } from "./p-B2zUuNXz-BLBgQDu7.js";
2
3
  import { s as a } from "./assets-Drv1fXkA.js";
3
4
  function t(s, e) {
4
5
  a(s, e);
@@ -10,13 +11,13 @@ const r = (s) => {
10
11
  };
11
12
  export {
12
13
  n as getAssetPath,
13
- f as getConstructedGidsStylesheet,
14
- P as refreshConstructedGidsStylesheet,
15
- A as render,
16
- G as setAssetPath,
14
+ l as getConstructedGidsStylesheet,
15
+ m as refreshConstructedGidsStylesheet,
16
+ f as render,
17
+ P as setAssetPath,
17
18
  r as setGidsAssetFilePaths,
18
19
  t as setGidsAssetPaths,
19
20
  i as setGidsDefaultAssetDirPath,
20
- c as setNonce,
21
- l as setPlatformOptions
21
+ A as setNonce,
22
+ G as setPlatformOptions
22
23
  };
@@ -0,0 +1,45 @@
1
+ const l = globalThis.CSSStyleSheet !== void 0 ? new CSSStyleSheet() : void 0;
2
+ let a = !1;
3
+ l && document.adoptedStyleSheets ? document.adoptedStyleSheets.push(l) : console.warn("CSSStyleSheet is not defined. Omitting constructed stylesheet behaviour.");
4
+ let u = null;
5
+ const d = globalThis.MutationObserver !== void 0 ? new MutationObserver((() => {
6
+ h();
7
+ })) : void 0, h = () => {
8
+ if (l === void 0) return !1;
9
+ const i = (() => {
10
+ if (l === void 0) return;
11
+ const o = [];
12
+ for (let n = 0; n < document.styleSheets.length; n++) {
13
+ const t = document.styleSheets.item(n);
14
+ if (t) try {
15
+ let e = -1, r = 0;
16
+ for (let s = 0; s < t.cssRules.length; s++) {
17
+ const c = t.cssRules.item(s);
18
+ if (c?.cssText.startsWith("gids-global-styles-start")) e = s;
19
+ else if (e > -1) {
20
+ if (c?.cssText.startsWith("gids-global-styles-end")) {
21
+ r = s - e + 1;
22
+ break;
23
+ }
24
+ o.push(c);
25
+ }
26
+ }
27
+ if (e > -1) return { rulesStartIndex: e, originalRulesCount: r, rules: o, styleSheet: t };
28
+ } catch (e) {
29
+ if (!(e instanceof DOMException)) throw e;
30
+ }
31
+ }
32
+ })();
33
+ if (i !== void 0) {
34
+ const o = i.styleSheet.ownerNode;
35
+ return d !== void 0 && o !== u && (u && d.disconnect(), o instanceof Element && d.observe(o, { childList: !0, characterData: !0, subtree: !0 }), u = o), l.replaceSync(((n) => n.rules.map(((t) => t.cssText)).join(""))(i)), ((n) => {
36
+ const { rulesStartIndex: t, originalRulesCount: e, styleSheet: r } = n;
37
+ for (let s = 0; s < e; s++) r.deleteRule(t);
38
+ })(i), !0;
39
+ }
40
+ return console.warn("refreshConstructedGidsStylesheet: Gids stylesheet is not found in document."), !1;
41
+ }, S = () => (a || (a = h()), l);
42
+ export {
43
+ S as i,
44
+ h as n
45
+ };
@@ -0,0 +1,15 @@
1
+ const u = (e) => e === null ? null : e?.parentElement?.closest("gids-overlay-provider") || null, d = ({ componentName: e = "snackbar", timerInMs: t }) => t && Number(t) > 0 ? t : ((n) => {
2
+ const s = (() => {
3
+ const r = document.querySelector("gids-overlay-provider");
4
+ if (!r || !r.shadowRoot) return 1;
5
+ const a = r.shadowRoot.querySelectorAll(".gids-snackbar-container__content"), o = a[a.length - 1];
6
+ if (!o) return 1;
7
+ const i = o.offsetHeight, c = getComputedStyle(o).lineHeight, l = c.endsWith("px") ? parseFloat(c) : 0;
8
+ return Math.ceil(l ? i / l : 1);
9
+ })();
10
+ return s === 2 ? n === "snackbar" ? 5e3 : 8e3 : s >= 3 ? n === "snackbar" ? 7e3 : 1e4 : n === "snackbar" ? 3e3 : 6e3;
11
+ })(e);
12
+ export {
13
+ u as e,
14
+ d as n
15
+ };
@@ -0,0 +1,24 @@
1
+ import { R as u } from "./p-ibikYq-w-BsGxk8ro.js";
2
+ import { l as f } from "./p-DybsMR13-DpmsG3Q1.js";
3
+ import { c as v } from "./clsx-OuTLNxxd.js";
4
+ const _ = ({ appearance: t, size: n, width: i, destructive: o, loading: l }, e, s) => v("gids-button", {
5
+ "gids-button--primary": t === "primary",
6
+ "gids-button--subtle": t === "subtle",
7
+ "gids-button--xs": n === "xs",
8
+ "gids-button--sm": n === "sm",
9
+ // 'gids-button--md': size === 'md',
10
+ "gids-button--lg": n === "lg",
11
+ "gids-button--full-width": i === "full",
12
+ "gids-button--destructive": o,
13
+ "gids-button--icon-only": e,
14
+ "gids-button--loading": l
15
+ }, s), h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16
+ __proto__: null,
17
+ getGidsButtonClassNames: _
18
+ }, Symbol.toStringTag, { value: "Module" })), a = (t) => t !== void 0 && (!Array.isArray(t) || t.length > 0), { getGidsButtonClassNames: w } = h, j = ({ appearance: t, size: n, destructive: i, loading: o, width: l, leadingIcon: e, trailingIcon: s, as: b, disabled: c, class: m, forceIconOnly: p = !1, ...d }, g) => {
19
+ const r = b || "button", y = n === "lg" || n === void 0 ? "md" : n;
20
+ return r !== "button" || "type" in d || (d.type = "button"), u(r, { class: w({ appearance: t, size: n, destructive: i, loading: o, width: l }, p || g.length === 0 && a(e) && !a(s), m), disabled: r === "button" ? c : void 0, ...d }, u("span", { class: "gids-button__content" }, e, g), o && u(f, { size: y, indeterminate: !0 }), s);
21
+ };
22
+ export {
23
+ j as a
24
+ };