agnosticui-core 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +67 -33
- package/dist/{VueButton.vue_vue_type_script_setup_true_lang-Bq8IPXqd.js → VueButton.vue_vue_type_script_setup_true_lang-D1jGatE9.js} +17 -15
- package/dist/{VueButtonFx.vue_vue_type_script_setup_true_lang-BUudF-lg.js → VueButtonFx.vue_vue_type_script_setup_true_lang-BRrt6Nxs.js} +1 -0
- package/dist/{VueCheckbox.vue_vue_type_script_setup_true_lang-DERDRO2P.js → VueCheckbox.vue_vue_type_script_setup_true_lang-VtQfJ-6f.js} +9 -10
- package/dist/{VueCombobox.vue_vue_type_script_setup_true_lang-C7gDMrYJ.js → VueCombobox.vue_vue_type_script_setup_true_lang-BSTZGX2X.js} +15 -13
- package/dist/VueIcon.vue_vue_type_script_setup_true_lang-C2Sky3bU.js +22 -0
- package/dist/{VueImage.vue_vue_type_script_setup_true_lang-CUwbK3NF.js → VueImage.vue_vue_type_script_setup_true_lang-SddK93SB.js} +23 -17
- package/dist/{VueInput.vue_vue_type_script_setup_true_lang-Dsxo7DuX.js → VueInput.vue_vue_type_script_setup_true_lang-wYdAqg-i.js} +19 -19
- package/dist/{VueMenu.vue_vue_type_script_setup_true_lang-bnn7ochj.js → VueMenu.vue_vue_type_script_setup_true_lang-BXc7397e.js} +5 -4
- package/dist/{VueRadio.vue_vue_type_script_setup_true_lang-DxNhH12d.js → VueRadio.vue_vue_type_script_setup_true_lang-C7Z-sWpa.js} +10 -12
- package/dist/{VueRating.vue_vue_type_script_setup_true_lang-CICncp71.js → VueRating.vue_vue_type_script_setup_true_lang-Bm2nRrqr.js} +11 -9
- package/dist/VueSelectionButton.vue_vue_type_script_setup_true_lang-DJN-Uk6n.js +24 -0
- package/dist/VueSelectionButtonGroup.vue_vue_type_script_setup_true_lang-DwYrIMVO.js +46 -0
- package/dist/VueSelectionCard.vue_vue_type_script_setup_true_lang-DJiyPsXH.js +24 -0
- package/dist/VueSelectionCardGroup.vue_vue_type_script_setup_true_lang-D5CycLY5.js +40 -0
- package/dist/{VueToggle.vue_vue_type_script_setup_true_lang-BxrvAsse.js → VueToggle.vue_vue_type_script_setup_true_lang-DLPCBOqZ.js} +18 -16
- package/dist/components/Alert/core/_Alert.d.ts.map +1 -1
- package/dist/components/Alert/core/_Alert.js +38 -19
- package/dist/components/Button/core/_Button.d.ts +5 -0
- package/dist/components/Button/core/_Button.d.ts.map +1 -1
- package/dist/components/Button/core/_Button.js +147 -65
- package/dist/components/Button/vue/VueButton.js +1 -1
- package/dist/components/Button/vue/VueButton.vue.d.ts +3 -0
- package/dist/components/Button/vue/VueButton.vue.d.ts.map +1 -1
- package/dist/components/Button/vue/index.js +1 -1
- package/dist/components/ButtonFx/vue/VueButtonFx.js +1 -1
- package/dist/components/ButtonFx/vue/index.js +1 -1
- package/dist/components/Card/core/_Card.d.ts +9 -1
- package/dist/components/Card/core/_Card.d.ts.map +1 -1
- package/dist/components/Card/core/_Card.js +83 -29
- package/dist/components/Card/vue/VueCard.js +29 -16
- package/dist/components/Card/vue/VueCard.vue.d.ts +25 -5
- package/dist/components/Card/vue/VueCard.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.d.ts +37 -11
- package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.js +73 -42
- package/dist/components/Checkbox/vue/VueCheckbox.js +1 -1
- package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts +3 -3
- package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/vue/index.js +1 -1
- package/dist/components/Combobox/core/_Combobox.d.ts +24 -1
- package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/core/_Combobox.js +141 -92
- package/dist/components/Combobox/vue/VueCombobox.js +1 -1
- package/dist/components/Combobox/vue/index.js +1 -1
- package/dist/components/Fieldset/vue/VueFieldset.vue.d.ts +1 -1
- package/dist/components/Icon/vue/VueIcon.js +1 -1
- package/dist/components/Icon/vue/VueIcon.vue.d.ts.map +1 -1
- package/dist/components/Icon/vue/index.js +1 -1
- package/dist/components/Image/vue/VueImage.js +1 -1
- package/dist/components/Image/vue/VueImage.vue.d.ts.map +1 -1
- package/dist/components/Image/vue/index.js +1 -1
- package/dist/components/Input/core/_Input.d.ts +21 -2
- package/dist/components/Input/core/_Input.d.ts.map +1 -1
- package/dist/components/Input/core/_Input.js +71 -35
- package/dist/components/Input/vue/VueInput.js +1 -1
- package/dist/components/Input/vue/VueInput.vue.d.ts.map +1 -1
- package/dist/components/Input/vue/index.js +1 -1
- package/dist/components/Link/core/_Link.d.ts.map +1 -1
- package/dist/components/Link/core/_Link.js +1 -0
- package/dist/components/Link/vue/VueLink.js +6 -5
- package/dist/components/Link/vue/VueLink.vue.d.ts.map +1 -1
- package/dist/components/Menu/vue/VueMenu.js +1 -1
- package/dist/components/Menu/vue/index.js +1 -1
- package/dist/components/Pagination/core/_Pagination.d.ts +0 -1
- package/dist/components/Pagination/core/_Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/core/_Pagination.js +6 -9
- package/dist/components/Radio/core/_Radio.d.ts +55 -10
- package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
- package/dist/components/Radio/core/_Radio.js +165 -116
- package/dist/components/Radio/vue/VueRadio.js +1 -1
- package/dist/components/Radio/vue/VueRadio.vue.d.ts.map +1 -1
- package/dist/components/Radio/vue/index.js +1 -1
- package/dist/components/Rating/core/_Rating.d.ts +23 -2
- package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
- package/dist/components/Rating/core/_Rating.js +97 -64
- package/dist/components/Rating/vue/VueRating.js +1 -1
- package/dist/components/Rating/vue/VueRating.vue.d.ts +2 -0
- package/dist/components/Rating/vue/VueRating.vue.d.ts.map +1 -1
- package/dist/components/Rating/vue/index.js +1 -1
- package/dist/components/Select/core/_Select.d.ts +20 -2
- package/dist/components/Select/core/_Select.d.ts.map +1 -1
- package/dist/components/Select/core/_Select.js +99 -69
- package/dist/components/SelectionButton/core/SelectionButton.d.ts +9 -0
- package/dist/components/SelectionButton/core/SelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/core/SelectionButton.js +5 -0
- package/dist/components/SelectionButton/core/_SelectionButton.d.ts +47 -0
- package/dist/components/SelectionButton/core/_SelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/core/_SelectionButton.js +474 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts +9 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.js +12 -0
- package/dist/components/SelectionButton/react/index.d.ts +3 -0
- package/dist/components/SelectionButton/react/index.d.ts.map +1 -0
- package/dist/components/SelectionButton/react/index.js +4 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.js +4 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts +55 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts.map +1 -0
- package/dist/components/SelectionButton/vue/index.d.ts +6 -0
- package/dist/components/SelectionButton/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionButton/vue/index.js +4 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts +9 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.js +5 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +87 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +235 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts +13 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.js +15 -0
- package/dist/components/SelectionButtonGroup/react/index.d.ts +3 -0
- package/dist/components/SelectionButtonGroup/react/index.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/react/index.js +4 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.js +4 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts +101 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/vue/index.d.ts +6 -0
- package/dist/components/SelectionButtonGroup/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/vue/index.js +4 -0
- package/dist/components/SelectionCard/core/SelectionCard.d.ts +9 -0
- package/dist/components/SelectionCard/core/SelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/core/SelectionCard.js +5 -0
- package/dist/components/SelectionCard/core/_SelectionCard.d.ts +39 -0
- package/dist/components/SelectionCard/core/_SelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/core/_SelectionCard.js +318 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts +9 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.js +12 -0
- package/dist/components/SelectionCard/react/index.d.ts +3 -0
- package/dist/components/SelectionCard/react/index.d.ts.map +1 -0
- package/dist/components/SelectionCard/react/index.js +4 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.js +4 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts +55 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts.map +1 -0
- package/dist/components/SelectionCard/vue/index.d.ts +6 -0
- package/dist/components/SelectionCard/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionCard/vue/index.js +4 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts +9 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.js +5 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +69 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +220 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts +13 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.js +15 -0
- package/dist/components/SelectionCardGroup/react/index.d.ts +3 -0
- package/dist/components/SelectionCardGroup/react/index.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/react/index.js +4 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.js +4 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts +86 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/vue/index.d.ts +6 -0
- package/dist/components/SelectionCardGroup/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/vue/index.js +4 -0
- package/dist/components/Slider/core/_Slider.d.ts +10 -16
- package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
- package/dist/components/Slider/core/_Slider.js +28 -39
- package/dist/components/Timeline/core/_Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/core/_Timeline.js +8 -3
- package/dist/components/Timeline/react/ReactTimeline.d.ts +23 -9
- package/dist/components/Timeline/react/ReactTimeline.d.ts.map +1 -1
- package/dist/components/Timeline/react/ReactTimeline.js +18 -14
- package/dist/components/Toggle/core/_Toggle.d.ts +36 -6
- package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/core/_Toggle.js +117 -77
- package/dist/components/Toggle/vue/VueToggle.js +1 -1
- package/dist/components/Toggle/vue/VueToggle.vue.d.ts.map +1 -1
- package/dist/components/Toggle/vue/index.js +1 -1
- package/dist/shared/face-mixin.d.ts +82 -0
- package/dist/shared/face-mixin.d.ts.map +1 -0
- package/dist/shared/face-mixin.js +86 -0
- package/dist/shared/form-control-styles.js +1 -1
- package/dist/styles/ag-tokens-dark.css +4 -0
- package/dist/styles/ag-tokens.css +18 -13
- package/dist/test-setup.js +340 -255
- package/package.json +51 -13
- package/src/components/Alert/core/_Alert.ts +21 -2
- package/src/components/Button/core/_Button.ts +111 -21
- package/src/components/Button/vue/VueButton.vue +2 -0
- package/src/components/Card/core/_Card.ts +70 -3
- package/src/components/Card/vue/VueCard.vue +19 -3
- package/src/components/Checkbox/core/_Checkbox.ts +78 -18
- package/src/components/Checkbox/vue/VueCheckbox.vue +0 -6
- package/src/components/Combobox/core/_Combobox.ts +84 -2
- package/src/components/Combobox/vue/VueCombobox.vue +1 -0
- package/src/components/Drawer/v1/dialog--drawer-bottom.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-end.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-start.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-top.hbs +48 -0
- package/src/components/Drawer/v1/dialog-demo.css +13 -0
- package/src/components/Drawer/v1/dialog.config.yml +5 -0
- package/src/components/Drawer/v1/dialog.css +99 -0
- package/src/components/Drawer/v1/dialog.hbs +48 -0
- package/src/components/Drawer/v1/drawer-animations.css +52 -0
- package/src/components/Drawer/v1/drawer.css +50 -0
- package/src/components/Icon/vue/VueIcon.vue +2 -5
- package/src/components/Image/vue/VueImage.vue +17 -13
- package/src/components/Input/core/_Input.ts +58 -3
- package/src/components/Input/vue/VueInput.vue +2 -6
- package/src/components/Link/core/_Link.ts +1 -0
- package/src/components/Link/vue/VueLink.vue +1 -0
- package/src/components/Pagination/core/_Pagination.ts +10 -18
- package/src/components/Radio/core/_Radio.ts +131 -41
- package/src/components/Radio/vue/VueRadio.vue +1 -5
- package/src/components/Rating/core/_Rating.ts +62 -5
- package/src/components/Rating/vue/VueRating.vue +3 -0
- package/src/components/Select/core/_Select.ts +55 -6
- package/src/components/SelectionButton/core/SelectionButton.ts +13 -0
- package/src/components/SelectionButton/core/_SelectionButton.ts +551 -0
- package/src/components/SelectionButton/react/ReactSelectionButton.tsx +16 -0
- package/src/components/SelectionButton/react/index.ts +4 -0
- package/src/components/SelectionButton/vue/VueSelectionButton.vue +33 -0
- package/src/components/SelectionButton/vue/index.ts +5 -0
- package/src/components/SelectionButtonGroup/core/SelectionButtonGroup.ts +13 -0
- package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +423 -0
- package/src/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.tsx +29 -0
- package/src/components/SelectionButtonGroup/react/index.ts +9 -0
- package/src/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue +89 -0
- package/src/components/SelectionButtonGroup/vue/index.ts +5 -0
- package/src/components/SelectionCard/core/SelectionCard.ts +13 -0
- package/src/components/SelectionCard/core/_SelectionCard.ts +384 -0
- package/src/components/SelectionCard/react/ReactSelectionCard.tsx +16 -0
- package/src/components/SelectionCard/react/index.ts +4 -0
- package/src/components/SelectionCard/vue/VueSelectionCard.vue +33 -0
- package/src/components/SelectionCard/vue/index.ts +5 -0
- package/src/components/SelectionCardGroup/core/SelectionCardGroup.ts +13 -0
- package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +396 -0
- package/src/components/SelectionCardGroup/react/ReactSelectionCardGroup.tsx +29 -0
- package/src/components/SelectionCardGroup/react/index.ts +9 -0
- package/src/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue +71 -0
- package/src/components/SelectionCardGroup/vue/index.ts +5 -0
- package/src/components/Slider/core/_Slider.ts +28 -28
- package/src/components/Timeline/core/_Timeline.ts +5 -0
- package/src/components/Timeline/react/ReactTimeline.tsx +47 -24
- package/src/components/Toggle/core/_Toggle.ts +83 -9
- package/src/components/Toggle/vue/VueToggle.vue +2 -0
- package/src/shared/face-mixin.ts +233 -0
- package/src/shared/form-control-styles.ts +1 -1
- package/src/styles/ag-tokens-dark.css +4 -0
- package/src/styles/ag-tokens.css +18 -13
- package/RTL_IMPLEMENTATION_PLAN.md +0 -295
- package/dist/VueIcon.vue_vue_type_script_setup_true_lang-kC-nzMyu.js +0 -25
- package/dist/components/Input/core/_Input.BACKUP.d.ts +0 -114
- package/dist/components/Input/core/_Input.BACKUP.d.ts.map +0 -1
- package/dist/components/Input/core/_Input.BACKUP.js +0 -511
- package/dist/global.d.js +0 -1
- package/src/components/Input/core/_Input.BACKUP.ts +0 -710
- package/src/global.d.ts +0 -43
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
createFormControlIds,
|
|
6
6
|
buildAriaDescribedBy,
|
|
7
7
|
} from '../../../shared/form-control-utils';
|
|
8
|
+
import { FaceMixin, syncInnerInputValidity } from '../../../shared/face-mixin';
|
|
8
9
|
|
|
9
10
|
export type CheckboxSize = 'small' | 'medium' | 'large';
|
|
10
11
|
export type CheckboxTheme = 'default' | 'primary' | 'success' | 'monochrome';
|
|
@@ -26,15 +27,15 @@ export type CheckboxChangeEvent = CustomEvent<CheckboxChangeEventDetail>;
|
|
|
26
27
|
* @csspart ag-checkbox-label - The label text span
|
|
27
28
|
*/
|
|
28
29
|
export interface CheckboxProps {
|
|
29
|
-
name
|
|
30
|
-
value
|
|
31
|
-
checked
|
|
32
|
-
indeterminate
|
|
33
|
-
disabled
|
|
34
|
-
size
|
|
35
|
-
theme
|
|
36
|
-
labelText
|
|
37
|
-
labelPosition
|
|
30
|
+
name?: string;
|
|
31
|
+
value?: string;
|
|
32
|
+
checked?: boolean;
|
|
33
|
+
indeterminate?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
size?: CheckboxSize;
|
|
36
|
+
theme?: CheckboxTheme;
|
|
37
|
+
labelText?: string;
|
|
38
|
+
labelPosition?: 'end' | 'start';
|
|
38
39
|
// Validation & hints
|
|
39
40
|
required?: boolean;
|
|
40
41
|
invalid?: boolean;
|
|
@@ -45,7 +46,7 @@ export interface CheckboxProps {
|
|
|
45
46
|
onChange?: (event: CheckboxChangeEvent) => void;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
49
|
+
export class AgCheckbox extends FaceMixin(LitElement) implements CheckboxProps {
|
|
49
50
|
static override styles = [
|
|
50
51
|
formControlStyles,
|
|
51
52
|
css`
|
|
@@ -58,7 +59,7 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
58
59
|
align-items: center;
|
|
59
60
|
cursor: pointer;
|
|
60
61
|
user-select: none;
|
|
61
|
-
gap:
|
|
62
|
+
gap: 0;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
:host([disabled]) .checkbox-wrapper {
|
|
@@ -249,15 +250,15 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
.checkbox-label-copy--small {
|
|
252
|
-
font-size:
|
|
253
|
+
font-size: var(--ag-font-size-sm);
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
.checkbox-label-copy--medium {
|
|
256
|
-
font-size:
|
|
257
|
+
font-size: var(--ag-font-size-sm);
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
.checkbox-label-copy--large {
|
|
260
|
-
font-size:
|
|
261
|
+
font-size: var(--ag-font-size-base);
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
/* Respect reduced motion preferences */
|
|
@@ -278,9 +279,6 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
278
279
|
`,
|
|
279
280
|
];
|
|
280
281
|
|
|
281
|
-
@property({ type: String })
|
|
282
|
-
declare name: string;
|
|
283
|
-
|
|
284
282
|
@property({ type: String })
|
|
285
283
|
declare value: string;
|
|
286
284
|
|
|
@@ -331,7 +329,6 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
331
329
|
|
|
332
330
|
constructor() {
|
|
333
331
|
super();
|
|
334
|
-
this.name = '';
|
|
335
332
|
this.value = '';
|
|
336
333
|
this.checked = false;
|
|
337
334
|
this.indeterminate = false;
|
|
@@ -353,6 +350,52 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
353
350
|
return this.inputRef || null;
|
|
354
351
|
}
|
|
355
352
|
|
|
353
|
+
// ─── FACE ─────────────────────────────────────────────────────────────────
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* FACE lifecycle: called when the parent form is reset.
|
|
357
|
+
* Restores checked and indeterminate to their default states.
|
|
358
|
+
*/
|
|
359
|
+
override formResetCallback(): void {
|
|
360
|
+
this.checked = false;
|
|
361
|
+
this.indeterminate = false;
|
|
362
|
+
this._internals.setFormValue(null);
|
|
363
|
+
this._internals.setValidity({});
|
|
364
|
+
this._syncStates();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Sync validity to ElementInternals by delegating to the inner
|
|
369
|
+
* <input type="checkbox">. Required validation is handled natively
|
|
370
|
+
* by the inner input; we just mirror its state.
|
|
371
|
+
*/
|
|
372
|
+
private _syncValidity(): void {
|
|
373
|
+
syncInnerInputValidity(this._internals, this.inputRef);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Sync CustomStateSet states so :state() pseudo-classes work from external CSS.
|
|
378
|
+
*
|
|
379
|
+
* Must be called AFTER _syncValidity() so that :state(invalid) reads the
|
|
380
|
+
* freshly-updated _internals.validity.valid value.
|
|
381
|
+
*
|
|
382
|
+
* Exposed states:
|
|
383
|
+
* :state(checked) — checkbox is checked
|
|
384
|
+
* :state(indeterminate) — checkbox is in indeterminate state
|
|
385
|
+
* :state(disabled) — checkbox is disabled
|
|
386
|
+
* :state(required) — checkbox is required
|
|
387
|
+
* :state(invalid) — FACE constraint validation is failing
|
|
388
|
+
*/
|
|
389
|
+
private _syncStates(): void {
|
|
390
|
+
this._setState('checked', this.checked);
|
|
391
|
+
this._setState('indeterminate', this.indeterminate);
|
|
392
|
+
this._setState('disabled', this.disabled);
|
|
393
|
+
this._setState('required', this.required);
|
|
394
|
+
this._setState('invalid', !this._internals.validity.valid);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// ─── End FACE ─────────────────────────────────────────────────────────────
|
|
398
|
+
|
|
356
399
|
override updated(changedProperties: Map<string, unknown>) {
|
|
357
400
|
super.updated(changedProperties);
|
|
358
401
|
|
|
@@ -360,6 +403,13 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
360
403
|
if (changedProperties.has('indeterminate') && this.inputRef) {
|
|
361
404
|
this.inputRef.indeterminate = this.indeterminate;
|
|
362
405
|
}
|
|
406
|
+
|
|
407
|
+
// FACE: sync form value and validity for programmatic changes to checked/indeterminate
|
|
408
|
+
if (changedProperties.has('checked') || changedProperties.has('indeterminate')) {
|
|
409
|
+
this._internals.setFormValue(this.checked ? (this.value || 'on') : null);
|
|
410
|
+
this._syncValidity();
|
|
411
|
+
this._syncStates();
|
|
412
|
+
}
|
|
363
413
|
}
|
|
364
414
|
|
|
365
415
|
private handleClick(e: MouseEvent) {
|
|
@@ -383,6 +433,11 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
383
433
|
this.indeterminate = false;
|
|
384
434
|
}
|
|
385
435
|
|
|
436
|
+
// FACE: sync form value and validity on user interaction
|
|
437
|
+
this._internals.setFormValue(this.checked ? (this.value || 'on') : null);
|
|
438
|
+
this._syncValidity();
|
|
439
|
+
this._syncStates();
|
|
440
|
+
|
|
386
441
|
// Dispatch custom change event with dual-dispatch pattern
|
|
387
442
|
const changeEvent = new CustomEvent<CheckboxChangeEventDetail>('change', {
|
|
388
443
|
detail: {
|
|
@@ -526,5 +581,10 @@ export class AgCheckbox extends LitElement implements CheckboxProps {
|
|
|
526
581
|
if (this.inputRef && this.indeterminate) {
|
|
527
582
|
this.inputRef.indeterminate = this.indeterminate;
|
|
528
583
|
}
|
|
584
|
+
|
|
585
|
+
// FACE: set initial form value and sync validity after first render
|
|
586
|
+
this._internals.setFormValue(this.checked ? (this.value || 'on') : null);
|
|
587
|
+
this._syncValidity();
|
|
588
|
+
this._syncStates();
|
|
529
589
|
}
|
|
530
590
|
}
|
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
|
-
import { ref } from "vue";
|
|
27
26
|
import type {
|
|
28
27
|
CheckboxProps,
|
|
29
|
-
CheckboxSize,
|
|
30
|
-
CheckboxTheme,
|
|
31
28
|
CheckboxChangeEvent,
|
|
32
29
|
CheckboxChangeEventDetail,
|
|
33
30
|
} from "../core/Checkbox";
|
|
@@ -62,9 +59,6 @@ const emit = defineEmits<{
|
|
|
62
59
|
(e: "update:indeterminate", indeterminate: boolean): void;
|
|
63
60
|
}>();
|
|
64
61
|
|
|
65
|
-
// Template ref
|
|
66
|
-
const checkboxRef = ref<HTMLElement>();
|
|
67
|
-
|
|
68
62
|
// Event handlers that bridge web component events to Vue emits
|
|
69
63
|
const handleClick = (event: MouseEvent) => {
|
|
70
64
|
emit("click", event);
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { LitElement, html, css, nothing } from 'lit';
|
|
18
18
|
import { property, state, query } from 'lit/decorators.js';
|
|
19
|
+
import { FaceMixin, type ValidationMessages } from '../../../shared/face-mixin';
|
|
19
20
|
import {
|
|
20
21
|
createFormControlIds,
|
|
21
22
|
buildAriaDescribedBy,
|
|
@@ -116,6 +117,7 @@ export interface ComboboxProps {
|
|
|
116
117
|
onClose?: (event: ComboboxCloseEvent) => void;
|
|
117
118
|
onFocus?: (event: FocusEvent) => void;
|
|
118
119
|
onBlur?: (event: FocusEvent) => void;
|
|
120
|
+
validationMessages?: ValidationMessages;
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
/**
|
|
@@ -138,7 +140,7 @@ export interface ComboboxProps {
|
|
|
138
140
|
* @csspart ag-combobox-help-text - Help text element
|
|
139
141
|
* @csspart ag-combobox-error-message - Error message element
|
|
140
142
|
*/
|
|
141
|
-
export class AgCombobox extends LitElement implements ComboboxProps {
|
|
143
|
+
export class AgCombobox extends FaceMixin(LitElement) implements ComboboxProps {
|
|
142
144
|
static styles = [
|
|
143
145
|
formControlStyles,
|
|
144
146
|
css`
|
|
@@ -200,7 +202,7 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
.combobox-input::placeholder {
|
|
203
|
-
color: var(--ag-text-
|
|
205
|
+
color: var(--ag-text-secondary);
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
.combobox-input:disabled {
|
|
@@ -615,6 +617,9 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
615
617
|
@property({ attribute: false })
|
|
616
618
|
declare onBlur?: (event: FocusEvent) => void;
|
|
617
619
|
|
|
620
|
+
@property({ attribute: false })
|
|
621
|
+
declare validationMessages: ValidationMessages | undefined;
|
|
622
|
+
|
|
618
623
|
// Internal state
|
|
619
624
|
@state()
|
|
620
625
|
private _open = false;
|
|
@@ -681,6 +686,7 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
681
686
|
this.loading = false;
|
|
682
687
|
this.loadingText = 'Loading...';
|
|
683
688
|
this.noResultsText = 'No results found';
|
|
689
|
+
this.validationMessages = undefined;
|
|
684
690
|
}
|
|
685
691
|
|
|
686
692
|
connectedCallback() {
|
|
@@ -746,6 +752,15 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
746
752
|
}
|
|
747
753
|
}
|
|
748
754
|
|
|
755
|
+
override updated(changedProperties: Map<string, unknown>) {
|
|
756
|
+
super.updated(changedProperties);
|
|
757
|
+
// FACE: sync for programmatic value changes
|
|
758
|
+
if (changedProperties.has('value')) {
|
|
759
|
+
this._syncFormValue();
|
|
760
|
+
this._syncValidity();
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
749
764
|
// Public methods
|
|
750
765
|
focus() {
|
|
751
766
|
this._inputElement?.focus();
|
|
@@ -876,6 +891,10 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
876
891
|
this.dispatchEvent(selectEvent);
|
|
877
892
|
this.onSelect?.(selectEvent);
|
|
878
893
|
|
|
894
|
+
// FACE: sync form value and validity after selection
|
|
895
|
+
this._syncFormValue();
|
|
896
|
+
this._syncValidity();
|
|
897
|
+
|
|
879
898
|
// Dispatch change event (value is already updated by _selectionChanged)
|
|
880
899
|
const changeEvent = new CustomEvent<ComboboxChangeEventDetail>('change', {
|
|
881
900
|
detail: {
|
|
@@ -914,6 +933,10 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
914
933
|
this._selectionChanged();
|
|
915
934
|
this._activeIndex = -1;
|
|
916
935
|
|
|
936
|
+
// FACE: sync form value and validity on clear
|
|
937
|
+
this._syncFormValue();
|
|
938
|
+
this._syncValidity();
|
|
939
|
+
|
|
917
940
|
// Dispatch change event
|
|
918
941
|
const changeEvent = new CustomEvent<ComboboxChangeEventDetail>('change', {
|
|
919
942
|
detail: {
|
|
@@ -927,6 +950,65 @@ export class AgCombobox extends LitElement implements ComboboxProps {
|
|
|
927
950
|
this.onChange?.(changeEvent);
|
|
928
951
|
}
|
|
929
952
|
|
|
953
|
+
// ─── FACE ─────────────────────────────────────────────────────────────────
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Sync the form value to ElementInternals.
|
|
957
|
+
* Single: submits the selected value string, or null if nothing selected.
|
|
958
|
+
* Multiple: submits all selected values via FormData overload.
|
|
959
|
+
* Typed text that hasn't been committed via selectOption() is never submitted.
|
|
960
|
+
*/
|
|
961
|
+
private _syncFormValue(): void {
|
|
962
|
+
if (this.multiple) {
|
|
963
|
+
const selected = Array.isArray(this.value) ? this.value : [];
|
|
964
|
+
if (selected.length === 0) {
|
|
965
|
+
this._internals.setFormValue(null);
|
|
966
|
+
} else {
|
|
967
|
+
const formData = new FormData();
|
|
968
|
+
selected.forEach(val => formData.append(this.name, val));
|
|
969
|
+
this._internals.setFormValue(formData);
|
|
970
|
+
}
|
|
971
|
+
} else {
|
|
972
|
+
const val = typeof this.value === 'string' ? this.value : '';
|
|
973
|
+
this._internals.setFormValue(val || null);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Sync validity. Required with no selection = valueMissing.
|
|
979
|
+
*/
|
|
980
|
+
private _syncValidity(): void {
|
|
981
|
+
const hasValue = this.multiple
|
|
982
|
+
? (Array.isArray(this.value) && this.value.length > 0)
|
|
983
|
+
: !!(typeof this.value === 'string' && this.value);
|
|
984
|
+
if (this.required && !hasValue) {
|
|
985
|
+
this._internals.setValidity(
|
|
986
|
+
{ valueMissing: true },
|
|
987
|
+
this.validationMessages?.valueMissing ?? 'Please select an option.'
|
|
988
|
+
);
|
|
989
|
+
} else {
|
|
990
|
+
this._internals.setValidity({});
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
override firstUpdated() {
|
|
995
|
+
this._syncFormValue();
|
|
996
|
+
this._syncValidity();
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* FACE lifecycle: called when the parent form is reset.
|
|
1001
|
+
* Clears selection and re-syncs form value.
|
|
1002
|
+
*/
|
|
1003
|
+
override formResetCallback(): void {
|
|
1004
|
+
this._selectedOptions = [];
|
|
1005
|
+
this._selectionChanged();
|
|
1006
|
+
this._internals.setFormValue(null);
|
|
1007
|
+
this._internals.setValidity({});
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
// ─── End FACE ─────────────────────────────────────────────────────────────
|
|
1011
|
+
|
|
930
1012
|
// Private methods
|
|
931
1013
|
private _selectionChanged() {
|
|
932
1014
|
if (this.multiple) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="dialog drawer-bottom"
|
|
2
|
+
id="dialog-example"
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
aria-labelledby="drawer-end-title"
|
|
5
|
+
aria-describedby="drawer-end-description">
|
|
6
|
+
<div class="dialog-overlay"
|
|
7
|
+
data-a11y-dialog-hide></div>
|
|
8
|
+
<div class="dialog-content drawer-content drawer-slide-bottom"
|
|
9
|
+
role="document">
|
|
10
|
+
<div class="mbs16 mbe24 mis16 mie16">
|
|
11
|
+
<button data-a11y-dialog-hide
|
|
12
|
+
class="close-button close-button-large dialog-close"
|
|
13
|
+
aria-label="Close this dialog window">
|
|
14
|
+
<svg class="close"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
aria-hidden="true">
|
|
17
|
+
<path fill="currentColor"
|
|
18
|
+
d="M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
|
|
22
|
+
<h1 id="drawer-end-title">Subscribe to our newsletter</h1>
|
|
23
|
+
<p id="drawer-end-description">
|
|
24
|
+
Fill in the form below to receive our newsletter!
|
|
25
|
+
</p>
|
|
26
|
+
<form class="dialog-form-demo">
|
|
27
|
+
<label class="label"
|
|
28
|
+
for="email">Email (required)</label>
|
|
29
|
+
<input class="input input-rounded"
|
|
30
|
+
type="email"
|
|
31
|
+
name="EMAIL"
|
|
32
|
+
id="email"
|
|
33
|
+
placeholder="john.doe@gmail.com"
|
|
34
|
+
required />
|
|
35
|
+
<button class="btn btn-primary btn-rounded btn-block"
|
|
36
|
+
type="submit"
|
|
37
|
+
name="button">Sign up</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<button type="button"
|
|
44
|
+
class="btn btn-primary btn-bordered"
|
|
45
|
+
data-a11y-dialog-show="dialog-example">
|
|
46
|
+
Open drawer
|
|
47
|
+
</button>
|
|
48
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="dialog drawer-end"
|
|
2
|
+
id="dialog-example"
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
aria-labelledby="drawer-end-title"
|
|
5
|
+
aria-describedby="drawer-end-description">
|
|
6
|
+
<div class="dialog-overlay"
|
|
7
|
+
data-a11y-dialog-hide></div>
|
|
8
|
+
<div class="dialog-content drawer-content drawer-slide-end"
|
|
9
|
+
role="document">
|
|
10
|
+
<div class="mbs16 mbe24 mis16 mie16">
|
|
11
|
+
<button data-a11y-dialog-hide
|
|
12
|
+
class="close-button close-button-large dialog-close"
|
|
13
|
+
aria-label="Close this dialog window">
|
|
14
|
+
<svg class="close"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
aria-hidden="true">
|
|
17
|
+
<path fill="currentColor"
|
|
18
|
+
d="M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
|
|
22
|
+
<h1 id="drawer-end-title">Subscribe to our newsletter</h1>
|
|
23
|
+
<p id="drawer-end-description">
|
|
24
|
+
Fill in the form below to receive our newsletter!
|
|
25
|
+
</p>
|
|
26
|
+
<form class="dialog-form-demo">
|
|
27
|
+
<label class="label"
|
|
28
|
+
for="email">Email (required)</label>
|
|
29
|
+
<input class="input input-rounded"
|
|
30
|
+
type="email"
|
|
31
|
+
name="EMAIL"
|
|
32
|
+
id="email"
|
|
33
|
+
placeholder="john.doe@gmail.com"
|
|
34
|
+
required />
|
|
35
|
+
<button class="btn btn-primary btn-rounded btn-block"
|
|
36
|
+
type="submit"
|
|
37
|
+
name="button">Sign up</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<button type="button"
|
|
44
|
+
class="btn btn-primary btn-bordered"
|
|
45
|
+
data-a11y-dialog-show="dialog-example">
|
|
46
|
+
Open drawer
|
|
47
|
+
</button>
|
|
48
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="dialog drawer-start"
|
|
2
|
+
id="dialog-example"
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
aria-labelledby="drawer-end-title"
|
|
5
|
+
aria-describedby="drawer-end-description">
|
|
6
|
+
<div class="dialog-overlay"
|
|
7
|
+
data-a11y-dialog-hide></div>
|
|
8
|
+
<div class="dialog-content drawer-content drawer-slide-start"
|
|
9
|
+
role="document">
|
|
10
|
+
<div class="mbs16 mbe24 mis16 mie16">
|
|
11
|
+
<button data-a11y-dialog-hide
|
|
12
|
+
class="close-button close-button-large dialog-close"
|
|
13
|
+
aria-label="Close this dialog window">
|
|
14
|
+
<svg class="close"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
aria-hidden="true">
|
|
17
|
+
<path fill="currentColor"
|
|
18
|
+
d="M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
|
|
22
|
+
<h1 id="drawer-end-title">Subscribe to our newsletter</h1>
|
|
23
|
+
<p id="drawer-end-description">
|
|
24
|
+
Fill in the form below to receive our newsletter!
|
|
25
|
+
</p>
|
|
26
|
+
<form class="dialog-form-demo">
|
|
27
|
+
<label class="label"
|
|
28
|
+
for="email">Email (required)</label>
|
|
29
|
+
<input class="input input-rounded"
|
|
30
|
+
type="email"
|
|
31
|
+
name="EMAIL"
|
|
32
|
+
id="email"
|
|
33
|
+
placeholder="john.doe@gmail.com"
|
|
34
|
+
required />
|
|
35
|
+
<button class="btn btn-primary btn-rounded btn-block"
|
|
36
|
+
type="submit"
|
|
37
|
+
name="button">Sign up</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<button type="button"
|
|
44
|
+
class="btn btn-primary btn-bordered"
|
|
45
|
+
data-a11y-dialog-show="dialog-example">
|
|
46
|
+
Open drawer
|
|
47
|
+
</button>
|
|
48
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="dialog drawer-top"
|
|
2
|
+
id="dialog-example"
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
aria-labelledby="drawer-end-title"
|
|
5
|
+
aria-describedby="drawer-end-description">
|
|
6
|
+
<div class="dialog-overlay"
|
|
7
|
+
data-a11y-dialog-hide></div>
|
|
8
|
+
<div class="dialog-content drawer-content drawer-slide-top"
|
|
9
|
+
role="document">
|
|
10
|
+
<div class="mbs16 mbe24 mis16 mie16">
|
|
11
|
+
<button data-a11y-dialog-hide
|
|
12
|
+
class="close-button close-button-large dialog-close"
|
|
13
|
+
aria-label="Close this dialog window">
|
|
14
|
+
<svg class="close"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
aria-hidden="true">
|
|
17
|
+
<path fill="currentColor"
|
|
18
|
+
d="M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
|
|
22
|
+
<h1 id="drawer-end-title">Subscribe to our newsletter</h1>
|
|
23
|
+
<p id="drawer-end-description">
|
|
24
|
+
Fill in the form below to receive our newsletter!
|
|
25
|
+
</p>
|
|
26
|
+
<form class="dialog-form-demo">
|
|
27
|
+
<label class="label"
|
|
28
|
+
for="email">Email (required)</label>
|
|
29
|
+
<input class="input input-rounded"
|
|
30
|
+
type="email"
|
|
31
|
+
name="EMAIL"
|
|
32
|
+
id="email"
|
|
33
|
+
placeholder="john.doe@gmail.com"
|
|
34
|
+
required />
|
|
35
|
+
<button class="btn btn-primary btn-rounded btn-block"
|
|
36
|
+
type="submit"
|
|
37
|
+
name="button">Sign up</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<button type="button"
|
|
44
|
+
class="btn btn-primary btn-bordered"
|
|
45
|
+
data-a11y-dialog-show="dialog-example">
|
|
46
|
+
Open drawer
|
|
47
|
+
</button>
|
|
48
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.dialog h1 {
|
|
2
|
+
margin: 0;
|
|
3
|
+
|
|
4
|
+
/* Since this is in a modal we want to force it smaller */
|
|
5
|
+
font-size: var(--agnostic-h3);
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
margin-block-end: var(--fluid-16);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dialog-form-demo > input {
|
|
12
|
+
margin-block-end: var(--fluid-24);
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
title: Dialog
|
|
2
|
+
notes: |
|
|
3
|
+
Dialog is a base-level implementation of a dialog component that can/will be leveraged for other components like popover, modal, menu, etc. Currently, the demo here is utilizing Kitty Giraudel's [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) which is a very clean styling-agnostic JavaScript implementation that supports what you'd expect from an a11y-compliant dialog and has saved me a lot of time while I figure out the styles. Thus, the structure should be consistent with what `a11y-dialog` recommends in terms of markup structure. The `a11y-dialog` script is currently pulled in via CDN.
|
|
4
|
+
|
|
5
|
+
To be absolutely 100% clear, if you utilize AgnosticUI's CSS package, you only get the HTML/CSS for dialog. The functionality in terms of showing / dismissing the dialog, navigating with your keyboard, etc., is being handled by [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog). The AgnosticUI framework implementations (React, Angular, Svelte, Vue, etc.) likely WILL handle said functionality once they've been implemented (not the case at time of writing).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.dialog,
|
|
2
|
+
.dialog-overlay {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dialog {
|
|
11
|
+
z-index: 1001;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dialog[aria-hidden="true"] {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dialog-overlay {
|
|
20
|
+
background-color: rgb(50 50 50 / 60%);
|
|
21
|
+
animation: fade-in var(--agnostic-timing-fast) both;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dialog-content {
|
|
25
|
+
background-color: var(--agnostic-light);
|
|
26
|
+
margin: auto;
|
|
27
|
+
z-index: 1001;
|
|
28
|
+
position: relative;
|
|
29
|
+
padding: var(--fluid-16);
|
|
30
|
+
max-width: 90%;
|
|
31
|
+
width: 600px;
|
|
32
|
+
border-radius: var(--agnostic-radius);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dialog-fade-in {
|
|
36
|
+
animation: fade-in var(--agnostic-timing-fast) both;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dialog-slide-up {
|
|
40
|
+
animation: slide-up var(--agnostic-timing-slow) var(--agnostic-timing-fast) both;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Cannot use two separate CSS classes with animation: foo, bar
|
|
45
|
+
* as the later class will overwrite the first (so this combines)
|
|
46
|
+
*/
|
|
47
|
+
.dialog-slide-up-fade-in {
|
|
48
|
+
animation:
|
|
49
|
+
fade-in var(--agnostic-timing-fast) both,
|
|
50
|
+
slide-up var(--agnostic-timing-slow) var(--agnostic-timing-fast) both;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media screen and (min-width: 700px) {
|
|
54
|
+
.dialog-content {
|
|
55
|
+
padding: var(--fluid-32);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes fade-in {
|
|
60
|
+
from {
|
|
61
|
+
opacity: 0%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes slide-up {
|
|
66
|
+
from {
|
|
67
|
+
transform: translateY(10%);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Shared with AgnosticUI close buton so only need positioning and transition */
|
|
72
|
+
.dialog-close {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: var(--fluid-8);
|
|
75
|
+
right: var(--fluid-8);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (prefers-reduced-motion), (update: slow) {
|
|
79
|
+
.dialog-slide-up-fade-in,
|
|
80
|
+
.dialog-fade-in,
|
|
81
|
+
.dialog-slide-up,
|
|
82
|
+
.dialog-content {
|
|
83
|
+
transition-duration: 0.001ms !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media only screen and (min-width: 576px) {
|
|
88
|
+
.dialog-close {
|
|
89
|
+
top: var(--fluid-12);
|
|
90
|
+
right: var(--fluid-12);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media screen and (min-width: 768px) {
|
|
95
|
+
.dialog-close {
|
|
96
|
+
top: var(--fluid-16);
|
|
97
|
+
right: var(--fluid-16);
|
|
98
|
+
}
|
|
99
|
+
}
|