@melodicdev/components 4.0.0 → 4.1.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/README.md +4 -4
- package/assets/fonts/phosphor/phosphor.css +5 -25
- package/assets/melodic-components.css +50 -25
- package/assets/melodic-components.js +9230 -7814
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.css +1 -21
- package/assets/melodic-components.min.js +1895 -26471
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +83 -78
- package/lib/components/data-display/activity-feed/activity-feed.styles.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed.styles.js +10 -5
- package/lib/components/data-display/avatar/avatar.styles.d.ts.map +1 -1
- package/lib/components/data-display/avatar/avatar.styles.js +23 -18
- package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.js +54 -48
- package/lib/components/data-display/badge-group/badge-group.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge-group/badge-group.styles.js +34 -29
- package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.styles.js +174 -155
- package/lib/components/data-display/data-grid/data-grid.component.d.ts +43 -2
- package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.component.js +94 -8
- package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.styles.js +139 -117
- package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.template.js +19 -10
- package/lib/components/data-display/data-grid/index.d.ts +1 -0
- package/lib/components/data-display/data-grid/index.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.styles.js +40 -35
- package/lib/components/data-display/list/list.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list.styles.js +10 -5
- package/lib/components/data-display/profile-card/profile-card.styles.d.ts.map +1 -1
- package/lib/components/data-display/profile-card/profile-card.styles.js +71 -66
- package/lib/components/data-display/stat-card/stat-card.styles.d.ts.map +1 -1
- package/lib/components/data-display/stat-card/stat-card.styles.js +67 -63
- package/lib/components/data-display/table/index.d.ts +1 -0
- package/lib/components/data-display/table/index.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.d.ts +16 -0
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +28 -3
- package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
- package/lib/components/data-display/table/table.styles.js +101 -90
- package/lib/components/data-display/table/table.template.d.ts.map +1 -1
- package/lib/components/data-display/table/table.template.js +8 -6
- package/lib/components/data-display/table-core/index.d.ts +2 -2
- package/lib/components/data-display/table-core/index.d.ts.map +1 -1
- package/lib/components/data-display/table-core/index.js +1 -1
- package/lib/components/data-display/table-core/table-core.d.ts +16 -2
- package/lib/components/data-display/table-core/table-core.d.ts.map +1 -1
- package/lib/components/data-display/table-core/table-core.js +32 -5
- package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
- package/lib/components/data-display/tag/tag.styles.js +78 -66
- package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.styles.js +89 -76
- package/lib/components/feedback/progress/progress.styles.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.styles.js +110 -106
- package/lib/components/feedback/spinner/spinner.styles.d.ts.map +1 -1
- package/lib/components/feedback/spinner/spinner.styles.js +18 -13
- package/lib/components/feedback/toast/index.d.ts +1 -0
- package/lib/components/feedback/toast/index.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast-container.styles.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast-container.styles.js +20 -0
- package/lib/components/feedback/toast/toast.component.d.ts +16 -0
- package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.component.js +63 -5
- package/lib/components/feedback/toast/toast.service.d.ts +14 -0
- package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.service.js +41 -0
- package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.styles.js +80 -69
- package/lib/components/feedback/toast/toast.template.js +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts +14 -4
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.js +40 -96
- package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.styles.js +191 -170
- package/lib/components/forms/autocomplete/autocomplete.template.js +7 -1
- package/lib/components/forms/button/button.styles.d.ts.map +1 -1
- package/lib/components/forms/button/button.styles.js +73 -57
- package/lib/components/forms/button-group/button-group-item.styles.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group-item.styles.js +11 -0
- package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.styles.js +24 -19
- package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.styles.js +94 -78
- package/lib/components/forms/date-picker/calendar.component.d.ts +20 -7
- package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/calendar.component.js +88 -13
- package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/calendar.styles.js +171 -147
- package/lib/components/forms/date-picker/date-picker.component.d.ts +2 -3
- package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.component.js +70 -18
- package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.styles.js +109 -92
- package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-time-picker/date-time-picker.styles.js +99 -83
- package/lib/components/forms/date-time-picker/tz-utils.d.ts.map +1 -1
- package/lib/components/forms/date-time-picker/tz-utils.js +24 -3
- package/lib/components/forms/file-upload/file-upload-item.styles.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload-item.styles.js +13 -1
- package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload.styles.js +108 -92
- package/lib/components/forms/form-field/form-field.component.d.ts +18 -1
- package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.component.js +55 -16
- package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.styles.js +92 -74
- package/lib/components/forms/input/input.styles.d.ts.map +1 -1
- package/lib/components/forms/input/input.styles.js +98 -82
- package/lib/components/forms/listbox-core/index.d.ts +3 -0
- package/lib/components/forms/listbox-core/index.d.ts.map +1 -0
- package/lib/components/forms/listbox-core/index.js +2 -0
- package/lib/components/forms/listbox-core/listbox-core.d.ts +57 -0
- package/lib/components/forms/listbox-core/listbox-core.d.ts.map +1 -0
- package/lib/components/forms/listbox-core/listbox-core.js +168 -0
- package/lib/components/forms/radio/radio-group.styles.js +1 -1
- package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.styles.js +89 -73
- package/lib/components/forms/radio-card-group/radio-card-group.styles.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card-group.styles.js +40 -35
- package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card.styles.js +124 -108
- package/lib/components/forms/select/select.component.d.ts +12 -4
- package/lib/components/forms/select/select.component.d.ts.map +1 -1
- package/lib/components/forms/select/select.component.js +41 -110
- package/lib/components/forms/select/select.styles.d.ts.map +1 -1
- package/lib/components/forms/select/select.styles.js +181 -159
- package/lib/components/forms/select/select.template.d.ts.map +1 -1
- package/lib/components/forms/select/select.template.js +25 -9
- package/lib/components/forms/slider/slider.component.js +1 -1
- package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
- package/lib/components/forms/slider/slider.styles.js +93 -77
- package/lib/components/forms/slider/slider.template.d.ts.map +1 -1
- package/lib/components/forms/slider/slider.template.js +5 -1
- package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
- package/lib/components/forms/textarea/textarea.styles.js +97 -81
- package/lib/components/forms/time-picker/time-picker.component.d.ts +1 -2
- package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
- package/lib/components/forms/time-picker/time-picker.component.js +8 -17
- package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/time-picker/time-picker.styles.js +220 -194
- package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.styles.js +95 -79
- package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
- package/lib/components/foundation/card/card.styles.js +62 -46
- package/lib/components/foundation/container/container.styles.d.ts.map +1 -1
- package/lib/components/foundation/container/container.styles.js +15 -10
- package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.styles.js +29 -24
- package/lib/components/foundation/stack/stack.styles.d.ts.map +1 -1
- package/lib/components/foundation/stack/stack.styles.js +16 -10
- package/lib/components/general/icon/icon.styles.d.ts.map +1 -1
- package/lib/components/general/icon/icon.styles.js +12 -8
- package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
- package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +5 -3
- package/lib/components/navigation/breadcrumb/breadcrumb.styles.d.ts.map +1 -1
- package/lib/components/navigation/breadcrumb/breadcrumb.styles.js +9 -4
- package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.styles.js +74 -69
- package/lib/components/navigation/sidebar/sidebar-group.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-group.styles.js +23 -18
- package/lib/components/navigation/sidebar/sidebar-item.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-item.styles.js +105 -100
- package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
- package/lib/components/navigation/sidebar/sidebar.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.styles.js +180 -175
- package/lib/components/navigation/sidebar/sidebar.template.js +2 -2
- package/lib/components/navigation/steps/step.styles.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.styles.js +155 -150
- package/lib/components/navigation/steps/steps.styles.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.styles.js +175 -170
- package/lib/components/navigation/tabs/tab-panel.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.styles.js +12 -7
- package/lib/components/navigation/tabs/tab.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab.styles.js +41 -36
- package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.component.js +4 -1
- package/lib/components/navigation/tabs/tabs.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.styles.js +134 -129
- package/lib/components/overlays/dialog/dialog.component.d.ts +15 -2
- package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.component.js +33 -1
- package/lib/components/overlays/dialog/dialog.service.d.ts +8 -2
- package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.service.js +1 -0
- package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.styles.js +78 -73
- package/lib/components/overlays/dialog/index.d.ts +1 -0
- package/lib/components/overlays/dialog/index.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.component.d.ts +18 -3
- package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.component.js +59 -16
- package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.styles.js +82 -77
- package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.styles.js +60 -43
- package/lib/components/overlays/dropdown/dropdown.styles.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.styles.js +35 -30
- package/lib/components/overlays/popover/popover.component.d.ts +12 -0
- package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.component.js +28 -1
- package/lib/components/overlays/popover/popover.styles.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.styles.js +36 -31
- package/lib/components/overlays/popover/popover.template.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.template.js +2 -0
- package/lib/components/overlays/tooltip/tooltip.component.d.ts +8 -5
- package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.component.js +10 -3
- package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.styles.js +34 -28
- package/lib/components/pages/auth/auth-layout.styles.d.ts +1 -1
- package/lib/components/pages/auth/auth-layout.styles.d.ts.map +1 -1
- package/lib/components/pages/auth/auth-layout.styles.js +86 -81
- package/lib/components/pages/dashboard/dashboard-page.styles.d.ts.map +1 -1
- package/lib/components/pages/dashboard/dashboard-page.styles.js +39 -34
- package/lib/components/sections/app-shell/app-shell.styles.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.styles.js +63 -57
- package/lib/components/sections/hero/hero-section.styles.js +97 -97
- package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.styles.js +69 -64
- package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.styles.js +56 -51
- package/lib/directives/tooltip.directive.d.ts.map +1 -1
- package/lib/directives/tooltip.directive.js +22 -3
- package/lib/theme/presets/base.preset.d.ts.map +1 -1
- package/lib/theme/presets/base.preset.js +17 -0
- package/lib/theme/presets/dark.preset.d.ts +8 -0
- package/lib/theme/presets/dark.preset.d.ts.map +1 -1
- package/lib/theme/presets/dark.preset.js +9 -0
- package/lib/theme/presets/light.preset.d.ts +6 -0
- package/lib/theme/presets/light.preset.d.ts.map +1 -1
- package/lib/theme/presets/light.preset.js +7 -0
- package/lib/theme/tokens/all-tokens.d.ts +10 -0
- package/lib/theme/tokens/all-tokens.d.ts.map +1 -1
- package/lib/theme/tokens/colors.tokens.d.ts +8 -0
- package/lib/theme/tokens/colors.tokens.d.ts.map +1 -1
- package/lib/theme/tokens/colors.tokens.js +11 -0
- package/lib/theme/tokens/transitions.tokens.d.ts +1 -0
- package/lib/theme/tokens/transitions.tokens.d.ts.map +1 -1
- package/lib/theme/tokens/transitions.tokens.js +3 -0
- package/lib/theme/tokens/typography.tokens.d.ts +1 -0
- package/lib/theme/tokens/typography.tokens.d.ts.map +1 -1
- package/lib/theme/tokens/typography.tokens.js +1 -0
- package/lib/utils/accessibility/cross-root-aria.d.ts +16 -8
- package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -1
- package/lib/utils/accessibility/cross-root-aria.js +58 -22
- package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-trap.js +9 -19
- package/lib/utils/accessibility/focus-utils.d.ts +10 -1
- package/lib/utils/accessibility/focus-utils.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-utils.js +48 -14
- package/lib/utils/accessibility/index.d.ts +2 -1
- package/lib/utils/accessibility/index.d.ts.map +1 -1
- package/lib/utils/accessibility/index.js +1 -1
- package/lib/utils/positioning/compute-position.d.ts +6 -1
- package/lib/utils/positioning/compute-position.d.ts.map +1 -1
- package/lib/utils/positioning/compute-position.js +3 -2
- package/lib/utils/positioning/middlewares/flip.middleware.js +2 -51
- package/package.json +8 -5
- package/assets/fonts/phosphor/Phosphor-Bold.svg +0 -3057
- package/assets/fonts/phosphor/Phosphor-Bold.ttf +0 -0
- package/assets/fonts/phosphor/Phosphor-Bold.woff +0 -0
- package/assets/fonts/phosphor/Phosphor-Fill.svg +0 -3057
- package/assets/fonts/phosphor/Phosphor-Fill.ttf +0 -0
- package/assets/fonts/phosphor/Phosphor-Fill.woff +0 -0
- package/assets/fonts/phosphor/Phosphor-Light.svg +0 -3057
- package/assets/fonts/phosphor/Phosphor-Light.ttf +0 -0
- package/assets/fonts/phosphor/Phosphor-Light.woff +0 -0
- package/assets/fonts/phosphor/Phosphor-Thin.svg +0 -3057
- package/assets/fonts/phosphor/Phosphor-Thin.ttf +0 -0
- package/assets/fonts/phosphor/Phosphor-Thin.woff +0 -0
- package/assets/fonts/phosphor/Phosphor.svg +0 -3056
- package/assets/fonts/phosphor/Phosphor.ttf +0 -0
- package/assets/fonts/phosphor/Phosphor.woff +0 -0
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { formFieldTemplate } from './form-field.template.js';
|
|
9
9
|
import { formFieldStyles } from './form-field.styles.js';
|
|
10
|
+
import { setCrossRootDescription, getFocusableControl } from '../../../utils/accessibility/cross-root-aria.js';
|
|
10
11
|
/**
|
|
11
12
|
* ml-form-field - Wrapper component that adds label, hint, and error to any form control
|
|
12
13
|
*
|
|
@@ -55,6 +56,9 @@ let FormFieldComponent = class FormFieldComponent {
|
|
|
55
56
|
* doesn't re-assign the slot). */
|
|
56
57
|
this._control = null;
|
|
57
58
|
this._controlResolved = false;
|
|
59
|
+
/** ARIA attributes this field has put on a nested (shadow) control. */
|
|
60
|
+
this._innerOwned = new Set();
|
|
61
|
+
this._innerControl = null;
|
|
58
62
|
/**
|
|
59
63
|
* Focus the slotted control when the label is clicked. `<label for=…>` can
|
|
60
64
|
* only target an element in the same tree, so the label's `for` never
|
|
@@ -111,13 +115,14 @@ let FormFieldComponent = class FormFieldComponent {
|
|
|
111
115
|
control.id = this.fieldId;
|
|
112
116
|
}
|
|
113
117
|
// The hint and error live in THIS component's shadow root while the
|
|
114
|
-
// control is in the light DOM, so an `aria-describedby` IDREF
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
+
// control is in the light DOM, so neither an `aria-describedby` IDREF
|
|
119
|
+
// nor an element reference from the control can reach them (references
|
|
120
|
+
// only resolve into the same or an ancestor tree). Their text is
|
|
121
|
+
// carried on the control as `aria-description` instead.
|
|
118
122
|
this.syncDescription(control);
|
|
119
123
|
this.syncAttribute(control, 'aria-invalid', this.error ? 'true' : null);
|
|
120
124
|
this.syncAttribute(control, 'aria-required', this.required ? 'true' : null);
|
|
125
|
+
this.syncInnerControl(control);
|
|
121
126
|
// Mirror the field's disabled state onto the control, in BOTH
|
|
122
127
|
// directions — it used to be set to true and never cleared, so a field
|
|
123
128
|
// that started disabled could never be re-enabled.
|
|
@@ -128,23 +133,57 @@ let FormFieldComponent = class FormFieldComponent {
|
|
|
128
133
|
this.syncAttribute(control, 'aria-disabled', this.disabled ? 'true' : null);
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
|
-
/**
|
|
132
|
-
|
|
136
|
+
/** The rendered error/hint elements that describe the control. */
|
|
137
|
+
getDescribers() {
|
|
133
138
|
const root = this.elementRef.shadowRoot;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
return [this.error ? root?.getElementById(this.errorId) : null, this.hint ? root?.getElementById(this.hintId) : null].filter((element) => element !== null && element !== undefined);
|
|
140
|
+
}
|
|
141
|
+
/** Describe the control with the hint/error across the shadow boundary. */
|
|
142
|
+
syncDescription(control) {
|
|
143
|
+
setCrossRootDescription(control, this.getDescribers());
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Mirror the field's ARIA state onto the element that actually takes
|
|
147
|
+
* focus. For a slotted `<ml-input>` / `<ml-select>` that is a control
|
|
148
|
+
* inside the component's own shadow root; ARIA on the host element alone
|
|
149
|
+
* is not announced when focus is on the inner control.
|
|
150
|
+
*
|
|
151
|
+
* The inner control belongs to another component, which may manage the
|
|
152
|
+
* same attributes itself — so only ever add our state, and only remove
|
|
153
|
+
* what we added.
|
|
154
|
+
*/
|
|
155
|
+
syncInnerControl(control) {
|
|
156
|
+
const inner = getFocusableControl(control);
|
|
157
|
+
const target = inner !== control ? inner : null;
|
|
158
|
+
if (this._innerControl && this._innerControl !== target) {
|
|
159
|
+
for (const name of this._innerOwned) {
|
|
160
|
+
this._innerControl.removeAttribute(name);
|
|
161
|
+
}
|
|
162
|
+
this._innerOwned.clear();
|
|
163
|
+
}
|
|
164
|
+
this._innerControl = target;
|
|
165
|
+
if (!target) {
|
|
139
166
|
return;
|
|
140
167
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const description = describers
|
|
144
|
-
.map((element) => element.textContent?.trim() ?? '')
|
|
168
|
+
const description = this.getDescribers()
|
|
169
|
+
.map((element) => element.textContent?.replace(/\s+/g, ' ').trim() ?? '')
|
|
145
170
|
.filter(Boolean)
|
|
146
171
|
.join('. ');
|
|
147
|
-
this.
|
|
172
|
+
this.syncOwnedAttribute(target, 'aria-description', description || null);
|
|
173
|
+
this.syncOwnedAttribute(target, 'aria-invalid', this.error ? 'true' : null);
|
|
174
|
+
this.syncOwnedAttribute(target, 'aria-required', this.required ? 'true' : null);
|
|
175
|
+
}
|
|
176
|
+
syncOwnedAttribute(target, name, value) {
|
|
177
|
+
if (value !== null) {
|
|
178
|
+
if (target.getAttribute(name) !== value) {
|
|
179
|
+
target.setAttribute(name, value);
|
|
180
|
+
}
|
|
181
|
+
this._innerOwned.add(name);
|
|
182
|
+
}
|
|
183
|
+
else if (this._innerOwned.has(name)) {
|
|
184
|
+
target.removeAttribute(name);
|
|
185
|
+
this._innerOwned.delete(name);
|
|
186
|
+
}
|
|
148
187
|
}
|
|
149
188
|
syncAttribute(el, name, value) {
|
|
150
189
|
if (value === null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/form-field/form-field.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"form-field.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/form-field/form-field.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,iDA0O3B,CAAC"}
|
|
@@ -1,51 +1,56 @@
|
|
|
1
1
|
import { css } from '@melodicdev/core';
|
|
2
2
|
export const formFieldStyles = () => css `
|
|
3
|
+
/*
|
|
4
|
+
* Tokens. Rules read each one with its default as the var() fallback,
|
|
5
|
+
* so a value set on the element or inherited from any ancestor wins.
|
|
6
|
+
*
|
|
7
|
+
* Label
|
|
8
|
+
* --ml-form-field-label-font-size: var(--ml-text-sm)
|
|
9
|
+
* --ml-form-field-label-font-weight: var(--ml-font-medium)
|
|
10
|
+
* --ml-form-field-label-color: var(--ml-color-text-secondary)
|
|
11
|
+
* --ml-form-field-label-line-height: var(--ml-leading-tight)
|
|
12
|
+
*
|
|
13
|
+
* Required indicator
|
|
14
|
+
* --ml-form-field-required-color: var(--ml-color-danger)
|
|
15
|
+
*
|
|
16
|
+
* Hint / Error
|
|
17
|
+
* --ml-form-field-hint-font-size: var(--ml-text-sm)
|
|
18
|
+
* --ml-form-field-hint-color: var(--ml-color-text-muted)
|
|
19
|
+
* --ml-form-field-error-color: var(--ml-color-danger)
|
|
20
|
+
*
|
|
21
|
+
* Disabled
|
|
22
|
+
* --ml-form-field-disabled-label-color: var(--ml-color-text-muted)
|
|
23
|
+
*
|
|
24
|
+
* Slotted input
|
|
25
|
+
* --ml-form-field-input-padding: var(--ml-space-2-5) var(--ml-space-3-5)
|
|
26
|
+
* --ml-form-field-input-font-size: var(--ml-text-sm)
|
|
27
|
+
* --ml-form-field-input-font-family: var(--ml-font-sans)
|
|
28
|
+
* --ml-form-field-input-color: var(--ml-color-text)
|
|
29
|
+
* --ml-form-field-input-bg: var(--ml-color-input-bg)
|
|
30
|
+
* --ml-form-field-input-border-width: var(--ml-border)
|
|
31
|
+
* --ml-form-field-input-border-color: var(--ml-color-border-strong)
|
|
32
|
+
* --ml-form-field-input-border-radius: var(--ml-radius)
|
|
33
|
+
* --ml-form-field-input-shadow: var(--ml-shadow-xs)
|
|
34
|
+
* --ml-form-field-input-focus-border-color: var(--ml-color-primary)
|
|
35
|
+
* --ml-form-field-input-focus-shadow: var(--ml-shadow-focus-ring)
|
|
36
|
+
* --ml-form-field-input-placeholder-color: var(--ml-color-text-muted)
|
|
37
|
+
* --ml-form-field-input-disabled-bg: var(--ml-color-input-disabled-bg)
|
|
38
|
+
* --ml-form-field-input-disabled-color: var(--ml-color-text-muted)
|
|
39
|
+
* --ml-form-field-input-error-border-color: var(--ml-color-danger)
|
|
40
|
+
* --ml-form-field-input-error-focus-shadow: var(--ml-shadow-ring-error)
|
|
41
|
+
*
|
|
42
|
+
* Horizontal layout
|
|
43
|
+
* --ml-form-field-horizontal-gap: var(--ml-space-4)
|
|
44
|
+
* --ml-form-field-horizontal-label-padding-top: var(--ml-space-2-5)
|
|
45
|
+
*
|
|
46
|
+
* Transition
|
|
47
|
+
* --ml-form-field-transition-duration: var(--ml-duration-150)
|
|
48
|
+
* --ml-form-field-transition-easing: var(--ml-ease-in-out)
|
|
49
|
+
*/
|
|
50
|
+
|
|
3
51
|
:host {
|
|
4
52
|
display: block;
|
|
5
53
|
width: 100%;
|
|
6
|
-
|
|
7
|
-
/* --- Label --- */
|
|
8
|
-
--ml-form-field-label-font-size: var(--ml-text-sm);
|
|
9
|
-
--ml-form-field-label-font-weight: var(--ml-font-medium);
|
|
10
|
-
--ml-form-field-label-color: var(--ml-color-text-secondary);
|
|
11
|
-
--ml-form-field-label-line-height: var(--ml-leading-tight);
|
|
12
|
-
|
|
13
|
-
/* --- Required indicator --- */
|
|
14
|
-
--ml-form-field-required-color: var(--ml-color-danger);
|
|
15
|
-
|
|
16
|
-
/* --- Hint / Error --- */
|
|
17
|
-
--ml-form-field-hint-font-size: var(--ml-text-sm);
|
|
18
|
-
--ml-form-field-hint-color: var(--ml-color-text-muted);
|
|
19
|
-
--ml-form-field-error-color: var(--ml-color-danger);
|
|
20
|
-
|
|
21
|
-
/* --- Disabled --- */
|
|
22
|
-
--ml-form-field-disabled-label-color: var(--ml-color-text-muted);
|
|
23
|
-
|
|
24
|
-
/* --- Slotted input --- */
|
|
25
|
-
--ml-form-field-input-padding: var(--ml-space-2-5) var(--ml-space-3-5);
|
|
26
|
-
--ml-form-field-input-font-size: var(--ml-text-sm);
|
|
27
|
-
--ml-form-field-input-font-family: var(--ml-font-sans);
|
|
28
|
-
--ml-form-field-input-color: var(--ml-color-text);
|
|
29
|
-
--ml-form-field-input-bg: var(--ml-color-input-bg);
|
|
30
|
-
--ml-form-field-input-border-width: var(--ml-border);
|
|
31
|
-
--ml-form-field-input-border-color: var(--ml-color-border-strong);
|
|
32
|
-
--ml-form-field-input-border-radius: var(--ml-radius);
|
|
33
|
-
--ml-form-field-input-shadow: var(--ml-shadow-xs);
|
|
34
|
-
--ml-form-field-input-focus-border-color: var(--ml-color-primary);
|
|
35
|
-
--ml-form-field-input-focus-shadow: var(--ml-shadow-focus-ring);
|
|
36
|
-
--ml-form-field-input-placeholder-color: var(--ml-color-text-muted);
|
|
37
|
-
--ml-form-field-input-disabled-bg: var(--ml-color-input-disabled-bg);
|
|
38
|
-
--ml-form-field-input-disabled-color: var(--ml-color-text-muted);
|
|
39
|
-
--ml-form-field-input-error-border-color: var(--ml-color-danger);
|
|
40
|
-
--ml-form-field-input-error-focus-shadow: var(--ml-shadow-ring-error);
|
|
41
|
-
|
|
42
|
-
/* --- Horizontal layout --- */
|
|
43
|
-
--ml-form-field-horizontal-gap: var(--ml-space-4);
|
|
44
|
-
--ml-form-field-horizontal-label-padding-top: var(--ml-space-2-5);
|
|
45
|
-
|
|
46
|
-
/* --- Transition --- */
|
|
47
|
-
--ml-form-field-transition-duration: var(--ml-duration-150);
|
|
48
|
-
--ml-form-field-transition-easing: var(--ml-ease-in-out);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
.ml-form-field {
|
|
@@ -59,15 +64,15 @@ export const formFieldStyles = () => css `
|
|
|
59
64
|
display: grid;
|
|
60
65
|
grid-template-columns: minmax(100px, auto) 1fr;
|
|
61
66
|
grid-template-rows: auto auto;
|
|
62
|
-
gap: var(--ml-space-1-5) var(--ml-form-field-horizontal-gap);
|
|
67
|
+
gap: var(--ml-space-1-5) var(--ml-form-field-horizontal-gap, var(--ml-space-4));
|
|
63
68
|
align-items: start;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
.ml-form-field--horizontal .ml-form-field__label {
|
|
67
72
|
grid-column: 1;
|
|
68
73
|
grid-row: 1;
|
|
69
|
-
padding-top: var(--ml-form-field-horizontal-label-padding-top);
|
|
70
|
-
text-align:
|
|
74
|
+
padding-top: var(--ml-form-field-horizontal-label-padding-top, var(--ml-space-2-5));
|
|
75
|
+
text-align: end;
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
.ml-form-field--horizontal .ml-form-field__control {
|
|
@@ -83,15 +88,15 @@ export const formFieldStyles = () => css `
|
|
|
83
88
|
|
|
84
89
|
/* Label */
|
|
85
90
|
.ml-form-field__label {
|
|
86
|
-
font-size: var(--ml-form-field-label-font-size);
|
|
87
|
-
font-weight: var(--ml-form-field-label-font-weight);
|
|
88
|
-
color: var(--ml-form-field-label-color);
|
|
89
|
-
line-height: var(--ml-form-field-label-line-height);
|
|
91
|
+
font-size: var(--ml-form-field-label-font-size, var(--ml-text-sm));
|
|
92
|
+
font-weight: var(--ml-form-field-label-font-weight, var(--ml-font-medium));
|
|
93
|
+
color: var(--ml-form-field-label-color, var(--ml-color-text-secondary));
|
|
94
|
+
line-height: var(--ml-form-field-label-line-height, var(--ml-leading-tight));
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
.ml-form-field__required {
|
|
93
|
-
color: var(--ml-form-field-required-color);
|
|
94
|
-
margin-
|
|
98
|
+
color: var(--ml-form-field-required-color, var(--ml-color-danger));
|
|
99
|
+
margin-inline-start: var(--ml-space-0-5);
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
/* Control wrapper */
|
|
@@ -103,21 +108,21 @@ export const formFieldStyles = () => css `
|
|
|
103
108
|
/* Hint and error messages */
|
|
104
109
|
.ml-form-field__hint,
|
|
105
110
|
.ml-form-field__error {
|
|
106
|
-
font-size: var(--ml-form-field-hint-font-size);
|
|
107
|
-
line-height: var(--ml-form-field-label-line-height);
|
|
111
|
+
font-size: var(--ml-form-field-hint-font-size, var(--ml-text-sm));
|
|
112
|
+
line-height: var(--ml-form-field-label-line-height, var(--ml-leading-tight));
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
.ml-form-field__hint {
|
|
111
|
-
color: var(--ml-form-field-hint-color);
|
|
116
|
+
color: var(--ml-form-field-hint-color, var(--ml-color-text-muted));
|
|
112
117
|
}
|
|
113
118
|
|
|
114
119
|
.ml-form-field__error {
|
|
115
|
-
color: var(--ml-form-field-error-color);
|
|
120
|
+
color: var(--ml-form-field-error-color, var(--ml-color-danger));
|
|
116
121
|
}
|
|
117
122
|
|
|
118
123
|
/* Disabled state */
|
|
119
124
|
.ml-form-field--disabled .ml-form-field__label {
|
|
120
|
-
color: var(--ml-form-field-disabled-label-color);
|
|
125
|
+
color: var(--ml-form-field-disabled-label-color, var(--ml-color-text-muted));
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
/* Size variants - Labels */
|
|
@@ -144,52 +149,52 @@ export const formFieldStyles = () => css `
|
|
|
144
149
|
::slotted(select),
|
|
145
150
|
::slotted(textarea) {
|
|
146
151
|
width: 100%;
|
|
147
|
-
padding: var(--ml-form-field-input-padding);
|
|
148
|
-
font-size: var(--ml-form-field-input-font-size);
|
|
149
|
-
font-family: var(--ml-form-field-input-font-family);
|
|
150
|
-
color: var(--ml-form-field-input-color);
|
|
151
|
-
background-color: var(--ml-form-field-input-bg);
|
|
152
|
-
border: var(--ml-form-field-input-border-width) solid var(--ml-form-field-input-border-color);
|
|
153
|
-
border-radius: var(--ml-form-field-input-border-radius);
|
|
154
|
-
box-shadow: var(--ml-form-field-input-shadow);
|
|
152
|
+
padding: var(--ml-form-field-input-padding, var(--ml-space-2-5) var(--ml-space-3-5));
|
|
153
|
+
font-size: var(--ml-form-field-input-font-size, var(--ml-text-sm));
|
|
154
|
+
font-family: var(--ml-form-field-input-font-family, var(--ml-font-sans));
|
|
155
|
+
color: var(--ml-form-field-input-color, var(--ml-color-text));
|
|
156
|
+
background-color: var(--ml-form-field-input-bg, var(--ml-color-input-bg));
|
|
157
|
+
border: var(--ml-form-field-input-border-width, var(--ml-border)) solid var(--ml-form-field-input-border-color, var(--ml-color-border-strong));
|
|
158
|
+
border-radius: var(--ml-form-field-input-border-radius, var(--ml-radius));
|
|
159
|
+
box-shadow: var(--ml-form-field-input-shadow, var(--ml-shadow-xs));
|
|
155
160
|
box-sizing: border-box;
|
|
156
161
|
transition:
|
|
157
|
-
border-color var(--ml-form-field-transition-duration) var(--ml-form-field-transition-easing),
|
|
158
|
-
box-shadow var(--ml-form-field-transition-duration) var(--ml-form-field-transition-easing);
|
|
162
|
+
border-color var(--ml-form-field-transition-duration, var(--ml-duration-150)) var(--ml-form-field-transition-easing, var(--ml-ease-in-out)),
|
|
163
|
+
box-shadow var(--ml-form-field-transition-duration, var(--ml-duration-150)) var(--ml-form-field-transition-easing, var(--ml-ease-in-out));
|
|
159
164
|
}
|
|
160
165
|
|
|
161
166
|
::slotted(input:focus),
|
|
162
167
|
::slotted(select:focus),
|
|
163
168
|
::slotted(textarea:focus) {
|
|
164
169
|
outline: none;
|
|
165
|
-
border-color: var(--ml-form-field-input-focus-border-color);
|
|
166
|
-
box-shadow: var(--ml-form-field-input-focus-shadow);
|
|
170
|
+
border-color: var(--ml-form-field-input-focus-border-color, var(--ml-color-primary));
|
|
171
|
+
box-shadow: var(--ml-form-field-input-focus-shadow, var(--ml-shadow-focus-ring));
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
::slotted(input::placeholder),
|
|
170
175
|
::slotted(textarea::placeholder) {
|
|
171
|
-
color: var(--ml-form-field-input-placeholder-color);
|
|
176
|
+
color: var(--ml-form-field-input-placeholder-color, var(--ml-color-text-muted));
|
|
172
177
|
}
|
|
173
178
|
|
|
174
179
|
::slotted(input:disabled),
|
|
175
180
|
::slotted(select:disabled),
|
|
176
181
|
::slotted(textarea:disabled) {
|
|
177
|
-
background-color: var(--ml-form-field-input-disabled-bg);
|
|
182
|
+
background-color: var(--ml-form-field-input-disabled-bg, var(--ml-color-input-disabled-bg));
|
|
178
183
|
cursor: not-allowed;
|
|
179
|
-
color: var(--ml-form-field-input-disabled-color);
|
|
184
|
+
color: var(--ml-form-field-input-disabled-color, var(--ml-color-text-muted));
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
/* Error state for slotted inputs */
|
|
183
188
|
.ml-form-field--error ::slotted(input),
|
|
184
189
|
.ml-form-field--error ::slotted(select),
|
|
185
190
|
.ml-form-field--error ::slotted(textarea) {
|
|
186
|
-
border-color: var(--ml-form-field-input-error-border-color);
|
|
191
|
+
border-color: var(--ml-form-field-input-error-border-color, var(--ml-color-danger));
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
.ml-form-field--error ::slotted(input:focus),
|
|
190
195
|
.ml-form-field--error ::slotted(select:focus),
|
|
191
196
|
.ml-form-field--error ::slotted(textarea:focus) {
|
|
192
|
-
box-shadow: var(--ml-form-field-input-error-focus-shadow);
|
|
197
|
+
box-shadow: var(--ml-form-field-input-error-focus-shadow, var(--ml-shadow-ring-error));
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
/* Size variants for slotted inputs */
|
|
@@ -215,4 +220,17 @@ export const formFieldStyles = () => css `
|
|
|
215
220
|
.ml-form-field--horizontal.ml-form-field--lg .ml-form-field__label {
|
|
216
221
|
padding-top: var(--ml-space-3-5);
|
|
217
222
|
}
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* Forced colors (Windows High Contrast): box-shadow rings and background
|
|
226
|
+
* highlights are not painted there, so focus falls back to a real outline.
|
|
227
|
+
*/
|
|
228
|
+
@media (forced-colors: active) {
|
|
229
|
+
::slotted(input:focus),
|
|
230
|
+
::slotted(select:focus),
|
|
231
|
+
::slotted(textarea:focus) {
|
|
232
|
+
outline: 2px solid Highlight;
|
|
233
|
+
outline-offset: 2px;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
218
236
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/input/input.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"input.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/input/input.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,iDAsMvB,CAAC"}
|
|
@@ -1,60 +1,65 @@
|
|
|
1
1
|
import { css } from '@melodicdev/core';
|
|
2
2
|
export const inputStyles = () => css `
|
|
3
|
+
/*
|
|
4
|
+
* Tokens. Rules read each one with its default as the var() fallback,
|
|
5
|
+
* so a value set on the element or inherited from any ancestor wins.
|
|
6
|
+
*
|
|
7
|
+
* Label
|
|
8
|
+
* --ml-input-label-font-size: var(--ml-text-sm)
|
|
9
|
+
* --ml-input-label-font-weight: var(--ml-font-medium)
|
|
10
|
+
* --ml-input-label-color: var(--ml-color-text-secondary)
|
|
11
|
+
* --ml-input-label-line-height: var(--ml-leading-tight)
|
|
12
|
+
*
|
|
13
|
+
* Required indicator
|
|
14
|
+
* --ml-input-required-color: var(--ml-color-danger)
|
|
15
|
+
*
|
|
16
|
+
* Wrapper
|
|
17
|
+
* --ml-input-bg: var(--ml-color-input-bg)
|
|
18
|
+
* --ml-input-border-width: var(--ml-border)
|
|
19
|
+
* --ml-input-border-color: var(--ml-color-border)
|
|
20
|
+
* --ml-input-border-radius: var(--ml-radius)
|
|
21
|
+
* --ml-input-shadow: none
|
|
22
|
+
* --ml-input-hover-border-color: var(--ml-color-border)
|
|
23
|
+
* --ml-input-padding: var(--ml-space-2-5) var(--ml-space-3-5)
|
|
24
|
+
* --ml-input-gap: var(--ml-space-2)
|
|
25
|
+
*
|
|
26
|
+
* Field
|
|
27
|
+
* --ml-input-color: var(--ml-color-text)
|
|
28
|
+
* --ml-input-font-family: var(--ml-font-sans)
|
|
29
|
+
* --ml-input-font-size: var(--ml-text-sm)
|
|
30
|
+
* --ml-input-line-height: var(--ml-leading-normal)
|
|
31
|
+
* --ml-input-placeholder-color: var(--ml-color-text-muted)
|
|
32
|
+
*
|
|
33
|
+
* Focus
|
|
34
|
+
* --ml-input-focus-border-color: var(--ml-color-primary)
|
|
35
|
+
* --ml-input-focus-shadow: var(--ml-shadow-focus-ring)
|
|
36
|
+
* --ml-input-focus-inset-shadow: none
|
|
37
|
+
*
|
|
38
|
+
* Error
|
|
39
|
+
* --ml-input-error-border-color: var(--ml-color-danger)
|
|
40
|
+
* --ml-input-error-focus-shadow: var(--ml-shadow-ring-error)
|
|
41
|
+
* --ml-input-error-color: var(--ml-color-danger)
|
|
42
|
+
*
|
|
43
|
+
* Disabled
|
|
44
|
+
* --ml-input-disabled-bg: var(--ml-color-input-disabled-bg)
|
|
45
|
+
* --ml-input-disabled-color: var(--ml-color-text-muted)
|
|
46
|
+
*
|
|
47
|
+
* Hint
|
|
48
|
+
* --ml-input-hint-color: var(--ml-color-text-muted)
|
|
49
|
+
* --ml-input-hint-font-size: var(--ml-text-sm)
|
|
50
|
+
*
|
|
51
|
+
* Prefix / Suffix
|
|
52
|
+
* --ml-input-addon-color: var(--ml-color-text-muted)
|
|
53
|
+
*
|
|
54
|
+
* Transition
|
|
55
|
+
* --ml-input-transition-duration: var(--ml-duration-150)
|
|
56
|
+
* --ml-input-transition-easing: var(--ml-ease-in-out)
|
|
57
|
+
*/
|
|
58
|
+
|
|
3
59
|
:host {
|
|
4
60
|
display: block;
|
|
5
61
|
width: 100%;
|
|
6
62
|
min-width: 0;
|
|
7
|
-
|
|
8
|
-
/* --- Label --- */
|
|
9
|
-
--ml-input-label-font-size: var(--ml-text-sm);
|
|
10
|
-
--ml-input-label-font-weight: var(--ml-font-medium);
|
|
11
|
-
--ml-input-label-color: var(--ml-color-text-secondary);
|
|
12
|
-
--ml-input-label-line-height: var(--ml-leading-tight);
|
|
13
|
-
|
|
14
|
-
/* --- Required indicator --- */
|
|
15
|
-
--ml-input-required-color: var(--ml-color-danger);
|
|
16
|
-
|
|
17
|
-
/* --- Wrapper --- */
|
|
18
|
-
--ml-input-bg: var(--ml-color-input-bg);
|
|
19
|
-
--ml-input-border-width: var(--ml-border);
|
|
20
|
-
--ml-input-border-color: var(--ml-color-border);
|
|
21
|
-
--ml-input-border-radius: var(--ml-radius);
|
|
22
|
-
--ml-input-shadow: none;
|
|
23
|
-
--ml-input-hover-border-color: var(--ml-color-border);
|
|
24
|
-
--ml-input-padding: var(--ml-space-2-5) var(--ml-space-3-5);
|
|
25
|
-
--ml-input-gap: var(--ml-space-2);
|
|
26
|
-
|
|
27
|
-
/* --- Field --- */
|
|
28
|
-
--ml-input-color: var(--ml-color-text);
|
|
29
|
-
--ml-input-font-family: var(--ml-font-sans);
|
|
30
|
-
--ml-input-font-size: var(--ml-text-sm);
|
|
31
|
-
--ml-input-line-height: var(--ml-leading-normal);
|
|
32
|
-
--ml-input-placeholder-color: var(--ml-color-text-muted);
|
|
33
|
-
|
|
34
|
-
/* --- Focus --- */
|
|
35
|
-
--ml-input-focus-border-color: var(--ml-color-primary);
|
|
36
|
-
--ml-input-focus-shadow: var(--ml-shadow-focus-ring);
|
|
37
|
-
--ml-input-focus-inset-shadow: none;
|
|
38
|
-
|
|
39
|
-
/* --- Error --- */
|
|
40
|
-
--ml-input-error-border-color: var(--ml-color-danger);
|
|
41
|
-
--ml-input-error-focus-shadow: var(--ml-shadow-ring-error);
|
|
42
|
-
--ml-input-error-color: var(--ml-color-danger);
|
|
43
|
-
|
|
44
|
-
/* --- Disabled --- */
|
|
45
|
-
--ml-input-disabled-bg: var(--ml-color-input-disabled-bg);
|
|
46
|
-
--ml-input-disabled-color: var(--ml-color-text-muted);
|
|
47
|
-
|
|
48
|
-
/* --- Hint --- */
|
|
49
|
-
--ml-input-hint-color: var(--ml-color-text-muted);
|
|
50
|
-
--ml-input-hint-font-size: var(--ml-text-sm);
|
|
51
|
-
|
|
52
|
-
/* --- Prefix / Suffix --- */
|
|
53
|
-
--ml-input-addon-color: var(--ml-color-text-muted);
|
|
54
|
-
|
|
55
|
-
/* --- Transition --- */
|
|
56
|
-
--ml-input-transition-duration: var(--ml-duration-150);
|
|
57
|
-
--ml-input-transition-easing: var(--ml-ease-in-out);
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
.ml-input {
|
|
@@ -64,33 +69,33 @@ export const inputStyles = () => css `
|
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
.ml-input__label {
|
|
67
|
-
font-size: var(--ml-input-label-font-size);
|
|
68
|
-
font-weight: var(--ml-input-label-font-weight);
|
|
69
|
-
color: var(--ml-input-label-color);
|
|
70
|
-
line-height: var(--ml-input-label-line-height);
|
|
72
|
+
font-size: var(--ml-input-label-font-size, var(--ml-text-sm));
|
|
73
|
+
font-weight: var(--ml-input-label-font-weight, var(--ml-font-medium));
|
|
74
|
+
color: var(--ml-input-label-color, var(--ml-color-text-secondary));
|
|
75
|
+
line-height: var(--ml-input-label-line-height, var(--ml-leading-tight));
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
.ml-input__required {
|
|
74
|
-
color: var(--ml-input-required-color);
|
|
75
|
-
margin-
|
|
79
|
+
color: var(--ml-input-required-color, var(--ml-color-danger));
|
|
80
|
+
margin-inline-start: var(--ml-space-0-5);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
.ml-input__wrapper {
|
|
79
84
|
display: flex;
|
|
80
85
|
align-items: center;
|
|
81
|
-
gap: var(--ml-input-gap);
|
|
82
|
-
padding: var(--ml-input-padding);
|
|
83
|
-
background-color: var(--ml-input-bg);
|
|
84
|
-
border: var(--ml-input-border-width) solid var(--ml-input-border-color);
|
|
85
|
-
border-radius: var(--ml-input-border-radius);
|
|
86
|
-
box-shadow: var(--ml-input-shadow);
|
|
86
|
+
gap: var(--ml-input-gap, var(--ml-space-2));
|
|
87
|
+
padding: var(--ml-input-padding, var(--ml-space-2-5) var(--ml-space-3-5));
|
|
88
|
+
background-color: var(--ml-input-bg, var(--ml-color-input-bg));
|
|
89
|
+
border: var(--ml-input-border-width, var(--ml-border)) solid var(--ml-input-border-color, var(--ml-color-border));
|
|
90
|
+
border-radius: var(--ml-input-border-radius, var(--ml-radius));
|
|
91
|
+
box-shadow: var(--ml-input-shadow, none);
|
|
87
92
|
transition:
|
|
88
|
-
border-color var(--ml-input-transition-duration) var(--ml-input-transition-easing),
|
|
89
|
-
box-shadow var(--ml-input-transition-duration) var(--ml-input-transition-easing);
|
|
93
|
+
border-color var(--ml-input-transition-duration, var(--ml-duration-150)) var(--ml-input-transition-easing, var(--ml-ease-in-out)),
|
|
94
|
+
box-shadow var(--ml-input-transition-duration, var(--ml-duration-150)) var(--ml-input-transition-easing, var(--ml-ease-in-out));
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
.ml-input__wrapper:hover:not(.ml-input--disabled .ml-input__wrapper) {
|
|
93
|
-
border-color: var(--ml-input-hover-border-color);
|
|
98
|
+
border-color: var(--ml-input-hover-border-color, var(--ml-color-border));
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
.ml-input__field {
|
|
@@ -98,10 +103,10 @@ export const inputStyles = () => css `
|
|
|
98
103
|
min-width: 0;
|
|
99
104
|
border: none;
|
|
100
105
|
background: transparent;
|
|
101
|
-
color: var(--ml-input-color);
|
|
102
|
-
font-family: var(--ml-input-font-family);
|
|
103
|
-
font-size: var(--ml-input-font-size);
|
|
104
|
-
line-height: var(--ml-input-line-height);
|
|
106
|
+
color: var(--ml-input-color, var(--ml-color-text));
|
|
107
|
+
font-family: var(--ml-input-font-family, var(--ml-font-sans));
|
|
108
|
+
font-size: var(--ml-input-font-size, var(--ml-text-sm));
|
|
109
|
+
line-height: var(--ml-input-line-height, var(--ml-leading-normal));
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
.ml-input__field:focus {
|
|
@@ -109,43 +114,43 @@ export const inputStyles = () => css `
|
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
.ml-input__field::placeholder {
|
|
112
|
-
color: var(--ml-input-placeholder-color);
|
|
117
|
+
color: var(--ml-input-placeholder-color, var(--ml-color-text-muted));
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
.ml-input__field:disabled {
|
|
116
121
|
cursor: not-allowed;
|
|
117
|
-
color: var(--ml-input-disabled-color);
|
|
122
|
+
color: var(--ml-input-disabled-color, var(--ml-color-text-muted));
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
.ml-input__hint,
|
|
121
126
|
.ml-input__error {
|
|
122
|
-
font-size: var(--ml-input-hint-font-size);
|
|
123
|
-
line-height: var(--ml-input-label-line-height);
|
|
127
|
+
font-size: var(--ml-input-hint-font-size, var(--ml-text-sm));
|
|
128
|
+
line-height: var(--ml-input-label-line-height, var(--ml-leading-tight));
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
.ml-input__hint {
|
|
127
|
-
color: var(--ml-input-hint-color);
|
|
132
|
+
color: var(--ml-input-hint-color, var(--ml-color-text-muted));
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
.ml-input__error {
|
|
131
|
-
color: var(--ml-input-error-color);
|
|
136
|
+
color: var(--ml-input-error-color, var(--ml-color-danger));
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
.ml-input--focused .ml-input__wrapper {
|
|
135
|
-
border-color: var(--ml-input-focus-border-color);
|
|
136
|
-
box-shadow: var(--ml-input-focus-shadow), var(--ml-input-focus-inset-shadow);
|
|
140
|
+
border-color: var(--ml-input-focus-border-color, var(--ml-color-primary));
|
|
141
|
+
box-shadow: var(--ml-input-focus-shadow, var(--ml-shadow-focus-ring)), var(--ml-input-focus-inset-shadow, none);
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
.ml-input--error .ml-input__wrapper {
|
|
140
|
-
border-color: var(--ml-input-error-border-color);
|
|
145
|
+
border-color: var(--ml-input-error-border-color, var(--ml-color-danger));
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
.ml-input--error.ml-input--focused .ml-input__wrapper {
|
|
144
|
-
box-shadow: var(--ml-input-error-focus-shadow);
|
|
149
|
+
box-shadow: var(--ml-input-error-focus-shadow, var(--ml-shadow-ring-error));
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
.ml-input--disabled .ml-input__wrapper {
|
|
148
|
-
background-color: var(--ml-input-disabled-bg);
|
|
153
|
+
background-color: var(--ml-input-disabled-bg, var(--ml-color-input-disabled-bg));
|
|
149
154
|
cursor: not-allowed;
|
|
150
155
|
}
|
|
151
156
|
|
|
@@ -178,7 +183,18 @@ export const inputStyles = () => css `
|
|
|
178
183
|
::slotted([slot='suffix']) {
|
|
179
184
|
display: flex;
|
|
180
185
|
align-items: center;
|
|
181
|
-
color: var(--ml-input-addon-color);
|
|
186
|
+
color: var(--ml-input-addon-color, var(--ml-color-text-muted));
|
|
182
187
|
flex-shrink: 0;
|
|
183
188
|
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* Forced colors (Windows High Contrast): box-shadow rings and background
|
|
192
|
+
* highlights are not painted there, so focus falls back to a real outline.
|
|
193
|
+
*/
|
|
194
|
+
@media (forced-colors: active) {
|
|
195
|
+
.ml-input--focused .ml-input__wrapper {
|
|
196
|
+
outline: 2px solid Highlight;
|
|
197
|
+
outline-offset: 2px;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
184
200
|
`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ListboxValueSync, registerListboxAdapter, areValuesEqual, normalizeValues, findNextEnabledIndex, findPreviousEnabledIndex, findFirstEnabledIndex, findLastEnabledIndex, scrollOptionIntoView } from './listbox-core.js';
|
|
2
|
+
export type { ListboxValueHost, ListboxOptionLike } from './listbox-core.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/listbox-core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// INTERNAL shared core for ml-select / ml-autocomplete — not exported from the package root.
|
|
2
|
+
export { ListboxValueSync, registerListboxAdapter, areValuesEqual, normalizeValues, findNextEnabledIndex, findPreviousEnabledIndex, findFirstEnabledIndex, findLastEnabledIndex, scrollOptionIntoView } from './listbox-core.js';
|