@propelinc/citrus-ui 1.3.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/citrus-ui.cdn.css +1 -1
- package/dist/citrus-ui.css +1 -1
- package/dist/colors/colors.d.ts +12 -0
- package/dist/components/CBadge.vue.d.ts +0 -1
- package/dist/components/CCard.vue.d.ts +0 -5
- package/dist/components/CIconButton.vue.d.ts +0 -6
- package/dist/components/CMaskedTextField.vue.d.ts +23 -60
- package/dist/components/CPhoneField.vue.d.ts +40 -92
- package/dist/components/CProgressRing.vue.d.ts +0 -1
- package/dist/components/CSelect.vue.d.ts +0 -4
- package/dist/components/CSkeleton.vue.d.ts +5 -1
- package/dist/components/CSkeletonLoaderCard.vue.d.ts +3 -0
- package/dist/components/CSplitInput.vue.d.ts +1 -5
- package/dist/components/CSsnField.vue.d.ts +41 -95
- package/dist/components/CSwitchListItem.vue.d.ts +1 -4
- package/dist/components/CTextArea.vue.d.ts +3 -8
- package/dist/components/CTextField.vue.d.ts +6 -14
- package/dist/components/CTextLink.vue.d.ts +0 -3
- package/dist/components/CZipcodeField.vue.d.ts +42 -96
- package/dist/components/index.d.ts +0 -2
- package/dist/composables/colors.d.ts +3 -2
- package/dist/composables/input-mask.d.ts +2 -2
- package/dist/composables/toast.d.ts +1 -0
- package/dist/index.cdn.mjs +4490 -4689
- package/dist/index.cdn.mjs.map +1 -1
- package/dist/index.mjs +1594 -1657
- package/dist/index.mjs.map +1 -1
- package/dist/src/assets/fonts/grenette-regular.woff2 +0 -0
- package/dist/src/assets/fonts/grenette-semibold.woff2 +0 -0
- package/dist/src/assets/fonts/polymath.woff2 +0 -0
- package/dist/styles.css +33 -34
- package/package.json +6 -4
- package/src/colors/colors.ts +44 -0
- package/src/colors/util-classes.ts +4 -0
- package/src/components/CAppBar.vue +3 -3
- package/src/components/CBadge.vue +3 -4
- package/src/components/CBottomSheet.vue +2 -2
- package/src/components/CCard.vue +3 -8
- package/src/components/CIconButton.vue +0 -6
- package/src/components/CLoader.vue +3 -3
- package/src/components/CMaskedTextField.vue +4 -9
- package/src/components/CNotification.vue +1 -0
- package/src/components/CProgressRing.vue +3 -4
- package/src/components/CSelect.vue +0 -4
- package/src/components/CSkeleton.vue +12 -1
- package/src/components/CSkeletonLoaderCard.vue +4 -1
- package/src/components/CSkeletonLoaderText.vue +3 -3
- package/src/components/CSplitInput.vue +1 -5
- package/src/components/CSquaredIcon.vue +2 -2
- package/src/components/CSsnField.vue +1 -3
- package/src/components/CSwitchListItem.vue +1 -4
- package/src/components/CTextArea.vue +3 -8
- package/src/components/CTextField.vue +3 -11
- package/src/components/CTextLink.vue +0 -3
- package/src/components/CToast.vue +3 -3
- package/src/components/CToastsList.vue +1 -0
- package/src/components/CZipcodeField.vue +2 -4
- package/src/components/index.ts +0 -2
- package/src/composables/colors.ts +12 -4
- package/src/composables/input-mask.ts +4 -4
- package/src/composables/toast.ts +1 -0
- package/src/styles/_core.scss +12 -10
- package/src/styles/_typography.scss +4 -0
- package/src/styles/layer-order.css +1 -0
- package/src/styles/tailwind.css +3 -0
- package/src/styles/variables.scss +15 -14
- package/dist/components/CCol.vue.d.ts +0 -30
- package/dist/components/CRow.vue.d.ts +0 -41
- package/src/components/CCol.vue +0 -54
- package/src/components/CRow.vue +0 -64
|
@@ -24,7 +24,7 @@ import { computed } from 'vue';
|
|
|
24
24
|
|
|
25
25
|
import type { HexColor } from '@propelinc/citrus-ui/src/colors/colors';
|
|
26
26
|
import Colors from '@propelinc/citrus-ui/src/colors/colors';
|
|
27
|
-
import {
|
|
27
|
+
import { usePaletteColor } from '@propelinc/citrus-ui/src/composables/colors';
|
|
28
28
|
|
|
29
29
|
type Size = 'sm' | 'md' | 'lg';
|
|
30
30
|
|
|
@@ -87,8 +87,8 @@ const computedSize = computed((): Size => {
|
|
|
87
87
|
return props.size;
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
const { cssColor: indicatorColorCode } =
|
|
91
|
-
const { cssColor: trackColorCode } =
|
|
90
|
+
const { cssColor: indicatorColorCode } = usePaletteColor(computedColor);
|
|
91
|
+
const { cssColor: trackColorCode } = usePaletteColor(computedTrackColor);
|
|
92
92
|
</script>
|
|
93
93
|
|
|
94
94
|
<style lang="scss" scoped>
|
|
@@ -53,10 +53,10 @@ const props = withDefaults(
|
|
|
53
53
|
counter?: number | null;
|
|
54
54
|
dataTest?: string;
|
|
55
55
|
id?: string;
|
|
56
|
-
label?: string
|
|
56
|
+
label?: string;
|
|
57
57
|
mask: MaskOptions['mask'] | null;
|
|
58
|
-
minlength?: number | string
|
|
59
|
-
maxlength?: number | string
|
|
58
|
+
minlength?: number | string;
|
|
59
|
+
maxlength?: number | string;
|
|
60
60
|
placeholder?: string;
|
|
61
61
|
rules?: Rules<string>;
|
|
62
62
|
tokens?: MaskTokens | null;
|
|
@@ -66,11 +66,6 @@ const props = withDefaults(
|
|
|
66
66
|
{
|
|
67
67
|
counter: null,
|
|
68
68
|
dataTest: 'masked-text-field',
|
|
69
|
-
id: undefined,
|
|
70
|
-
label: null,
|
|
71
|
-
minlength: null,
|
|
72
|
-
maxlength: null,
|
|
73
|
-
placeholder: undefined,
|
|
74
69
|
rules: () => [],
|
|
75
70
|
tokens: null,
|
|
76
71
|
unmaskRules: true,
|
|
@@ -96,7 +91,7 @@ defineSlots<{
|
|
|
96
91
|
'message'?: () => VNode[];
|
|
97
92
|
}>();
|
|
98
93
|
|
|
99
|
-
const {
|
|
94
|
+
const { maxlength, minlength, value } = toRefs(props);
|
|
100
95
|
|
|
101
96
|
const textField = ref<InstanceType<typeof CTextField> | null>(null);
|
|
102
97
|
const input = computed(() => textField.value?.input ?? null);
|
|
@@ -31,7 +31,7 @@ import type { VNode } from 'vue';
|
|
|
31
31
|
|
|
32
32
|
import type Colors from '@propelinc/citrus-ui/src/colors/colors';
|
|
33
33
|
import type { HexColor } from '@propelinc/citrus-ui/src/colors/colors';
|
|
34
|
-
import {
|
|
34
|
+
import { usePaletteColor } from '@propelinc/citrus-ui/src/composables/colors';
|
|
35
35
|
|
|
36
36
|
const props = withDefaults(
|
|
37
37
|
defineProps<{
|
|
@@ -53,7 +53,6 @@ const props = withDefaults(
|
|
|
53
53
|
trackColor?: HexColor | keyof typeof Colors;
|
|
54
54
|
}>(),
|
|
55
55
|
{
|
|
56
|
-
accessibleText: undefined,
|
|
57
56
|
dataTest: 'c-progress-ring',
|
|
58
57
|
value: 0,
|
|
59
58
|
valueMax: 100,
|
|
@@ -68,8 +67,8 @@ defineSlots<{
|
|
|
68
67
|
default?: () => VNode[];
|
|
69
68
|
}>();
|
|
70
69
|
|
|
71
|
-
const { cssColor } =
|
|
72
|
-
const { cssColor: trackCssColor } =
|
|
70
|
+
const { cssColor } = usePaletteColor(() => props.color);
|
|
71
|
+
const { cssColor: trackCssColor } = usePaletteColor(() => props.trackColor);
|
|
73
72
|
|
|
74
73
|
const percentage = computed(() => (100 * Number(props.value)) / Number(props.valueMax));
|
|
75
74
|
</script>
|
|
@@ -120,16 +120,12 @@ const props = withDefaults(
|
|
|
120
120
|
value?: string;
|
|
121
121
|
}>(),
|
|
122
122
|
{
|
|
123
|
-
ariaLabel: undefined,
|
|
124
123
|
dataTest: 'select',
|
|
125
124
|
disabled: false,
|
|
126
125
|
hideDetails: false,
|
|
127
126
|
hideLabel: false,
|
|
128
|
-
id: undefined,
|
|
129
127
|
items: () => [],
|
|
130
|
-
label: undefined,
|
|
131
128
|
loading: false,
|
|
132
|
-
placeholder: undefined,
|
|
133
129
|
required: false,
|
|
134
130
|
rules: () => [],
|
|
135
131
|
value: '',
|
|
@@ -21,10 +21,17 @@
|
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<div class="c-skeleton" data-test="skeleton">
|
|
24
|
-
<div class="c-skeleton__indicator" />
|
|
24
|
+
<div class="c-skeleton__indicator" :class="{ 'c-skeleton__indicator--squared': squared }" />
|
|
25
25
|
</div>
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
defineProps<{
|
|
30
|
+
/** Toggles a squared-off card style intended to fill the width of the page */
|
|
31
|
+
squared?: boolean;
|
|
32
|
+
}>();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
28
35
|
<style lang="scss" scoped>
|
|
29
36
|
@import '@propelinc/citrus-ui/src/styles/core';
|
|
30
37
|
|
|
@@ -51,6 +58,10 @@
|
|
|
51
58
|
background-size: 400% 100%;
|
|
52
59
|
border-radius: $border-radius-next;
|
|
53
60
|
flex: 1 1 auto;
|
|
61
|
+
|
|
62
|
+
&--squared {
|
|
63
|
+
border-radius: 0;
|
|
64
|
+
}
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
@keyframes sheen {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
data-test="skeleton-loader-card"
|
|
5
5
|
:style="{ height: `${height}px` }"
|
|
6
6
|
>
|
|
7
|
-
<CSkeleton />
|
|
7
|
+
<CSkeleton :squared="tile" />
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -15,9 +15,12 @@ withDefaults(
|
|
|
15
15
|
defineProps<{
|
|
16
16
|
/** Controls the height of the skeleton loader card */
|
|
17
17
|
height?: number | string;
|
|
18
|
+
/** Toggles a squared-off card style intended to fill the width of the page */
|
|
19
|
+
tile?: boolean;
|
|
18
20
|
}>(),
|
|
19
21
|
{
|
|
20
22
|
height: 100,
|
|
23
|
+
tile: false,
|
|
21
24
|
}
|
|
22
25
|
);
|
|
23
26
|
</script>
|
|
@@ -81,13 +81,13 @@ const lineTypeClass = computed(() => {
|
|
|
81
81
|
// NOTE(mohan): This ensures that the skeleton loader text is exactly the same size as the text it
|
|
82
82
|
// is replacing including the extra space around the text itself added by the line height.
|
|
83
83
|
@mixin skeleton-loader-text-sizing($font-style) {
|
|
84
|
-
font-size: map
|
|
85
|
-
line-height: map
|
|
84
|
+
font-size: map.get($font-style, 'size');
|
|
85
|
+
line-height: map.get($font-style, 'line-height');
|
|
86
86
|
|
|
87
87
|
// By applying a height equal to the font size, the skeleton takes up the space of the text,
|
|
88
88
|
// leaving whitespace between each row
|
|
89
89
|
.c-skeleton-loader-text__line__skeleton {
|
|
90
|
-
height: map
|
|
90
|
+
height: map.get($font-style, 'size');
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -46,7 +46,7 @@ const props = withDefaults(
|
|
|
46
46
|
/** A hint to show the appropriate virtual keyboard, e.g. "numeric". */
|
|
47
47
|
inputmode?: HTMLAttributes['inputmode'];
|
|
48
48
|
/** The input's label */
|
|
49
|
-
label?: string
|
|
49
|
+
label?: string;
|
|
50
50
|
/** The input's name */
|
|
51
51
|
name?: string;
|
|
52
52
|
/** Validation rules */
|
|
@@ -57,12 +57,8 @@ const props = withDefaults(
|
|
|
57
57
|
value?: string;
|
|
58
58
|
}>(),
|
|
59
59
|
{
|
|
60
|
-
autocomplete: undefined,
|
|
61
60
|
dataTest: 'split-input',
|
|
62
61
|
disabled: false,
|
|
63
|
-
inputmode: undefined,
|
|
64
|
-
label: null,
|
|
65
|
-
name: undefined,
|
|
66
62
|
rules: () => [],
|
|
67
63
|
type: 'text',
|
|
68
64
|
value: '',
|
|
@@ -19,7 +19,7 @@ import { FontAwesomeIcon as FontAwesomeIconComponent } from '@fortawesome/vue-fo
|
|
|
19
19
|
import type { Component, VNode } from 'vue';
|
|
20
20
|
import { computed, onMounted } from 'vue';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { usePaletteColor } from '@propelinc/citrus-ui/src/composables/colors';
|
|
23
23
|
import type { FaIconArray } from '@propelinc/citrus-ui/src/types/font-awesome';
|
|
24
24
|
|
|
25
25
|
// FontAwesomeIcon's prop types produce a union too complex for TypeScript to resolve
|
|
@@ -57,7 +57,7 @@ onMounted(() => {
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
const { cssColor } =
|
|
60
|
+
const { cssColor } = usePaletteColor(() => props.color);
|
|
61
61
|
|
|
62
62
|
const useWhiteIcon = computed(() => props.color === 'black');
|
|
63
63
|
</script>
|
|
@@ -50,15 +50,13 @@ const props = withDefaults(
|
|
|
50
50
|
defineProps<{
|
|
51
51
|
dataTest?: string;
|
|
52
52
|
id?: string;
|
|
53
|
-
label?: string
|
|
53
|
+
label?: string;
|
|
54
54
|
rules?: Rules<string>;
|
|
55
55
|
value?: string;
|
|
56
56
|
fourDigitSsn?: boolean;
|
|
57
57
|
}>(),
|
|
58
58
|
{
|
|
59
59
|
dataTest: 'ssn-field',
|
|
60
|
-
id: undefined,
|
|
61
|
-
label: null,
|
|
62
60
|
rules: (): Rules<string> => [],
|
|
63
61
|
value: '',
|
|
64
62
|
fourDigitSsn: false,
|
|
@@ -49,7 +49,7 @@ withDefaults(
|
|
|
49
49
|
/** Prevents the user from interacting with the switch */
|
|
50
50
|
disabled?: boolean;
|
|
51
51
|
/** Font Awesome icon to render on the left side of the component */
|
|
52
|
-
icon?: string | string[] | IconDefinition
|
|
52
|
+
icon?: string | string[] | IconDefinition;
|
|
53
53
|
/** Color of the icon background */
|
|
54
54
|
iconColor?: string;
|
|
55
55
|
/** Plain body copy. Overridden by the default slot. */
|
|
@@ -62,10 +62,7 @@ withDefaults(
|
|
|
62
62
|
{
|
|
63
63
|
align: 'center',
|
|
64
64
|
disabled: false,
|
|
65
|
-
icon: null,
|
|
66
65
|
iconColor: 'gray-100',
|
|
67
|
-
label: undefined,
|
|
68
|
-
title: undefined,
|
|
69
66
|
value: false,
|
|
70
67
|
}
|
|
71
68
|
);
|
|
@@ -91,7 +91,7 @@ const props = withDefaults(
|
|
|
91
91
|
* Overrides the default validation message. If provided, this error message will always
|
|
92
92
|
* be shown, regardless of any other failing validation rules.
|
|
93
93
|
*/
|
|
94
|
-
errorMessage?: string
|
|
94
|
+
errorMessage?: string;
|
|
95
95
|
/** Hides the label and instead labels the field with `aria-label` */
|
|
96
96
|
hideLabel?: boolean;
|
|
97
97
|
/**
|
|
@@ -100,9 +100,9 @@ const props = withDefaults(
|
|
|
100
100
|
*/
|
|
101
101
|
hideDetails?: boolean | 'auto';
|
|
102
102
|
/** The textarea element's id */
|
|
103
|
-
id?: string
|
|
103
|
+
id?: string;
|
|
104
104
|
/** The textarea's label, both visual and screenreader-only */
|
|
105
|
-
label?: string
|
|
105
|
+
label?: string;
|
|
106
106
|
/** Sets the maxlength attribute of the textarea */
|
|
107
107
|
maxlength?: number;
|
|
108
108
|
/** The textarea's placeholder */
|
|
@@ -124,13 +124,8 @@ const props = withDefaults(
|
|
|
124
124
|
counterValue: null,
|
|
125
125
|
dataTest: 'text-area',
|
|
126
126
|
disabled: false,
|
|
127
|
-
errorMessage: null,
|
|
128
127
|
hideDetails: false,
|
|
129
128
|
hideLabel: false,
|
|
130
|
-
id: null,
|
|
131
|
-
label: null,
|
|
132
|
-
maxlength: undefined,
|
|
133
|
-
placeholder: '',
|
|
134
129
|
required: false,
|
|
135
130
|
rules: () => [],
|
|
136
131
|
value: '',
|
|
@@ -158,9 +158,9 @@ defineOptions({ inheritAttrs: false });
|
|
|
158
158
|
|
|
159
159
|
const props = withDefaults(
|
|
160
160
|
defineProps<{
|
|
161
|
-
id?: string
|
|
162
|
-
label?: string
|
|
163
|
-
ariaLabel?: string
|
|
161
|
+
id?: string;
|
|
162
|
+
label?: string;
|
|
163
|
+
ariaLabel?: string;
|
|
164
164
|
placeholder?: string;
|
|
165
165
|
type?:
|
|
166
166
|
| 'text'
|
|
@@ -195,16 +195,9 @@ const props = withDefaults(
|
|
|
195
195
|
errorMessage?: string;
|
|
196
196
|
}>(),
|
|
197
197
|
{
|
|
198
|
-
id: null,
|
|
199
|
-
label: null,
|
|
200
|
-
ariaLabel: null,
|
|
201
|
-
placeholder: '',
|
|
202
198
|
type: 'text',
|
|
203
199
|
clearable: false,
|
|
204
200
|
size: 'medium',
|
|
205
|
-
inputmode: undefined,
|
|
206
|
-
minlength: undefined,
|
|
207
|
-
maxlength: undefined,
|
|
208
201
|
disabled: false,
|
|
209
202
|
hideable: false,
|
|
210
203
|
hideLabel: false,
|
|
@@ -216,7 +209,6 @@ const props = withDefaults(
|
|
|
216
209
|
rules: () => [],
|
|
217
210
|
validateOnBlur: true,
|
|
218
211
|
required: false,
|
|
219
|
-
errorMessage: undefined,
|
|
220
212
|
}
|
|
221
213
|
);
|
|
222
214
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:duration="duration"
|
|
11
11
|
:style="{ '--toast-base-transform': transform }"
|
|
12
12
|
@sl-hide="onHide"
|
|
13
|
-
@sl-after-hide="
|
|
13
|
+
@sl-after-hide="onAfterHide"
|
|
14
14
|
>
|
|
15
15
|
<div class="flex-grow-1 d-flex flex-row align-center gap-4">
|
|
16
16
|
<slot name="icon">
|
|
@@ -138,7 +138,6 @@ const show = async (): Promise<void> => {
|
|
|
138
138
|
const onHide = (): void => {
|
|
139
139
|
isOpen.value = false;
|
|
140
140
|
emit('input', false);
|
|
141
|
-
emit('hide');
|
|
142
141
|
};
|
|
143
142
|
|
|
144
143
|
const close = async (): Promise<void> => {
|
|
@@ -175,8 +174,9 @@ const icon = computed(() => {
|
|
|
175
174
|
const alertHideAnimation = ref<ElementAnimation | 'default'>('default');
|
|
176
175
|
useShoelaceAnimation(alert, 'alert.hide', alertHideAnimation);
|
|
177
176
|
|
|
178
|
-
const
|
|
177
|
+
const onAfterHide = (): void => {
|
|
179
178
|
alertHideAnimation.value = 'default';
|
|
179
|
+
emit('hide');
|
|
180
180
|
};
|
|
181
181
|
|
|
182
182
|
const { base } = useShoelaceShadowParts(alert, ['base']);
|
|
@@ -43,16 +43,14 @@ const props = withDefaults(
|
|
|
43
43
|
defineProps<{
|
|
44
44
|
dataTest?: string;
|
|
45
45
|
id?: string;
|
|
46
|
-
label?: string
|
|
47
|
-
placeholder?: string
|
|
46
|
+
label?: string;
|
|
47
|
+
placeholder?: string;
|
|
48
48
|
rules?: Rules<string>;
|
|
49
49
|
value?: string;
|
|
50
50
|
}>(),
|
|
51
51
|
{
|
|
52
52
|
dataTest: 'zipcode-field',
|
|
53
53
|
id: undefined,
|
|
54
|
-
label: null,
|
|
55
|
-
placeholder: null,
|
|
56
54
|
rules: (): Rules<string> => [],
|
|
57
55
|
value: '',
|
|
58
56
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ export { default as CCardFooter } from '@propelinc/citrus-ui/src/components/CCar
|
|
|
9
9
|
export { default as CCardHeader } from '@propelinc/citrus-ui/src/components/CCardHeader.vue';
|
|
10
10
|
export { default as CCardSection } from '@propelinc/citrus-ui/src/components/CCardSection.vue';
|
|
11
11
|
export { default as CCheckbox } from '@propelinc/citrus-ui/src/components/CCheckbox.vue';
|
|
12
|
-
export { default as CCol } from '@propelinc/citrus-ui/src/components/CCol.vue';
|
|
13
12
|
export { default as CDivider } from '@propelinc/citrus-ui/src/components/CDivider.vue';
|
|
14
13
|
export { default as CDobField } from '@propelinc/citrus-ui/src/components/CDobField.vue';
|
|
15
14
|
export { default as CDobSelect } from '@propelinc/citrus-ui/src/components/CDobSelect.vue';
|
|
@@ -41,7 +40,6 @@ export { default as CProgressRing } from '@propelinc/citrus-ui/src/components/CP
|
|
|
41
40
|
export { default as CRadio } from '@propelinc/citrus-ui/src/components/CRadio.vue';
|
|
42
41
|
export { default as CRadioGroup } from '@propelinc/citrus-ui/src/components/CRadioGroup.vue';
|
|
43
42
|
export { default as CRebrand } from '@propelinc/citrus-ui/src/components/CRebrand.vue';
|
|
44
|
-
export { default as CRow } from '@propelinc/citrus-ui/src/components/CRow.vue';
|
|
45
43
|
export { default as CSafeArea } from '@propelinc/citrus-ui/src/components/CSafeArea.vue';
|
|
46
44
|
export { default as CSectionHeader } from '@propelinc/citrus-ui/src/components/CSectionHeader.vue';
|
|
47
45
|
export { default as CSelect } from '@propelinc/citrus-ui/src/components/CSelect.vue';
|
|
@@ -3,20 +3,23 @@ import { computed, toValue } from 'vue';
|
|
|
3
3
|
|
|
4
4
|
import Colors, {
|
|
5
5
|
type CssColor,
|
|
6
|
+
type RgbaColor,
|
|
6
7
|
isColorKey,
|
|
7
8
|
isCssColor,
|
|
9
|
+
isPaletteRgba,
|
|
8
10
|
} from '@propelinc/citrus-ui/src/colors/colors';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Maps from a color name or hex code to its corresponding CSS color value.
|
|
12
14
|
* Gray neutrals resolve to rgba(); other palette colors are hex.
|
|
15
|
+
* Can also accept a palette color converted to rgba for transparency via `withAlpha`.
|
|
13
16
|
*
|
|
14
17
|
* @param name - The color to resolve. Can be in kebab case, SCREAMING_SNAKE_CASE, or a hex code from the palette.
|
|
15
18
|
* @returns The CSS color value (hex or rgba) and whether the color is valid.
|
|
16
19
|
*/
|
|
17
|
-
export function
|
|
20
|
+
export function usePaletteColor(name: MaybeRefOrGetter<string | undefined>): {
|
|
18
21
|
cssColor: Ref<CssColor | undefined>;
|
|
19
|
-
|
|
22
|
+
isPaletteColor: Ref<boolean>;
|
|
20
23
|
} {
|
|
21
24
|
const normalizedColor = computed(() =>
|
|
22
25
|
isCssColor(toValue(name)) ? (toValue(name)?.toLowerCase() as CssColor) : undefined
|
|
@@ -48,12 +51,17 @@ export function useCssColor(name: MaybeRefOrGetter<string | undefined>): {
|
|
|
48
51
|
return normalizedColor.value;
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
// If we're given a palette rgba (transparent variant via withAlpha), return it as-is
|
|
55
|
+
if (isPaletteRgba(toValue(name))) {
|
|
56
|
+
return toValue(name) as RgbaColor;
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
return undefined;
|
|
52
60
|
});
|
|
53
61
|
|
|
54
|
-
const
|
|
62
|
+
const isPaletteColor = computed(() => {
|
|
55
63
|
return cssColor.value !== undefined;
|
|
56
64
|
});
|
|
57
65
|
|
|
58
|
-
return { cssColor,
|
|
66
|
+
return { cssColor, isPaletteColor };
|
|
59
67
|
}
|
|
@@ -3,8 +3,8 @@ import { type Ref, computed, watch } from 'vue';
|
|
|
3
3
|
|
|
4
4
|
import { useInternalValue } from '@propelinc/citrus-ui/src/composables/binding';
|
|
5
5
|
|
|
6
|
-
const toNumber = (value: number | string | null): number | null => {
|
|
7
|
-
if (value === null || value === '') {
|
|
6
|
+
const toNumber = (value: number | string | null | undefined): number | null => {
|
|
7
|
+
if (value === null || value === undefined || value === '') {
|
|
8
8
|
return null;
|
|
9
9
|
} else if (typeof value === 'number') {
|
|
10
10
|
return value;
|
|
@@ -68,7 +68,7 @@ export function useInputMask(
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export function useMaskedMinLength(
|
|
71
|
-
minlength: Ref<number | string |
|
|
71
|
+
minlength: Ref<number | string | undefined>,
|
|
72
72
|
value: Ref<string>,
|
|
73
73
|
options: Ref<MaskOptions>
|
|
74
74
|
): Ref<number | null> {
|
|
@@ -122,7 +122,7 @@ export function useMaskedMinLength(
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
export function useMaskedMaxLength(
|
|
125
|
-
maxlength: Ref<number | string |
|
|
125
|
+
maxlength: Ref<number | string | undefined>,
|
|
126
126
|
options: Ref<MaskOptions>
|
|
127
127
|
): Ref<number | null> {
|
|
128
128
|
return computed(() => {
|
package/src/composables/toast.ts
CHANGED
package/src/styles/_core.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
1
3
|
// ****************************************************************************
|
|
2
4
|
// This file contains our Citrus-specific Sass variables. These are intended to
|
|
3
5
|
// be used to style Citrus and imported into stylesheets in freshebt-vue
|
|
@@ -185,7 +187,7 @@ $large-headline: (
|
|
|
185
187
|
'font-family': var(--font-family-headline, #{$font-family-base}),
|
|
186
188
|
'size': $font-size-2x-large,
|
|
187
189
|
'weight': $font-weight-semibold,
|
|
188
|
-
'line-height': $line-height-
|
|
190
|
+
'line-height': $line-height-medium,
|
|
189
191
|
'letter-spacing': $letter-spacing-tighten-medium,
|
|
190
192
|
);
|
|
191
193
|
|
|
@@ -211,14 +213,14 @@ $body: (
|
|
|
211
213
|
'letter-spacing': $letter-spacing-extend-small,
|
|
212
214
|
);
|
|
213
215
|
|
|
214
|
-
$body-emphasized: map
|
|
216
|
+
$body-emphasized: map.merge(
|
|
215
217
|
$body,
|
|
216
218
|
(
|
|
217
219
|
'weight': $font-weight-emphasized,
|
|
218
220
|
)
|
|
219
221
|
);
|
|
220
222
|
|
|
221
|
-
$statement: map
|
|
223
|
+
$statement: map.merge(
|
|
222
224
|
$body,
|
|
223
225
|
(
|
|
224
226
|
'line-height': 100%,
|
|
@@ -239,7 +241,7 @@ $caption-small: (
|
|
|
239
241
|
'letter-spacing': $letter-spacing-extend-small,
|
|
240
242
|
);
|
|
241
243
|
|
|
242
|
-
$caption-emphasized: map
|
|
244
|
+
$caption-emphasized: map.merge(
|
|
243
245
|
$caption,
|
|
244
246
|
(
|
|
245
247
|
'weight': $font-weight-emphasized,
|
|
@@ -262,12 +264,12 @@ $eyebrow: (
|
|
|
262
264
|
);
|
|
263
265
|
|
|
264
266
|
@mixin create-type-mixin($type-style) {
|
|
265
|
-
font-family: map
|
|
266
|
-
font-size: map
|
|
267
|
-
font-weight: map
|
|
268
|
-
letter-spacing: map
|
|
269
|
-
line-height: map
|
|
270
|
-
text-transform: map
|
|
267
|
+
font-family: map.get($type-style, 'font-family');
|
|
268
|
+
font-size: map.get($type-style, 'size');
|
|
269
|
+
font-weight: map.get($type-style, 'weight');
|
|
270
|
+
letter-spacing: map.get($type-style, 'letter-spacing');
|
|
271
|
+
line-height: map.get($type-style, 'line-height');
|
|
272
|
+
text-transform: map.get($type-style, 'text-transform');
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
@mixin balance {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer reset, base, components, utilities;
|