@ganpatiinfo/gids-core-web 3.1.0 → 5.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.
- package/dist/css/index.css +977 -0
- package/dist/css/index.css.map +1 -1
- package/dist/custom-elements.json +90 -0
- package/dist/gids-field.d.ts +11 -0
- package/dist/gids-field.js +1 -0
- package/dist/gids-icon.d.ts +1 -1
- package/dist/gids-icon.js +1 -1
- package/dist/gids-input.d.ts +11 -0
- package/dist/gids-input.js +1 -0
- package/dist/gids-notification.d.ts +11 -0
- package/dist/gids-notification.js +1 -0
- package/dist/gids-overlay-provider.d.ts +11 -0
- package/dist/gids-overlay-provider.js +1 -0
- package/dist/gids-password-field.d.ts +11 -0
- package/dist/gids-password-field.js +1 -0
- package/dist/gids-scrim.d.ts +11 -0
- package/dist/gids-scrim.js +1 -0
- package/dist/gids-snackbar.d.ts +11 -0
- package/dist/gids-snackbar.js +1 -0
- package/dist/gids-text-field.d.ts +11 -0
- package/dist/gids-text-field.js +1 -0
- package/dist/gids-toggle-button.d.ts +1 -1
- package/dist/gids-toggle-button.js +1 -1
- package/dist/index.js +1 -1
- package/dist/p-B2zUuNXz.js +1 -0
- package/dist/p-BVh4zbX4.js +1 -0
- package/dist/p-BplPYg8z.js +1 -0
- package/dist/p-CVtNa0cL.js +1 -0
- package/dist/p-CWdkmFbc.js +1 -0
- package/dist/p-DijVkS9b.js +1 -0
- package/dist/p-DybsMR13.js +1 -0
- package/dist/p-ibikYq-w.js +1 -0
- package/dist/p-veoOgDXg.js +1 -0
- package/dist/types/components/html/GidsDismissButton/GidsDismissButton.d.ts +6 -0
- package/dist/types/components/html/GidsHeading/GidsHeading.d.ts +6 -0
- package/dist/types/components/html/GidsLogo/GidsLogo.d.ts +9 -0
- package/dist/types/components/html/GidsRequirementsMeter/GidsRequirementsMeter.d.ts +4 -0
- package/dist/types/components/html/GidsSearchBar/GidsSearchBar.d.ts +10 -0
- package/dist/types/components/html/GidsSegmentedControl/GidsSegmentedControl.d.ts +1 -1
- package/dist/types/components/html/GidsSegmentedTabItem/GidsSegmentedTabItem.d.ts +1 -1
- package/dist/types/components/html/GidsStatusTag/GidsStatusTag.d.ts +5 -0
- package/dist/types/components/html/GidsStepper/GidsStepper.d.ts +7 -0
- package/dist/types/components/html/GidsStrengthMeter/GidsStrengthMeter.d.ts +5 -0
- package/dist/types/components/html/GidsTopNavigation/GidsTopNavigation.d.ts +8 -0
- package/dist/types/components/html/_GidsNotificationContainer/GidsNotificationContainer.d.ts +7 -0
- package/dist/types/components/html/_GidsRequirementsMeterLabel/GidsRequirementsMeterLabel.d.ts +4 -0
- package/dist/types/components/html/_GidsSideMenuItem/GidsSideMenuItem.d.ts +7 -0
- package/dist/types/components/html/_GidsSnackbarContainer/GidsSnackbarContainer.d.ts +6 -0
- package/dist/types/components/webComponents/GidsField/GidsField.d.ts +54 -0
- package/dist/types/components/webComponents/GidsInput/GidsInput.d.ts +27 -0
- package/dist/types/components/webComponents/GidsNotification/GidsNotification.d.ts +17 -0
- package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProvider.d.ts +23 -0
- package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProviderUtils.d.ts +8 -0
- package/dist/types/components/webComponents/GidsPasswordField/GidsPasswordField.d.ts +49 -0
- package/dist/types/components/webComponents/GidsScrim/GidsScrim.d.ts +7 -0
- package/dist/types/components/webComponents/GidsSnackbar/GidsSnackbar.d.ts +15 -0
- package/dist/types/components/webComponents/GidsTextField/GidsTextField.d.ts +39 -0
- package/dist/types/components.d.ts +455 -4
- package/dist-bundled/es/gids-field.js +6 -0
- package/dist-bundled/es/gids-icon.js +16 -200
- package/dist-bundled/es/gids-input.js +6 -0
- package/dist-bundled/es/gids-notification.js +31 -0
- package/dist-bundled/es/gids-overlay-provider.js +209 -0
- package/dist-bundled/es/gids-password-field.js +221 -0
- package/dist-bundled/es/gids-scrim.js +35 -0
- package/dist-bundled/es/gids-snackbar.js +31 -0
- package/dist-bundled/es/gids-text-field.js +78 -0
- package/dist-bundled/es/gids-toggle-button.js +14 -55
- package/dist-bundled/es/index.js +8 -7
- package/dist-bundled/es/p-B2zUuNXz-BLBgQDu7.js +45 -0
- package/dist-bundled/es/p-BVh4zbX4-C4UJ8LPX.js +74 -0
- package/dist-bundled/es/p-BplPYg8z-B8uAAfo4.js +181 -0
- package/dist-bundled/es/p-CVtNa0cL-sSVeJsR3.js +15 -0
- package/dist-bundled/es/p-CWdkmFbc-D89ZE8Mi.js +24 -0
- package/dist-bundled/es/p-DijVkS9b-CtFkEtlE.js +35 -0
- package/dist-bundled/es/p-DybsMR13-DpmsG3Q1.js +31 -0
- package/dist-bundled/es/p-ibikYq-w-BsGxk8ro.js +635 -0
- package/dist-bundled/es/p-veoOgDXg-DElc87c0.js +192 -0
- package/dist-bundled/umd/gids-field.umd.js +5 -0
- package/dist-bundled/umd/gids-icon.umd.js +5 -1
- package/dist-bundled/umd/gids-input.umd.js +5 -0
- package/dist-bundled/umd/gids-notification.umd.js +5 -0
- package/dist-bundled/umd/gids-overlay-provider.umd.js +5 -0
- package/dist-bundled/umd/gids-password-field.umd.js +5 -0
- package/dist-bundled/umd/gids-scrim.umd.js +5 -0
- package/dist-bundled/umd/gids-snackbar.umd.js +5 -0
- package/dist-bundled/umd/gids-text-field.umd.js +5 -0
- package/dist-bundled/umd/gids-toggle-button.umd.js +6 -2
- package/dist-bundled/umd/index.umd.js +5 -1
- package/dist-bundled/umd-complete/gids-core-web.umd.js +6 -2
- package/package.json +71 -7
- package/dist/p-CgujYzVX.js +0 -1
- package/dist-bundled/es/p-CgujYzVX-xo1axnk6.js +0 -465
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { H as l, C as n, f as r, R as o, D as d } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { d as h } from "./p-veoOgDXg-DElc87c0.js";
|
|
3
|
+
import { i as c } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
4
|
+
import { c as _ } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const g = (t) => _("gids-field", t), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
getGidsFieldClassNames: g
|
|
8
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsFieldClassNames: p } = u, f = n(class extends r {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.status = "implicit", this._hasLabel = !1, this._controlListenerTargets = [], this._controlTouched = !1, this._handleLabelSlotChange = () => {
|
|
11
|
+
this._hasLabel = (this._labelSlot?.assignedElements()?.length ?? 0) > 0;
|
|
12
|
+
}, this._setLabelSlot = (e) => {
|
|
13
|
+
this._labelSlot = e ?? void 0, this._handleLabelSlotChange();
|
|
14
|
+
}, this._setControlSlot = (e) => {
|
|
15
|
+
this._controlSlot = e ?? void 0, this._handleControlSlotChange();
|
|
16
|
+
}, this._handleControlSlotChange = () => {
|
|
17
|
+
const e = this._controlSlot?.assignedNodes({ flatten: !0 }) ?? [], s = this._findTextControl(e);
|
|
18
|
+
this._attachControlElement(s);
|
|
19
|
+
}, this._handleControlValueInput = (e) => {
|
|
20
|
+
if (!this._controlTouched) {
|
|
21
|
+
const s = e.target;
|
|
22
|
+
s instanceof HTMLInputElement && (s.type === "checkbox" || s.type === "radio") && (this._controlTouched = !0);
|
|
23
|
+
}
|
|
24
|
+
this._updateControlValidationState();
|
|
25
|
+
}, this._handleControlBlur = () => {
|
|
26
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
27
|
+
}, this._handleControlInvalid = () => {
|
|
28
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
29
|
+
}, this._handleFormReset = () => {
|
|
30
|
+
this._controlTouched = !1, this._updateControlValidationState();
|
|
31
|
+
}, this._handleFormSubmit = () => {
|
|
32
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
_handleStatusChange() {
|
|
36
|
+
this._isImplicitStatus() || this._controlValidationMessage === void 0 ? this._updateControlValidationState() : this._controlValidationMessage = void 0;
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
const t = c();
|
|
40
|
+
t !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(t);
|
|
41
|
+
}
|
|
42
|
+
componentDidLoad() {
|
|
43
|
+
setTimeout((() => {
|
|
44
|
+
this._handleControlSlotChange(), this._handleLabelSlotChange();
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
async reScanControl() {
|
|
48
|
+
this._handleControlSlotChange();
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
this._detachControlElement(), this._detachFormListeners();
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const t = this._hasStatusText(), e = this._controlValidationMessage !== void 0 ? this._controlValidationMessage : this._shouldRenderExplicitStatusText() ? this.statusText : void 0, s = this._getCurrentStatus(), i = ["gids-field__status-text"];
|
|
55
|
+
if (t) {
|
|
56
|
+
const a = this._getStatusModifierClass(s, "gids-field__status-text");
|
|
57
|
+
a != null && i.push(a);
|
|
58
|
+
}
|
|
59
|
+
return o(d, { key: "4bd0ef4ac11ded5f563595485082650801fdbe1b" }, o("div", { key: "3617e3301f53dcb21a9beb98b4a23d620e3dd39d", class: p() }, o("div", { key: "bb1f6710ee27c94346f7ee9459389d901b23d913", class: "gids-field__header", hidden: !this._hasLabelContent() }, o("slot", { key: "8fa03ca31936bc6082052b099ac29afea2ec3032", ref: this._setLabelSlot, name: "label", onSlotchange: this._handleControlSlotChange }), o("div", { key: "1b50c69005c2d0b89c47dc01c2dcbb343bdeecff", class: "gids-field__count", "aria-live": "polite" }, this.count)), o("div", { key: "b8664a96496a6e7289fb14bdadbb59dcee9af3d1", class: "gids-field__control" }, o("slot", { key: "bff757557406c0165be3569c4eb34adb1fe346ca", ref: this._setControlSlot, onSlotchange: this._handleControlSlotChange })), o("p", { key: "0638e493fc4ac98f6c10a8392c45ffde8b8340a4", class: "gids-field__supporting-text", hidden: !this._shouldShowHelperText() }, this.helperText), t ? o("p", { class: i.join(" "), role: "status", "aria-live": "polite" }, this._renderStatusIcon(s), e !== void 0 ? o("span", null, e) : null) : null));
|
|
60
|
+
}
|
|
61
|
+
_hasLabelContent() {
|
|
62
|
+
return this._hasLabel;
|
|
63
|
+
}
|
|
64
|
+
_hasHelperText() {
|
|
65
|
+
return this._hasText(this.helperText);
|
|
66
|
+
}
|
|
67
|
+
_shouldShowHelperText() {
|
|
68
|
+
return !!this._hasHelperText() && !this._hasStatusText();
|
|
69
|
+
}
|
|
70
|
+
_hasStatusText() {
|
|
71
|
+
return this._isImplicitStatus() ? this._controlValidationMessage !== void 0 : this._shouldRenderExplicitStatusText();
|
|
72
|
+
}
|
|
73
|
+
_shouldRenderExplicitStatusText() {
|
|
74
|
+
return !this._isImplicitStatus() && this.status !== "default" && this._hasText(this.statusText);
|
|
75
|
+
}
|
|
76
|
+
_renderStatusIcon(t) {
|
|
77
|
+
if (!this._hasStatusText()) return;
|
|
78
|
+
const e = this._getStatusIconName(t);
|
|
79
|
+
if (e === void 0) return;
|
|
80
|
+
const s = ["gids-field__status-icon"], i = this._getStatusModifierClass(t, "gids-field__status-icon");
|
|
81
|
+
i != null && s.push(i);
|
|
82
|
+
let a = t;
|
|
83
|
+
return t === "error" && (a = "danger"), t === "success" && (a = "positive"), o(h, { appearance: "filled", size: "sm", alt: "", name: e, class: s.join(" "), style: { "--gidsIcon-color": `var(--gids-color-icon-${a})` } });
|
|
84
|
+
}
|
|
85
|
+
_getCurrentStatus() {
|
|
86
|
+
return this._isImplicitStatus() && this._controlValidationMessage != null ? "error" : this.status ?? "implicit";
|
|
87
|
+
}
|
|
88
|
+
_getStatusIconName(t) {
|
|
89
|
+
if (t !== "implicit") return t === "success" ? "positive" : t === "error" ? "danger" : void 0;
|
|
90
|
+
}
|
|
91
|
+
_isImplicitStatus() {
|
|
92
|
+
return this.status === "implicit" || this.status === void 0;
|
|
93
|
+
}
|
|
94
|
+
_hasText(t) {
|
|
95
|
+
return typeof t == "string" && t.trim().length > 0;
|
|
96
|
+
}
|
|
97
|
+
_getStatusModifierClass(t, e) {
|
|
98
|
+
if (t !== "implicit") return `${e}--${t}`;
|
|
99
|
+
}
|
|
100
|
+
_attachControlElement(t) {
|
|
101
|
+
if (this._controlElement === t) return this._updateControlValidationState(), void this._attachFormListeners(t?.form ?? this._el.closest("form"));
|
|
102
|
+
if (this._detachControlElement(), this._controlElement = t, this._resetControlValidationState(), this._controlListenerTargets = [], t) {
|
|
103
|
+
const e = this._getControlListenerTargets(t);
|
|
104
|
+
this._controlListenerTargets = e, e.forEach(((s) => {
|
|
105
|
+
s.addEventListener("input", this._handleControlValueInput), s.addEventListener("change", this._handleControlValueInput), s.addEventListener("blur", this._handleControlBlur, !0), s.addEventListener("invalid", this._handleControlInvalid);
|
|
106
|
+
})), this._attachFormListeners(t.form ?? this._el.closest("form"));
|
|
107
|
+
}
|
|
108
|
+
this._updateControlValidationState();
|
|
109
|
+
}
|
|
110
|
+
_detachControlElement() {
|
|
111
|
+
this._controlListenerTargets.length > 0 && (this._controlListenerTargets?.forEach(((t) => {
|
|
112
|
+
t.removeEventListener("input", this._handleControlValueInput), t.removeEventListener("change", this._handleControlValueInput), t.removeEventListener("blur", this._handleControlBlur, !0), t.removeEventListener("invalid", this._handleControlInvalid);
|
|
113
|
+
})), this._controlListenerTargets = []), this._controlElement = null, this._resetControlValidationState(), this._detachFormListeners();
|
|
114
|
+
}
|
|
115
|
+
_getControlListenerTargets(t) {
|
|
116
|
+
return t instanceof HTMLInputElement && t.type === "radio" && t.name != null ? this._getRadioGroupControls(t) : [t];
|
|
117
|
+
}
|
|
118
|
+
_getRadioGroupControls(t) {
|
|
119
|
+
const e = t.form;
|
|
120
|
+
if (e && t.name != null) {
|
|
121
|
+
const s = e.elements.namedItem(t.name);
|
|
122
|
+
if (s instanceof RadioNodeList) {
|
|
123
|
+
const i = Array.from(s).filter(((a) => a instanceof HTMLInputElement && a.type === "radio" && this._el.contains(a)));
|
|
124
|
+
if (i.length > 0) return i;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (t.name != null) {
|
|
128
|
+
const s = `input[type="radio"][name="${CSS.escape(t.name)}"]`, i = Array.from(this._el.querySelectorAll(s));
|
|
129
|
+
if (i.length > 0) return i;
|
|
130
|
+
}
|
|
131
|
+
return [t];
|
|
132
|
+
}
|
|
133
|
+
_attachFormListeners(t) {
|
|
134
|
+
t !== void 0 && (t !== null ? t !== this._formElement && (this._detachFormListeners(), this._formElement = t, this._formElement.addEventListener("reset", this._handleFormReset), this._formElement.addEventListener("submit", this._handleFormSubmit)) : this._detachFormListeners());
|
|
135
|
+
}
|
|
136
|
+
_detachFormListeners() {
|
|
137
|
+
this._formElement && (this._formElement.removeEventListener("reset", this._handleFormReset), this._formElement.removeEventListener("submit", this._handleFormSubmit), this._formElement = null);
|
|
138
|
+
}
|
|
139
|
+
_findTextControl(t) {
|
|
140
|
+
for (const e of t) {
|
|
141
|
+
if (e.nodeType !== Node.ELEMENT_NODE) continue;
|
|
142
|
+
const s = e, i = this._asTextControl(s);
|
|
143
|
+
if (i !== null) return i;
|
|
144
|
+
const a = s.querySelector("input, textarea");
|
|
145
|
+
if (a instanceof HTMLInputElement || a instanceof HTMLTextAreaElement) return a;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
_asTextControl(t) {
|
|
150
|
+
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement ? t : null;
|
|
151
|
+
}
|
|
152
|
+
_resetControlValidationState() {
|
|
153
|
+
this._controlTouched = !1, this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0);
|
|
154
|
+
}
|
|
155
|
+
_updateControlValidationState() {
|
|
156
|
+
if (!this._isImplicitStatus()) return void (this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0));
|
|
157
|
+
const t = this._controlElement;
|
|
158
|
+
if (!t || t.disabled) return void (this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0));
|
|
159
|
+
const e = t.validationMessage?.trim() ?? "";
|
|
160
|
+
this._controlTouched && t.matches(":user-invalid") && e.length > 0 ? this._controlValidationMessage !== e && (this._controlValidationMessage = e) : this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0);
|
|
161
|
+
}
|
|
162
|
+
get _el() {
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
static get watchers() {
|
|
166
|
+
return { status: [{ _handleStatusChange: 0 }] };
|
|
167
|
+
}
|
|
168
|
+
static get style() {
|
|
169
|
+
return ".gids-field{display:flex;flex-direction:column;gap:var(--gids-gap-075)}.gids-field__header{display:flex;gap:var(--gids-gap-100);align-items:flex-start}.gids-field__header[hidden]{display:none}.gids-field__count{margin-left:auto;color:var(--gids-color-text-subtle);text-align:right;white-space:nowrap;font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}:host([disabled]) .gids-field__count{color:var(--gids-color-text-disabled)}.gids-field__control{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-field__supporting-text,.gids-field__status-text{margin:0;padding-top:var(--gids-padding-vertical-edge-to-element-050);font-family:var(--gids-typography-paragraph-x-small__font-family);font-size:var(--gids-typography-paragraph-x-small__font-size);font-weight:var(--gids-typography-paragraph-x-small__font-weight);letter-spacing:var(--gids-typography-paragraph-x-small__letter-spacing);line-height:var(--gids-typography-paragraph-x-small__line-height);text-transform:var(--gids-typography-paragraph-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-paragraph-x-small__font-variant-caps, inherit)}.gids-field__supporting-text{color:var(--gids-color-text-subtlest)}.gids-field__status-text{display:flex;align-items:flex-start;gap:var(--gids-gap-050)}.gids-field__status-text .gids-field__status-icon{margin-top:max(0px, -1 * (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-text>span{margin-top:max(0px, (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-icon{flex-shrink:0}.gids-field__status-text--information{color:var(--gids-color-text-information);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--information{--gidsIcon-color:$icon-color}.gids-field__status-text--success{color:var(--gids-color-text-positive);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--success{--gidsIcon-color:$icon-color}.gids-field__status-text--warning{color:var(--gids-color-text-warning);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--warning{--gidsIcon-color:$icon-color}.gids-field__status-text--error{color:var(--gids-color-text-danger);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--error{--gidsIcon-color:$icon-color}";
|
|
170
|
+
}
|
|
171
|
+
}, [257, "gids-field", { disabled: [516], count: [513], helperText: [513, "helper-text"], statusText: [513, "status-text"], status: [513], _controlValidationMessage: [32], _hasLabel: [32], reScanControl: [64] }, void 0, { status: [{ _handleStatusChange: 0 }] }]);
|
|
172
|
+
function m() {
|
|
173
|
+
typeof customElements < "u" && ["gids-field"].forEach(((t) => {
|
|
174
|
+
t === "gids-field" && (customElements.get(l(t)) || customElements.define(l(t), f));
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
m();
|
|
178
|
+
export {
|
|
179
|
+
f as d,
|
|
180
|
+
m as h
|
|
181
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { R as o } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { d as f } from "./p-veoOgDXg-DElc87c0.js";
|
|
3
|
+
import { c as u } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
const _ = ({ disabled: e }, s) => u("gids-label", { "gids-label--disabled": e }, s), y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
|
+
__proto__: null,
|
|
6
|
+
getGidsLabelClassNames: _
|
|
7
|
+
}, Symbol.toStringTag, { value: "Module" })), b = (e) => {
|
|
8
|
+
const s = Array.isArray(e) ? e[e.length - 1] : e;
|
|
9
|
+
return typeof s == "string" && s.trim().endsWith(".");
|
|
10
|
+
}, S = /\w/, h = (e) => e.replace(S, (s) => s.toLocaleUpperCase()), c = (e, s) => typeof e == "function" ? e(s) : s ? h(e) : e, C = ({ children: e, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, isLabelSentence: i }) => {
|
|
11
|
+
const n = i ? i(e) : b(e);
|
|
12
|
+
if (s === "required")
|
|
13
|
+
return c(r && r.length > 0 ? r : "(required)", n);
|
|
14
|
+
if (s === "optional")
|
|
15
|
+
return c(t && t.length > 0 ? t : "(optional)", n);
|
|
16
|
+
}, j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
17
|
+
__proto__: null,
|
|
18
|
+
getIndicatorText: C,
|
|
19
|
+
isSentence: b
|
|
20
|
+
}, Symbol.toStringTag, { value: "Module" })), L = ({ appearance: e, size: s }, t) => u("gids-dismiss-button", {
|
|
21
|
+
"gids-dismiss-button--sm": s === "sm",
|
|
22
|
+
// 'gids-dismiss-button--md': size === 'md',
|
|
23
|
+
"gids-dismiss-button--lg": s === "lg",
|
|
24
|
+
"gids-dismiss-button--bold": e === "bold"
|
|
25
|
+
}, t), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
|
+
__proto__: null,
|
|
27
|
+
getGidsDismissButtonClassNames: L
|
|
28
|
+
}, Symbol.toStringTag, { value: "Module" })), { getIndicatorText: v } = j, { getGidsLabelClassNames: z } = y, T = ({ disabled: e, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, info: i, htmlFor: n, labelId: l, class: m, isLabelSentence: g, ...p }, a) => {
|
|
29
|
+
const d = v({ children: a, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, isLabelSentence: g });
|
|
30
|
+
return o("div", { class: z({ disabled: e }, m), ...p }, o("label", { htmlFor: n, id: l }, a, d && o("span", { class: "gids-label__field-requirement" }, d)), i);
|
|
31
|
+
}, { getGidsDismissButtonClassNames: F } = O, x = ({ appearance: e = "subtle", size: s = "md", disabled: t = !1, class: r, onPressDismiss: i, label: n, ...l }) => o("button", { class: F({ appearance: e, size: s }, r), onClick: i, disabled: t, "aria-label": n, ...l }, o(f, { name: "cross", appearance: "regular" }));
|
|
32
|
+
export {
|
|
33
|
+
T as n,
|
|
34
|
+
x as o
|
|
35
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { R as l } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { c as x } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
const f = ({ size: e, indeterminate: t, value: n }, r) => x("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, r), h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
|
+
__proto__: null,
|
|
13
|
+
getGidsSpinnerControlClassNames: f
|
|
14
|
+
}, Symbol.toStringTag, { value: "Module" })), c = 64, g = 10, u = c / 2 - g / 2, _ = c / 2, a = 2 * Math.PI * u, y = `0 0 ${c} ${c}`, k = (e = 0, t) => {
|
|
15
|
+
const n = typeof t == "number" && t > 0 ? t : 1, i = Math.max(0, Math.min(n, e)) / n * 100, o = (a * i / 100).toFixed(2), m = (a - parseFloat(o)).toFixed(2);
|
|
16
|
+
return `${o} ${m}`;
|
|
17
|
+
}, v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18
|
+
__proto__: null,
|
|
19
|
+
calculateStrokeDasharray: k,
|
|
20
|
+
centerPosition: _,
|
|
21
|
+
circumference: a,
|
|
22
|
+
radius: u,
|
|
23
|
+
thickness: g,
|
|
24
|
+
viewBox: y
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsSpinnerControlClassNames: S } = h, { calculateStrokeDasharray: b, thickness: d, radius: p, centerPosition: s, viewBox: M } = v, P = ({ size: e, indeterminate: t, value: n, max: r, ...i }) => {
|
|
26
|
+
let o;
|
|
27
|
+
return t || (o = { strokeDashArray: b(n, r || 0), strokeDashoffset: "0" }), l("svg", { class: S({ size: e, indeterminate: t, value: n }), viewBox: M, ...i }, l("circle", { class: "gids-spinner-control__track", cx: s, cy: s, r: p, "stroke-width": d }), l("circle", { style: o, class: "gids-spinner-control__progress", cx: s, cy: s, r: p, "stroke-width": d }));
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
P as l
|
|
31
|
+
};
|