q2-tecton-elements 1.71.2 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-report.json +1282 -594
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +10 -9
- package/dist/cjs/{index-SpDCZABA.js → index-BY3aao8R.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{q2-action-group_2.cjs.entry.js → q2-action-group.cjs.entry.js} +1 -89
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +113 -12
- package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +7 -5
- package/dist/cjs/q2-card-image.cjs.entry.js +4 -4
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-context.cjs.entry.js +4 -3
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/q2-editable-field.cjs.entry.js +38 -37
- package/dist/cjs/q2-file-picker.cjs.entry.js +60 -4
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-meter.cjs.entry.js +1 -1
- package/dist/cjs/q2-modal.cjs.entry.js +59 -17
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-otp.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +22 -4
- package/dist/cjs/q2-radio.cjs.entry.js +3 -3
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-resize-observer.cjs.entry.js +92 -0
- package/dist/cjs/q2-search.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +7 -7
- package/dist/cjs/q2-select.cjs.entry.js +35 -19
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-surface.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q2-toast.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +5 -3
- package/dist/collection/components/q2-btn/q2-btn.css +79 -21
- package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +156 -3
- package/dist/collection/components/q2-calendar/q2-calendar.css +3 -0
- package/dist/collection/components/q2-calendar/q2-calendar.js +5 -3
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +23 -2
- package/dist/collection/components/q2-card/test/q2-card-test.vr.js +4 -0
- package/dist/collection/components/q2-card-image/q2-card-image.css +89 -134
- package/dist/collection/components/q2-card-image/q2-card-image.js +4 -4
- package/dist/collection/components/q2-card-image/test/q2-card-image-test.vr.js +4 -0
- package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +13 -0
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +2 -2
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +2 -0
- package/dist/collection/components/q2-context/q2-context.css +5 -0
- package/dist/collection/components/q2-context/q2-context.js +2 -1
- package/dist/collection/components/q2-context/test/q2-context-test.vr.js +11 -1
- package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +5 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.css +2 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.vr.js +30 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.css +2 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +38 -43
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +27 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +98 -2
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.vr.js +22 -0
- package/dist/collection/components/q2-input/q2-input.css +67 -1
- package/dist/collection/components/q2-input/q2-input.js +155 -13
- package/dist/collection/components/q2-input/test/q2-input-test.vr.js +35 -0
- package/dist/collection/components/q2-item/q2-item.css +3 -1
- package/dist/collection/components/q2-item/test/q2-item-test.vr.js +6 -0
- package/dist/collection/components/q2-message/q2-message.css +5 -5
- package/dist/collection/components/q2-modal/q2-modal.css +40 -3
- package/dist/collection/components/q2-modal/q2-modal.js +100 -16
- package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +25 -0
- package/dist/collection/components/q2-pill/q2-pill.css +2 -2
- package/dist/collection/components/q2-popover/q2-popover.css +3 -2
- package/dist/collection/components/q2-popover/q2-popover.js +8 -7
- package/dist/collection/components/q2-radio/q2-radio.css +158 -104
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio/test/q2-radio-test.vr.js +25 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +39 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +68 -2
- package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.vr.js +43 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +2 -2
- package/dist/collection/components/q2-search/q2-search.css +2 -0
- package/dist/collection/components/q2-section/q2-section.css +2 -0
- package/dist/collection/components/q2-section/q2-section.js +6 -6
- package/dist/collection/components/q2-select/q2-select.css +3 -0
- package/dist/collection/components/q2-select/q2-select.js +37 -18
- package/dist/collection/components/q2-select/test/q2-select-test.vr.js +13 -0
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-surface/q2-surface.js +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +5 -3
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/test/vr-helpers.js +16 -2
- package/dist/components/index2.js +1 -1
- package/dist/components/q2-btn2.js +1 -1
- package/dist/components/q2-calendar.js +11 -9
- package/dist/components/q2-card-image.js +24 -24
- package/dist/components/q2-checkbox-group.js +6 -6
- package/dist/components/q2-checkbox2.js +1 -1
- package/dist/components/q2-context.js +27 -26
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-dropdown.js +21 -21
- package/dist/components/q2-editable-field.js +33 -35
- package/dist/components/q2-file-picker.js +70 -10
- package/dist/components/q2-input2.js +268 -163
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-message2.js +24 -24
- package/dist/components/q2-modal.js +96 -78
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +29 -26
- package/dist/components/q2-radio-group.js +70 -40
- package/dist/components/q2-radio.js +40 -55
- package/dist/components/q2-relative-time.js +5 -5
- package/dist/components/q2-search.js +1 -1
- package/dist/components/q2-section.js +33 -33
- package/dist/components/q2-select2.js +46 -39
- package/dist/components/q2-stepper-pane.js +15 -11
- package/dist/components/q2-stepper-vertical.js +4 -4
- package/dist/components/q2-surface.js +3 -3
- package/dist/components/q2-tab-container.js +21 -21
- package/dist/components/q2-tab-pane.js +2 -2
- package/dist/components/q2-tag2.js +5 -5
- package/dist/components/tecton-tab-pane.js +8 -7
- package/dist/esm/click-elsewhere_3.entry.js +10 -9
- package/dist/esm/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{q2-action-group_2.entry.js → q2-action-group.entry.js} +3 -90
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +113 -12
- package/dist/esm/q2-btn_2.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js +7 -5
- package/dist/esm/q2-card-image.entry.js +4 -4
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox_2.entry.js +3 -3
- package/dist/esm/q2-context.entry.js +4 -3
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +3 -3
- package/dist/esm/q2-editable-field.entry.js +38 -37
- package/dist/esm/q2-file-picker.entry.js +60 -4
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +2 -2
- package/dist/esm/q2-link_2.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-meter.entry.js +1 -1
- package/dist/esm/q2-modal.entry.js +59 -17
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-otp.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js +22 -4
- package/dist/esm/q2-radio.entry.js +3 -3
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-resize-observer.entry.js +90 -0
- package/dist/esm/q2-search.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +7 -7
- package/dist/esm/q2-select.entry.js +35 -19
- package/dist/esm/q2-stepper-pane.entry.js +2 -2
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-surface.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +2 -2
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-toast.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +5 -3
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +32 -29
- package/dist/q2-tecton-elements/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/q2-tecton-elements/{q2-action-group_2.entry.js → q2-action-group.entry.js} +35 -113
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge_2.entry.js +240 -140
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-calendar.entry.js +14 -12
- package/dist/q2-tecton-elements/q2-card-image.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +31 -31
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +16 -16
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-context.entry.js +22 -21
- package/dist/q2-tecton-elements/q2-data-table.entry.js +34 -34
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +38 -40
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +61 -6
- package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +24 -24
- package/dist/q2-tecton-elements/q2-meter.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-modal.entry.js +61 -45
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-otp.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +55 -34
- package/dist/q2-tecton-elements/q2-radio.entry.js +38 -53
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +81 -0
- package/dist/q2-tecton-elements/q2-search.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-section.entry.js +33 -33
- package/dist/q2-tecton-elements/q2-select.entry.js +27 -20
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +20 -16
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-stepper.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-surface.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +8 -7
- package/dist/types/components/q2-card-image/q2-card-image.d.ts +1 -1
- package/dist/types/components/q2-dropdown/test/q2-dropdown-test.vr.d.ts +1 -0
- package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +6 -1
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +20 -0
- package/dist/types/components/q2-input/q2-input.d.ts +28 -2
- package/dist/types/components/q2-modal/q2-modal.d.ts +10 -1
- package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +14 -0
- package/dist/types/components/q2-select/q2-select.d.ts +8 -2
- package/dist/types/components.d.ts +119 -11
- package/dist/types/utils/test/vr-helpers.d.ts +2 -0
- package/package.json +3 -3
|
@@ -88,9 +88,9 @@ button {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* @prop --tct-radio-margin: (<length-percentage>+) Controls the outer margin of the radio container.
|
|
92
91
|
* @prop --tct-radio-transition: (*) Controls the transition timing of radio state changes.
|
|
93
|
-
* @prop --tct-radio-
|
|
92
|
+
* @prop --tct-radio-mark-size: (<length>) Controls the width and height of the radio mark.
|
|
93
|
+
* @prop --tct-radio-stroke-width: (<number>) Controls the stroke width of the radio circles in the default state. Values above `2` are clipped by the radio mark envelope.
|
|
94
94
|
* @prop --tct-radio-stroke-color: (<color>) Controls the stroke color of the radio circles in the default state.
|
|
95
95
|
* @prop --tct-radio-background-fill?: (<color>) Controls the optional background fill of the radio in the default state.
|
|
96
96
|
* @prop --tct-radio-background-stroke: (<color>) Controls the stroke color of the radio in the default state.
|
|
@@ -109,6 +109,7 @@ button {
|
|
|
109
109
|
* @prop --tct-radio-background-stroke-active: (<color>) Controls the stroke color when the radio is active.
|
|
110
110
|
* @prop --tct-radio-hover-background-fill?: (<color>) Controls the optional background fill when the radio is hovered.
|
|
111
111
|
* @prop --tct-radio-hover-stroke-color: (<color>) Controls the stroke color when the radio is hovered.
|
|
112
|
+
* @prop --tct-radio-checked-hover-stroke-color: (<color>) Controls the stroke color when a checked radio is hovered.
|
|
112
113
|
* @prop --tct-radio-hover-label-color?: (<color>) Controls the optional label text color when the radio is hovered.
|
|
113
114
|
* @prop --tct-radio-focus-background-fill?: (<color>) Controls the optional background fill when the radio is focused.
|
|
114
115
|
* @prop --tct-radio-focus-stroke-color: (<color>) Controls the stroke color when the radio is focused.
|
|
@@ -129,65 +130,81 @@ button {
|
|
|
129
130
|
* @prop --tct-radio-checked-label-letter-spacing: (<length>) Controls the label letter spacing when the radio is checked (legacy alias).
|
|
130
131
|
* @prop --tct-radio-label-gap: (<length-percentage>) Controls the gap between the radio circle and label content.
|
|
131
132
|
* @prop --tct-radio-label-margin-right: (<length-percentage>) Controls the right margin of the radio label.
|
|
133
|
+
* @prop --tct-radio-min-height: (<length>) Controls the minimum height of the radio label row.
|
|
132
134
|
* @prop --tct-radio-hidden-columns: (*) Controls the grid-template-columns when the label is visually hidden.
|
|
133
135
|
* @prop --tct-radio-label-hidden-columns?: (*) Controls the optional grid-template-columns when the label is visually hidden.
|
|
134
|
-
* @prop --tct-radio-tile-border-radius: (<length-percentage>) Controls the corner radius of the radio tile.
|
|
135
136
|
* @prop --tct-radio-tile-label-font-size: (<length-percentage>) Controls the font size of the radio tile label.
|
|
137
|
+
* @prop --tct-radio-tile-padding: (<length-percentage>+) Controls the inner padding of a radio tile.
|
|
138
|
+
* @prop --tct-radio-tile-divider-width: (<length>) Controls the width of the divider between radio tiles.
|
|
139
|
+
* @prop --tct-radio-tile-divider-color: (<color>) Controls the color of the divider between radio tiles.
|
|
140
|
+
* @prop --tct-radio-tile-hover-background-fill: (<color>) Controls the background of an unselected radio tile on hover.
|
|
141
|
+
* @prop --tct-radio-tile-active-background-fill: (<color>) Controls the background of an unselected radio tile while active.
|
|
142
|
+
* @prop --tct-radio-tile-checked-background-fill: (<color>) Controls the background of a selected radio tile.
|
|
143
|
+
* @prop --tct-radio-tile-checked-label-color: (<color>) Controls the label color of a selected radio tile.
|
|
144
|
+
* @prop --tct-radio-tile-indicator-height: (<length>) Controls the height of the selected radio tile indicator.
|
|
145
|
+
* @prop --tct-radio-tile-indicator-border-radius: (<length-percentage>+) Controls the selected radio tile indicator radius.
|
|
136
146
|
* @prop --tct-radio-tile-checked-stroke-color: (<color>) Controls the border color of the radio tile when checked.
|
|
137
|
-
* @prop --tct-radio-tile-focus-stroke-color: (<color>) Controls the border color of the radio tile when focused.
|
|
138
147
|
* @prop --tct-radio-tile-focus-box-shadow: (*) Controls the box shadow of the radio tile when focused via keyboard.
|
|
139
148
|
*/
|
|
140
149
|
:host {
|
|
141
150
|
display: block;
|
|
151
|
+
letter-spacing: var(--tct-radio-label-letter-spacing, inherit);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host([checked]:not([checked=false])) {
|
|
155
|
+
letter-spacing: var(--tct-radio-label-letter-spacing-checked, var(--tct-radio-checked-label-letter-spacing, var(--tct-checkbox-selected-letter-spacing, var(--tct-radio-label-letter-spacing, inherit))));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host(:active) {
|
|
159
|
+
letter-spacing: var(--tct-radio-label-letter-spacing-active, var(--tct-radio-label-letter-spacing, inherit));
|
|
142
160
|
}
|
|
143
161
|
|
|
144
162
|
.radio-container {
|
|
145
|
-
--comp-radio-
|
|
146
|
-
--comp-
|
|
147
|
-
--comp-
|
|
148
|
-
--comp-
|
|
149
|
-
--comp-
|
|
150
|
-
--comp-
|
|
163
|
+
--comp-radio-mark-track-size: 36px;
|
|
164
|
+
--comp-radio-mark-size: var(--tct-radio-mark-size, 20px);
|
|
165
|
+
--comp-radio-mark-fill: var(--tct-radio-background-fill, transparent);
|
|
166
|
+
--comp-radio-mark-stroke: var(--tct-radio-background-stroke, var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494)));
|
|
167
|
+
--comp-radio-mark-stroke-width: var(--tct-radio-background-stroke-width, var(--tct-radio-stroke-width, 2));
|
|
168
|
+
--comp-radio-mark-color-transition: background-color var(--tct-radio-background-transition, var(--tct-checkbox-tween, var(--app-tween-1, 0.15s ease))), border-color var(--tct-radio-background-transition, var(--tct-checkbox-tween, var(--app-tween-1, 0.15s ease)));
|
|
169
|
+
--comp-radio-mark-dot-fill: var(--tct-radio-select-fill-default, transparent);
|
|
151
170
|
--comp-label-content-color: var(--tct-radio-label-color, inherit);
|
|
152
171
|
--comp-label-content-font-weight: var(--tct-radio-label-font-weight, var(--tct-radio-font-weight, var(--tct-checkbox-font-weight, 400)));
|
|
153
|
-
--comp-label-content-
|
|
154
|
-
--comp-label-content-
|
|
155
|
-
--comp-label-
|
|
156
|
-
--comp-
|
|
157
|
-
--comp-
|
|
158
|
-
--comp-
|
|
159
|
-
--comp-
|
|
160
|
-
--comp-
|
|
161
|
-
--comp-
|
|
162
|
-
--comp-label-content-font-weight-checked: var(--tct-radio-label-font-weight-checked, var(--tct-radio-checked-label-font-weight, var(--tct-checkbox-selected-font-weight, 600)));
|
|
163
|
-
--comp-label-content-letter-spacing-checked: var(--tct-radio-label-letter-spacing-checked, var(--tct-radio-checked-label-letter-spacing, var(--tct-checkbox-selected-letter-spacing, var(--comp-label-content-letter-spacing))));
|
|
172
|
+
--comp-label-content-margin-right: var(--tct-radio-label-margin-right, 0);
|
|
173
|
+
--comp-label-content-gap: var(--tct-radio-label-gap, 0);
|
|
174
|
+
--comp-label-hidden-columns: var(--tct-radio-hidden-columns, var(--tct-radio-label-hidden-columns, var(--comp-radio-mark-track-size) 1fr));
|
|
175
|
+
--comp-radio-mark-transition: box-shadow var(--tct-radio-transition, var(--tct-tween-1, var(--app-tween-1, 0.15s ease))), transform var(--tct-radio-transition, var(--tct-tween-1, var(--app-tween-1, 0.15s ease)));
|
|
176
|
+
--comp-radio-mark-box-shadow: var(--tct-radio-box-shadow, none);
|
|
177
|
+
--comp-radio-mark-fill-checked: var(--tct-radio-checked-background-fill, var(--t-base, #ffffff));
|
|
178
|
+
--comp-radio-mark-stroke-checked: var(--tct-radio-checked-stroke-color, var(--t-primary, #6a4a9e));
|
|
179
|
+
--comp-radio-mark-dot-fill-checked: var(--tct-radio-select-fill-checked, var(--tct-radio-checked-fill, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, var(--t-primary, #6a4a9e)))));
|
|
180
|
+
--comp-label-content-font-weight-checked: var(--tct-radio-label-font-weight-checked, var(--tct-radio-checked-label-font-weight, var(--tct-checkbox-selected-font-weight, var(--comp-label-content-font-weight))));
|
|
164
181
|
--comp-label-content-color-checked: var(--tct-radio-label-font-color-checked, var(--tct-radio-checked-label-font-color, var(--tct-radio-checked-label-color, inherit)));
|
|
165
|
-
--comp-
|
|
166
|
-
--comp-
|
|
167
|
-
--comp-
|
|
182
|
+
--comp-radio-mark-fill-active: var(--tct-radio-background-fill-active, #e8ddef);
|
|
183
|
+
--comp-radio-mark-stroke-active: var(--tct-radio-background-stroke-active, var(--t-primary-d2, #553b7e));
|
|
184
|
+
--comp-radio-mark-dot-fill-active: var(--tct-radio-selected-fill-active, var(--comp-radio-mark-dot-fill-checked));
|
|
168
185
|
--comp-label-content-font-weight-active: var(--tct-radio-label-font-weight-active, var(--comp-label-content-font-weight));
|
|
169
|
-
--comp-label-content-letter-spacing-active: var(--tct-radio-label-letter-spacing-active, var(--comp-label-content-letter-spacing));
|
|
170
186
|
--comp-label-content-color-active: var(--tct-radio-label-color-active, var(--comp-label-content-color));
|
|
171
|
-
--comp-
|
|
172
|
-
--comp-
|
|
187
|
+
--comp-radio-mark-fill-hover: var(--tct-radio-hover-background-fill, #f3eefa);
|
|
188
|
+
--comp-radio-mark-stroke-hover: var(--tct-radio-hover-stroke-color, var(--t-primary, #6a4a9e));
|
|
189
|
+
--comp-radio-mark-stroke-checked-hover: var(--tct-radio-checked-hover-stroke-color, var(--t-primary-d2, #553b7e));
|
|
173
190
|
--comp-label-content-color-hover: var(--tct-radio-hover-label-color, var(--comp-label-content-color));
|
|
174
|
-
--comp-
|
|
175
|
-
--comp-
|
|
191
|
+
--comp-radio-mark-fill-focus: var(--tct-radio-focus-background-fill, var(--comp-radio-mark-fill));
|
|
192
|
+
--comp-radio-mark-stroke-focus: var(--tct-radio-focus-stroke-color, var(--comp-radio-mark-stroke));
|
|
176
193
|
--comp-label-content-color-focus: var(--tct-radio-focus-label-color, var(--comp-label-content-color));
|
|
177
|
-
--comp-
|
|
178
|
-
margin: var(--comp-radio-margin);
|
|
194
|
+
--comp-radio-mark-box-shadow-focus-visible: var(--tct-radio-box-shadow-focus-visible, var(--tct-radio-focus-box-shadow, var(--const-double-focus-ring)));
|
|
179
195
|
}
|
|
180
196
|
.radio-container label[for] {
|
|
181
|
-
color: var(
|
|
182
|
-
font-weight: var(
|
|
197
|
+
color: var(--comp-label-content-color);
|
|
198
|
+
font-weight: var(--comp-label-content-font-weight);
|
|
183
199
|
font-size: var(--tct-radio-label-font-size, var(--const-px-14, 14px));
|
|
184
|
-
align-items:
|
|
200
|
+
align-items: center;
|
|
185
201
|
cursor: pointer;
|
|
186
|
-
margin-right: var(
|
|
202
|
+
margin-right: var(--comp-label-content-margin-right);
|
|
187
203
|
display: grid;
|
|
188
|
-
grid-template-columns:
|
|
204
|
+
grid-template-columns: var(--comp-radio-mark-track-size) 1fr;
|
|
189
205
|
gap: var(--comp-label-content-gap);
|
|
190
|
-
|
|
206
|
+
min-height: var(--tct-radio-min-height, var(--comp-radio-mark-track-size));
|
|
207
|
+
user-select: none;
|
|
191
208
|
}
|
|
192
209
|
.radio-container label[for].label-hidden {
|
|
193
210
|
grid-template-columns: var(--comp-label-hidden-columns);
|
|
@@ -195,116 +212,153 @@ button {
|
|
|
195
212
|
.radio-container label[for] .description-content {
|
|
196
213
|
grid-column: 2;
|
|
197
214
|
}
|
|
198
|
-
.radio-container
|
|
215
|
+
.radio-container .radio-mark {
|
|
216
|
+
--comp-radio-mark-current-fill: var(--comp-radio-mark-fill);
|
|
217
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke);
|
|
218
|
+
border-radius: 50%;
|
|
219
|
+
box-shadow: var(--comp-radio-mark-box-shadow);
|
|
220
|
+
height: var(--comp-radio-mark-size);
|
|
221
|
+
justify-self: center;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
position: relative;
|
|
224
|
+
transition: var(--comp-radio-mark-transition);
|
|
225
|
+
width: var(--comp-radio-mark-size);
|
|
226
|
+
}
|
|
227
|
+
.radio-container .radio-mark::before {
|
|
228
|
+
background: var(--comp-radio-mark-current-fill);
|
|
229
|
+
border-color: var(--comp-radio-mark-current-stroke);
|
|
199
230
|
border-radius: 50%;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
231
|
+
border-style: solid;
|
|
232
|
+
border-width: calc(var(--comp-radio-mark-stroke-width) * 1px);
|
|
233
|
+
box-sizing: border-box;
|
|
234
|
+
content: "";
|
|
235
|
+
height: calc(var(--comp-radio-mark-size) - 2px + var(--comp-radio-mark-stroke-width) * 1px);
|
|
236
|
+
left: 50%;
|
|
237
|
+
position: absolute;
|
|
238
|
+
top: 50%;
|
|
239
|
+
transform: translate(-50%, -50%);
|
|
240
|
+
transition: var(--comp-radio-mark-color-transition);
|
|
241
|
+
width: calc(var(--comp-radio-mark-size) - 2px + var(--comp-radio-mark-stroke-width) * 1px);
|
|
204
242
|
}
|
|
205
|
-
.radio-container .
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
243
|
+
.radio-container .radio-mark::after {
|
|
244
|
+
background: var(--comp-radio-mark-dot-fill);
|
|
245
|
+
border-radius: 50%;
|
|
246
|
+
content: "";
|
|
247
|
+
height: calc(var(--comp-radio-mark-size) / 2);
|
|
248
|
+
left: 50%;
|
|
249
|
+
position: absolute;
|
|
250
|
+
top: 50%;
|
|
251
|
+
transform: translate(-50%, -50%) scale(0);
|
|
252
|
+
transition: transform var(--tct-radio-transition, var(--tct-tween-1, var(--app-tween-1, 0.15s ease)));
|
|
253
|
+
width: calc(var(--comp-radio-mark-size) / 2);
|
|
210
254
|
}
|
|
211
|
-
.radio-container
|
|
212
|
-
|
|
255
|
+
.radio-container input:focus-visible {
|
|
256
|
+
box-shadow: none;
|
|
213
257
|
}
|
|
214
|
-
.radio-container input:checked + label .
|
|
215
|
-
fill: var(--comp-
|
|
216
|
-
stroke: var(--comp-
|
|
258
|
+
.radio-container input:checked + label .radio-mark {
|
|
259
|
+
--comp-radio-mark-current-fill: var(--comp-radio-mark-fill-checked);
|
|
260
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke-checked);
|
|
217
261
|
}
|
|
218
|
-
.radio-container input:checked + label .
|
|
219
|
-
|
|
262
|
+
.radio-container input:checked + label .radio-mark::after {
|
|
263
|
+
background: var(--comp-radio-mark-dot-fill-checked);
|
|
264
|
+
transform: translate(-50%, -50%) scale(1);
|
|
220
265
|
}
|
|
221
266
|
.radio-container input:checked + label .label-content {
|
|
222
267
|
font-weight: var(--comp-label-content-font-weight-checked);
|
|
223
|
-
letter-spacing: var(--comp-label-content-letter-spacing-checked);
|
|
224
268
|
color: var(--comp-label-content-color-checked);
|
|
225
269
|
}
|
|
226
|
-
.radio-container input:hover + label .
|
|
227
|
-
fill: var(--comp-
|
|
228
|
-
stroke: var(--comp-
|
|
270
|
+
.radio-container input:hover:not(:disabled) + label .radio-mark {
|
|
271
|
+
--comp-radio-mark-current-fill: var(--comp-radio-mark-fill-hover);
|
|
272
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke-hover);
|
|
229
273
|
}
|
|
230
|
-
.radio-container input:hover + label .label-content {
|
|
274
|
+
.radio-container input:hover:not(:disabled) + label .label-content {
|
|
231
275
|
color: var(--comp-label-content-color-hover);
|
|
232
276
|
}
|
|
233
|
-
.radio-container input:active + label .
|
|
234
|
-
fill: var(--comp-
|
|
235
|
-
stroke: var(--comp-
|
|
277
|
+
.radio-container input:active:not(:disabled) + label .radio-mark {
|
|
278
|
+
--comp-radio-mark-current-fill: var(--comp-radio-mark-fill-active);
|
|
279
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke-active);
|
|
280
|
+
transform: scale(0.9);
|
|
236
281
|
}
|
|
237
|
-
.radio-container input:active + label .
|
|
238
|
-
|
|
282
|
+
.radio-container input:active:not(:disabled) + label .radio-mark::after {
|
|
283
|
+
background: var(--comp-radio-mark-dot-fill-active);
|
|
239
284
|
}
|
|
240
|
-
.radio-container input:active + label .label-content {
|
|
285
|
+
.radio-container input:active:not(:disabled) + label .label-content {
|
|
241
286
|
font-weight: var(--comp-label-content-font-weight-active);
|
|
242
|
-
letter-spacing: var(--comp-label-content-letter-spacing-active);
|
|
243
287
|
color: var(--comp-label-content-color-active);
|
|
244
288
|
}
|
|
245
|
-
.radio-container input:focus + label .
|
|
246
|
-
fill: var(--comp-
|
|
247
|
-
stroke: var(--comp-
|
|
289
|
+
.radio-container input:focus + label .radio-mark {
|
|
290
|
+
--comp-radio-mark-current-fill: var(--comp-radio-mark-fill-focus);
|
|
291
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke-focus);
|
|
248
292
|
}
|
|
249
293
|
.radio-container input:focus + label .label-content {
|
|
250
294
|
color: var(--comp-label-content-color-focus);
|
|
251
295
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
flex-basis: 100px;
|
|
255
|
-
flex-grow: 0;
|
|
256
|
-
flex-wrap: wrap;
|
|
296
|
+
.radio-container input:focus-visible + label .radio-mark {
|
|
297
|
+
box-shadow: var(--comp-radio-mark-box-shadow-focus-visible);
|
|
257
298
|
}
|
|
299
|
+
.radio-container input:checked:hover:not(:disabled) + label .radio-mark {
|
|
300
|
+
--comp-radio-mark-current-stroke: var(--comp-radio-mark-stroke-checked-hover);
|
|
301
|
+
}
|
|
302
|
+
|
|
258
303
|
.radio-tile label[for] {
|
|
259
304
|
color: var(--tct-radio-label-font-color, var(--tct-radio-label-color, inherit));
|
|
260
305
|
align-items: center;
|
|
261
|
-
border
|
|
262
|
-
|
|
263
|
-
background: var(--tct-radio-background-fill, transparent);
|
|
306
|
+
border: 0;
|
|
307
|
+
background: var(--tct-radio-background-fill, var(--t-base, #ffffff));
|
|
264
308
|
cursor: pointer;
|
|
265
309
|
display: block;
|
|
266
310
|
font-size: var(--tct-radio-tile-label-font-size, var(--tct-radio-label-font-size, var(--const-px-14, 14px)));
|
|
267
|
-
|
|
311
|
+
overflow: hidden;
|
|
312
|
+
padding: var(--tct-radio-tile-padding, 10px 20px);
|
|
268
313
|
position: relative;
|
|
269
314
|
text-align: center;
|
|
270
|
-
transition:
|
|
315
|
+
transition: background var(--tct-tween-1, var(--app-tween-1, 0.15s ease)), color var(--tct-tween-1, var(--app-tween-1, 0.15s ease)), box-shadow var(--tct-tween-1, var(--app-tween-1, 0.15s ease));
|
|
271
316
|
white-space: nowrap;
|
|
317
|
+
user-select: none;
|
|
318
|
+
}
|
|
319
|
+
.radio-tile input:focus-visible {
|
|
320
|
+
box-shadow: none;
|
|
272
321
|
}
|
|
273
322
|
.radio-tile input:checked + label {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
background: var(--tct-radio-checked-background-fill, transparent);
|
|
277
|
-
color: var(--tct-radio-checked-label-color, inherit);
|
|
323
|
+
background: var(--tct-radio-tile-checked-background-fill, var(--tct-radio-checked-background-fill, #f3eefa));
|
|
324
|
+
color: var(--tct-radio-tile-checked-label-color, var(--tct-radio-checked-label-color, var(--t-primary, #6a4a9e)));
|
|
278
325
|
}
|
|
279
326
|
.radio-tile input:checked + label:after {
|
|
280
|
-
|
|
281
|
-
border-
|
|
282
|
-
border-left-width: 5px;
|
|
283
|
-
border-left: 8px solid transparent;
|
|
284
|
-
border-right-width: 5px;
|
|
285
|
-
border-right: 8px solid transparent;
|
|
327
|
+
background: var(--tct-radio-tile-checked-stroke-color, var(--t-primary, #6a4a9e));
|
|
328
|
+
border-radius: var(--tct-radio-tile-indicator-border-radius, 9999px 9999px 0 0);
|
|
286
329
|
bottom: 0;
|
|
287
330
|
content: "";
|
|
288
|
-
height:
|
|
289
|
-
left:
|
|
290
|
-
margin-left: -5px;
|
|
331
|
+
height: var(--tct-radio-tile-indicator-height, 2px);
|
|
332
|
+
left: 0;
|
|
291
333
|
position: absolute;
|
|
292
|
-
|
|
334
|
+
right: 0;
|
|
293
335
|
}
|
|
294
|
-
.radio-tile input:hover + label {
|
|
295
|
-
|
|
296
|
-
background: var(--tct-radio-hover-background-fill, transparent);
|
|
336
|
+
.radio-tile input:not(:checked):hover:not(:disabled) + label {
|
|
337
|
+
background: var(--tct-radio-tile-hover-background-fill, #fafafa);
|
|
297
338
|
color: var(--tct-radio-hover-label-color, var(--tct-radio-label-color, inherit));
|
|
298
339
|
}
|
|
299
|
-
.radio-tile input:
|
|
300
|
-
--
|
|
301
|
-
border-color: var(--tct-radio-tile-focus-stroke-color, var(--tct-radio-focus-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)))));
|
|
302
|
-
background: var(--tct-radio-focus-background-fill, transparent);
|
|
303
|
-
box-shadow: var(--tct-radio-tile-focus-box-shadow, var(--comp-radio-tile-focus-box-shadow-fallback));
|
|
304
|
-
color: var(--tct-radio-focus-label-color, var(--tct-radio-checked-label-color, inherit));
|
|
340
|
+
.radio-tile input:not(:checked):active:not(:disabled) + label {
|
|
341
|
+
background: var(--tct-radio-tile-active-background-fill, var(--t-gray-14, #f2f2f2));
|
|
305
342
|
}
|
|
306
|
-
.radio-tile input:focus
|
|
307
|
-
|
|
343
|
+
.radio-tile input:focus-visible + label {
|
|
344
|
+
z-index: 1;
|
|
345
|
+
box-shadow: var(--tct-radio-tile-focus-box-shadow, var(--const-double-focus-ring));
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
:host(:not(:first-child)) .radio-tile label[for] {
|
|
349
|
+
border-left: var(--tct-radio-tile-divider-width, 1px) solid var(--tct-radio-tile-divider-color, var(--t-gray-13, #e6e6e6));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
:host(:first-child) .radio-tile label[for] {
|
|
353
|
+
border-radius: var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px)) 0 0 var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
:host(:last-child) .radio-tile label[for] {
|
|
357
|
+
border-radius: 0 var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px)) var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px)) 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
:host(:only-child) .radio-tile label[for] {
|
|
361
|
+
border-radius: var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px));
|
|
308
362
|
}
|
|
309
363
|
|
|
310
364
|
input:disabled + label[for] {
|
|
@@ -90,7 +90,7 @@ export class Q2Radio {
|
|
|
90
90
|
// #endregion
|
|
91
91
|
// #region Render Methods
|
|
92
92
|
render() {
|
|
93
|
-
return (h("div", { key: '
|
|
93
|
+
return (h("div", { key: '8fbe0ad9c8b0712fd51dbac67baae6209ebf2532', class: this.groupTileLayout ? 'radio-tile' : 'radio-container' }, h("input", { key: 'a9322154f304963731fb3d6ee99632c06938f27f', ref: el => (this.inputField = el), class: "sr", id: this._id, type: "radio", name: this.name, value: this.value, disabled: this.disabled || this.groupDisabled, checked: this.checked, "aria-label": this.label && this.hideLabel ? loc(this.label) : undefined, onChange: this.inputChange, "test-id": "q2RadioInnerRadioBox" }), h("label", { key: '234f95d4c4656e4325a15853bacf888d7a4ae446', htmlFor: this._id, class: this.hideLabel ? 'label-hidden' : undefined, "test-id": "radioButton" }, !this.groupTileLayout && (h("span", { key: 'ac98c34734a5e54b347cc2a48dc23d3ea2eb31ce', class: "radio-mark", "aria-hidden": "true" })), !this.hideLabel && (h("div", { key: '41dd2c195bc03dd8af8d5722e4aa2323cbeaab76', class: "label-content" }, (this.label && loc(this.label)) || '', h("slot", { key: '595014c6a32c2e98f7612dc51f0bd89579770988' }))))));
|
|
94
94
|
}
|
|
95
95
|
static get is() { return "q2-radio"; }
|
|
96
96
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,12 +5,24 @@ const VARIANTS = [
|
|
|
5
5
|
{
|
|
6
6
|
name: 'unchecked',
|
|
7
7
|
html: `<q2-radio value="1" label="Default"></q2-radio>`,
|
|
8
|
-
states: ['resting', 'hover', 'focus'],
|
|
8
|
+
states: ['resting', 'hover', 'focus', 'active'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'letter-spacing-override',
|
|
12
|
+
html: `<style>
|
|
13
|
+
q2-radio {
|
|
14
|
+
letter-spacing: 0.12em !important;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
<div style="width: 220px">
|
|
18
|
+
<q2-radio value="1" label="Send the payment on the next business day" checked></q2-radio>
|
|
19
|
+
</div>`,
|
|
20
|
+
states: ['resting'],
|
|
9
21
|
},
|
|
10
22
|
{
|
|
11
23
|
name: 'checked',
|
|
12
24
|
html: `<q2-radio value="1" label="Default" checked></q2-radio>`,
|
|
13
|
-
states: ['resting', 'hover', 'focus'],
|
|
25
|
+
states: ['resting', 'hover', 'focus', 'active'],
|
|
14
26
|
},
|
|
15
27
|
{
|
|
16
28
|
name: 'disabled-unchecked',
|
|
@@ -58,6 +70,15 @@ const focusCase = (variant, theme) => {
|
|
|
58
70
|
await expect(page).toHaveScreenshot(`q2-radio--${variant.name}--focus--${theme}.png`);
|
|
59
71
|
});
|
|
60
72
|
};
|
|
73
|
+
const activeCase = (variant, theme) => {
|
|
74
|
+
test(`q2-radio--${variant.name}--active — ${theme}`, async ({ page }) => {
|
|
75
|
+
await setupPage(page, variant.html, { theme });
|
|
76
|
+
await page.locator('q2-radio').hover();
|
|
77
|
+
await page.mouse.down();
|
|
78
|
+
await expect(page).toHaveScreenshot(`q2-radio--${variant.name}--active--${theme}.png`);
|
|
79
|
+
await page.mouse.up();
|
|
80
|
+
});
|
|
81
|
+
};
|
|
61
82
|
test.describe('q2-radio — variants × themes', () => {
|
|
62
83
|
for (const variant of VARIANTS) {
|
|
63
84
|
for (const theme of THEMES) {
|
|
@@ -67,6 +88,8 @@ test.describe('q2-radio — variants × themes', () => {
|
|
|
67
88
|
hoverCase(variant, theme);
|
|
68
89
|
if (variant.states.includes('focus'))
|
|
69
90
|
focusCase(variant, theme);
|
|
91
|
+
if (variant.states.includes('active'))
|
|
92
|
+
activeCase(variant, theme);
|
|
70
93
|
}
|
|
71
94
|
}
|
|
72
95
|
});
|
|
@@ -97,12 +97,18 @@ button {
|
|
|
97
97
|
* @prop --tct-radio-group-border-radius: (<length-percentage>) Controls the corner radius of the radio options container.
|
|
98
98
|
* @prop --tct-radio-group-border-width: (<length>+) Controls the border width of the radio options container.
|
|
99
99
|
* @prop --tct-radio-group-error-border-color: (<color>) Controls the border color of the radio options container in the error state.
|
|
100
|
-
* @prop --tct-radio-group-
|
|
100
|
+
* @prop --tct-radio-group-horizontal-gap: (<length-percentage>) Controls the gap between horizontal non-tile radio options.
|
|
101
|
+
* @prop --tct-radio-group-justify-content: (<custom-ident>) Controls how non-tile radio options are aligned along the layout direction.
|
|
102
|
+
* @prop --tct-radio-group-separator-color: (<color>) Controls the color of separators between vertical non-tile radio options.
|
|
103
|
+
* @prop --tct-radio-group-separator-width?: (<length>) Controls the optional thickness of separators between vertical non-tile radio options.
|
|
104
|
+
* @prop --tct-radio-group-tile-border-color: (<color>) Controls the border color around the tiled radio group.
|
|
105
|
+
* @prop --tct-radio-group-tile-border-radius: (<length-percentage>) Controls the corner radius of the tiled radio group.
|
|
101
106
|
* @prop --tct-radio-group-label-column-gap: (<length-percentage>) Controls the column gap between the radio-group label text and trailing icon.
|
|
102
107
|
* @prop --tct-radio-group-label-font-color?: (<color>) Controls the optional text color of the radio-group label.
|
|
103
108
|
* @prop --tct-radio-group-label-font-size?: (<length-percentage>) Controls the optional font size of the radio-group label.
|
|
104
109
|
* @prop --tct-radio-group-label-font-weight: (<number>) Controls the font weight of the radio-group label.
|
|
105
110
|
* @prop --tct-radio-group-label-letter-spacing?: (<length>) Controls the optional letter spacing of the radio-group label.
|
|
111
|
+
* @prop --tct-radio-group-label-line-height?: (<length-percentage>) Controls the optional line height of the radio-group label.
|
|
106
112
|
* @prop --tct-radio-group-label-text-transform?: (<custom-ident>) Controls the optional text transform of the radio-group label.
|
|
107
113
|
* @prop --tct-radio-group-label-optional-color: (<color>) Controls the text color of the "(optional)" indicator next to the label.
|
|
108
114
|
* @prop --tct-radio-group-label-optional-font-size: (<length-percentage>) Controls the font size of the "(optional)" indicator next to the label.
|
|
@@ -132,6 +138,7 @@ fieldset {
|
|
|
132
138
|
font-weight: var(--tct-radio-group-label-font-weight, 600);
|
|
133
139
|
text-transform: var(--tct-radio-group-label-text-transform, none);
|
|
134
140
|
letter-spacing: var(--tct-radio-group-label-letter-spacing, inherit);
|
|
141
|
+
line-height: var(--tct-radio-group-label-line-height, inherit);
|
|
135
142
|
}
|
|
136
143
|
.label-row q2-icon {
|
|
137
144
|
grid-area: icon;
|
|
@@ -185,6 +192,29 @@ legend.sr-only {
|
|
|
185
192
|
:host([has-error=false]) .options-container {
|
|
186
193
|
border-color: transparent;
|
|
187
194
|
}
|
|
195
|
+
.options-container.horizontal, .options-container.vertical {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-wrap: wrap;
|
|
198
|
+
justify-content: var(--tct-radio-group-justify-content, start);
|
|
199
|
+
}
|
|
200
|
+
.options-container.horizontal {
|
|
201
|
+
flex-direction: row;
|
|
202
|
+
column-gap: var(--tct-radio-group-horizontal-gap, var(--app-scale-4x, 20px));
|
|
203
|
+
}
|
|
204
|
+
.options-container.vertical {
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
}
|
|
207
|
+
.options-container.vertical ::slotted(q2-radio:not(:first-child)) {
|
|
208
|
+
position: relative;
|
|
209
|
+
}
|
|
210
|
+
.options-container.vertical ::slotted(q2-radio:not(:first-child))::before {
|
|
211
|
+
border-block-start: var(--tct-radio-group-separator-width, 0) solid var(--tct-radio-group-separator-color, var(--t-gray-12, #d9d9d9));
|
|
212
|
+
content: "";
|
|
213
|
+
inset-block-start: calc(var(--tct-radio-group-separator-width, 0) / -2);
|
|
214
|
+
inset-inline: 0;
|
|
215
|
+
pointer-events: none;
|
|
216
|
+
position: absolute;
|
|
217
|
+
}
|
|
188
218
|
|
|
189
219
|
.tile-container.left {
|
|
190
220
|
justify-content: start;
|
|
@@ -193,6 +223,13 @@ legend.sr-only {
|
|
|
193
223
|
justify-content: end;
|
|
194
224
|
}
|
|
195
225
|
.tile-container .options-container {
|
|
196
|
-
|
|
226
|
+
border-color: var(--tct-radio-group-tile-border-color, var(--t-gray-13, #e6e6e6));
|
|
227
|
+
border-radius: var(--tct-radio-group-tile-border-radius, var(--app-border-radius-2, 8px));
|
|
228
|
+
flex-grow: 0;
|
|
229
|
+
flex-wrap: nowrap;
|
|
197
230
|
justify-content: inherit;
|
|
231
|
+
overflow: visible;
|
|
232
|
+
}
|
|
233
|
+
:host([has-error]) .tile-container .options-container {
|
|
234
|
+
border-color: var(--tct-radio-group-error-border-color, var(--const-stoplight-alert, #d20a0a));
|
|
198
235
|
}
|
|
@@ -12,11 +12,22 @@ export class Q2RadioGroup {
|
|
|
12
12
|
// #region Own Properties
|
|
13
13
|
this._id = `radio-group-${createGuid()}`;
|
|
14
14
|
// #endregion
|
|
15
|
+
// #region State Properties
|
|
16
|
+
this.responsiveOrientation = 'vertical';
|
|
17
|
+
// #endregion
|
|
15
18
|
// #region Public Property API
|
|
16
19
|
/** Determines if all radios in the group are put into a `disabled` state. */
|
|
17
20
|
this.disabled = false;
|
|
18
21
|
/** Determines if the component should display in an errant state. */
|
|
19
22
|
this.hasError = false;
|
|
23
|
+
/** The layout direction of radio options when `tileLayout` is not enabled. */
|
|
24
|
+
this.orientation = 'vertical';
|
|
25
|
+
/**
|
|
26
|
+
* The width, in pixels, below which a horizontal non-tile layout displays vertically.
|
|
27
|
+
*
|
|
28
|
+
* @info The component determines this based on its own width, not the browser window.
|
|
29
|
+
*/
|
|
30
|
+
this.orientationThreshold = 440;
|
|
20
31
|
/** Provides alignment direction for tile-style radio group. */
|
|
21
32
|
this.tileAlignment = 'center';
|
|
22
33
|
this.checkedRadioExists = () => {
|
|
@@ -32,6 +43,10 @@ export class Q2RadioGroup {
|
|
|
32
43
|
this.radioElements[0].tabIndex = 0;
|
|
33
44
|
}
|
|
34
45
|
};
|
|
46
|
+
this.handleResize = (event) => {
|
|
47
|
+
const width = event.detail.entries[0].contentRect.width;
|
|
48
|
+
this.responsiveOrientation = width < this.orientationThreshold ? 'vertical' : 'horizontal';
|
|
49
|
+
};
|
|
35
50
|
this.onInnerRadioChange = (event) => {
|
|
36
51
|
event.stopImmediatePropagation();
|
|
37
52
|
if (this.readonly)
|
|
@@ -156,6 +171,9 @@ export class Q2RadioGroup {
|
|
|
156
171
|
}
|
|
157
172
|
// #endregion
|
|
158
173
|
// #region Local Methods
|
|
174
|
+
get computedOrientation() {
|
|
175
|
+
return this.orientation === 'horizontal' ? this.responsiveOrientation : 'vertical';
|
|
176
|
+
}
|
|
159
177
|
get inputId() {
|
|
160
178
|
return this._id;
|
|
161
179
|
}
|
|
@@ -169,7 +187,7 @@ export class Q2RadioGroup {
|
|
|
169
187
|
return (h("div", { class: `tile-container ${alignment}` }, h("div", { class: "options-container" }, h("slot", null))));
|
|
170
188
|
}
|
|
171
189
|
else {
|
|
172
|
-
return (h("div", { class:
|
|
190
|
+
return (h("div", { class: `options-container ${this.computedOrientation}` }, h("slot", null)));
|
|
173
191
|
}
|
|
174
192
|
}
|
|
175
193
|
// #endregion
|
|
@@ -178,7 +196,7 @@ export class Q2RadioGroup {
|
|
|
178
196
|
const showLabel = this.label || this.optional || this.readonly;
|
|
179
197
|
const { hasError } = this;
|
|
180
198
|
const showLabelRow = (showLabel && !this.hideLabel) || hasError;
|
|
181
|
-
return (h(Fragment, { key: '
|
|
199
|
+
return (h(Fragment, { key: '25ec8b2089b54a5d968c3cfb99a1740c5dcbd0d0' }, showLabelRow && (h("div", { key: '1ff216a3e27dd4284dbb2f0300e25728f376df62', class: "label-row" }, showLabel && !this.hideLabel && h("div", { key: '462c3833b83b524426ef2f937e0bf60c1cc841f7', class: "group-legend" }, renderLabel(this)), hasError && (h("q2-icon", { key: '249e09338abad9e55fa472bcc9807ce2297cd4c3', type: "error", "test-id": "iconError" })))), h("fieldset", { key: '2085294bc3fc10c2f3cf20e6a1a0553cb0829e7d', onChange: this.onInnerRadioChange, "aria-invalid": hasError ? `${hasError}` : undefined }, showLabel && h("legend", { key: 'ad2686c2e07d168a0cf1cbe0baf844121add6ecd', class: "sr-only" }, renderLabel(this)), h("q2-resize-observer", { key: 'e183977bae5484f38356b17b274d6e3125d4d603', onTctResize: this.handleResize, disabled: this.tileLayout || this.orientation !== 'horizontal' }, this.inputDom()))));
|
|
182
200
|
}
|
|
183
201
|
static get is() { return "q2-radio-group"; }
|
|
184
202
|
static get encapsulation() { return "shadow"; }
|
|
@@ -316,6 +334,49 @@ export class Q2RadioGroup {
|
|
|
316
334
|
"reflect": true,
|
|
317
335
|
"attribute": "optional"
|
|
318
336
|
},
|
|
337
|
+
"orientation": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"mutable": false,
|
|
340
|
+
"complexType": {
|
|
341
|
+
"original": "'vertical' | 'horizontal'",
|
|
342
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
343
|
+
"references": {}
|
|
344
|
+
},
|
|
345
|
+
"required": false,
|
|
346
|
+
"optional": false,
|
|
347
|
+
"docs": {
|
|
348
|
+
"tags": [],
|
|
349
|
+
"text": "The layout direction of radio options when `tileLayout` is not enabled."
|
|
350
|
+
},
|
|
351
|
+
"getter": false,
|
|
352
|
+
"setter": false,
|
|
353
|
+
"reflect": true,
|
|
354
|
+
"attribute": "orientation",
|
|
355
|
+
"defaultValue": "'vertical'"
|
|
356
|
+
},
|
|
357
|
+
"orientationThreshold": {
|
|
358
|
+
"type": "number",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "number",
|
|
362
|
+
"resolved": "number",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": false,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [{
|
|
369
|
+
"name": "info",
|
|
370
|
+
"text": "The component determines this based on its own width, not the browser window."
|
|
371
|
+
}],
|
|
372
|
+
"text": "The width, in pixels, below which a horizontal non-tile layout displays vertically."
|
|
373
|
+
},
|
|
374
|
+
"getter": false,
|
|
375
|
+
"setter": false,
|
|
376
|
+
"reflect": false,
|
|
377
|
+
"attribute": "orientation-threshold",
|
|
378
|
+
"defaultValue": "440"
|
|
379
|
+
},
|
|
319
380
|
"readonly": {
|
|
320
381
|
"type": "boolean",
|
|
321
382
|
"mutable": false,
|
|
@@ -417,6 +478,11 @@ export class Q2RadioGroup {
|
|
|
417
478
|
}
|
|
418
479
|
};
|
|
419
480
|
}
|
|
481
|
+
static get states() {
|
|
482
|
+
return {
|
|
483
|
+
"responsiveOrientation": {}
|
|
484
|
+
};
|
|
485
|
+
}
|
|
420
486
|
static get events() {
|
|
421
487
|
return [{
|
|
422
488
|
"method": "change",
|