@editora/ui-core 0.1.21 → 0.1.22
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/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +3 -3
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +6 -6
- package/dist/alert.esm.js +6 -6
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +4 -4
- package/dist/animated-text.cjs.js +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +3 -3
- package/dist/aspect-ratio.cjs.js +3 -3
- package/dist/aspect-ratio.esm.js +3 -3
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +4 -4
- package/dist/badge.esm.js +4 -4
- package/dist/block-controls.cjs.js +4 -4
- package/dist/block-controls.esm.js +4 -4
- package/dist/box.cjs.js +2 -2
- package/dist/box.esm.js +2 -2
- package/dist/breadcrumb.cjs.js +5 -5
- package/dist/breadcrumb.esm.js +5 -5
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +4 -4
- package/dist/chart.esm.js +6 -6
- package/dist/checkbox.cjs.js +2 -2
- package/dist/checkbox.esm.js +2 -2
- package/dist/collapsible.cjs.js +7 -7
- package/dist/collapsible.esm.js +7 -7
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +82 -60
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +2 -2
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +4 -4
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +5 -2
- package/dist/data-table.esm.js +145 -142
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +48 -44
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +88 -84
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +102 -98
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
- package/dist/description.cjs.js +3 -3
- package/dist/description.esm.js +3 -3
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +72 -74
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +49 -48
- package/dist/empty-state.cjs.js +3 -3
- package/dist/empty-state.esm.js +3 -3
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +4 -4
- package/dist/file-upload.cjs.js +3 -3
- package/dist/file-upload.esm.js +5 -3
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +9 -9
- package/dist/form.cjs.js +11 -11
- package/dist/form.esm.js +11 -11
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +99 -88
- package/dist/icon-cloud.cjs.js +3 -3
- package/dist/icon-cloud.esm.js +3 -3
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +39 -32
- package/dist/label.cjs.js +3 -3
- package/dist/label.esm.js +3 -3
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +3 -3
- package/dist/marquee.esm.js +3 -3
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +29 -28
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +2 -2
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +51 -43
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +29 -27
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +4 -4
- package/dist/odometer.cjs.js +2 -2
- package/dist/odometer.esm.js +2 -2
- package/dist/orbiter.cjs.js +3 -3
- package/dist/orbiter.esm.js +3 -3
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +5 -5
- package/dist/popover.esm.js +4 -4
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +3 -3
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +1 -1
- package/dist/radio-group.esm.js +1 -1
- package/dist/radio.cjs.js +2 -2
- package/dist/radio.esm.js +2 -2
- package/dist/rating.cjs.js +17 -16
- package/dist/rating.esm.js +91 -92
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +36 -32
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/separator.cjs.js +7 -7
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -7
- package/dist/sidebar.esm.js +7 -7
- package/dist/skeleton.cjs.js +7 -7
- package/dist/skeleton.esm.js +7 -7
- package/dist/slider.cjs.js +3 -3
- package/dist/slider.esm.js +3 -3
- package/dist/slot.cjs.js +3 -3
- package/dist/slot.esm.js +3 -3
- package/dist/sortable.cjs.js +41 -42
- package/dist/sortable.esm.js +98 -99
- package/dist/spinning-text.cjs.js +3 -3
- package/dist/spinning-text.esm.js +3 -3
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.esm.js +1 -1
- package/dist/switch.cjs.js +10 -12
- package/dist/switch.esm.js +10 -12
- package/dist/table.cjs.js +9 -6
- package/dist/table.esm.js +46 -43
- package/dist/tabs.cjs.js +20 -21
- package/dist/tabs.esm.js +70 -66
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +30 -21
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +5 -5
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +4 -4
- package/dist/toast.cjs.js +6 -6
- package/dist/toast.esm.js +13 -13
- package/dist/toggle-group.cjs.js +5 -6
- package/dist/toggle-group.esm.js +63 -60
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/tooltip.cjs.js +4 -4
- package/dist/tooltip.esm.js +4 -4
- package/dist/transfer-list.cjs.js +3 -3
- package/dist/transfer-list.esm.js +3 -3
- package/dist/tree-7qbVnpGp.js +39 -0
- package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +17 -15
- package/package.json +1 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
|
@@ -80,19 +80,19 @@ const y = 1200, v = 0, I = "ease-out", O = "decimal", A = 0, S = 0.4, F = 6, L =
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
:host([tone="neutral"]) {
|
|
83
|
-
--ui-number-ticker-color: #
|
|
83
|
+
--ui-number-ticker-color: #526175;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
:host([tone="info"]) {
|
|
87
|
-
--ui-number-ticker-color: #
|
|
87
|
+
--ui-number-ticker-color: var(--ui-color-info, #0e7490);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
:host([tone="success"]) {
|
|
91
|
-
--ui-number-ticker-color: var(--ui-color-success, #
|
|
91
|
+
--ui-number-ticker-color: var(--ui-color-success, #15803d);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
:host([tone="warning"]) {
|
|
95
|
-
--ui-number-ticker-color: var(--ui-color-warning, #
|
|
95
|
+
--ui-number-ticker-color: var(--ui-color-warning, #b45309);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
:host([tone="danger"]) {
|
package/dist/odometer.cjs.js
CHANGED
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
:host([tone="success"]) {
|
|
59
|
-
--ui-odometer-color: var(--ui-color-success, #
|
|
59
|
+
--ui-odometer-color: var(--ui-color-success, #15803d);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
:host([tone="warning"]) {
|
|
63
|
-
--ui-odometer-color: var(--ui-color-warning, #
|
|
63
|
+
--ui-odometer-color: var(--ui-color-warning, #b45309);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
:host([tone="danger"]) {
|
package/dist/odometer.esm.js
CHANGED
|
@@ -57,11 +57,11 @@ const D = `
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([tone="success"]) {
|
|
60
|
-
--ui-odometer-color: var(--ui-color-success, #
|
|
60
|
+
--ui-odometer-color: var(--ui-color-success, #15803d);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
:host([tone="warning"]) {
|
|
64
|
-
--ui-odometer-color: var(--ui-color-warning, #
|
|
64
|
+
--ui-odometer-color: var(--ui-color-warning, #b45309);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
:host([tone="danger"]) {
|
package/dist/orbiter.cjs.js
CHANGED
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
:host([tone="neutral"]) {
|
|
117
|
-
--ui-orbiter-accent: #
|
|
117
|
+
--ui-orbiter-accent: #526175;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
:host([tone="info"]) {
|
|
@@ -122,11 +122,11 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
:host([tone="success"]) {
|
|
125
|
-
--ui-orbiter-accent: var(--ui-color-success, #
|
|
125
|
+
--ui-orbiter-accent: var(--ui-color-success, #15803d);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
:host([tone="warning"]) {
|
|
129
|
-
--ui-orbiter-accent: var(--ui-color-warning, #
|
|
129
|
+
--ui-orbiter-accent: var(--ui-color-warning, #b45309);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
:host([tone="danger"]) {
|
package/dist/orbiter.esm.js
CHANGED
|
@@ -173,7 +173,7 @@ const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ =
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
:host([tone="neutral"]) {
|
|
176
|
-
--ui-orbiter-accent: #
|
|
176
|
+
--ui-orbiter-accent: #526175;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
:host([tone="info"]) {
|
|
@@ -181,11 +181,11 @@ const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ =
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
:host([tone="success"]) {
|
|
184
|
-
--ui-orbiter-accent: var(--ui-color-success, #
|
|
184
|
+
--ui-orbiter-accent: var(--ui-color-success, #15803d);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
:host([tone="warning"]) {
|
|
188
|
-
--ui-orbiter-accent: var(--ui-color-warning, #
|
|
188
|
+
--ui-orbiter-accent: var(--ui-color-warning, #b45309);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
:host([tone="danger"]) {
|
package/dist/pagination.cjs.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
--ui-pagination-active-color: #ffffff;
|
|
12
12
|
--ui-pagination-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
13
13
|
--ui-pagination-color: var(--ui-color-text, #0f172a);
|
|
14
|
-
--ui-pagination-muted: var(--ui-color-muted, #
|
|
14
|
+
--ui-pagination-muted: var(--ui-color-muted, #526175);
|
|
15
15
|
--ui-pagination-padding: 6px 11px;
|
|
16
16
|
--ui-pagination-font-size: 13px;
|
|
17
17
|
--ui-pagination-shadow: none;
|
package/dist/pagination.esm.js
CHANGED
|
@@ -12,7 +12,7 @@ const r = `
|
|
|
12
12
|
--ui-pagination-active-color: #ffffff;
|
|
13
13
|
--ui-pagination-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
14
14
|
--ui-pagination-color: var(--ui-color-text, #0f172a);
|
|
15
|
-
--ui-pagination-muted: var(--ui-color-muted, #
|
|
15
|
+
--ui-pagination-muted: var(--ui-color-muted, #526175);
|
|
16
16
|
--ui-pagination-padding: 6px 11px;
|
|
17
17
|
--ui-pagination-font-size: 13px;
|
|
18
18
|
--ui-pagination-shadow: none;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("./ElementBase-EV6mVBUV.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("./ElementBase-EV6mVBUV.js"),p=require("./control-name-BmoI1m3a.js"),B=`
|
|
2
2
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
3
3
|
<path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
|
4
4
|
</svg>
|
|
5
|
-
`,
|
|
5
|
+
`,C=`
|
|
6
6
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
7
7
|
<path d="M2.4 10c1.5-3 4.3-5 7.6-5s6.1 2 7.6 5c-1.5 3-4.3 5-7.6 5s-6.1-2-7.6-5Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
8
|
<circle cx="10" cy="10" r="2.5" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
|
9
9
|
</svg>
|
|
10
|
-
`,
|
|
10
|
+
`,N=`
|
|
11
11
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
12
12
|
<path d="M3 3l14 14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/>
|
|
13
13
|
<path d="M6.1 6.1A9.3 9.3 0 0 1 10 5c3.3 0 6.1 2 7.6 5-.5 1-1.2 1.9-2 2.7M8.2 8.2A2.5 2.5 0 0 1 11.8 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
14
|
<path d="M4.4 7.1C3.6 7.9 3 8.9 2.4 10c1.5 3 4.3 5 7.6 5 1.2 0 2.4-.3 3.4-.7" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
15
|
</svg>
|
|
16
|
-
`,
|
|
16
|
+
`,M=`
|
|
17
17
|
:host {
|
|
18
18
|
--ui-input-padding: var(--ui-padding, 10px 12px);
|
|
19
19
|
--ui-input-border-color: var(--ui-color-border, var(--ui-border-color, #cbd5e1));
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
--ui-input-width: 100%;
|
|
26
26
|
--ui-input-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
|
|
27
27
|
--ui-input-color: var(--ui-color-text, var(--ui-text, #0f172a));
|
|
28
|
-
--ui-label-color: var(--ui-color-muted, var(--ui-muted, #
|
|
29
|
-
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #
|
|
28
|
+
--ui-label-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
29
|
+
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
30
30
|
--ui-input-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
31
31
|
--ui-input-error: var(--ui-color-danger, var(--ui-error, #dc2626));
|
|
32
|
-
--ui-input-success: var(--ui-color-success, var(--ui-success, #
|
|
33
|
-
--ui-input-warning: var(--ui-color-warning, var(--ui-warning, #
|
|
32
|
+
--ui-input-success: var(--ui-color-success, var(--ui-success, #15803d));
|
|
33
|
+
--ui-input-warning: var(--ui-color-warning, var(--ui-warning, #b45309));
|
|
34
34
|
--ui-input-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
35
35
|
--ui-input-shadow: none;
|
|
36
36
|
--ui-input-gap: 8px;
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
--ui-password-field-strength-gap: 8px;
|
|
41
41
|
--ui-password-field-track-bg: color-mix(in srgb, var(--ui-color-text, #0f172a) 10%, transparent);
|
|
42
42
|
--ui-password-field-strength-weak: var(--ui-color-danger, #dc2626);
|
|
43
|
-
--ui-password-field-strength-fair: var(--ui-color-warning, #
|
|
43
|
+
--ui-password-field-strength-fair: var(--ui-color-warning, #b45309);
|
|
44
44
|
--ui-password-field-strength-good: var(--ui-color-primary, #2563eb);
|
|
45
|
-
--ui-password-field-strength-strong: var(--ui-color-success, #
|
|
45
|
+
--ui-password-field-strength-strong: var(--ui-color-success, #15803d);
|
|
46
46
|
--ui-password-field-toggle-bg: transparent;
|
|
47
47
|
--ui-password-field-toggle-hover-bg: color-mix(in srgb, var(--ui-input-color) 10%, transparent);
|
|
48
48
|
--ui-password-field-toggle-active-bg: color-mix(in srgb, var(--ui-input-color) 16%, transparent);
|
|
@@ -309,7 +309,7 @@
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
.strength-caption {
|
|
312
|
-
color: var(--ui-color-muted, #
|
|
312
|
+
color: var(--ui-color-muted, #526175);
|
|
313
313
|
font-size: 11px;
|
|
314
314
|
line-height: 1.35;
|
|
315
315
|
}
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
:host([tone="success"]) {
|
|
473
|
-
--ui-input-accent: var(--ui-color-success, var(--ui-success, #
|
|
473
|
+
--ui-input-accent: var(--ui-color-success, var(--ui-success, #15803d));
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
:host([tone="warning"]) {
|
|
@@ -573,16 +573,16 @@
|
|
|
573
573
|
box-shadow: none;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
`,
|
|
577
|
-
<style>${
|
|
576
|
+
`,I=["value","placeholder","disabled","clearable","debounce","validation","size","minlength","maxlength","readonly","autofocus","counter","floating-label","name","required","pattern","autocomplete","spellcheck","variant","tone","density","shape","color","radius","label","description","data-error"];function u(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function g(o){if(!o)return!1;const t=o.assignedNodes({flatten:!0});return t.length?t.some(e=>e.nodeType===Node.TEXT_NODE?!!e.textContent?.trim():e.nodeType===Node.ELEMENT_NODE):!1}function c(o,t){const e=o.getAttribute(t);if(e==null)return!1;const i=String(e).trim().toLowerCase();return i!=="false"&&i!=="0"}function U(o){return o==="none"||o==="large"||o==="full"}function L(o){let t=0;switch(o.length>=8&&(t+=1),/[a-z]/.test(o)&&/[A-Z]/.test(o)&&(t+=1),/\d/.test(o)&&(t+=1),(/[^A-Za-z0-9]/.test(o)||o.length>=14)&&(t+=1),Math.max(1,Math.min(4,t||1))){case 1:return{score:1,label:"Weak",caption:"Use more characters and mix case, numbers, or symbols."};case 2:return{score:2,label:"Fair",caption:"Add numbers or symbols to reduce guessability."};case 3:return{score:3,label:"Good",caption:"Solid baseline. Longer passphrases are even better."};default:return{score:4,label:"Strong",caption:"Strong password shape for production accounts."}}}class E extends q.ElementBase{constructor(){super(),this._input=null,this._clearBtn=null,this._toggleBtn=null,this._debounceTimer=null,this._formUnregister=null,this._uid=Math.random().toString(36).slice(2,9),this._autofocusApplied=!1,this._revealed=!1,this._lastStrengthKey="",this.strengthEvaluator=null,this._onNativeInput=this._onNativeInput.bind(this),this._onNativeChange=this._onNativeChange.bind(this),this._onClearClick=this._onClearClick.bind(this),this._onToggleClick=this._onToggleClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return[...I,"aria-label","aria-description","aria-describedby","show-strength","revealable"]}get value(){return this.getAttribute("value")||""}set value(t){t?this.setAttribute("value",t):this.removeAttribute("value")}get revealed(){return this._revealed}connectedCallback(){super.connectedCallback(),this.root.addEventListener("slotchange",this._onSlotChange),this._registerWithForm()}disconnectedCallback(){this.root.removeEventListener("slotchange",this._onSlotChange),this._detachListeners(),this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null),this._formUnregister&&(this._formUnregister(),this._formUnregister=null),this._autofocusApplied=!1,super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i&&(t==="name"&&this.isConnected&&this._registerWithForm(),t==="autofocus"&&!this.hasAttribute("autofocus")&&(this._autofocusApplied=!1),!(!this.isConnected||!this._input))){if(t==="value"){this._syncInputValue(this.value),this._syncStrengthUi();return}this._syncUi(),t==="autofocus"&&this.hasAttribute("autofocus")&&!this._autofocusApplied&&(this._autofocusApplied=!0,queueMicrotask(()=>{if(this.isConnected)try{this._input?.focus({preventScroll:!0})}catch{this._input?.focus()}}))}}shouldRenderOnAttributeChange(){return!1}focus(t){if(this._input){this._input.focus(t);return}super.focus(t)}blur(){this._input?.blur()}select(){this._input?.select()}toggleVisibility(t){if(c(this,"disabled")||this.hasAttribute("readonly")||this.getAttribute("revealable")==="false")return;const e=typeof t=="boolean"?t:!this._revealed;if(e===this._revealed)return;const i=this._input?.selectionStart??null,r=this._input?.selectionEnd??null;this._revealed=e,this._syncToggleUi(),this.dispatchEvent(new CustomEvent("visibility-change",{detail:{revealed:this._revealed},bubbles:!0,composed:!0})),queueMicrotask(()=>{const n=this._input;if(n){try{n.focus({preventScroll:!0})}catch{n.focus()}if(i!=null&&r!=null&&typeof n.setSelectionRange=="function")try{n.setSelectionRange(i,r)}catch{}}})}render(){const t=this.value,e=this.getAttribute("label")||"",i=this.getAttribute("description")||"",r=this.getAttribute("data-error")||"",n=this.getAttribute("placeholder")||"",s=this.hasAttribute("required")?'<span class="required" aria-hidden="true">*</span>':"",a=this.hasAttribute("floating-label");this.setContent(`
|
|
577
|
+
<style>${M}</style>
|
|
578
578
|
<div class="root" part="root">
|
|
579
579
|
<div class="meta" part="meta">
|
|
580
580
|
<label class="label" id="${this._uid}-label" part="label">
|
|
581
|
-
<slot name="label">${
|
|
581
|
+
<slot name="label">${u(e)}</slot>
|
|
582
582
|
${s}
|
|
583
583
|
</label>
|
|
584
584
|
<p class="description" id="${this._uid}-description" part="description">
|
|
585
|
-
<slot name="description">${
|
|
585
|
+
<slot name="description">${u(i)}</slot>
|
|
586
586
|
</p>
|
|
587
587
|
</div>
|
|
588
588
|
|
|
@@ -593,22 +593,22 @@
|
|
|
593
593
|
<input
|
|
594
594
|
part="input"
|
|
595
595
|
type="password"
|
|
596
|
-
value="${
|
|
597
|
-
placeholder="${
|
|
596
|
+
value="${u(t)}"
|
|
597
|
+
placeholder="${u(n)}"
|
|
598
598
|
/>
|
|
599
|
-
${a?`<span class="floating-label" part="floating-label">${
|
|
599
|
+
${a?`<span class="floating-label" part="floating-label">${u(e||n||"Password")}</span>`:""}
|
|
600
600
|
</div>
|
|
601
601
|
|
|
602
602
|
<div class="actions" part="actions">
|
|
603
|
-
<button class="clear-btn" part="clear" type="button" aria-label="Clear" hidden>${
|
|
603
|
+
<button class="clear-btn" part="clear" type="button" aria-label="Clear" hidden>${B}</button>
|
|
604
604
|
<span class="suffix-slot" part="suffix"><slot name="suffix"></slot></span>
|
|
605
|
-
<button class="toggle-btn" part="toggle" type="button" aria-label="Show password">${
|
|
605
|
+
<button class="toggle-btn" part="toggle" type="button" aria-label="Show password">${C}</button>
|
|
606
606
|
</div>
|
|
607
607
|
</div>
|
|
608
608
|
|
|
609
609
|
<div class="footer" part="footer">
|
|
610
610
|
<p class="error" id="${this._uid}-error" part="error" aria-live="polite">
|
|
611
|
-
<slot name="error">${
|
|
611
|
+
<slot name="error">${u(r)}</slot>
|
|
612
612
|
</p>
|
|
613
613
|
<p class="counter" part="counter"></p>
|
|
614
614
|
</div>
|
|
@@ -623,4 +623,4 @@
|
|
|
623
623
|
</div>
|
|
624
624
|
</div>
|
|
625
625
|
</div>
|
|
626
|
-
`),this._detachListeners(),this._input=this.root.querySelector("input"),this._clearBtn=this.root.querySelector(".clear-btn"),this._toggleBtn=this.root.querySelector(".toggle-btn"),this._input?.addEventListener("input",this._onNativeInput),this._input?.addEventListener("change",this._onNativeChange),this._clearBtn?.addEventListener("click",this._onClearClick),this._toggleBtn?.addEventListener("click",this._onToggleClick),this._syncUi()}_detachListeners(){this._input?.removeEventListener("input",this._onNativeInput),this._input?.removeEventListener("change",this._onNativeChange),this._clearBtn?.removeEventListener("click",this._onClearClick),this._toggleBtn?.removeEventListener("click",this._onToggleClick),this._clearBtn=null,this._toggleBtn=null}_syncHostTokens(){const t=this.getAttribute("color");t?this.style.setProperty("--ui-input-accent",t):this.style.removeProperty("--ui-input-accent");const e=this.getAttribute("radius")||"";e&&!
|
|
626
|
+
`),this._detachListeners(),this._input=this.root.querySelector("input"),this._clearBtn=this.root.querySelector(".clear-btn"),this._toggleBtn=this.root.querySelector(".toggle-btn"),this._input?.addEventListener("input",this._onNativeInput),this._input?.addEventListener("change",this._onNativeChange),this._clearBtn?.addEventListener("click",this._onClearClick),this._toggleBtn?.addEventListener("click",this._onToggleClick),this._syncUi()}_detachListeners(){this._input?.removeEventListener("input",this._onNativeInput),this._input?.removeEventListener("change",this._onNativeChange),this._clearBtn?.removeEventListener("click",this._onClearClick),this._toggleBtn?.removeEventListener("click",this._onToggleClick),this._clearBtn=null,this._toggleBtn=null}_syncHostTokens(){const t=this.getAttribute("color");t?this.style.setProperty("--ui-input-accent",t):this.style.removeProperty("--ui-input-accent");const e=this.getAttribute("radius")||"";e&&!U(e)?this.style.setProperty("--ui-input-border-radius",e):this.style.removeProperty("--ui-input-border-radius")}_syncControlAttrs(){if(this._syncHostTokens(),!this._input)return;const t=c(this,"disabled"),e=this.hasAttribute("required"),i=this.hasAttribute("readonly"),r=this.getAttribute("maxlength")||"",n=this.getAttribute("minlength")||"",s=this.getAttribute("pattern")||"",a=this.getAttribute("autocomplete")||"current-password",l=this.getAttribute("spellcheck")||"",h=this.getAttribute("placeholder")||"",d=this.getAttribute("name")||"";this._input.disabled=t,this._input.required=e,this._input.readOnly=i,this._input.placeholder=h,this._input.name=d,this._input.type=this._revealed?"text":"password",this._input.setAttribute("autocomplete",a),s?this._input.setAttribute("pattern",s):this._input.removeAttribute("pattern"),l?this._input.setAttribute("spellcheck",l):this._input.removeAttribute("spellcheck"),r&&Number.isFinite(Number(r))?this._input.setAttribute("maxlength",r):this._input.removeAttribute("maxlength"),n&&Number.isFinite(Number(n))?this._input.setAttribute("minlength",n):this._input.removeAttribute("minlength")}_syncInputValue(t){this._input&&this._input.value!==t&&(this._input.value=t);const e=this.root.querySelector(".shell");e&&e.setAttribute("data-has-value",t?"true":"false"),this._clearBtn&&(c(this,"clearable")&&t.length>0&&!c(this,"disabled")&&!this.hasAttribute("readonly")?this._clearBtn.removeAttribute("hidden"):this._clearBtn.setAttribute("hidden",""));const i=this.root.querySelector(".counter");if(i&&this.hasAttribute("counter")){const r=this.getAttribute("maxlength");i.textContent=r?`${t.length}/${r}`:String(t.length)}else i&&(i.textContent="")}_syncToggleUi(){if(!this._toggleBtn||!this._input)return;this._input.type=this._revealed?"text":"password";const t=this.getAttribute("revealable")!=="false",e=c(this,"disabled")||this.hasAttribute("readonly");this._toggleBtn.hidden=!t,this._toggleBtn.disabled=e,this._toggleBtn.setAttribute("aria-pressed",this._revealed?"true":"false"),this._toggleBtn.setAttribute("aria-label",this._revealed?"Hide password":"Show password");const i=this._revealed?"revealed":"hidden";this._toggleBtn.dataset.iconState!==i&&(this._toggleBtn.dataset.iconState=i,this._toggleBtn.innerHTML=this._revealed?N:C)}_syncStrengthUi(){const t=this.root.querySelector(".strength"),e=this.root.querySelector(".strength-label"),i=this.root.querySelector(".strength-caption");if(!t||!e||!i)return;const r=this.value,n=this.hasAttribute("show-strength")&&r.length>0;if(t.hidden=!n,!n){delete t.dataset.score,e.textContent="",i.textContent="",this._lastStrengthKey="";return}const s=(this.strengthEvaluator||L)(r);t.dataset.score=String(s.score),e.textContent=s.label,i.textContent=s.caption;const a=`${r}|${s.score}|${s.label}|${s.caption}`;a!==this._lastStrengthKey&&(this._lastStrengthKey=a,this.dispatchEvent(new CustomEvent("strength-change",{detail:{value:r,score:s.score,label:s.label,caption:s.caption},bubbles:!0,composed:!0})))}_syncDerivedState(){const t=this.root.querySelector('slot[name="label"]'),e=this.root.querySelector('slot[name="description"]'),i=this.root.querySelector('slot[name="error"]'),r=this.root.querySelector('slot[name="prefix"]'),n=this.root.querySelector('slot[name="suffix"]'),s=(this.getAttribute("label")||"").trim(),a=(this.getAttribute("description")||"").trim(),l=(this.getAttribute("data-error")||"").trim(),h=!!s||g(t),d=!!a||g(e),b=!!l||g(i),z=g(r),T=g(n),v=this.root.querySelector(".label"),m=this.root.querySelector(".description"),_=this.root.querySelector(".prefix"),x=this.root.querySelector(".suffix-slot"),y=this.root.querySelector(".meta"),w=this.root.querySelector(".footer"),A=this.root.querySelector(".error"),k=this.root.querySelector(".counter");p.syncSlotFallbackText(t,s),p.syncSlotFallbackText(e,a),p.syncSlotFallbackText(i,l),v&&v.toggleAttribute("hidden",!h),m&&m.toggleAttribute("hidden",!d),_&&_.toggleAttribute("hidden",!z),x&&x.toggleAttribute("hidden",!T),y&&y.toggleAttribute("hidden",!h&&!d);const S=this.hasAttribute("counter");if(k&&k.toggleAttribute("hidden",!S),A&&A.toggleAttribute("hidden",!b),w&&w.toggleAttribute("hidden",!b&&!S),!this._input)return;p.syncControlName(this._input,this,h?`${this._uid}-label`:null);const f=[];d&&f.push(`${this._uid}-description`),b&&f.push(`${this._uid}-error`),p.syncControlDescription(this._input,this,this._uid,f),this.getAttribute("validation")==="error"||!!l?this._input.setAttribute("aria-invalid","true"):this._input.removeAttribute("aria-invalid"),this.hasAttribute("required")?this._input.setAttribute("aria-required","true"):this._input.removeAttribute("aria-required")}_syncUi(){this._syncControlAttrs(),this._syncInputValue(this.value),this._syncDerivedState(),this._syncToggleUi(),this._syncStrengthUi(),this.hasAttribute("autofocus")&&!this._autofocusApplied&&(this._autofocusApplied=!0,queueMicrotask(()=>{if(this.isConnected)try{this._input?.focus({preventScroll:!0})}catch{this._input?.focus()}}))}_emitValueEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{value:e},bubbles:!0,composed:!0}))}_registerWithForm(){this._formUnregister&&(this._formUnregister(),this._formUnregister=null);try{const r=this.getRootNode().host?.closest?.("ui-form")||null||this.closest("ui-form"),n=this.getAttribute("name");r&&typeof r.registerField=="function"&&n&&(this._formUnregister=r.registerField(n,{name:n,getValue:()=>this.value,setValue:s=>{this.value=String(s??"")},validate:async()=>this._input?{valid:this._input.checkValidity(),message:this._input.validationMessage||void 0}:{valid:!0},setError:s=>{s?(this.setAttribute("validation","error"),this.setAttribute("data-error",s)):(this.removeAttribute("validation"),this.removeAttribute("data-error")),this._syncUi()}}))}catch{}}_onSlotChange(){this._syncDerivedState()}_onNativeInput(t){const e=t.target.value;this.getAttribute("value")!==e?e?this.setAttribute("value",e):this.removeAttribute("value"):(this._syncInputValue(e),this._syncStrengthUi()),this._emitValueEvent("input",e);const i=Number(this.getAttribute("debounce")||0);i>0?(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._emitValueEvent("debounced-input",e),this._debounceTimer=null},i)):this._emitValueEvent("debounced-input",e)}_onNativeChange(t){const e=t.target.value;this._emitValueEvent("change",e)}_onClearClick(t){if(t.preventDefault(),!(c(this,"disabled")||this.hasAttribute("readonly"))&&this._input){this.value="",this._input.value="",this._input.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this._input.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{bubbles:!0,composed:!0}));try{this._input.focus({preventScroll:!0})}catch{this._input.focus()}}}_onToggleClick(t){t.preventDefault(),t.stopPropagation(),this.toggleVisibility()}}typeof customElements<"u"&&!customElements.get("ui-password-field")&&customElements.define("ui-password-field",E);exports.UIPasswordField=E;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
|
|
1
|
+
import { E as T } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { b as f, s as q, a as B } from "./control-name-Bpj7F34X.mjs";
|
|
3
|
+
const N = `
|
|
3
4
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
4
5
|
<path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
|
5
6
|
</svg>
|
|
6
|
-
`,
|
|
7
|
+
`, S = `
|
|
7
8
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
8
9
|
<path d="M2.4 10c1.5-3 4.3-5 7.6-5s6.1 2 7.6 5c-1.5 3-4.3 5-7.6 5s-6.1-2-7.6-5Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
10
|
<circle cx="10" cy="10" r="2.5" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
|
10
11
|
</svg>
|
|
11
|
-
`,
|
|
12
|
+
`, M = `
|
|
12
13
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
13
14
|
<path d="M3 3l14 14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/>
|
|
14
15
|
<path d="M6.1 6.1A9.3 9.3 0 0 1 10 5c3.3 0 6.1 2 7.6 5-.5 1-1.2 1.9-2 2.7M8.2 8.2A2.5 2.5 0 0 1 11.8 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
16
|
<path d="M4.4 7.1C3.6 7.9 3 8.9 2.4 10c1.5 3 4.3 5 7.6 5 1.2 0 2.4-.3 3.4-.7" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
16
17
|
</svg>
|
|
17
|
-
`,
|
|
18
|
+
`, I = `
|
|
18
19
|
:host {
|
|
19
20
|
--ui-input-padding: var(--ui-padding, 10px 12px);
|
|
20
21
|
--ui-input-border-color: var(--ui-color-border, var(--ui-border-color, #cbd5e1));
|
|
@@ -26,12 +27,12 @@ const q = `
|
|
|
26
27
|
--ui-input-width: 100%;
|
|
27
28
|
--ui-input-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
|
|
28
29
|
--ui-input-color: var(--ui-color-text, var(--ui-text, #0f172a));
|
|
29
|
-
--ui-label-color: var(--ui-color-muted, var(--ui-muted, #
|
|
30
|
-
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #
|
|
30
|
+
--ui-label-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
31
|
+
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
31
32
|
--ui-input-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
32
33
|
--ui-input-error: var(--ui-color-danger, var(--ui-error, #dc2626));
|
|
33
|
-
--ui-input-success: var(--ui-color-success, var(--ui-success, #
|
|
34
|
-
--ui-input-warning: var(--ui-color-warning, var(--ui-warning, #
|
|
34
|
+
--ui-input-success: var(--ui-color-success, var(--ui-success, #15803d));
|
|
35
|
+
--ui-input-warning: var(--ui-color-warning, var(--ui-warning, #b45309));
|
|
35
36
|
--ui-input-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
36
37
|
--ui-input-shadow: none;
|
|
37
38
|
--ui-input-gap: 8px;
|
|
@@ -41,9 +42,9 @@ const q = `
|
|
|
41
42
|
--ui-password-field-strength-gap: 8px;
|
|
42
43
|
--ui-password-field-track-bg: color-mix(in srgb, var(--ui-color-text, #0f172a) 10%, transparent);
|
|
43
44
|
--ui-password-field-strength-weak: var(--ui-color-danger, #dc2626);
|
|
44
|
-
--ui-password-field-strength-fair: var(--ui-color-warning, #
|
|
45
|
+
--ui-password-field-strength-fair: var(--ui-color-warning, #b45309);
|
|
45
46
|
--ui-password-field-strength-good: var(--ui-color-primary, #2563eb);
|
|
46
|
-
--ui-password-field-strength-strong: var(--ui-color-success, #
|
|
47
|
+
--ui-password-field-strength-strong: var(--ui-color-success, #15803d);
|
|
47
48
|
--ui-password-field-toggle-bg: transparent;
|
|
48
49
|
--ui-password-field-toggle-hover-bg: color-mix(in srgb, var(--ui-input-color) 10%, transparent);
|
|
49
50
|
--ui-password-field-toggle-active-bg: color-mix(in srgb, var(--ui-input-color) 16%, transparent);
|
|
@@ -310,7 +311,7 @@ const q = `
|
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
.strength-caption {
|
|
313
|
-
color: var(--ui-color-muted, #
|
|
314
|
+
color: var(--ui-color-muted, #526175);
|
|
314
315
|
font-size: 11px;
|
|
315
316
|
line-height: 1.35;
|
|
316
317
|
}
|
|
@@ -471,7 +472,7 @@ const q = `
|
|
|
471
472
|
}
|
|
472
473
|
|
|
473
474
|
:host([tone="success"]) {
|
|
474
|
-
--ui-input-accent: var(--ui-color-success, var(--ui-success, #
|
|
475
|
+
--ui-input-accent: var(--ui-color-success, var(--ui-success, #15803d));
|
|
475
476
|
}
|
|
476
477
|
|
|
477
478
|
:host([tone="warning"]) {
|
|
@@ -574,7 +575,7 @@ const q = `
|
|
|
574
575
|
box-shadow: none;
|
|
575
576
|
}
|
|
576
577
|
}
|
|
577
|
-
`,
|
|
578
|
+
`, L = [
|
|
578
579
|
"value",
|
|
579
580
|
"placeholder",
|
|
580
581
|
"disabled",
|
|
@@ -603,7 +604,7 @@ const q = `
|
|
|
603
604
|
"description",
|
|
604
605
|
"data-error"
|
|
605
606
|
];
|
|
606
|
-
function
|
|
607
|
+
function u(o) {
|
|
607
608
|
return o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
608
609
|
}
|
|
609
610
|
function p(o) {
|
|
@@ -611,16 +612,16 @@ function p(o) {
|
|
|
611
612
|
const t = o.assignedNodes({ flatten: !0 });
|
|
612
613
|
return t.length ? t.some((e) => e.nodeType === Node.TEXT_NODE ? !!e.textContent?.trim() : e.nodeType === Node.ELEMENT_NODE) : !1;
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
+
function c(o, t) {
|
|
615
616
|
const e = o.getAttribute(t);
|
|
616
617
|
if (e == null) return !1;
|
|
617
618
|
const i = String(e).trim().toLowerCase();
|
|
618
619
|
return i !== "false" && i !== "0";
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
+
function U(o) {
|
|
621
622
|
return o === "none" || o === "large" || o === "full";
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
+
function $(o) {
|
|
624
625
|
let t = 0;
|
|
625
626
|
switch (o.length >= 8 && (t += 1), /[a-z]/.test(o) && /[A-Z]/.test(o) && (t += 1), /\d/.test(o) && (t += 1), (/[^A-Za-z0-9]/.test(o) || o.length >= 14) && (t += 1), Math.max(1, Math.min(4, t || 1))) {
|
|
626
627
|
case 1:
|
|
@@ -633,12 +634,12 @@ function I(o) {
|
|
|
633
634
|
return { score: 4, label: "Strong", caption: "Strong password shape for production accounts." };
|
|
634
635
|
}
|
|
635
636
|
}
|
|
636
|
-
class
|
|
637
|
+
class F extends T {
|
|
637
638
|
constructor() {
|
|
638
639
|
super(), this._input = null, this._clearBtn = null, this._toggleBtn = null, this._debounceTimer = null, this._formUnregister = null, this._uid = Math.random().toString(36).slice(2, 9), this._autofocusApplied = !1, this._revealed = !1, this._lastStrengthKey = "", this.strengthEvaluator = null, this._onNativeInput = this._onNativeInput.bind(this), this._onNativeChange = this._onNativeChange.bind(this), this._onClearClick = this._onClearClick.bind(this), this._onToggleClick = this._onToggleClick.bind(this), this._onSlotChange = this._onSlotChange.bind(this);
|
|
639
640
|
}
|
|
640
641
|
static get observedAttributes() {
|
|
641
|
-
return [...
|
|
642
|
+
return [...L, "aria-label", "aria-description", "aria-describedby", "show-strength", "revealable"];
|
|
642
643
|
}
|
|
643
644
|
get value() {
|
|
644
645
|
return this.getAttribute("value") || "";
|
|
@@ -688,7 +689,7 @@ class L extends z {
|
|
|
688
689
|
this._input?.select();
|
|
689
690
|
}
|
|
690
691
|
toggleVisibility(t) {
|
|
691
|
-
if (
|
|
692
|
+
if (c(this, "disabled") || this.hasAttribute("readonly") || this.getAttribute("revealable") === "false") return;
|
|
692
693
|
const e = typeof t == "boolean" ? t : !this._revealed;
|
|
693
694
|
if (e === this._revealed) return;
|
|
694
695
|
const i = this._input?.selectionStart ?? null, r = this._input?.selectionEnd ?? null;
|
|
@@ -717,15 +718,15 @@ class L extends z {
|
|
|
717
718
|
render() {
|
|
718
719
|
const t = this.value, e = this.getAttribute("label") || "", i = this.getAttribute("description") || "", r = this.getAttribute("data-error") || "", n = this.getAttribute("placeholder") || "", s = this.hasAttribute("required") ? '<span class="required" aria-hidden="true">*</span>' : "", a = this.hasAttribute("floating-label");
|
|
719
720
|
this.setContent(`
|
|
720
|
-
<style>${
|
|
721
|
+
<style>${I}</style>
|
|
721
722
|
<div class="root" part="root">
|
|
722
723
|
<div class="meta" part="meta">
|
|
723
724
|
<label class="label" id="${this._uid}-label" part="label">
|
|
724
|
-
<slot name="label">${
|
|
725
|
+
<slot name="label">${u(e)}</slot>
|
|
725
726
|
${s}
|
|
726
727
|
</label>
|
|
727
728
|
<p class="description" id="${this._uid}-description" part="description">
|
|
728
|
-
<slot name="description">${
|
|
729
|
+
<slot name="description">${u(i)}</slot>
|
|
729
730
|
</p>
|
|
730
731
|
</div>
|
|
731
732
|
|
|
@@ -736,22 +737,22 @@ class L extends z {
|
|
|
736
737
|
<input
|
|
737
738
|
part="input"
|
|
738
739
|
type="password"
|
|
739
|
-
value="${
|
|
740
|
-
placeholder="${
|
|
740
|
+
value="${u(t)}"
|
|
741
|
+
placeholder="${u(n)}"
|
|
741
742
|
/>
|
|
742
|
-
${a ? `<span class="floating-label" part="floating-label">${
|
|
743
|
+
${a ? `<span class="floating-label" part="floating-label">${u(e || n || "Password")}</span>` : ""}
|
|
743
744
|
</div>
|
|
744
745
|
|
|
745
746
|
<div class="actions" part="actions">
|
|
746
|
-
<button class="clear-btn" part="clear" type="button" aria-label="Clear" hidden>${
|
|
747
|
+
<button class="clear-btn" part="clear" type="button" aria-label="Clear" hidden>${N}</button>
|
|
747
748
|
<span class="suffix-slot" part="suffix"><slot name="suffix"></slot></span>
|
|
748
|
-
<button class="toggle-btn" part="toggle" type="button" aria-label="Show password">${
|
|
749
|
+
<button class="toggle-btn" part="toggle" type="button" aria-label="Show password">${S}</button>
|
|
749
750
|
</div>
|
|
750
751
|
</div>
|
|
751
752
|
|
|
752
753
|
<div class="footer" part="footer">
|
|
753
754
|
<p class="error" id="${this._uid}-error" part="error" aria-live="polite">
|
|
754
|
-
<slot name="error">${
|
|
755
|
+
<slot name="error">${u(r)}</slot>
|
|
755
756
|
</p>
|
|
756
757
|
<p class="counter" part="counter"></p>
|
|
757
758
|
</div>
|
|
@@ -775,17 +776,17 @@ class L extends z {
|
|
|
775
776
|
const t = this.getAttribute("color");
|
|
776
777
|
t ? this.style.setProperty("--ui-input-accent", t) : this.style.removeProperty("--ui-input-accent");
|
|
777
778
|
const e = this.getAttribute("radius") || "";
|
|
778
|
-
e && !
|
|
779
|
+
e && !U(e) ? this.style.setProperty("--ui-input-border-radius", e) : this.style.removeProperty("--ui-input-border-radius");
|
|
779
780
|
}
|
|
780
781
|
_syncControlAttrs() {
|
|
781
782
|
if (this._syncHostTokens(), !this._input) return;
|
|
782
|
-
const t =
|
|
783
|
-
this._input.disabled = t, this._input.required = e, this._input.readOnly = i, this._input.placeholder = h, this._input.name = d, this._input.type = this._revealed ? "text" : "password", this._input.setAttribute("autocomplete", a), s ? this._input.setAttribute("pattern", s) : this._input.removeAttribute("pattern"),
|
|
783
|
+
const t = c(this, "disabled"), e = this.hasAttribute("required"), i = this.hasAttribute("readonly"), r = this.getAttribute("maxlength") || "", n = this.getAttribute("minlength") || "", s = this.getAttribute("pattern") || "", a = this.getAttribute("autocomplete") || "current-password", l = this.getAttribute("spellcheck") || "", h = this.getAttribute("placeholder") || "", d = this.getAttribute("name") || "";
|
|
784
|
+
this._input.disabled = t, this._input.required = e, this._input.readOnly = i, this._input.placeholder = h, this._input.name = d, this._input.type = this._revealed ? "text" : "password", this._input.setAttribute("autocomplete", a), s ? this._input.setAttribute("pattern", s) : this._input.removeAttribute("pattern"), l ? this._input.setAttribute("spellcheck", l) : this._input.removeAttribute("spellcheck"), r && Number.isFinite(Number(r)) ? this._input.setAttribute("maxlength", r) : this._input.removeAttribute("maxlength"), n && Number.isFinite(Number(n)) ? this._input.setAttribute("minlength", n) : this._input.removeAttribute("minlength");
|
|
784
785
|
}
|
|
785
786
|
_syncInputValue(t) {
|
|
786
787
|
this._input && this._input.value !== t && (this._input.value = t);
|
|
787
788
|
const e = this.root.querySelector(".shell");
|
|
788
|
-
e && e.setAttribute("data-has-value", t ? "true" : "false"), this._clearBtn && (
|
|
789
|
+
e && e.setAttribute("data-has-value", t ? "true" : "false"), this._clearBtn && (c(this, "clearable") && t.length > 0 && !c(this, "disabled") && !this.hasAttribute("readonly") ? this._clearBtn.removeAttribute("hidden") : this._clearBtn.setAttribute("hidden", ""));
|
|
789
790
|
const i = this.root.querySelector(".counter");
|
|
790
791
|
if (i && this.hasAttribute("counter")) {
|
|
791
792
|
const r = this.getAttribute("maxlength");
|
|
@@ -795,10 +796,10 @@ class L extends z {
|
|
|
795
796
|
_syncToggleUi() {
|
|
796
797
|
if (!this._toggleBtn || !this._input) return;
|
|
797
798
|
this._input.type = this._revealed ? "text" : "password";
|
|
798
|
-
const t = this.getAttribute("revealable") !== "false", e =
|
|
799
|
+
const t = this.getAttribute("revealable") !== "false", e = c(this, "disabled") || this.hasAttribute("readonly");
|
|
799
800
|
this._toggleBtn.hidden = !t, this._toggleBtn.disabled = e, this._toggleBtn.setAttribute("aria-pressed", this._revealed ? "true" : "false"), this._toggleBtn.setAttribute("aria-label", this._revealed ? "Hide password" : "Show password");
|
|
800
801
|
const i = this._revealed ? "revealed" : "hidden";
|
|
801
|
-
this._toggleBtn.dataset.iconState !== i && (this._toggleBtn.dataset.iconState = i, this._toggleBtn.innerHTML = this._revealed ?
|
|
802
|
+
this._toggleBtn.dataset.iconState !== i && (this._toggleBtn.dataset.iconState = i, this._toggleBtn.innerHTML = this._revealed ? M : S);
|
|
802
803
|
}
|
|
803
804
|
_syncStrengthUi() {
|
|
804
805
|
const t = this.root.querySelector(".strength"), e = this.root.querySelector(".strength-label"), i = this.root.querySelector(".strength-caption");
|
|
@@ -808,7 +809,7 @@ class L extends z {
|
|
|
808
809
|
delete t.dataset.score, e.textContent = "", i.textContent = "", this._lastStrengthKey = "";
|
|
809
810
|
return;
|
|
810
811
|
}
|
|
811
|
-
const s = (this.strengthEvaluator ||
|
|
812
|
+
const s = (this.strengthEvaluator || $)(r);
|
|
812
813
|
t.dataset.score = String(s.score), e.textContent = s.label, i.textContent = s.caption;
|
|
813
814
|
const a = `${r}|${s.score}|${s.label}|${s.caption}`;
|
|
814
815
|
a !== this._lastStrengthKey && (this._lastStrengthKey = a, this.dispatchEvent(
|
|
@@ -825,13 +826,13 @@ class L extends z {
|
|
|
825
826
|
));
|
|
826
827
|
}
|
|
827
828
|
_syncDerivedState() {
|
|
828
|
-
const t = this.root.querySelector('slot[name="label"]'), e = this.root.querySelector('slot[name="description"]'), i = this.root.querySelector('slot[name="error"]'), r = this.root.querySelector('slot[name="prefix"]'), n = this.root.querySelector('slot[name="suffix"]'), s = (this.getAttribute("label") || "").trim(), a = (this.getAttribute("description") || "").trim(),
|
|
829
|
-
f
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
d &&
|
|
829
|
+
const t = this.root.querySelector('slot[name="label"]'), e = this.root.querySelector('slot[name="description"]'), i = this.root.querySelector('slot[name="error"]'), r = this.root.querySelector('slot[name="prefix"]'), n = this.root.querySelector('slot[name="suffix"]'), s = (this.getAttribute("label") || "").trim(), a = (this.getAttribute("description") || "").trim(), l = (this.getAttribute("data-error") || "").trim(), h = !!s || p(t), d = !!a || p(e), g = !!l || p(i), E = p(r), z = p(n), v = this.root.querySelector(".label"), m = this.root.querySelector(".description"), _ = this.root.querySelector(".prefix"), x = this.root.querySelector(".suffix-slot"), y = this.root.querySelector(".meta"), w = this.root.querySelector(".footer"), A = this.root.querySelector(".error"), k = this.root.querySelector(".counter");
|
|
830
|
+
f(t, s), f(e, a), f(i, l), v && v.toggleAttribute("hidden", !h), m && m.toggleAttribute("hidden", !d), _ && _.toggleAttribute("hidden", !E), x && x.toggleAttribute("hidden", !z), y && y.toggleAttribute("hidden", !h && !d);
|
|
831
|
+
const C = this.hasAttribute("counter");
|
|
832
|
+
if (k && k.toggleAttribute("hidden", !C), A && A.toggleAttribute("hidden", !g), w && w.toggleAttribute("hidden", !g && !C), !this._input) return;
|
|
833
|
+
q(this._input, this, h ? `${this._uid}-label` : null);
|
|
834
|
+
const b = [];
|
|
835
|
+
d && b.push(`${this._uid}-description`), g && b.push(`${this._uid}-error`), B(this._input, this, this._uid, b), this.getAttribute("validation") === "error" || !!l ? this._input.setAttribute("aria-invalid", "true") : this._input.removeAttribute("aria-invalid"), this.hasAttribute("required") ? this._input.setAttribute("aria-required", "true") : this._input.removeAttribute("aria-required");
|
|
835
836
|
}
|
|
836
837
|
_syncUi() {
|
|
837
838
|
this._syncControlAttrs(), this._syncInputValue(this.value), this._syncDerivedState(), this._syncToggleUi(), this._syncStrengthUi(), this.hasAttribute("autofocus") && !this._autofocusApplied && (this._autofocusApplied = !0, queueMicrotask(() => {
|
|
@@ -886,7 +887,7 @@ class L extends z {
|
|
|
886
887
|
this._emitValueEvent("change", e);
|
|
887
888
|
}
|
|
888
889
|
_onClearClick(t) {
|
|
889
|
-
if (t.preventDefault(), !(
|
|
890
|
+
if (t.preventDefault(), !(c(this, "disabled") || this.hasAttribute("readonly")) && this._input) {
|
|
890
891
|
this.value = "", this._input.value = "", this._input.dispatchEvent(new Event("input", { bubbles: !0, composed: !0 })), this._input.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("clear", { bubbles: !0, composed: !0 }));
|
|
891
892
|
try {
|
|
892
893
|
this._input.focus({ preventScroll: !0 });
|
|
@@ -899,7 +900,7 @@ class L extends z {
|
|
|
899
900
|
t.preventDefault(), t.stopPropagation(), this.toggleVisibility();
|
|
900
901
|
}
|
|
901
902
|
}
|
|
902
|
-
typeof customElements < "u" && !customElements.get("ui-password-field") && customElements.define("ui-password-field",
|
|
903
|
+
typeof customElements < "u" && !customElements.get("ui-password-field") && customElements.define("ui-password-field", F);
|
|
903
904
|
export {
|
|
904
|
-
|
|
905
|
+
F as UIPasswordField
|
|
905
906
|
};
|