@dubai-design-system/components-js 5.0.3 → 5.1.1
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/CHANGELOG.md +233 -1
- package/MIGRATION.md +423 -0
- package/dist/cjs/dda-accordion.cjs.entry.js +12 -7
- package/dist/cjs/dda-alert.cjs.entry.js +20 -3
- package/dist/cjs/dda-attach-file.cjs.entry.js +24 -8
- package/dist/cjs/dda-avatar.cjs.entry.js +23 -12
- package/dist/cjs/dda-banner.cjs.entry.js +14 -5
- package/dist/cjs/dda-breadcrumb.cjs.entry.js +22 -10
- package/dist/cjs/dda-button.cjs.entry.js +16 -9
- package/dist/cjs/dda-checkbox.cjs.entry.js +5 -4
- package/dist/cjs/dda-chip.cjs.entry.js +8 -3
- package/dist/cjs/dda-credit-card.cjs.entry.js +5 -3
- package/dist/cjs/dda-creditcard-field.cjs.entry.js +26 -8
- package/dist/cjs/dda-dropdown.cjs.entry.js +31 -5
- package/dist/cjs/dda-footer.cjs.entry.js +9 -3
- package/dist/cjs/dda-header.cjs.entry.js +88 -8
- package/dist/cjs/dda-home-banner.cjs.entry.js +11 -5
- package/dist/cjs/dda-horizontal-stepper.cjs.entry.js +22 -5
- package/dist/cjs/dda-input.cjs.entry.js +17 -10
- package/dist/cjs/dda-link-button_2.cjs.entry.js +21 -13
- package/dist/cjs/dda-number-field.cjs.entry.js +20 -8
- package/dist/cjs/dda-pagination.cjs.entry.js +21 -11
- package/dist/cjs/dda-phonefield.cjs.entry.js +27 -9
- package/dist/cjs/dda-progressbar.cjs.entry.js +8 -3
- package/dist/cjs/dda-range-slider.cjs.entry.js +15 -3
- package/dist/cjs/dda-search-input.cjs.entry.js +27 -12
- package/dist/cjs/dda-segmented-tabs.cjs.entry.js +54 -6
- package/dist/cjs/dda-select.cjs.entry.js +40 -8
- package/dist/cjs/dda-sticky-footer.cjs.entry.js +20 -3
- package/dist/cjs/dda-tabs.cjs.entry.js +10 -4
- package/dist/cjs/dda-textarea.cjs.entry.js +22 -12
- package/dist/cjs/dda-toggle.cjs.entry.js +5 -4
- package/dist/cjs/dda-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/dda-ui-card.cjs.entry.js +19 -2
- package/dist/cjs/dda-vertical-stepper.cjs.entry.js +23 -3
- package/dist/cjs/dda.cjs.js +2 -2
- package/dist/cjs/index-Bgd2iAET.js +2116 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/unique-id-DahNGdQy.js +14 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/dda-accordion/dda-accordion.js +16 -11
- package/dist/collection/components/dda-alert/dda-alert.js +74 -17
- package/dist/collection/components/dda-alert/dda-alert.stories.js +2 -8
- package/dist/collection/components/dda-attach-file/dda-attach-file.js +35 -19
- package/dist/collection/components/dda-attach-file/dda-attach-file.stories.js +0 -9
- package/dist/collection/components/dda-avatar/dda-avatar.js +53 -25
- package/dist/collection/components/dda-avatar/dda-avatar.stories.js +1 -1
- package/dist/collection/components/dda-banner/dda-banner.css +35 -0
- package/dist/collection/components/dda-banner/dda-banner.js +34 -5
- package/dist/collection/components/dda-breadcrumb/dda-breadcrumb.js +49 -12
- package/dist/collection/components/dda-button/dda-button.js +29 -22
- package/dist/collection/components/dda-checkbox/dda-checkbox.css +13 -0
- package/dist/collection/components/dda-checkbox/dda-checkbox.js +13 -12
- package/dist/collection/components/dda-checkbox/dda-checkbox.stories.js +0 -11
- package/dist/collection/components/dda-chip/dda-chip.js +34 -9
- package/dist/collection/components/dda-chip/dda-chip.stories.js +0 -11
- package/dist/collection/components/dda-credit-card/dda-credit-card.js +10 -8
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.js +58 -23
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.stories.js +1 -10
- package/dist/collection/components/dda-dropdown/dda-dropdown.js +90 -18
- package/dist/collection/components/dda-dropdown/dda-dropdown.stories.js +0 -4
- package/dist/collection/components/dda-footer/dda-footer.js +57 -10
- package/dist/collection/components/dda-footer/dda-footer.stories.js +5 -4
- package/dist/collection/components/dda-header/dda-header.css +11 -0
- package/dist/collection/components/dda-header/dda-header.js +232 -37
- package/dist/collection/components/dda-header/dda-header.stories.js +12 -21
- package/dist/collection/components/dda-home-banner/dda-home-banner.js +8 -2
- package/dist/collection/components/dda-home-banner/home-banner.css +23 -2
- package/dist/collection/components/dda-input/dda-input.js +47 -21
- package/dist/collection/components/dda-input/dda-input.stories.js +0 -13
- package/dist/collection/components/dda-link-button/dda-link-button.js +30 -23
- package/dist/collection/components/dda-number-field/dda-number-field.js +54 -22
- package/dist/collection/components/dda-number-field/dda-number-field.stories.js +0 -9
- package/dist/collection/components/dda-pagination/dda-pagination.js +95 -28
- package/dist/collection/components/dda-pagination/dda-pagination.stories.js +24 -24
- package/dist/collection/components/dda-phonefield/dda-phonefield.js +62 -24
- package/dist/collection/components/dda-phonefield/dda-phonefield.stories.js +0 -13
- package/dist/collection/components/dda-progressbar/dda-progressbar.js +13 -8
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.css +156 -25
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.js +13 -12
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.stories.js +5 -16
- package/dist/collection/components/dda-range-slider/dda-range-slider.js +29 -17
- package/dist/collection/components/dda-search-input/dda-search-input.js +61 -26
- package/dist/collection/components/dda-search-input/dda-search-input.stories.js +0 -9
- package/dist/collection/components/dda-select/dda-select.js +78 -20
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.js +80 -43
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.stories.js +1 -1
- package/dist/collection/components/dda-tabs/dda-tabs.js +21 -15
- package/dist/collection/components/dda-tabs/dda-tabs.stories.js +3 -10
- package/dist/collection/components/dda-textarea/dda-textarea.js +33 -23
- package/dist/collection/components/dda-textarea/dda-textarea.stories.js +0 -9
- package/dist/collection/components/dda-toggle/dda-toggle.css +9 -0
- package/dist/collection/components/dda-toggle/dda-toggle.js +47 -8
- package/dist/collection/components/dda-toggle/dda-toggle.stories.js +10 -22
- package/dist/collection/components/dda-tooltip/dda-tooltip.js +9 -7
- package/dist/collection/components/dda-ui-card/dda-ui-card.js +55 -13
- package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.js +79 -11
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.css +4 -1
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.js +24 -6
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.stories.js +2 -2
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.js +49 -6
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.stories.js +2 -2
- package/dist/collection/global/global.css +152 -25
- package/dist/collection/global/input.css +56 -2
- package/dist/collection/storybook/component-api.js +15 -0
- package/dist/collection/utils/placeholder-color.js +89 -0
- package/dist/collection/utils/unique-id.js +10 -0
- package/dist/components/dda-accordion.js +1 -1
- package/dist/components/dda-alert.js +1 -1
- package/dist/components/dda-attach-file.js +1 -1
- package/dist/components/dda-avatar.js +1 -1
- package/dist/components/dda-banner.js +1 -1
- package/dist/components/dda-breadcrumb.js +1 -1
- package/dist/components/dda-button.js +1 -1
- package/dist/components/dda-checkbox.js +1 -1
- package/dist/components/dda-chip.js +1 -1
- package/dist/components/dda-credit-card.js +1 -1
- package/dist/components/dda-creditcard-field.js +1 -1
- package/dist/components/dda-dropdown.js +1 -1
- package/dist/components/dda-footer.js +1 -1
- package/dist/components/dda-header.js +1 -1
- package/dist/components/dda-home-banner.js +1 -1
- package/dist/components/dda-horizontal-stepper.js +1 -1
- package/dist/components/dda-input.js +1 -1
- package/dist/components/dda-link-button.js +1 -1
- package/dist/components/dda-number-field.js +1 -1
- package/dist/components/dda-pagination.js +1 -1
- package/dist/components/dda-phonefield.js +1 -1
- package/dist/components/dda-progressbar.js +1 -1
- package/dist/components/dda-radiobutton.js +1 -1
- package/dist/components/dda-range-slider.js +1 -1
- package/dist/components/dda-search-input.js +1 -1
- package/dist/components/dda-segmented-tabs.js +1 -1
- package/dist/components/dda-select.js +1 -1
- package/dist/components/dda-sticky-footer.js +1 -1
- package/dist/components/dda-tabs.js +1 -1
- package/dist/components/dda-textarea.js +1 -1
- package/dist/components/dda-toggle.js +1 -1
- package/dist/components/dda-tooltip.js +1 -1
- package/dist/components/dda-ui-card.js +1 -1
- package/dist/components/dda-vertical-stepper.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-B-I003EB.js +1 -0
- package/dist/components/p-Bc2V1U4_.js +1 -0
- package/dist/components/p-Bzqf-PpF.js +1 -0
- package/dist/components/p-D-CHT-as.js +1 -0
- package/dist/components/p-DJw8qV7U.js +1 -0
- package/dist/components/p-DpwQ9sGp.js +1 -0
- package/dist/dda/dda.css +2 -2
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/p-03400387.entry.js +1 -0
- package/dist/dda/p-04bcda8a.entry.js +1 -0
- package/dist/dda/p-18a3d7b1.entry.js +1 -0
- package/dist/dda/p-1f7b8486.entry.js +1 -0
- package/dist/dda/p-3024288f.entry.js +1 -0
- package/dist/dda/p-41b8ed7d.entry.js +1 -0
- package/dist/dda/p-56f60336.entry.js +1 -0
- package/dist/dda/p-65776d80.entry.js +1 -0
- package/dist/dda/p-73611084.entry.js +1 -0
- package/dist/dda/p-7ad8cde9.entry.js +1 -0
- package/dist/dda/p-8134e59d.entry.js +1 -0
- package/dist/dda/p-8494fd9e.entry.js +1 -0
- package/dist/dda/p-876d55b2.entry.js +1 -0
- package/dist/dda/p-88d884a8.entry.js +1 -0
- package/dist/dda/p-8b25ae94.entry.js +1 -0
- package/dist/dda/p-8f376986.entry.js +1 -0
- package/dist/dda/p-90019b80.entry.js +1 -0
- package/dist/dda/p-92fa4777.entry.js +1 -0
- package/dist/dda/p-97431faf.entry.js +1 -0
- package/dist/dda/p-B-I003EB.js +1 -0
- package/dist/dda/p-D6L6zgH9.js +2 -0
- package/dist/dda/p-a5456de2.entry.js +1 -0
- package/dist/dda/p-aa7b4c13.entry.js +1 -0
- package/dist/dda/p-ad40eb27.entry.js +1 -0
- package/dist/dda/p-c055f0d2.entry.js +1 -0
- package/dist/dda/p-c42c8733.entry.js +1 -0
- package/dist/dda/p-c77282be.entry.js +1 -0
- package/dist/dda/p-ca64abe6.entry.js +1 -0
- package/dist/dda/p-ceca8088.entry.js +1 -0
- package/dist/dda/p-d6786b43.entry.js +1 -0
- package/dist/dda/p-e2113e42.entry.js +1 -0
- package/dist/dda/p-ee862207.entry.js +1 -0
- package/dist/dda/p-ef38e28b.entry.js +1 -0
- package/dist/dda/p-f43fb910.entry.js +1 -0
- package/dist/dda/p-fb4db977.entry.js +1 -0
- package/dist/esm/dda-accordion.entry.js +12 -7
- package/dist/esm/dda-alert.entry.js +20 -3
- package/dist/esm/dda-attach-file.entry.js +24 -8
- package/dist/esm/dda-avatar.entry.js +23 -12
- package/dist/esm/dda-banner.entry.js +14 -5
- package/dist/esm/dda-breadcrumb.entry.js +22 -10
- package/dist/esm/dda-button.entry.js +16 -9
- package/dist/esm/dda-checkbox.entry.js +5 -4
- package/dist/esm/dda-chip.entry.js +8 -3
- package/dist/esm/dda-credit-card.entry.js +5 -3
- package/dist/esm/dda-creditcard-field.entry.js +26 -8
- package/dist/esm/dda-dropdown.entry.js +31 -5
- package/dist/esm/dda-footer.entry.js +9 -3
- package/dist/esm/dda-header.entry.js +88 -8
- package/dist/esm/dda-home-banner.entry.js +11 -5
- package/dist/esm/dda-horizontal-stepper.entry.js +22 -5
- package/dist/esm/dda-input.entry.js +17 -10
- package/dist/esm/dda-link-button_2.entry.js +21 -13
- package/dist/esm/dda-number-field.entry.js +20 -8
- package/dist/esm/dda-pagination.entry.js +21 -11
- package/dist/esm/dda-phonefield.entry.js +27 -9
- package/dist/esm/dda-progressbar.entry.js +8 -3
- package/dist/esm/dda-range-slider.entry.js +15 -3
- package/dist/esm/dda-search-input.entry.js +27 -12
- package/dist/esm/dda-segmented-tabs.entry.js +54 -6
- package/dist/esm/dda-select.entry.js +40 -8
- package/dist/esm/dda-sticky-footer.entry.js +20 -3
- package/dist/esm/dda-tabs.entry.js +10 -4
- package/dist/esm/dda-textarea.entry.js +22 -12
- package/dist/esm/dda-toggle.entry.js +5 -4
- package/dist/esm/dda-tooltip.entry.js +6 -4
- package/dist/esm/dda-ui-card.entry.js +19 -2
- package/dist/esm/dda-vertical-stepper.entry.js +23 -3
- package/dist/esm/dda.js +3 -3
- package/dist/esm/index-D6L6zgH9.js +2106 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/unique-id-B-I003EB.js +12 -0
- package/dist/types/components/dda-accordion/dda-accordion.d.ts +6 -0
- package/dist/types/components/dda-alert/dda-alert.d.ts +21 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.d.ts +17 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.stories.d.ts +0 -4
- package/dist/types/components/dda-avatar/dda-avatar.d.ts +20 -0
- package/dist/types/components/dda-banner/dda-banner.d.ts +5 -0
- package/dist/types/components/dda-breadcrumb/dda-breadcrumb.d.ts +12 -6
- package/dist/types/components/dda-button/dda-button.d.ts +15 -4
- package/dist/types/components/dda-checkbox/dda-checkbox.d.ts +11 -0
- package/dist/types/components/dda-checkbox/dda-checkbox.stories.d.ts +0 -10
- package/dist/types/components/dda-chip/dda-chip.d.ts +10 -0
- package/dist/types/components/dda-chip/dda-chip.stories.d.ts +0 -6
- package/dist/types/components/dda-credit-card/dda-credit-card.d.ts +7 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.d.ts +24 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.stories.d.ts +0 -6
- package/dist/types/components/dda-dropdown/dda-dropdown.d.ts +25 -0
- package/dist/types/components/dda-dropdown/dda-dropdown.stories.d.ts +0 -4
- package/dist/types/components/dda-footer/dda-footer.d.ts +13 -0
- package/dist/types/components/dda-header/dda-header.d.ts +62 -0
- package/dist/types/components/dda-header/dda-header.stories.d.ts +6 -0
- package/dist/types/components/dda-home-banner/dda-home-banner.d.ts +1 -0
- package/dist/types/components/dda-input/dda-input.d.ts +18 -0
- package/dist/types/components/dda-input/dda-input.stories.d.ts +0 -6
- package/dist/types/components/dda-link-button/dda-link-button.d.ts +14 -3
- package/dist/types/components/dda-number-field/dda-number-field.d.ts +21 -0
- package/dist/types/components/dda-number-field/dda-number-field.stories.d.ts +0 -6
- package/dist/types/components/dda-pagination/dda-pagination.d.ts +26 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.d.ts +21 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.stories.d.ts +0 -6
- package/dist/types/components/dda-progressbar/dda-progressbar.d.ts +7 -0
- package/dist/types/components/dda-radiobutton/dda-radiobutton.d.ts +11 -0
- package/dist/types/components/dda-radiobutton/dda-radiobutton.stories.d.ts +5 -15
- package/dist/types/components/dda-range-slider/dda-range-slider.d.ts +16 -0
- package/dist/types/components/dda-search-input/dda-search-input.d.ts +21 -0
- package/dist/types/components/dda-search-input/dda-search-input.stories.d.ts +0 -6
- package/dist/types/components/dda-select/dda-select.d.ts +23 -0
- package/dist/types/components/dda-sticky-footer/dda-sticky-footer.d.ts +46 -3
- package/dist/types/components/dda-tabs/dda-tabs.d.ts +12 -1
- package/dist/types/components/dda-tabs/dda-tabs.stories.d.ts +0 -4
- package/dist/types/components/dda-textarea/dda-textarea.d.ts +16 -0
- package/dist/types/components/dda-textarea/dda-textarea.stories.d.ts +0 -6
- package/dist/types/components/dda-toggle/dda-toggle.d.ts +11 -0
- package/dist/types/components/dda-toggle/dda-toggle.stories.d.ts +2 -12
- package/dist/types/components/dda-tooltip/dda-tooltip.d.ts +5 -0
- package/dist/types/components/dda-ui-card/dda-ui-card.d.ts +13 -1
- package/dist/types/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.d.ts +19 -2
- package/dist/types/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.d.ts +6 -0
- package/dist/types/components/stepper/dda-vertical-stepper/dda-vertical-stepper.d.ts +8 -0
- package/dist/types/components.d.ts +2373 -38
- package/dist/types/utils/placeholder-color.d.ts +10 -0
- package/dist/types/utils/unique-id.d.ts +6 -0
- package/package.json +4 -3
- package/readme.md +6 -0
- package/dist/cjs/index-CDUC0Pdj.js +0 -1986
- package/dist/components/p-9UeqjDnY.js +0 -1
- package/dist/components/p-CrTEb7xH.js +0 -1
- package/dist/components/p-DldlmGnP.js +0 -1
- package/dist/components/p-NvTw9Mx1.js +0 -1
- package/dist/components/p-i15-_er0.js +0 -1
- package/dist/dda/p-016e4090.entry.js +0 -1
- package/dist/dda/p-0229b303.entry.js +0 -1
- package/dist/dda/p-05a6f90d.entry.js +0 -1
- package/dist/dda/p-1c9a6035.entry.js +0 -1
- package/dist/dda/p-2c313105.entry.js +0 -1
- package/dist/dda/p-2cec7be6.entry.js +0 -1
- package/dist/dda/p-2f4ace4c.entry.js +0 -1
- package/dist/dda/p-360a0577.entry.js +0 -1
- package/dist/dda/p-3e49128d.entry.js +0 -1
- package/dist/dda/p-3fa27728.entry.js +0 -1
- package/dist/dda/p-43e1c12f.entry.js +0 -1
- package/dist/dda/p-4428417d.entry.js +0 -1
- package/dist/dda/p-44ce832e.entry.js +0 -1
- package/dist/dda/p-560a3f0c.entry.js +0 -1
- package/dist/dda/p-5712bbd9.entry.js +0 -1
- package/dist/dda/p-626d7e7b.entry.js +0 -1
- package/dist/dda/p-68008c64.entry.js +0 -1
- package/dist/dda/p-6f3d9f78.entry.js +0 -1
- package/dist/dda/p-79db1218.entry.js +0 -1
- package/dist/dda/p-84911fab.entry.js +0 -1
- package/dist/dda/p-90d9648b.entry.js +0 -1
- package/dist/dda/p-91040abe.entry.js +0 -1
- package/dist/dda/p-Cq6A4mXg.js +0 -2
- package/dist/dda/p-a1421a54.entry.js +0 -1
- package/dist/dda/p-a22b1c56.entry.js +0 -1
- package/dist/dda/p-aa0e9035.entry.js +0 -1
- package/dist/dda/p-b2981646.entry.js +0 -1
- package/dist/dda/p-c1f45887.entry.js +0 -1
- package/dist/dda/p-c50e1141.entry.js +0 -1
- package/dist/dda/p-d8a9cab1.entry.js +0 -1
- package/dist/dda/p-dd966009.entry.js +0 -1
- package/dist/dda/p-ed099201.entry.js +0 -1
- package/dist/dda/p-f4bd2b2e.entry.js +0 -1
- package/dist/dda/p-fc30c60e.entry.js +0 -1
- package/dist/esm/index-Cq6A4mXg.js +0 -1976
|
@@ -714,7 +714,8 @@
|
|
|
714
714
|
.quick-links-wrap {
|
|
715
715
|
width: 100%;
|
|
716
716
|
position: absolute;
|
|
717
|
-
|
|
717
|
+
/* dda-sticky-footer sets --dda-sticky-footer-height; the cards sit above the fixed bar. */
|
|
718
|
+
bottom: calc(45px + var(--dda-sticky-footer-height, 0px));
|
|
718
719
|
z-index: 1;
|
|
719
720
|
}
|
|
720
721
|
|
|
@@ -764,6 +765,14 @@
|
|
|
764
765
|
margin-bottom: 15px;
|
|
765
766
|
color: var(--dda-on-surface-variant-40);
|
|
766
767
|
}
|
|
768
|
+
.quick-links .link-item i {
|
|
769
|
+
display: block;
|
|
770
|
+
width: fit-content;
|
|
771
|
+
font-size: 35px;
|
|
772
|
+
line-height: 1;
|
|
773
|
+
margin-bottom: 15px;
|
|
774
|
+
color: var(--dda-on-surface-variant-40);
|
|
775
|
+
}
|
|
767
776
|
.quick-links .link-item .title {
|
|
768
777
|
display: block;
|
|
769
778
|
font-size: var(--dda-fs-title-sm);
|
|
@@ -785,6 +794,8 @@
|
|
|
785
794
|
}
|
|
786
795
|
.quick-links-wrap {
|
|
787
796
|
position: relative;
|
|
797
|
+
/* In normal flow the cards do not sit over the fixed bar, so keep the original offset. */
|
|
798
|
+
bottom: 45px;
|
|
788
799
|
}
|
|
789
800
|
.quick-links-wrap .quick-links {
|
|
790
801
|
display: grid;
|
|
@@ -804,7 +815,10 @@
|
|
|
804
815
|
}
|
|
805
816
|
} */
|
|
806
817
|
|
|
807
|
-
|
|
818
|
+
/* Short landscape screens (a phone or small tablet on its side) cannot fit the display-size
|
|
819
|
+
slide title in the full-height banner. This was keyed on max-width: 1600px, which also caught
|
|
820
|
+
ordinary laptop screens and shrank the title there to 1.2rem. */
|
|
821
|
+
@media only screen and (orientation: landscape) and (max-height: 600px) {
|
|
808
822
|
.slide-content h2 {
|
|
809
823
|
font-size: 1.2rem;
|
|
810
824
|
}
|
|
@@ -812,6 +826,8 @@
|
|
|
812
826
|
font-size: 1rem;
|
|
813
827
|
margin-bottom: 5px;
|
|
814
828
|
}
|
|
829
|
+
}
|
|
830
|
+
@media only screen and (orientation: landscape) and (max-width: 1600px) {
|
|
815
831
|
.quick-links .link-item {
|
|
816
832
|
padding: 13px;
|
|
817
833
|
height: 128px;
|
|
@@ -820,6 +836,10 @@
|
|
|
820
836
|
height: 20px;
|
|
821
837
|
margin-bottom: 5px;
|
|
822
838
|
}
|
|
839
|
+
.quick-links .link-item i {
|
|
840
|
+
font-size: 20px;
|
|
841
|
+
margin-bottom: 5px;
|
|
842
|
+
}
|
|
823
843
|
.quick-links .link-item .title {
|
|
824
844
|
font-size: 15px;
|
|
825
845
|
}
|
|
@@ -831,7 +851,7 @@
|
|
|
831
851
|
.dda-head-logo .govt-logo img {
|
|
832
852
|
height: 39px;
|
|
833
853
|
}
|
|
834
|
-
.transparent .dda-header::before {
|
|
854
|
+
.transparent dda-header:not(.dda-scrolled) .dda-header::before {
|
|
835
855
|
height: 100%;
|
|
836
856
|
}
|
|
837
857
|
}
|
|
@@ -2054,6 +2074,20 @@
|
|
|
2054
2074
|
transition: transform 300ms ease-in-out;
|
|
2055
2075
|
}
|
|
2056
2076
|
|
|
2077
|
+
/* WCAG 2.4.11: the fixed bar covers the bottom of the viewport. dda-sticky-footer publishes
|
|
2078
|
+
its height as --dda-sticky-footer-height (and removes it when it is removed), so:
|
|
2079
|
+
- scroll-padding-bottom keeps focused and scrolled-to elements above the bar, the same way
|
|
2080
|
+
scroll-padding-top in dda-header.css keeps them below the fixed header;
|
|
2081
|
+
- body padding-bottom lets the end of the page scroll clear of the bar.
|
|
2082
|
+
Without the component the variable is not set and both are 0. */
|
|
2083
|
+
:root {
|
|
2084
|
+
scroll-padding-bottom: var(--dda-sticky-footer-height, 0px);
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
body {
|
|
2088
|
+
padding-bottom: var(--dda-sticky-footer-height, 0px);
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2057
2091
|
/* dda-sticky-footer toggles this class off its own scroll-direction state
|
|
2058
2092
|
(see dda-sticky-footer.tsx handleScroll) to hide the bar while scrolling
|
|
2059
2093
|
down and bring it back while scrolling up. Same transition idiom as
|
|
@@ -2145,11 +2179,23 @@
|
|
|
2145
2179
|
box-shadow: none;
|
|
2146
2180
|
}
|
|
2147
2181
|
|
|
2148
|
-
.foot-menu
|
|
2149
|
-
.foot-icon-btn a span {
|
|
2182
|
+
.foot-menu {
|
|
2150
2183
|
display: none;
|
|
2151
2184
|
}
|
|
2152
2185
|
|
|
2186
|
+
/* Hide the icon text visually only: it is the link's name when the image is decorative. */
|
|
2187
|
+
.foot-icon-btn a span {
|
|
2188
|
+
position: absolute;
|
|
2189
|
+
width: 1px;
|
|
2190
|
+
height: 1px;
|
|
2191
|
+
margin: -1px;
|
|
2192
|
+
padding: 0;
|
|
2193
|
+
overflow: hidden;
|
|
2194
|
+
clip: rect(0, 0, 0, 0);
|
|
2195
|
+
white-space: nowrap;
|
|
2196
|
+
border: 0;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2153
2199
|
.dda-footer-item ul li {
|
|
2154
2200
|
padding: 0 8px;
|
|
2155
2201
|
border: 0px !important;
|
|
@@ -2479,15 +2525,17 @@
|
|
|
2479
2525
|
position: relative;
|
|
2480
2526
|
}
|
|
2481
2527
|
|
|
2482
|
-
.transparent .dda-header {
|
|
2528
|
+
.transparent dda-header:not(.dda-scrolled) .dda-header {
|
|
2483
2529
|
background: transparent;
|
|
2484
2530
|
box-shadow: none;
|
|
2485
2531
|
}
|
|
2486
2532
|
|
|
2487
|
-
.transparent .dda-header::before {
|
|
2533
|
+
.transparent dda-header:not(.dda-scrolled) .dda-header::before {
|
|
2488
2534
|
content: "";
|
|
2489
2535
|
width: 100%;
|
|
2490
2536
|
height: 250px;
|
|
2537
|
+
/* Decoration only: it reaches below the header and must not catch taps on the page. */
|
|
2538
|
+
pointer-events: none;
|
|
2491
2539
|
background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 63.02%, rgba(0, 0, 0, 0) 100%);
|
|
2492
2540
|
position: absolute;
|
|
2493
2541
|
top: 0;
|
|
@@ -2513,13 +2561,13 @@
|
|
|
2513
2561
|
.entt-logo img {
|
|
2514
2562
|
height: 44px;
|
|
2515
2563
|
}
|
|
2516
|
-
.transparent .logo-colored{
|
|
2564
|
+
.transparent dda-header:not(.dda-scrolled) .logo-colored{
|
|
2517
2565
|
display: none;
|
|
2518
2566
|
}
|
|
2519
2567
|
.logo-white{
|
|
2520
2568
|
display: none;
|
|
2521
2569
|
}
|
|
2522
|
-
.transparent .logo-white{
|
|
2570
|
+
.transparent dda-header:not(.dda-scrolled) .logo-white{
|
|
2523
2571
|
display: block;
|
|
2524
2572
|
}
|
|
2525
2573
|
.dda-header.white .dda-head-logo .logo-white,
|
|
@@ -2639,9 +2687,9 @@
|
|
|
2639
2687
|
background-color: var(--dda-color-primary-40);
|
|
2640
2688
|
}
|
|
2641
2689
|
|
|
2642
|
-
.transparent .hamburger-menu-btn::before,
|
|
2643
|
-
.transparent .hamburger-menu-btn::after,
|
|
2644
|
-
.transparent .hamburger-line {
|
|
2690
|
+
.transparent dda-header:not(.dda-scrolled) .hamburger-menu-btn::before,
|
|
2691
|
+
.transparent dda-header:not(.dda-scrolled) .hamburger-menu-btn::after,
|
|
2692
|
+
.transparent dda-header:not(.dda-scrolled) .hamburger-line {
|
|
2645
2693
|
background-color: var(--dda-neutral-100) !important;
|
|
2646
2694
|
}
|
|
2647
2695
|
|
|
@@ -2705,7 +2753,7 @@
|
|
|
2705
2753
|
color: var(--dda-color-primary-40);
|
|
2706
2754
|
}
|
|
2707
2755
|
|
|
2708
|
-
.transparent .dda-mega-menu>li>a {
|
|
2756
|
+
.transparent dda-header:not(.dda-scrolled) .dda-mega-menu>li>a {
|
|
2709
2757
|
color: var(--dda-neutral-100);
|
|
2710
2758
|
}
|
|
2711
2759
|
|
|
@@ -2722,7 +2770,7 @@
|
|
|
2722
2770
|
transition: all 0.25s ease-in-out;
|
|
2723
2771
|
}
|
|
2724
2772
|
|
|
2725
|
-
.transparent .dda-mega-menu>li>a::after {
|
|
2773
|
+
.transparent dda-header:not(.dda-scrolled) .dda-mega-menu>li>a::after {
|
|
2726
2774
|
background-color: var(--dda-neutral-100);
|
|
2727
2775
|
}
|
|
2728
2776
|
|
|
@@ -2836,8 +2884,8 @@
|
|
|
2836
2884
|
gap: 10px;
|
|
2837
2885
|
}
|
|
2838
2886
|
|
|
2839
|
-
.transparent .dda-toolbar-menu ul li .tool-btn,
|
|
2840
|
-
.transparent .dda-toolbar-menu-sidemenu ul li .tool-btn {
|
|
2887
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu ul li .tool-btn,
|
|
2888
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu-sidemenu ul li .tool-btn {
|
|
2841
2889
|
background-color: var(--dda-neutral-17);
|
|
2842
2890
|
color: var(--dda-neutral-100);
|
|
2843
2891
|
}
|
|
@@ -2858,10 +2906,10 @@
|
|
|
2858
2906
|
color: var(--dda-on-surface-variant-30);
|
|
2859
2907
|
}
|
|
2860
2908
|
|
|
2861
|
-
.transparent .dda-toolbar-menu ul li .tool-btn i,
|
|
2862
|
-
.transparent .dda-toolbar-menu ul li .tool-btn svg,
|
|
2863
|
-
.transparent .dda-toolbar-menu-sidemenu ul li .tool-btn i,
|
|
2864
|
-
.transparent .dda-toolbar-menu-sidemenu ul li .tool-btn svg {
|
|
2909
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu ul li .tool-btn i,
|
|
2910
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu ul li .tool-btn svg,
|
|
2911
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu-sidemenu ul li .tool-btn i,
|
|
2912
|
+
.transparent dda-header:not(.dda-scrolled) .dda-toolbar-menu-sidemenu ul li .tool-btn svg {
|
|
2865
2913
|
color: var(--dda-neutral-100);
|
|
2866
2914
|
}
|
|
2867
2915
|
.dda-search{
|
|
@@ -2907,10 +2955,10 @@
|
|
|
2907
2955
|
.dda-search input[type="text"]::placeholder{
|
|
2908
2956
|
color: var(--dda-on-surface-0);
|
|
2909
2957
|
}
|
|
2910
|
-
.transparent .dda-search input[type="text"]::-ms-input-placeholder {
|
|
2958
|
+
.transparent dda-header:not(.dda-scrolled) .dda-search input[type="text"]::-ms-input-placeholder {
|
|
2911
2959
|
color: var(--dda-neutral-100);
|
|
2912
2960
|
}
|
|
2913
|
-
.transparent .dda-search input[type="text"]::placeholder{
|
|
2961
|
+
.transparent dda-header:not(.dda-scrolled) .dda-search input[type="text"]::placeholder{
|
|
2914
2962
|
color: var(--dda-neutral-100);
|
|
2915
2963
|
}
|
|
2916
2964
|
|
|
@@ -2933,6 +2981,8 @@
|
|
|
2933
2981
|
gap: 15px;
|
|
2934
2982
|
padding: 32px;
|
|
2935
2983
|
overflow-y: auto;
|
|
2984
|
+
/* Reaching the end of the menu must not start scrolling the locked page. */
|
|
2985
|
+
overscroll-behavior: contain;
|
|
2936
2986
|
height: 100%;
|
|
2937
2987
|
}
|
|
2938
2988
|
|
|
@@ -3202,8 +3252,8 @@ ul.main_side_menu .main_sub_menu .main_sub_menu .main_sub_menu {
|
|
|
3202
3252
|
fill: var(--dda-on-surface-variant-30);
|
|
3203
3253
|
}
|
|
3204
3254
|
|
|
3205
|
-
.transparent .dda-mobile-search button i,
|
|
3206
|
-
.transparent .dda-mobile-search button svg {
|
|
3255
|
+
.transparent dda-header:not(.dda-scrolled) .dda-mobile-search button i,
|
|
3256
|
+
.transparent dda-header:not(.dda-scrolled) .dda-mobile-search button svg {
|
|
3207
3257
|
color: var(--dda-neutral-100);
|
|
3208
3258
|
}
|
|
3209
3259
|
|
|
@@ -3214,7 +3264,7 @@ ul.main_side_menu .main_sub_menu .main_sub_menu .main_sub_menu {
|
|
|
3214
3264
|
|
|
3215
3265
|
|
|
3216
3266
|
@media screen and (max-width: 767px) {
|
|
3217
|
-
.transparent .dda-header::before {
|
|
3267
|
+
.transparent dda-header:not(.dda-scrolled) .dda-header::before {
|
|
3218
3268
|
height: 130px;
|
|
3219
3269
|
}
|
|
3220
3270
|
.dda-header{
|
|
@@ -3442,6 +3492,76 @@ ul.main_side_menu .main_sub_menu .main_sub_menu .main_sub_menu {
|
|
|
3442
3492
|
|
|
3443
3493
|
|
|
3444
3494
|
|
|
3495
|
+
/* Mobile search: the search button opens this panel under the header. */
|
|
3496
|
+
.dda-mobile-search-panel {
|
|
3497
|
+
position: absolute;
|
|
3498
|
+
top: 100%;
|
|
3499
|
+
inset-inline: 0;
|
|
3500
|
+
padding: 12px 16px;
|
|
3501
|
+
background: var(--dda-surface-100);
|
|
3502
|
+
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.12);
|
|
3503
|
+
z-index: 8;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
.dda-mobile-search-panel[hidden] {
|
|
3507
|
+
display: none;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
.dda-mobile-search-form {
|
|
3511
|
+
position: relative;
|
|
3512
|
+
display: flex;
|
|
3513
|
+
align-items: center;
|
|
3514
|
+
gap: 8px;
|
|
3515
|
+
border: 1px solid var(--dda-surface-90);
|
|
3516
|
+
border-radius: 100px;
|
|
3517
|
+
padding-inline-start: 12px;
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
.dda-mobile-search-form:focus-within {
|
|
3521
|
+
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(0, 0, 0, 0.65);
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
.dda-mobile-search-form > i {
|
|
3525
|
+
font-size: 24px;
|
|
3526
|
+
color: var(--dda-on-surface-variant-30);
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
.dda-mobile-search-form input {
|
|
3530
|
+
flex: 1;
|
|
3531
|
+
min-width: 0;
|
|
3532
|
+
height: 44px;
|
|
3533
|
+
border: 0;
|
|
3534
|
+
background: transparent;
|
|
3535
|
+
color: var(--dda-on-surface-0);
|
|
3536
|
+
font-size: var(--dda-fs-body-lg);
|
|
3537
|
+
outline: 0;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
.dda-mobile-search-close {
|
|
3541
|
+
width: 44px;
|
|
3542
|
+
height: 44px;
|
|
3543
|
+
flex-shrink: 0;
|
|
3544
|
+
display: inline-flex;
|
|
3545
|
+
align-items: center;
|
|
3546
|
+
justify-content: center;
|
|
3547
|
+
border: 0;
|
|
3548
|
+
border-radius: 100px;
|
|
3549
|
+
background: transparent;
|
|
3550
|
+
color: var(--dda-on-surface-variant-30);
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
.dda-mobile-search-close:focus-visible {
|
|
3554
|
+
outline: none;
|
|
3555
|
+
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(0, 0, 0, 0.65);
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
/* The panel only exists where the mobile search button is shown. */
|
|
3559
|
+
@media screen and (min-width: 768px) {
|
|
3560
|
+
.dda-mobile-search-panel {
|
|
3561
|
+
display: none;
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3445
3565
|
|
|
3446
3566
|
:root{
|
|
3447
3567
|
--font-family-main: 'Dubai', sans-serif;
|
|
@@ -3504,6 +3624,13 @@ a:hover {
|
|
|
3504
3624
|
text-decoration: none !important;
|
|
3505
3625
|
}
|
|
3506
3626
|
|
|
3627
|
+
/* WCAG 1.4.1: links in running text keep an underline so color is not the only cue.
|
|
3628
|
+
Classed links (buttons, cards) and list links (menus) stay undecorated. */
|
|
3629
|
+
:where(p, td, dd, blockquote, figcaption) a:not([class]),
|
|
3630
|
+
:where(p, td, dd, blockquote, figcaption) a:not([class]):hover {
|
|
3631
|
+
text-decoration: underline !important;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3507
3634
|
button {
|
|
3508
3635
|
cursor: pointer;
|
|
3509
3636
|
}
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
height: 32px;
|
|
23
23
|
background-color: transparent;
|
|
24
24
|
flex: 1;
|
|
25
|
+
/* An input's intrinsic width would otherwise stop it shrinking and push the row past its container. */
|
|
26
|
+
min-width: 0;
|
|
25
27
|
font-size: var(--dda-fs-body-lg);
|
|
26
28
|
font-weight: var(--dda-fw-400);
|
|
27
29
|
padding: 0px;
|
|
@@ -67,6 +69,35 @@
|
|
|
67
69
|
border: 1px solid var(--dda-neutral-90);
|
|
68
70
|
color: var(--dda-neutral-0);
|
|
69
71
|
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* WCAG 1.4.3 placeholder contrast. The global `::placeholder` colour in
|
|
75
|
+
* global.css (#8E9191) is 3.18:1 on the white field background. The
|
|
76
|
+
* theme-aware --dda-on-surface-variant-40 is 6.49:1 on surface-100 in the
|
|
77
|
+
* light theme (#56605F on #FFFFFF) and 7.46:1 in the dark theme (#A3ADAC on
|
|
78
|
+
* #191C1C). `.light-mode` forces a white field, so it uses the raw light
|
|
79
|
+
* step. Kept above the validation-error and disabled placeholder rules so
|
|
80
|
+
* those still win at equal specificity.
|
|
81
|
+
*/
|
|
82
|
+
.dda-input-field::-ms-input-placeholder,
|
|
83
|
+
.dda-field-group-input::-ms-input-placeholder {
|
|
84
|
+
color: var(--dda-on-surface-variant-40);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.dda-input-field::placeholder,
|
|
88
|
+
.dda-field-group-input::placeholder {
|
|
89
|
+
color: var(--dda-on-surface-variant-40);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.light-mode .dda-input-field::-ms-input-placeholder,
|
|
93
|
+
.light-mode .dda-field-group-input::-ms-input-placeholder {
|
|
94
|
+
color: var(--dda-neutral-variant-40);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.light-mode .dda-input-field::placeholder,
|
|
98
|
+
.light-mode .dda-field-group-input::placeholder {
|
|
99
|
+
color: var(--dda-neutral-variant-40);
|
|
100
|
+
}
|
|
70
101
|
.dda-input-size-small .dda-input-field-group,
|
|
71
102
|
.dda-input-size-small .dda-input-field {
|
|
72
103
|
height: 48px;
|
|
@@ -90,6 +121,7 @@
|
|
|
90
121
|
|
|
91
122
|
.dda-input-dropdown-btn {
|
|
92
123
|
min-width: 110px;
|
|
124
|
+
flex-shrink: 0;
|
|
93
125
|
position: relative;
|
|
94
126
|
display: inline-block;
|
|
95
127
|
padding: 0;
|
|
@@ -568,8 +600,30 @@
|
|
|
568
600
|
background-color: var(--dda-surface-94);
|
|
569
601
|
}
|
|
570
602
|
|
|
571
|
-
|
|
572
|
-
|
|
603
|
+
/*
|
|
604
|
+
* WCAG 2.1.1 / 4.1.2: the native file input was `display: none`, so it was
|
|
605
|
+
* out of the tab order and the accessibility tree. It is now visually hidden
|
|
606
|
+
* but focusable; keyboard focus shows the ring on the visible control after
|
|
607
|
+
* it ("Choose File", or the chosen file's details).
|
|
608
|
+
*/
|
|
609
|
+
.dda-attach-file input[type='file'] {
|
|
610
|
+
position: absolute;
|
|
611
|
+
width: 1px;
|
|
612
|
+
height: 1px;
|
|
613
|
+
margin: -1px;
|
|
614
|
+
padding: 0;
|
|
615
|
+
overflow: hidden;
|
|
616
|
+
clip: rect(0 0 0 0);
|
|
617
|
+
clip-path: inset(50%);
|
|
618
|
+
white-space: nowrap;
|
|
619
|
+
border: 0;
|
|
620
|
+
opacity: 0;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.dda-attach-file input[type='file']:focus-visible + .dda-file-input .dda-file-choose,
|
|
624
|
+
.dda-attach-file input[type='file']:focus-visible + .dda-file-details {
|
|
625
|
+
outline: none;
|
|
626
|
+
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(0, 0, 0, 0.65);
|
|
573
627
|
}
|
|
574
628
|
|
|
575
629
|
.dda-file-details {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Builds a docs page's API section from the tables Stencil generates into a component readme,
|
|
2
|
+
// so the documented props and events always match the component source after a build.
|
|
3
|
+
const API_SECTIONS = ['Properties', 'Events', 'Methods', 'Slots', 'Shadow Parts', 'CSS Custom Properties'];
|
|
4
|
+
|
|
5
|
+
export function componentApi(readme) {
|
|
6
|
+
const generated = readme.split('<!-- Auto Generated Below -->')[1] ?? '';
|
|
7
|
+
const sections = generated
|
|
8
|
+
.split(/^## /m)
|
|
9
|
+
.slice(1)
|
|
10
|
+
.filter(section => API_SECTIONS.includes(section.split('\n')[0].trim()))
|
|
11
|
+
// Drop Stencil's "Built with StencilJS" footer, which follows the last section.
|
|
12
|
+
.map(section => `### ${section.replace(/^-{10,}[\s\S]*$/m, '').trim()}`);
|
|
13
|
+
|
|
14
|
+
return sections.length ? sections.join('\n\n') : '_This component has no public properties or events._';
|
|
15
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Shared e2e helper for WCAG 1.4.3 placeholder-contrast specs. Not consumed
|
|
2
|
+
// by any component.
|
|
3
|
+
//
|
|
4
|
+
// Chromium's `getComputedStyle(input, '::placeholder')` returns the input's
|
|
5
|
+
// own `color`, not the placeholder's, so a spec cannot read the placeholder
|
|
6
|
+
// colour directly. This walks the page's stylesheets instead: it finds every
|
|
7
|
+
// `::placeholder` rule whose base selector matches the field, keeps the one
|
|
8
|
+
// that wins the cascade (highest specificity, then latest in source order),
|
|
9
|
+
// and resolves its `color` value (including `var()`) to a computed
|
|
10
|
+
// `rgb(...)` string that `contrastRatio()` can read.
|
|
11
|
+
//
|
|
12
|
+
// Pass the function itself to `page.evaluate()`. It runs in the browser, so
|
|
13
|
+
// it must stay self-contained: no imports, no closures, no async.
|
|
14
|
+
export function readPlaceholderColors(args) {
|
|
15
|
+
const field = document.querySelector(args.field);
|
|
16
|
+
const backgroundEl = document.querySelector(args.background || args.field);
|
|
17
|
+
if (!field || !backgroundEl) {
|
|
18
|
+
throw new Error(`placeholder-color.ts: no element for "${args.field}" or "${args.background}"`);
|
|
19
|
+
}
|
|
20
|
+
const specificity = (selector) => {
|
|
21
|
+
let rest = selector;
|
|
22
|
+
const ids = (rest.match(/#[\w-]+/g) || []).length;
|
|
23
|
+
rest = rest.replace(/#[\w-]+/g, ' ');
|
|
24
|
+
const classes = (rest.match(/\.[\w-]+|\[[^\]]*\]|:[\w-]+/g) || []).length;
|
|
25
|
+
rest = rest.replace(/\.[\w-]+|\[[^\]]*\]|:[\w-]+/g, ' ');
|
|
26
|
+
const types = (rest.match(/[a-zA-Z][\w-]*/g) || []).length;
|
|
27
|
+
return ids * 10000 + classes * 100 + types;
|
|
28
|
+
};
|
|
29
|
+
let bestValue = '';
|
|
30
|
+
let bestSpecificity = -1;
|
|
31
|
+
const visit = (rules) => {
|
|
32
|
+
for (let i = 0; i < rules.length; i++) {
|
|
33
|
+
const rule = rules[i];
|
|
34
|
+
if (rule.styleSheet && rule.styleSheet.cssRules) {
|
|
35
|
+
visit(rule.styleSheet.cssRules);
|
|
36
|
+
}
|
|
37
|
+
else if (rule.selectorText !== undefined) {
|
|
38
|
+
const value = rule.style.getPropertyValue('color');
|
|
39
|
+
if (!value)
|
|
40
|
+
continue;
|
|
41
|
+
const parts = String(rule.selectorText).split(',');
|
|
42
|
+
for (let j = 0; j < parts.length; j++) {
|
|
43
|
+
const part = parts[j].trim();
|
|
44
|
+
if (!/::placeholder$/.test(part))
|
|
45
|
+
continue;
|
|
46
|
+
const base = part.replace(/::placeholder$/, '').trim() || '*';
|
|
47
|
+
let matches = false;
|
|
48
|
+
try {
|
|
49
|
+
matches = field.matches(base);
|
|
50
|
+
}
|
|
51
|
+
catch (_a) {
|
|
52
|
+
matches = false;
|
|
53
|
+
}
|
|
54
|
+
if (!matches)
|
|
55
|
+
continue;
|
|
56
|
+
const s = specificity(base);
|
|
57
|
+
if (s >= bestSpecificity) {
|
|
58
|
+
bestSpecificity = s;
|
|
59
|
+
bestValue = value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (rule.cssRules) {
|
|
64
|
+
const media = rule.media ? rule.media.mediaText : '';
|
|
65
|
+
if (!media || window.matchMedia(media).matches) {
|
|
66
|
+
visit(rule.cssRules);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
72
|
+
let rules = null;
|
|
73
|
+
try {
|
|
74
|
+
rules = document.styleSheets[i].cssRules;
|
|
75
|
+
}
|
|
76
|
+
catch (_a) {
|
|
77
|
+
rules = null;
|
|
78
|
+
}
|
|
79
|
+
if (rules)
|
|
80
|
+
visit(rules);
|
|
81
|
+
}
|
|
82
|
+
// Resolve var()/keywords to rgb() in the field's own context.
|
|
83
|
+
const probe = document.createElement('span');
|
|
84
|
+
field.parentElement.appendChild(probe);
|
|
85
|
+
probe.style.color = bestValue || getComputedStyle(field).color;
|
|
86
|
+
const placeholder = getComputedStyle(probe).color;
|
|
87
|
+
probe.remove();
|
|
88
|
+
return { placeholder, background: getComputedStyle(backgroundEl).backgroundColor };
|
|
89
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
let counter = 0;
|
|
2
|
+
/**
|
|
3
|
+
* Returns an id that is unique on the page, for elements such as a label's input when the
|
|
4
|
+
* consumer did not pass one. Call it once per component instance (as a field initializer),
|
|
5
|
+
* so the id stays stable across renders.
|
|
6
|
+
*/
|
|
7
|
+
export function uniqueId(prefix) {
|
|
8
|
+
counter += 1;
|
|
9
|
+
return `${prefix}-${counter}`;
|
|
10
|
+
}
|