@citizenplane/pimp 18.7.0 → 18.8.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/biome.json +178 -0
- package/dist/components/BaseInputLabel.vue.d.ts.map +1 -1
- package/dist/components/BaseSelectClearButton.vue.d.ts.map +1 -1
- package/dist/components/CpAccordion.vue.d.ts.map +1 -1
- package/dist/components/CpAlert.vue.d.ts.map +1 -1
- package/dist/components/CpBadge.vue.d.ts.map +1 -1
- package/dist/components/CpButton.vue.d.ts.map +1 -1
- package/dist/components/CpButtonToggle.vue.d.ts +1 -1
- package/dist/components/CpButtonToggle.vue.d.ts.map +1 -1
- package/dist/components/CpCalendar.vue.d.ts.map +1 -1
- package/dist/components/CpCheckbox.vue.d.ts.map +1 -1
- package/dist/components/CpContextualMenu.vue.d.ts.map +1 -1
- package/dist/components/CpDate.vue.d.ts.map +1 -1
- package/dist/components/CpDatepicker.vue.d.ts.map +1 -1
- package/dist/components/CpInput.vue.d.ts.map +1 -1
- package/dist/components/CpItemActions.vue.d.ts.map +1 -1
- package/dist/components/CpMenu.vue.d.ts.map +1 -1
- package/dist/components/CpMenuItem.vue.d.ts.map +1 -1
- package/dist/components/CpMultiselect.vue.d.ts.map +1 -1
- package/dist/components/CpRadio.vue.d.ts.map +1 -1
- package/dist/components/CpRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CpRadioNew.vue.d.ts.map +1 -1
- package/dist/components/CpSelect.vue.d.ts.map +1 -1
- package/dist/components/CpSelectMenu.vue.d.ts.map +1 -1
- package/dist/components/CpSelectableButton.vue.d.ts +1 -1
- package/dist/components/CpSelectableButton.vue.d.ts.map +1 -1
- package/dist/components/CpSwitch.vue.d.ts.map +1 -1
- package/dist/components/CpTable.vue.d.ts.map +1 -1
- package/dist/components/CpTelInput.vue.d.ts.map +1 -1
- package/dist/components/CpTooltip.vue.d.ts +2 -0
- package/dist/components/CpTooltip.vue.d.ts.map +1 -1
- package/dist/components/CpTrip.vue.d.ts +48 -0
- package/dist/components/CpTrip.vue.d.ts.map +1 -0
- package/dist/components/CpTripTimeline.vue.d.ts +24 -0
- package/dist/components/CpTripTimeline.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/useDynamicSize.d.ts +9 -0
- package/dist/composables/useDynamicSize.d.ts.map +1 -0
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/layout/Breakpoints.d.ts +9 -0
- package/dist/constants/layout/Breakpoints.d.ts.map +1 -0
- package/dist/constants/layout/Sizes.d.ts +2 -0
- package/dist/constants/layout/Sizes.d.ts.map +1 -0
- package/dist/constants/layout/index.d.ts +3 -0
- package/dist/constants/layout/index.d.ts.map +1 -0
- package/dist/helpers/functions.d.ts +1 -0
- package/dist/helpers/functions.d.ts.map +1 -1
- package/dist/libs/CoreDatepicker.vue.d.ts.map +1 -1
- package/dist/pimp.es.js +6794 -6459
- package/dist/pimp.umd.js +54 -54
- package/dist/style.css +1 -1
- package/package.json +14 -24
- package/src/assets/css/base.css +17 -11
- package/src/assets/css/colors.css +12 -22
- package/src/assets/css/dimensions.css +4 -0
- package/src/assets/css/shadows.css +0 -3
- package/src/assets/css/tokens.css +21 -65
- package/src/assets/css/typography.css +0 -17
- package/src/assets/main.css +7 -7
- package/src/assets/styles/helpers/_functions.scss +2 -2
- package/src/assets/styles/utilities/_index.scss +2 -3
- package/src/components/BaseInputLabel.vue +7 -11
- package/src/components/BaseSelectClearButton.vue +6 -7
- package/src/components/CpAccordion.vue +27 -28
- package/src/components/CpAccordionGroup.vue +2 -2
- package/src/components/CpAlert.vue +12 -11
- package/src/components/CpBadge.vue +4 -19
- package/src/components/CpButton.vue +23 -25
- package/src/components/CpButtonGroup.vue +2 -2
- package/src/components/CpButtonToggle.vue +22 -22
- package/src/components/CpCalendar.vue +30 -26
- package/src/components/CpCheckbox.vue +29 -33
- package/src/components/CpContextualMenu.vue +1 -2
- package/src/components/CpDate.vue +72 -76
- package/src/components/CpDatepicker.vue +2 -3
- package/src/components/CpDialog.vue +8 -8
- package/src/components/CpHeading.vue +6 -6
- package/src/components/CpIcon.vue +2 -2
- package/src/components/CpInput.vue +46 -48
- package/src/components/CpItemActions.vue +10 -10
- package/src/components/CpMenu.vue +8 -9
- package/src/components/CpMenuItem.vue +7 -7
- package/src/components/CpMenuList.vue +3 -3
- package/src/components/CpMultiselect.vue +29 -30
- package/src/components/CpRadio.vue +53 -59
- package/src/components/CpRadioGroup.vue +11 -12
- package/src/components/CpRadioNew.vue +56 -58
- package/src/components/CpSelect.vue +42 -42
- package/src/components/CpSelectMenu.vue +32 -32
- package/src/components/CpSelectableButton.vue +50 -51
- package/src/components/CpSwitch.vue +43 -44
- package/src/components/CpTable.vue +69 -81
- package/src/components/CpTableColumnEditor.vue +16 -16
- package/src/components/CpTableEmptyState.vue +4 -4
- package/src/components/CpTableFooter.vue +2 -2
- package/src/components/CpTableFooterDesktop.vue +2 -2
- package/src/components/CpTableFooterDetails.vue +2 -2
- package/src/components/CpTableFooterMobile.vue +4 -4
- package/src/components/CpTabs.vue +1 -1
- package/src/components/CpTelInput.vue +31 -32
- package/src/components/CpTextarea.vue +13 -13
- package/src/components/CpToast.vue +25 -24
- package/src/components/CpTooltip.vue +15 -13
- package/src/components/CpTransitionCounter.vue +1 -1
- package/src/components/CpTransitionExpand.vue +5 -5
- package/src/components/CpTransitionSize.vue +1 -1
- package/src/components/CpTrip.vue +190 -0
- package/src/components/CpTripTimeline.vue +272 -0
- package/src/components/index.ts +36 -34
- package/src/composables/useDynamicSize.ts +60 -0
- package/src/constants/index.ts +2 -2
- package/src/constants/layout/Breakpoints.ts +8 -0
- package/src/constants/layout/Sizes.ts +1 -0
- package/src/constants/layout/index.ts +3 -0
- package/src/directives/ClickOutside.ts +1 -1
- package/src/directives/ResizeSelect.ts +1 -1
- package/src/helpers/functions.ts +1 -1
- package/src/helpers/index.ts +1 -1
- package/src/libs/CoreDatepicker.vue +115 -134
- package/src/stories/Colors.stories.ts +2 -1
- package/src/stories/CpAccordion.stories.ts +2 -2
- package/src/stories/CpAccordionGroup.stories.ts +1 -2
- package/src/stories/CpButtonToggle.stories.ts +1 -2
- package/src/stories/CpCheckbox.stories.ts +1 -2
- package/src/stories/CpContextualMenu.stories.ts +1 -2
- package/src/stories/CpDate.stories.ts +1 -2
- package/src/stories/CpDatepicker.stories.ts +1 -2
- package/src/stories/CpDialog.stories.ts +1 -2
- package/src/stories/CpInput.stories.ts +1 -2
- package/src/stories/CpItemActions.stories.ts +1 -2
- package/src/stories/CpMenu.stories.ts +1 -2
- package/src/stories/CpMenuItem.stories.ts +1 -2
- package/src/stories/CpMultiselect.stories.ts +1 -2
- package/src/stories/CpRadio.stories.ts +1 -2
- package/src/stories/CpRadioGroup.stories.ts +1 -2
- package/src/stories/CpSelect.stories.ts +1 -2
- package/src/stories/CpSelectMenu.stories.ts +1 -2
- package/src/stories/CpSwitch.stories.ts +1 -2
- package/src/stories/CpTable.stories.ts +2 -3
- package/src/stories/CpTabs.stories.ts +1 -2
- package/src/stories/CpText.stories.ts +2 -1
- package/src/stories/CpTextarea.stories.ts +1 -2
- package/src/stories/CpToast.stories.ts +2 -3
- package/src/stories/CpTransitionCounter.stories.ts +1 -2
- package/src/stories/CpTransitionExpand.stories.ts +1 -2
- package/src/stories/CpTransitionListItems.stories.ts +1 -2
- package/src/stories/CpTransitionSize.stories.ts +1 -2
- package/src/stories/CpTransitionSlide.stories.ts +1 -2
- package/src/stories/CpTransitionTabContent.stories.ts +1 -2
- package/src/stories/CpTrip.stories.ts +323 -0
- package/src/stories/Dimensions.stories.ts +1 -0
- package/src/stories/Shadows.stories.ts +1 -0
- package/src/stories/Typography.stories.ts +1 -0
- package/src/vendors/ff-polyfill.ts +1 -1
- package/vitest.workspace.js +1 -1
- package/src/components/Pimp.vue +0 -10
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup lang="ts">
|
|
22
|
-
import { computed, ref } from 'vue'
|
|
23
|
-
|
|
24
22
|
import type { MenuItem } from 'primevue/menuitem'
|
|
23
|
+
import { computed, ref } from 'vue'
|
|
25
24
|
|
|
26
25
|
import CpButtonGroup from '@/components/CpButtonGroup.vue'
|
|
27
26
|
import CpContextualMenu from '@/components/CpContextualMenu.vue'
|
|
@@ -66,8 +65,8 @@ const handleDropdownState = (state: boolean) => (isDropdownOpen.value = state)
|
|
|
66
65
|
<style lang="scss">
|
|
67
66
|
.cpItemActions {
|
|
68
67
|
position: absolute;
|
|
69
|
-
right: 0;
|
|
70
68
|
top: 50%;
|
|
69
|
+
right: 0;
|
|
71
70
|
transform: translate3d(calc(var(--cp-dimensions-1) * 1.25), -50%, 0);
|
|
72
71
|
transition:
|
|
73
72
|
transform 150ms ease,
|
|
@@ -77,23 +76,24 @@ const handleDropdownState = (state: boolean) => (isDropdownOpen.value = state)
|
|
|
77
76
|
background-color: var(--cp-background-primary);
|
|
78
77
|
}
|
|
79
78
|
|
|
79
|
+
.cpMenuItem__button {
|
|
80
|
+
padding: var(--cp-spacing-sm-md);
|
|
81
|
+
border-radius: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
.cpMenuItem {
|
|
81
85
|
padding: 0;
|
|
82
86
|
|
|
83
87
|
&:first-child .cpMenuItem__button {
|
|
84
|
-
border-top-left-radius: var(--cp-radius-md);
|
|
85
88
|
border-bottom-left-radius: var(--cp-radius-md);
|
|
89
|
+
border-top-left-radius: var(--cp-radius-md);
|
|
86
90
|
}
|
|
91
|
+
|
|
87
92
|
&:last-child .cpMenuItem__button {
|
|
88
|
-
border-top-right-radius: var(--cp-radius-md);
|
|
89
93
|
border-bottom-right-radius: var(--cp-radius-md);
|
|
94
|
+
border-top-right-radius: var(--cp-radius-md);
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
|
-
|
|
93
|
-
.cpMenuItem__button {
|
|
94
|
-
border-radius: 0;
|
|
95
|
-
padding: var(--cp-spacing-sm-md);
|
|
96
|
-
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
[cp-item-actions-trigger] {
|
|
@@ -60,11 +60,10 @@
|
|
|
60
60
|
|
|
61
61
|
<script setup lang="ts">
|
|
62
62
|
import PrimevueDrawer from 'primevue/drawer'
|
|
63
|
+
import type { MenuItem } from 'primevue/menuitem'
|
|
63
64
|
import PrimevuePopover from 'primevue/popover'
|
|
64
65
|
import { computed, nextTick, onUnmounted, ref, useId } from 'vue'
|
|
65
66
|
|
|
66
|
-
import type { MenuItem } from 'primevue/menuitem'
|
|
67
|
-
|
|
68
67
|
import CpButton from '@/components/CpButton.vue'
|
|
69
68
|
import CpIcon from '@/components/CpIcon.vue'
|
|
70
69
|
import CpMenuList from '@/components/CpMenuList.vue'
|
|
@@ -174,13 +173,13 @@ defineExpose({ show, hide, toggle })
|
|
|
174
173
|
|
|
175
174
|
&__overlay {
|
|
176
175
|
position: absolute;
|
|
177
|
-
margin-top: var(--cp-spacing-sm-md);
|
|
178
176
|
min-width: calc(var(--cp-dimensions-1) * 62.5);
|
|
179
177
|
border-radius: var(--cp-radius-md);
|
|
178
|
+
margin-top: var(--cp-spacing-sm-md);
|
|
180
179
|
background-color: var(--cp-background-primary);
|
|
181
180
|
box-shadow: var(--cp-shadows-overlay);
|
|
182
|
-
will-change: opacity, transform;
|
|
183
181
|
transform-origin: top;
|
|
182
|
+
will-change: opacity, transform;
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
&__overlayContent {
|
|
@@ -189,24 +188,24 @@ defineExpose({ show, hide, toggle })
|
|
|
189
188
|
|
|
190
189
|
&__drawerMask {
|
|
191
190
|
position: fixed;
|
|
192
|
-
inset: 0;
|
|
193
191
|
z-index: 2;
|
|
194
192
|
display: flex;
|
|
195
193
|
align-items: flex-end;
|
|
196
194
|
justify-content: center;
|
|
197
195
|
background-color: var(--cp-background-overlay);
|
|
196
|
+
inset: 0;
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
&__drawer {
|
|
201
200
|
position: relative;
|
|
201
|
+
display: flex;
|
|
202
202
|
width: 100%;
|
|
203
203
|
max-height: 85vh;
|
|
204
|
-
display: flex;
|
|
205
204
|
flex-direction: column;
|
|
206
|
-
|
|
205
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
207
206
|
border-radius: var(--cp-radius-lg) var(--cp-radius-lg) 0 0;
|
|
207
|
+
background-color: var(--cp-background-primary);
|
|
208
208
|
box-shadow: var(--cp-shadows-overlay);
|
|
209
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
210
209
|
}
|
|
211
210
|
|
|
212
211
|
&__drawer--fullHeight {
|
|
@@ -221,8 +220,8 @@ defineExpose({ show, hide, toggle })
|
|
|
221
220
|
|
|
222
221
|
&__drawerContent {
|
|
223
222
|
flex: 1;
|
|
224
|
-
overflow-y: auto;
|
|
225
223
|
padding-bottom: var(--cp-spacing-sm);
|
|
224
|
+
overflow-y: auto;
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
&__drawerToolbar {
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script setup lang="ts">
|
|
27
|
-
import { computed, useSlots } from 'vue'
|
|
28
|
-
|
|
29
27
|
import type { MenuItem } from 'primevue/menuitem'
|
|
28
|
+
import { computed, useSlots } from 'vue'
|
|
30
29
|
|
|
31
30
|
interface Props {
|
|
32
31
|
hideLabel?: boolean
|
|
@@ -61,7 +60,7 @@ const dynamicClass = computed(() => ({
|
|
|
61
60
|
const disabled = computed(() => props.isLoading || props.disabled)
|
|
62
61
|
const hasLeadingIcon = computed(() => !!props.leadingIcon || !!slots['leading-icon'])
|
|
63
62
|
const hasTrailingIcon = computed(() => !!props.trailingIcon || !!slots['trailing-icon'])
|
|
64
|
-
const hasLabel = computed(() => (!!props.label || !!slots
|
|
63
|
+
const hasLabel = computed(() => (!!props.label || !!slots.label) && !props.hideLabel)
|
|
65
64
|
const ariaLabel = computed(() => (props.hideLabel ? props.label : undefined))
|
|
66
65
|
|
|
67
66
|
const handleItemClick = async (event: Event) => {
|
|
@@ -91,15 +90,15 @@ const handleItemClick = async (event: Event) => {
|
|
|
91
90
|
--cp-menu-item-color: var(--cp-text-primary);
|
|
92
91
|
--cp-menu-item-color-hover: var(--cp-text-primary);
|
|
93
92
|
|
|
94
|
-
padding: var(--cp-spacing-sm-md) var(--cp-spacing-md);
|
|
95
93
|
position: relative;
|
|
96
|
-
color: var(--cp-menu-item-color);
|
|
97
|
-
background-color: var(--cp-menu-item-background-color);
|
|
98
94
|
display: flex;
|
|
99
95
|
width: 100%;
|
|
100
96
|
align-items: center;
|
|
101
|
-
|
|
97
|
+
padding: var(--cp-spacing-sm-md) var(--cp-spacing-md);
|
|
98
|
+
background-color: var(--cp-menu-item-background-color);
|
|
99
|
+
color: var(--cp-menu-item-color);
|
|
102
100
|
font-size: var(--cp-text-size-sm);
|
|
101
|
+
gap: var(--cp-spacing-lg);
|
|
103
102
|
line-height: var(--cp-line-height-sm);
|
|
104
103
|
text-align: start;
|
|
105
104
|
transition:
|
|
@@ -116,6 +115,7 @@ const handleItemClick = async (event: Event) => {
|
|
|
116
115
|
--cp-menu-item-background-color-hover: var(--cp-background-primary);
|
|
117
116
|
--cp-menu-item-color: var(--cp-text-disabled);
|
|
118
117
|
--cp-menu-item-color-hover: var(--cp-text-disabled);
|
|
118
|
+
|
|
119
119
|
cursor: not-allowed;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -35,12 +35,12 @@ const getItemRole = (item: MenuItem) => (item.separator ? 'separator' : 'none')
|
|
|
35
35
|
|
|
36
36
|
<style lang="scss">
|
|
37
37
|
.cpMenuList {
|
|
38
|
-
margin: 0;
|
|
39
|
-
padding: 0;
|
|
40
|
-
list-style: none;
|
|
41
38
|
display: flex;
|
|
42
39
|
flex-direction: column;
|
|
40
|
+
padding: 0;
|
|
41
|
+
margin: 0;
|
|
43
42
|
gap: var(--cp-spacing-sm);
|
|
43
|
+
list-style: none;
|
|
44
44
|
|
|
45
45
|
&__item {
|
|
46
46
|
display: block;
|
|
@@ -97,9 +97,8 @@
|
|
|
97
97
|
<script setup lang="ts">
|
|
98
98
|
import { absolutePosition, getOuterWidth } from '@primeuix/utils/dom'
|
|
99
99
|
import AutoComplete from 'primevue/autocomplete'
|
|
100
|
-
import { ref, computed, onMounted, useSlots, useId } from 'vue'
|
|
101
|
-
|
|
102
100
|
import type { Slots } from 'vue'
|
|
101
|
+
import { computed, onMounted, ref, useId, useSlots } from 'vue'
|
|
103
102
|
|
|
104
103
|
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
105
104
|
import BaseSelectClearButton from '@/components/BaseSelectClearButton.vue'
|
|
@@ -335,8 +334,8 @@ onMounted(() => overrideAlignOverlay())
|
|
|
335
334
|
|
|
336
335
|
&__prefix {
|
|
337
336
|
display: flex;
|
|
338
|
-
align-items: center;
|
|
339
337
|
flex-shrink: 0;
|
|
338
|
+
align-items: center;
|
|
340
339
|
order: -1;
|
|
341
340
|
|
|
342
341
|
&:empty {
|
|
@@ -349,29 +348,21 @@ onMounted(() => overrideAlignOverlay())
|
|
|
349
348
|
align-items: center;
|
|
350
349
|
justify-content: space-between;
|
|
351
350
|
padding: var(--cp-spacing-md) var(--cp-spacing-xl);
|
|
351
|
+
border-radius: var(--cp-radius-md);
|
|
352
352
|
box-shadow:
|
|
353
353
|
var(--cp-shadows-3xs-inset),
|
|
354
354
|
0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft);
|
|
355
|
-
border-radius: var(--cp-radius-md);
|
|
356
355
|
gap: var(--cp-spacing-md);
|
|
357
356
|
|
|
358
357
|
&--sm {
|
|
359
358
|
padding: var(--cp-spacing-sm) var(--cp-spacing-lg);
|
|
360
359
|
}
|
|
361
360
|
|
|
362
|
-
&:has(input:hover):not(:has(input:disabled)) {
|
|
363
|
-
outline: var(--cp-dimensions-0_25) solid var(--cp-border-strong-hover);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
&:has(input:focus-visible):not(:has(input:disabled)) {
|
|
367
|
-
outline: var(--cp-dimensions-0_5) solid var(--cp-border-accent-solid);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
361
|
&:has(input:disabled) {
|
|
371
362
|
background: var(--cp-background-disabled);
|
|
372
|
-
pointer-events: none;
|
|
373
363
|
box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-disabled);
|
|
374
364
|
color: var(--cp-text-disabled);
|
|
365
|
+
pointer-events: none;
|
|
375
366
|
|
|
376
367
|
input,
|
|
377
368
|
input::placeholder {
|
|
@@ -381,23 +372,32 @@ onMounted(() => overrideAlignOverlay())
|
|
|
381
372
|
.cpMultiselect__toggle {
|
|
382
373
|
display: none;
|
|
383
374
|
}
|
|
375
|
+
|
|
384
376
|
.cpIcon {
|
|
385
377
|
color: var(--cp-foreground-disabled);
|
|
386
378
|
}
|
|
387
379
|
}
|
|
380
|
+
|
|
381
|
+
&:has(input:hover):not(:has(input:disabled)) {
|
|
382
|
+
outline: var(--cp-dimensions-0_25) solid var(--cp-border-strong-hover);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&:has(input:focus-visible):not(:has(input:disabled)) {
|
|
386
|
+
outline: var(--cp-dimensions-0_5) solid var(--cp-border-accent-solid);
|
|
387
|
+
}
|
|
388
388
|
|
|
389
389
|
&:is([data-p*='invalid'], .p-invalid, :has([data-p*='invalid']), :has([aria-invalid='true'])) {
|
|
390
|
-
outline: var(--cp-dimensions-0_25) solid var(--cp-border-error-solid) !important;
|
|
391
390
|
box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-error-solid) !important;
|
|
391
|
+
outline: var(--cp-dimensions-0_25) solid var(--cp-border-error-solid) !important;
|
|
392
392
|
|
|
393
393
|
&:is(:hover, :has(input:hover), :has(input:placeholder-shown):has(input:hover)) {
|
|
394
|
-
outline: var(--cp-dimensions-0_25) solid var(--cp-border-error-solid) !important;
|
|
395
394
|
box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-error-solid) !important;
|
|
395
|
+
outline: var(--cp-dimensions-0_25) solid var(--cp-border-error-solid) !important;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
&:is(:focus-within, :has(input:focus-visible), :has(input:placeholder-shown):has(input:focus-visible)) {
|
|
399
|
-
outline: var(--cp-dimensions-0_5) solid var(--cp-border-error-solid) !important;
|
|
400
399
|
box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-error-solid) !important;
|
|
400
|
+
outline: var(--cp-dimensions-0_5) solid var(--cp-border-error-solid) !important;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
}
|
|
@@ -438,11 +438,11 @@ onMounted(() => overrideAlignOverlay())
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
&__input {
|
|
441
|
+
width: 100%;
|
|
441
442
|
padding: 0;
|
|
443
|
+
background-color: transparent;
|
|
442
444
|
font-size: var(--cp-text-size-sm);
|
|
443
445
|
line-height: var(--cp-line-height-md);
|
|
444
|
-
background-color: transparent;
|
|
445
|
-
width: 100%;
|
|
446
446
|
|
|
447
447
|
&::placeholder {
|
|
448
448
|
color: var(--cp-text-placeholder);
|
|
@@ -458,22 +458,21 @@ onMounted(() => overrideAlignOverlay())
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
&--isSingle {
|
|
461
|
+
width: 100%;
|
|
461
462
|
text-overflow: ellipsis;
|
|
462
463
|
white-space: nowrap;
|
|
463
|
-
width: 100%;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
&__dropdownIcon {
|
|
468
468
|
width: var(--cp-dimensions-4);
|
|
469
469
|
height: var(--cp-dimensions-4);
|
|
470
|
-
|
|
471
470
|
color: var(--cp-foreground-secondary);
|
|
472
471
|
transition: rotate 200ms ease;
|
|
473
472
|
|
|
474
473
|
&--isRotated {
|
|
475
|
-
rotate: 180deg;
|
|
476
474
|
color: var(--cp-foreground-primary);
|
|
475
|
+
rotate: 180deg;
|
|
477
476
|
}
|
|
478
477
|
}
|
|
479
478
|
|
|
@@ -483,13 +482,13 @@ onMounted(() => overrideAlignOverlay())
|
|
|
483
482
|
}
|
|
484
483
|
|
|
485
484
|
&__overlay {
|
|
486
|
-
padding-block: var(--cp-spacing-sm);
|
|
487
485
|
left: 0;
|
|
488
486
|
overflow: hidden;
|
|
489
|
-
background: var(--cp-background-primary);
|
|
490
487
|
border-radius: var(--cp-radius-md);
|
|
491
|
-
|
|
488
|
+
background: var(--cp-background-primary);
|
|
492
489
|
box-shadow: var(--cp-shadows-overlay);
|
|
490
|
+
margin-block: var(--cp-spacing-md);
|
|
491
|
+
padding-block: var(--cp-spacing-sm);
|
|
493
492
|
|
|
494
493
|
&--isHidden {
|
|
495
494
|
display: none;
|
|
@@ -506,9 +505,9 @@ onMounted(() => overrideAlignOverlay())
|
|
|
506
505
|
|
|
507
506
|
&__list {
|
|
508
507
|
display: flex;
|
|
509
|
-
padding-inline: var(--cp-spacing-sm);
|
|
510
508
|
flex-direction: column;
|
|
511
509
|
gap: var(--cp-spacing-xs);
|
|
510
|
+
padding-inline: var(--cp-spacing-sm);
|
|
512
511
|
}
|
|
513
512
|
|
|
514
513
|
&__optionWrapper {
|
|
@@ -531,20 +530,20 @@ onMounted(() => overrideAlignOverlay())
|
|
|
531
530
|
}
|
|
532
531
|
|
|
533
532
|
&[data-p-disabled='true'] {
|
|
534
|
-
opacity: 0.5;
|
|
535
533
|
cursor: not-allowed;
|
|
534
|
+
opacity: 0.5;
|
|
536
535
|
pointer-events: none;
|
|
537
536
|
}
|
|
538
537
|
}
|
|
539
538
|
|
|
540
539
|
&__optionWrapper > *,
|
|
541
540
|
&__option {
|
|
541
|
+
width: 100%;
|
|
542
542
|
padding: var(--cp-dimensions-2_5);
|
|
543
543
|
border-radius: var(--cp-radius-sm-md);
|
|
544
544
|
font-size: var(--cp-text-size-sm);
|
|
545
545
|
line-height: var(--cp-line-height-sm);
|
|
546
546
|
text-align: left;
|
|
547
|
-
width: 100%;
|
|
548
547
|
}
|
|
549
548
|
|
|
550
549
|
&__option {
|
|
@@ -553,8 +552,8 @@ onMounted(() => overrideAlignOverlay())
|
|
|
553
552
|
|
|
554
553
|
&__empty {
|
|
555
554
|
padding: var(--cp-spacing-md);
|
|
556
|
-
font-size: var(--cp-text-size-sm);
|
|
557
555
|
color: var(--cp-text-secondary);
|
|
556
|
+
font-size: var(--cp-text-size-sm);
|
|
558
557
|
}
|
|
559
558
|
|
|
560
559
|
&__error {
|
|
@@ -569,10 +568,10 @@ onMounted(() => overrideAlignOverlay())
|
|
|
569
568
|
|
|
570
569
|
&__clear {
|
|
571
570
|
position: absolute;
|
|
572
|
-
right: var(--cp-dimensions-3);
|
|
573
571
|
top: 50%;
|
|
574
|
-
|
|
572
|
+
right: var(--cp-dimensions-3);
|
|
575
573
|
background-color: var(--cp-background-primary);
|
|
574
|
+
transform: translateY(-50%);
|
|
576
575
|
}
|
|
577
576
|
|
|
578
577
|
@include mx.media-query-pointer-device-only {
|
|
@@ -76,8 +76,8 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&--is#{$className} input:checked {
|
|
79
|
-
background-color: $color;
|
|
80
79
|
border-color: $color;
|
|
80
|
+
background-color: $color;
|
|
81
81
|
|
|
82
82
|
& ~ .cpRadio__label,
|
|
83
83
|
& ~ .cpRadio__additionalData {
|
|
@@ -104,16 +104,15 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
104
104
|
|
|
105
105
|
&__item {
|
|
106
106
|
position: relative;
|
|
107
|
+
display: grid;
|
|
108
|
+
width: 100%;
|
|
109
|
+
align-items: center;
|
|
110
|
+
padding: var(--cp-spacing-xl) var(--cp-spacing-lg);
|
|
107
111
|
border: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
|
|
108
112
|
border-radius: var(--cp-radius-md-lg);
|
|
109
|
-
|
|
110
|
-
display: grid;
|
|
113
|
+
gap: 0 var(--cp-spacing-lg);
|
|
111
114
|
grid-template-columns: min-content 1fr;
|
|
112
115
|
grid-template-rows: auto auto auto;
|
|
113
|
-
align-items: center;
|
|
114
|
-
column-gap: var(--cp-spacing-lg);
|
|
115
|
-
row-gap: 0;
|
|
116
|
-
width: 100%;
|
|
117
116
|
|
|
118
117
|
&:not(:has(input:disabled)),
|
|
119
118
|
&:not(:has(input:disabled)) * {
|
|
@@ -121,9 +120,9 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
&:has(input:disabled) {
|
|
123
|
+
border-color: var(--cp-border-disabled);
|
|
124
124
|
background-color: var(--cp-background-disabled);
|
|
125
125
|
color: var(--cp-foreground-disabled);
|
|
126
|
-
border-color: var(--cp-border-disabled);
|
|
127
126
|
|
|
128
127
|
&,
|
|
129
128
|
* {
|
|
@@ -133,8 +132,8 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
133
132
|
&:hover,
|
|
134
133
|
&:focus,
|
|
135
134
|
&:has(input:checked) {
|
|
136
|
-
box-shadow: none;
|
|
137
135
|
border-color: var(--cp-border-disabled);
|
|
136
|
+
box-shadow: none;
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
}
|
|
@@ -150,48 +149,72 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
.cpRadio__additionalData {
|
|
152
|
+
margin-left: 0;
|
|
153
153
|
grid-column: 2;
|
|
154
154
|
grid-row: 3;
|
|
155
|
-
margin-left: 0;
|
|
156
155
|
text-align: left;
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
@include cp-radio-style(var(--cp-foreground-accent-primary), 'Accent');
|
|
160
|
-
|
|
161
159
|
@include cp-radio-style(var(--cp-foreground-blue-primary), 'Blue');
|
|
162
|
-
|
|
163
160
|
@include cp-radio-style(var(--cp-foreground-accent-primary), 'Purple'); // TODO: Sould be replace by ACCENT
|
|
164
161
|
|
|
165
162
|
input {
|
|
166
|
-
-webkit-appearance: none;
|
|
167
|
-
-moz-appearance: none;
|
|
168
|
-
appearance: none;
|
|
169
|
-
border: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
|
|
170
|
-
border-radius: var(--cp-radius-full);
|
|
171
|
-
padding: 25%;
|
|
172
163
|
width: $cp-radio-base-width;
|
|
173
164
|
height: $cp-radio-base-width;
|
|
174
|
-
|
|
165
|
+
align-self: center;
|
|
166
|
+
padding: 25%;
|
|
167
|
+
border: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
|
|
168
|
+
border-radius: var(--cp-radius-full);
|
|
169
|
+
appearance: none;
|
|
175
170
|
grid-column: 1;
|
|
176
171
|
grid-row: 1 / -1;
|
|
177
|
-
|
|
172
|
+
transition: transform 0.1s linear;
|
|
178
173
|
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
&__label,
|
|
175
|
+
&__description {
|
|
176
|
+
line-height: 1.3;
|
|
177
|
+
text-transform: capitalize;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__label,
|
|
181
|
+
&__additionalData {
|
|
182
|
+
font-weight: 500;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&__description,
|
|
186
|
+
&__additionalData {
|
|
187
|
+
color: var(--cp-text-secondary);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&__label {
|
|
191
|
+
white-space: nowrap;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&__description:empty {
|
|
195
|
+
display: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&__additionalData:empty {
|
|
199
|
+
display: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&::before {
|
|
181
203
|
display: flex;
|
|
182
204
|
width: 100%;
|
|
183
205
|
height: 100%;
|
|
184
206
|
border-radius: var(--cp-radius-full);
|
|
185
207
|
background-color: var(--cp-background-primary);
|
|
186
|
-
|
|
208
|
+
content: '';
|
|
187
209
|
transform: scale(0);
|
|
210
|
+
transition: transform 0.15s linear;
|
|
188
211
|
}
|
|
189
212
|
|
|
190
213
|
&:active:not(:disabled) {
|
|
191
214
|
transform: scale(0.8);
|
|
192
215
|
}
|
|
193
216
|
|
|
194
|
-
&:checked
|
|
217
|
+
&:checked::before {
|
|
195
218
|
transform: scale(1);
|
|
196
219
|
}
|
|
197
220
|
|
|
@@ -200,7 +223,7 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
200
223
|
background-color: var(--cp-background-disabled);
|
|
201
224
|
}
|
|
202
225
|
|
|
203
|
-
&:checked:disabled
|
|
226
|
+
&:checked:disabled::before {
|
|
204
227
|
background-color: var(--cp-foreground-disabled);
|
|
205
228
|
}
|
|
206
229
|
|
|
@@ -209,54 +232,25 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
209
232
|
color: var(--cp-foreground-disabled);
|
|
210
233
|
}
|
|
211
234
|
}
|
|
212
|
-
|
|
213
|
-
&__label,
|
|
214
|
-
&__description {
|
|
215
|
-
line-height: 1.3;
|
|
216
|
-
text-transform: capitalize;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
&__label,
|
|
220
|
-
&__additionalData {
|
|
221
|
-
font-weight: 500;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
&__description,
|
|
225
|
-
&__additionalData {
|
|
226
|
-
color: var(--cp-text-secondary);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
&__label {
|
|
230
|
-
white-space: nowrap;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&__description:empty {
|
|
234
|
-
display: none;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
&__additionalData:empty {
|
|
238
|
-
display: none;
|
|
239
|
-
}
|
|
240
235
|
}
|
|
241
236
|
|
|
242
237
|
@media (min-width: 768px) {
|
|
243
238
|
.cpRadio {
|
|
244
239
|
display: grid;
|
|
240
|
+
gap: var(--cp-spacing-lg) var(--cp-spacing-lg);
|
|
245
241
|
grid-template-columns: min-content max-content minmax(0, 1fr) auto;
|
|
246
|
-
column-gap: var(--cp-spacing-lg);
|
|
247
|
-
row-gap: var(--cp-spacing-lg);
|
|
248
242
|
}
|
|
249
243
|
|
|
250
244
|
.cpRadio__item {
|
|
245
|
+
grid-column: 1 / -1;
|
|
251
246
|
grid-template-columns: subgrid;
|
|
252
247
|
grid-template-rows: auto;
|
|
253
|
-
grid-column: 1 / -1;
|
|
254
248
|
row-gap: 0;
|
|
255
249
|
|
|
256
250
|
input {
|
|
251
|
+
align-self: center;
|
|
257
252
|
grid-column: auto;
|
|
258
253
|
grid-row: auto;
|
|
259
|
-
align-self: center;
|
|
260
254
|
}
|
|
261
255
|
|
|
262
256
|
.cpRadio__label {
|
|
@@ -265,16 +259,16 @@ const computedClasses = computed(() => `cpRadio--is${capitalizeFirstLetter(props
|
|
|
265
259
|
}
|
|
266
260
|
|
|
267
261
|
.cpRadio__description {
|
|
262
|
+
min-width: 0;
|
|
268
263
|
grid-column: auto;
|
|
269
264
|
grid-row: auto;
|
|
270
|
-
min-width: 0;
|
|
271
265
|
}
|
|
272
266
|
|
|
273
267
|
.cpRadio__additionalData {
|
|
268
|
+
margin-left: var(--cp-spacing-xl);
|
|
274
269
|
grid-column: auto;
|
|
275
270
|
grid-row: auto;
|
|
276
271
|
text-align: right;
|
|
277
|
-
margin-left: var(--cp-spacing-xl);
|
|
278
272
|
}
|
|
279
273
|
}
|
|
280
274
|
}
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
20
|
import { computed, provide, reactive, toRef, useId } from 'vue'
|
|
21
21
|
|
|
22
|
-
import CpRadioNew, { type RadioOption } from './CpRadioNew.vue'
|
|
23
22
|
import { capitalizeFirstLetter } from '@/helpers'
|
|
23
|
+
import CpRadioNew, { type RadioOption } from './CpRadioNew.vue'
|
|
24
24
|
|
|
25
25
|
interface Props {
|
|
26
26
|
autofocus?: boolean
|
|
@@ -83,9 +83,9 @@ provide(
|
|
|
83
83
|
<style lang="scss">
|
|
84
84
|
.cpRadioGroup {
|
|
85
85
|
display: flex;
|
|
86
|
-
gap: var(--cp-spacing-md);
|
|
87
|
-
flex-direction: column;
|
|
88
86
|
width: 100%;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: var(--cp-spacing-md);
|
|
89
89
|
|
|
90
90
|
&__options {
|
|
91
91
|
display: flex;
|
|
@@ -94,16 +94,15 @@ provide(
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
&--isHorizontal .cpRadioGroup__options {
|
|
97
|
-
flex-
|
|
98
|
-
gap: var(--cp-spacing-2xl);
|
|
99
|
-
flex-wrap: wrap;
|
|
97
|
+
flex-flow: row wrap;
|
|
100
98
|
align-items: flex-start;
|
|
99
|
+
gap: var(--cp-spacing-2xl);
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
&__header {
|
|
104
103
|
display: flex;
|
|
105
104
|
flex-direction: column;
|
|
106
|
-
font-family:
|
|
105
|
+
font-family: Figtree, sans-serif;
|
|
107
106
|
font-size: var(--cp-text-size-sm);
|
|
108
107
|
line-height: var(--cp-line-height-sm);
|
|
109
108
|
}
|
|
@@ -114,16 +113,16 @@ provide(
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
&__label {
|
|
117
|
-
font-weight: 500;
|
|
118
|
-
color: var(--cp-text-primary);
|
|
119
116
|
display: flex;
|
|
120
|
-
gap: var(--cp-spacing-sm);
|
|
121
117
|
align-items: baseline;
|
|
118
|
+
color: var(--cp-text-primary);
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
gap: var(--cp-spacing-sm);
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
&__helperText {
|
|
125
|
-
font-weight: 400;
|
|
126
124
|
color: var(--cp-text-secondary);
|
|
125
|
+
font-weight: 400;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
&__required {
|
|
@@ -133,8 +132,8 @@ provide(
|
|
|
133
132
|
|
|
134
133
|
&__optional {
|
|
135
134
|
color: var(--cp-text-secondary);
|
|
136
|
-
font-weight: 400;
|
|
137
135
|
font-size: var(--cp-text-size-xs);
|
|
136
|
+
font-weight: 400;
|
|
138
137
|
line-height: var(--cp-line-height-xs);
|
|
139
138
|
}
|
|
140
139
|
|