tide-design-system 2.2.9 → 2.2.11
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/.storybook/main.ts +1 -0
- package/dist/IconArrowUp-75edebad.js +16 -0
- package/dist/IconArrowUp-c0afd43d.cjs +2 -0
- package/dist/IconAssignment-7171d067.cjs +2 -0
- package/dist/IconAssignment-b1d2ffa2.js +16 -0
- package/dist/IconClear-4db1f7d4.cjs +2 -0
- package/dist/IconClear-5cf9e8be.js +16 -0
- package/dist/IconFacebook-a83c1949.cjs +2 -0
- package/dist/IconFacebook-fb3f93e3.js +16 -0
- package/dist/IconInstagram-9f642623.cjs +2 -0
- package/dist/IconInstagram-db345e15.js +16 -0
- package/dist/IconLayout-6963184f.js +16 -0
- package/dist/IconLayout-d0d278c5.cjs +2 -0
- package/dist/IconLinkedIn-2fa1ac20.cjs +2 -0
- package/dist/IconLinkedIn-9c4740a6.js +16 -0
- package/dist/IconStarFilled-9f4d0d62.cjs +2 -0
- package/dist/IconStarFilled-b73e12dc.js +16 -0
- package/dist/IconStarHalf-0b663cd6.js +16 -0
- package/dist/IconStarHalf-65db4ff6.cjs +2 -0
- package/dist/css/dynamic-utilities.css +31 -30
- package/dist/css/realm/aero.css +8 -20
- package/dist/css/realm/atv.css +8 -20
- package/dist/css/realm/boatmart.css +7 -19
- package/dist/css/realm/cycle.css +8 -20
- package/dist/css/realm/equipment.css +7 -19
- package/dist/css/realm/pwc.css +7 -19
- package/dist/css/realm/rv.css +7 -19
- package/dist/css/realm/snow.css +7 -19
- package/dist/css/realm/truck.css +8 -20
- package/dist/css/utilities-lg.css +46 -1
- package/dist/css/utilities-md.css +46 -1
- package/dist/css/utilities-sm.css +46 -1
- package/dist/css/utilities-xl.css +46 -1
- package/dist/css/utilities.css +46 -1
- package/dist/css/variables.css +106 -14
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +117 -5
- package/dist/tide-design-system.esm.js +1403 -1174
- package/index.ts +8 -2
- package/package.json +1 -1
- package/src/assets/css/dynamic-utilities.css +31 -30
- package/src/assets/css/realm/aero.css +8 -20
- package/src/assets/css/realm/atv.css +8 -20
- package/src/assets/css/realm/boatmart.css +7 -19
- package/src/assets/css/realm/cycle.css +8 -20
- package/src/assets/css/realm/equipment.css +7 -19
- package/src/assets/css/realm/pwc.css +7 -19
- package/src/assets/css/realm/rv.css +7 -19
- package/src/assets/css/realm/snow.css +7 -19
- package/src/assets/css/realm/truck.css +8 -20
- package/src/assets/css/utilities-lg.css +46 -1
- package/src/assets/css/utilities-md.css +46 -1
- package/src/assets/css/utilities-sm.css +46 -1
- package/src/assets/css/utilities-xl.css +46 -1
- package/src/assets/css/utilities.css +46 -1
- package/src/assets/css/variables.css +106 -14
- package/src/assets/svg/icons/IconArrowUp.svg +3 -0
- package/src/assets/svg/icons/IconAssignment.svg +1 -3
- package/src/assets/svg/icons/IconClear.svg +1 -3
- package/src/assets/svg/icons/IconFacebook.svg +1 -3
- package/src/assets/svg/icons/IconInstagram.svg +1 -3
- package/src/assets/svg/icons/IconLayout.svg +1 -3
- package/src/assets/svg/icons/IconLinkedIn.svg +1 -3
- package/src/assets/svg/icons/IconStarFilled.svg +3 -0
- package/src/assets/svg/icons/IconStarHalf.svg +3 -0
- package/src/components/TideBadge.vue +7 -2
- package/src/components/TideBadgeVerifiedVehicle.vue +1 -1
- package/src/components/TideChipAction.vue +10 -3
- package/src/components/TideImage.vue +19 -2
- package/src/components/TideImageBackground.vue +7 -11
- package/src/components/TideModal.vue +2 -2
- package/src/components/TidePopover.vue +4 -1
- package/src/components/TideSheet.vue +166 -0
- package/src/stories/FoundationsBorder.stories.ts +31 -1
- package/src/stories/FoundationsColor.stories.ts +161 -13
- package/src/stories/FoundationsTypography.stories.ts +3 -3
- package/src/stories/TideBadge.stories.ts +51 -1
- package/src/stories/TideCarousel.stories.ts +1 -0
- package/src/stories/TideChipAction.stories.ts +28 -1
- package/src/stories/TideImage.stories.ts +22 -2
- package/src/stories/TideImageBackground.stories.ts +11 -3
- package/src/stories/TideSheet.stories.ts +142 -0
- package/src/types/Badge.ts +65 -0
- package/src/types/Image.ts +7 -0
- package/src/types/Storybook.ts +5 -0
- package/src/types/Styles.ts +46 -2
- package/tests/svg-icons.spec.ts +74 -0
- package/dist/IconAssignment-1983e555.js +0 -16
- package/dist/IconAssignment-915702cc.cjs +0 -2
- package/dist/IconClear-489c5a46.cjs +0 -2
- package/dist/IconClear-9419bf17.js +0 -16
- package/dist/IconFacebook-4658b533.js +0 -16
- package/dist/IconFacebook-9c43095a.cjs +0 -2
- package/dist/IconInstagram-43bb02ea.cjs +0 -2
- package/dist/IconInstagram-57188d29.js +0 -16
- package/dist/IconLayout-2865e0eb.js +0 -16
- package/dist/IconLayout-e663120e.cjs +0 -2
- package/dist/IconLinkedIn-088a3792.cjs +0 -2
- package/dist/IconLinkedIn-f29c217d.js +0 -16
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import TideIcon from '@/components/TideIcon.vue';
|
|
3
|
+
import { ELEMENT } from '@/types/Element';
|
|
3
4
|
import { ICON } from '@/types/Icon';
|
|
4
5
|
import { CSS } from '@/types/Styles';
|
|
5
6
|
import { TARGET } from '@/types/Target';
|
|
6
7
|
|
|
8
|
+
import type { Element } from '@/types/Element';
|
|
9
|
+
|
|
7
10
|
type Props = {
|
|
8
|
-
|
|
11
|
+
element: Element;
|
|
12
|
+
href?: string;
|
|
9
13
|
isNewTab?: boolean;
|
|
10
14
|
label: string;
|
|
11
15
|
};
|
|
12
16
|
|
|
13
17
|
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
element: ELEMENT.LINK,
|
|
19
|
+
href: undefined,
|
|
14
20
|
isNewTab: false,
|
|
15
21
|
});
|
|
16
22
|
</script>
|
|
17
23
|
|
|
18
24
|
<template>
|
|
19
|
-
<
|
|
25
|
+
<component
|
|
20
26
|
:class="[
|
|
21
27
|
'tide-chip-action',
|
|
22
28
|
CSS.DISPLAY.FLEX,
|
|
@@ -33,11 +39,12 @@
|
|
|
33
39
|
]"
|
|
34
40
|
:href="props.href"
|
|
35
41
|
:target="props.isNewTab ? TARGET.BLANK : TARGET.SELF"
|
|
42
|
+
:is="element"
|
|
36
43
|
>
|
|
37
44
|
<TideIcon :icon="ICON.SEARCH" />
|
|
38
45
|
|
|
39
46
|
<span>{{ props.label }}</span>
|
|
40
|
-
</
|
|
47
|
+
</component>
|
|
41
48
|
</template>
|
|
42
49
|
|
|
43
50
|
<style scoped>
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ref } from 'vue';
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
3
|
|
|
4
|
+
import { OBJECT_FIT } from '@/types/Image';
|
|
4
5
|
import { CSS } from '@/types/Styles';
|
|
5
6
|
|
|
7
|
+
import type { ObjectFit } from '@/types/Image';
|
|
6
8
|
import type { Source } from '@/types/Source';
|
|
7
9
|
|
|
8
10
|
type Props = {
|
|
9
11
|
alt: string;
|
|
10
12
|
height?: string;
|
|
11
13
|
isLazy?: boolean;
|
|
14
|
+
objectFit?: ObjectFit;
|
|
12
15
|
sources?: Source[];
|
|
13
16
|
src?: string;
|
|
14
17
|
width?: string;
|
|
@@ -18,6 +21,7 @@
|
|
|
18
21
|
alt: '',
|
|
19
22
|
height: undefined,
|
|
20
23
|
isLazy: true,
|
|
24
|
+
objectFit: OBJECT_FIT.COVER,
|
|
21
25
|
sources: () => [],
|
|
22
26
|
src: undefined,
|
|
23
27
|
width: undefined,
|
|
@@ -28,6 +32,19 @@
|
|
|
28
32
|
|
|
29
33
|
const imageDefault = 'https://cdn-static.tilabs.io/marketplace/common/image-coming-soon.svg';
|
|
30
34
|
|
|
35
|
+
const objectFitClassName = computed<string>(() => {
|
|
36
|
+
switch (props.objectFit) {
|
|
37
|
+
case OBJECT_FIT.CONTAIN:
|
|
38
|
+
return CSS.OBJECT.CONTAIN;
|
|
39
|
+
case OBJECT_FIT.COVER:
|
|
40
|
+
return CSS.OBJECT.COVER;
|
|
41
|
+
case OBJECT_FIT.SCALE_DOWN:
|
|
42
|
+
return CSS.OBJECT.SCALE_DOWN;
|
|
43
|
+
default:
|
|
44
|
+
return OBJECT_FIT.COVER;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
31
48
|
const setImageFromDefault = () => {
|
|
32
49
|
const currentSrc = img.value?.currentSrc;
|
|
33
50
|
const pictureSource = picture.value?.querySelector(`source[srcset="${currentSrc}"]`);
|
|
@@ -62,7 +79,7 @@
|
|
|
62
79
|
|
|
63
80
|
<img
|
|
64
81
|
:alt="alt"
|
|
65
|
-
:class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL, CSS.OBJECT.CENTER,
|
|
82
|
+
:class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL, CSS.OBJECT.CENTER, objectFitClassName]"
|
|
66
83
|
:fetchpriority="isLazy ? undefined : 'high'"
|
|
67
84
|
:loading="props.isLazy ? 'lazy' : 'eager'"
|
|
68
85
|
ref="img"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import TideImage from '@/components/TideImage.vue';
|
|
3
|
+
import { OBJECT_FIT } from '@/types/Image';
|
|
3
4
|
import { CSS } from '@/types/Styles';
|
|
4
5
|
|
|
5
6
|
import type { Source } from '@/types/Source';
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
<template>
|
|
23
|
-
<div :class="[CSS.POSITION.RELATIVE, CSS.OVERFLOW.XY.HIDDEN, CSS.ISOLATION.ISOLATE]">
|
|
24
|
+
<div :class="['tide-image-background', CSS.POSITION.RELATIVE, CSS.OVERFLOW.XY.HIDDEN, CSS.ISOLATION.ISOLATE]">
|
|
24
25
|
<div
|
|
25
26
|
:class="[
|
|
26
27
|
CSS.POSITION.ABSOLUTE,
|
|
@@ -32,11 +33,12 @@
|
|
|
32
33
|
]"
|
|
33
34
|
>
|
|
34
35
|
<TideImage
|
|
35
|
-
:
|
|
36
|
+
:alt="props.alt"
|
|
37
|
+
:class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL]"
|
|
36
38
|
:is-lazy="props.isLazy"
|
|
39
|
+
:object-fit="OBJECT_FIT.COVER"
|
|
37
40
|
:sources="props.sources"
|
|
38
41
|
:src="props.src"
|
|
39
|
-
alt="props.alt"
|
|
40
42
|
/>
|
|
41
43
|
</div>
|
|
42
44
|
|
|
@@ -44,14 +46,8 @@
|
|
|
44
46
|
</div>
|
|
45
47
|
</template>
|
|
46
48
|
|
|
47
|
-
<style scoped
|
|
48
|
-
.tide-image
|
|
49
|
+
<style scoped>
|
|
50
|
+
:deep(.tide-image) {
|
|
49
51
|
z-index: -1;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
:deep(.tide-image-background img) {
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: 100%;
|
|
55
|
-
object-fit: cover;
|
|
56
|
-
}
|
|
57
53
|
</style>
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
}
|
|
174
174
|
.tide-modal[open]::backdrop {
|
|
175
175
|
background-color: var(--tide-transparent-400);
|
|
176
|
-
backdrop-filter: blur
|
|
176
|
+
backdrop-filter: var(--tide-bg-blur);
|
|
177
177
|
}
|
|
178
178
|
@starting-style {
|
|
179
179
|
.tide-modal[open] {
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
}
|
|
183
183
|
.tide-modal[open]::backdrop {
|
|
184
184
|
background-color: transparent;
|
|
185
|
-
backdrop-filter: blur
|
|
185
|
+
backdrop-filter: var(--tide-bg-blur);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
.tide-modal-body {
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
CSS.SHADOW.BOTTOM,
|
|
143
143
|
]"
|
|
144
144
|
ref="floating"
|
|
145
|
-
:style="{ ...floatingStyles
|
|
145
|
+
:style="{ ...floatingStyles }"
|
|
146
146
|
v-show="isShowPopover"
|
|
147
147
|
>
|
|
148
148
|
<slot />
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
</template>
|
|
153
153
|
|
|
154
154
|
<style scoped>
|
|
155
|
+
.tide-popover {
|
|
156
|
+
max-width: 256px;
|
|
157
|
+
}
|
|
155
158
|
.v-enter-from,
|
|
156
159
|
.v-leave-to {
|
|
157
160
|
opacity: 0;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onBeforeMount, onMounted, ref, watch } from 'vue';
|
|
3
|
+
|
|
4
|
+
import TideButtonIcon from '@/components/TideButtonIcon.vue';
|
|
5
|
+
import { ICON } from '@/types/Icon';
|
|
6
|
+
import { PRIORITY } from '@/types/Priority';
|
|
7
|
+
import { CSS } from '@/types/Styles';
|
|
8
|
+
import { TOP_LAYER_ID, initFauxTopLayer, setScrollLock } from '@/utilities/viewport';
|
|
9
|
+
|
|
10
|
+
import TideDivider from './TideDivider.vue';
|
|
11
|
+
|
|
12
|
+
import type { Ref } from 'vue';
|
|
13
|
+
|
|
14
|
+
type Props = {
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
isBackButton?: boolean;
|
|
17
|
+
};
|
|
18
|
+
const props = defineProps<Props>();
|
|
19
|
+
|
|
20
|
+
type Emits = {
|
|
21
|
+
(e: 'back'): void;
|
|
22
|
+
(e: 'close'): void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits<Emits>();
|
|
26
|
+
|
|
27
|
+
const dialogElement: Ref<HTMLDialogElement | null> = ref(null);
|
|
28
|
+
|
|
29
|
+
const triggerNativeDialogOpen = () => {
|
|
30
|
+
dialogElement.value?.showModal();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const triggerNativeDialogClose = () => {
|
|
34
|
+
dialogElement.value?.close();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
watch(
|
|
38
|
+
() => props.isOpen,
|
|
39
|
+
(newValue) => {
|
|
40
|
+
if (!dialogElement.value) return;
|
|
41
|
+
if (newValue) {
|
|
42
|
+
triggerNativeDialogOpen();
|
|
43
|
+
} else {
|
|
44
|
+
triggerNativeDialogClose();
|
|
45
|
+
}
|
|
46
|
+
setScrollLock(newValue);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
onBeforeMount(() => {
|
|
51
|
+
initFauxTopLayer();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
if (props.isOpen) {
|
|
56
|
+
triggerNativeDialogOpen();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<Teleport :to="`#${TOP_LAYER_ID}`">
|
|
63
|
+
<dialog
|
|
64
|
+
:class="['tide-sheet', CSS.BG.INITIAL, CSS.HEIGHT.FULL, CSS.WIDTH.FULL, CSS.OVERFLOW.XY.HIDDEN]"
|
|
65
|
+
ref="dialogElement"
|
|
66
|
+
@click.self="emit('close')"
|
|
67
|
+
@close="emit('close')"
|
|
68
|
+
>
|
|
69
|
+
<div
|
|
70
|
+
:class="[
|
|
71
|
+
'tide-sheet-body',
|
|
72
|
+
CSS.BG.SURFACE.DEFAULT,
|
|
73
|
+
CSS.DISPLAY.FLEX,
|
|
74
|
+
CSS.FLEX.DIRECTION.COLUMN,
|
|
75
|
+
CSS.HEIGHT.FULL,
|
|
76
|
+
CSS.OVERFLOW.XY.HIDDEN,
|
|
77
|
+
CSS.WIDTH.FULL,
|
|
78
|
+
]"
|
|
79
|
+
>
|
|
80
|
+
<header :class="[CSS.DISPLAY.FLEX, CSS.PADDING.X.ONE, CSS.PADDING.TOP.ONE]">
|
|
81
|
+
<TideButtonIcon
|
|
82
|
+
:class="[CSS.FLEX.GROW.OFF, CSS.FLEX.SHRINK.OFF]"
|
|
83
|
+
:icon="ICON.CHEVRON_LEFT"
|
|
84
|
+
:priority="PRIORITY.QUATERNARY"
|
|
85
|
+
@click="emit('back')"
|
|
86
|
+
v-if="isBackButton"
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<TideButtonIcon
|
|
90
|
+
:class="[CSS.FLEX.GROW.OFF, CSS.FLEX.SHRINK.OFF, CSS.MARGIN.LEFT.AUTO]"
|
|
91
|
+
:icon="ICON.CLOSE"
|
|
92
|
+
:priority="PRIORITY.QUATERNARY"
|
|
93
|
+
@click="triggerNativeDialogClose"
|
|
94
|
+
/>
|
|
95
|
+
</header>
|
|
96
|
+
|
|
97
|
+
<TideDivider />
|
|
98
|
+
|
|
99
|
+
<div
|
|
100
|
+
:class="[
|
|
101
|
+
'tide-sheet-content',
|
|
102
|
+
CSS.DISPLAY.GRID,
|
|
103
|
+
CSS.OVERFLOW.Y.AUTO,
|
|
104
|
+
CSS.OVERFLOW.X.HIDDEN,
|
|
105
|
+
CSS.WIDTH.FULL,
|
|
106
|
+
CSS.PADDING.BOTTOM.ONE,
|
|
107
|
+
]"
|
|
108
|
+
>
|
|
109
|
+
<slot />
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</dialog>
|
|
113
|
+
</Teleport>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<style scoped>
|
|
117
|
+
.tide-sheet {
|
|
118
|
+
--sheet-padding-x: var(--tide-spacing-1);
|
|
119
|
+
max-width: unset;
|
|
120
|
+
max-height: unset;
|
|
121
|
+
justify-items: right;
|
|
122
|
+
display: none;
|
|
123
|
+
transition: all var(--tide-animate) allow-discrete;
|
|
124
|
+
transform: translateX(100%);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.tide-sheet[open] {
|
|
128
|
+
display: grid;
|
|
129
|
+
transform: translateX(0%);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.tide-sheet::backdrop {
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
transition: all var(--tide-animate) allow-discrete;
|
|
135
|
+
backdrop-filter: blur(0px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.tide-sheet[open]::backdrop {
|
|
139
|
+
background-color: var(--tide-transparent-400);
|
|
140
|
+
backdrop-filter: var(--tide-bg-blur);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.tide-sheet-body {
|
|
144
|
+
max-width: min(calc(100vw - var(--tide-spacing-2)), 311px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.tide-sheet-content {
|
|
148
|
+
grid-template-columns: var(--sheet-padding-x) 1fr var(--sheet-padding-x);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:where(.tide-sheet-content):deep(> :where(*)) {
|
|
152
|
+
grid-column: 2;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@starting-style {
|
|
156
|
+
.tide-sheet[open] {
|
|
157
|
+
display: grid;
|
|
158
|
+
transform: translateX(100%);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tide-sheet[open]::backdrop {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
backdrop-filter: var(--tide-bg-blur);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -5,6 +5,7 @@ import type { StoryContext } from '@storybook/vue3';
|
|
|
5
5
|
|
|
6
6
|
const BORDER_RADIUS = prependNoneAsEmpty(STYLES.BORDER_RADIUS);
|
|
7
7
|
const BORDER_SIDE = prependNoneAsEmpty(STYLES.BORDER_SIDE);
|
|
8
|
+
const BORDER_STYLE = prependNoneAsEmpty(STYLES.BORDER_STYLE);
|
|
8
9
|
const BORDER_WIDTH = prependNoneAsEmpty(STYLES.BORDER_WIDTH);
|
|
9
10
|
|
|
10
11
|
const formatArgs = (args: any) => {
|
|
@@ -16,7 +17,7 @@ const formatArgs = (args: any) => {
|
|
|
16
17
|
const formatClassNames = (args: any) => {
|
|
17
18
|
const classNames: string[] = [];
|
|
18
19
|
|
|
19
|
-
if (args.borderSide === BORDER_SIDE.Full && args.borderWidth
|
|
20
|
+
if (args.borderSide === BORDER_SIDE.Full && args.borderWidth && args.borderRadius) {
|
|
20
21
|
classNames.push(args.borderRadius);
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -24,6 +25,10 @@ const formatClassNames = (args: any) => {
|
|
|
24
25
|
classNames.push(`${args.borderSide}-${args.borderWidth}`);
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
if (args.borderSide && args.borderWidth && args.borderStyle) {
|
|
29
|
+
classNames.push(args.borderStyle);
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
return classNames;
|
|
28
33
|
};
|
|
29
34
|
|
|
@@ -74,6 +79,12 @@ export default {
|
|
|
74
79
|
if: { arg: 'borderWidth', neq: BORDER_WIDTH.None },
|
|
75
80
|
name: 'Border Side',
|
|
76
81
|
},
|
|
82
|
+
borderStyle: {
|
|
83
|
+
...formatArgType({ BORDER_STYLE }),
|
|
84
|
+
description: 'Applies a border style',
|
|
85
|
+
if: { arg: 'borderWidth', neq: BORDER_STYLE.None },
|
|
86
|
+
name: 'Border Style',
|
|
87
|
+
},
|
|
77
88
|
borderWidth: {
|
|
78
89
|
...formatArgType({ BORDER_WIDTH }),
|
|
79
90
|
description: 'Applies a border width',
|
|
@@ -83,6 +94,7 @@ export default {
|
|
|
83
94
|
args: {
|
|
84
95
|
borderRadius: BORDER_RADIUS.None,
|
|
85
96
|
borderSide: BORDER_SIDE.None,
|
|
97
|
+
borderStyle: BORDER_STYLE.None,
|
|
86
98
|
borderWidth: BORDER_WIDTH.None,
|
|
87
99
|
},
|
|
88
100
|
parameters,
|
|
@@ -133,6 +145,15 @@ export const BorderFull1px = {
|
|
|
133
145
|
name: 'Border Full 1px',
|
|
134
146
|
};
|
|
135
147
|
|
|
148
|
+
export const BorderFullDashed1px = {
|
|
149
|
+
args: {
|
|
150
|
+
borderSide: BORDER_SIDE.Full,
|
|
151
|
+
borderStyle: BORDER_STYLE.Dashed,
|
|
152
|
+
borderWidth: BORDER_WIDTH['1px'],
|
|
153
|
+
},
|
|
154
|
+
name: 'Border Full Dashed 1px',
|
|
155
|
+
};
|
|
156
|
+
|
|
136
157
|
export const BorderTop2px = {
|
|
137
158
|
args: {
|
|
138
159
|
borderSide: BORDER_SIDE.Top,
|
|
@@ -173,6 +194,15 @@ export const BorderFull2px = {
|
|
|
173
194
|
name: 'Border Full 2px',
|
|
174
195
|
};
|
|
175
196
|
|
|
197
|
+
export const BorderFullDashed2px = {
|
|
198
|
+
args: {
|
|
199
|
+
borderSide: BORDER_SIDE.Full,
|
|
200
|
+
borderStyle: BORDER_STYLE.Dashed,
|
|
201
|
+
borderWidth: BORDER_WIDTH['2px'],
|
|
202
|
+
},
|
|
203
|
+
name: 'Border Full Dashed 1px',
|
|
204
|
+
};
|
|
205
|
+
|
|
176
206
|
export const RadiusQuarter = {
|
|
177
207
|
args: {
|
|
178
208
|
borderRadius: BORDER_RADIUS['0.25 REM'],
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import TideIcon from '@/components/TideIcon.vue';
|
|
1
2
|
import { CSS } from '@/types/Styles';
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
disabledArgType,
|
|
5
|
+
flatten,
|
|
6
|
+
formatArgType,
|
|
7
|
+
getConstantsByValues,
|
|
8
|
+
prependNoneAsEmpty,
|
|
9
|
+
} from '@/utilities/storybook';
|
|
3
10
|
|
|
4
11
|
import type { StoryContext } from '@storybook/vue3';
|
|
5
12
|
|
|
@@ -47,10 +54,11 @@ const parameters = {
|
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
const render = (args: any) => ({
|
|
57
|
+
components: { TideIcon },
|
|
50
58
|
setup() {
|
|
51
59
|
return formatArgs(args);
|
|
52
60
|
},
|
|
53
|
-
template:
|
|
61
|
+
template: `<div class="tide-display-inline-block tide-padding-1" v-bind="args">${args.default}</div>`,
|
|
54
62
|
updated() {
|
|
55
63
|
return formatArgs(args);
|
|
56
64
|
},
|
|
@@ -76,6 +84,7 @@ export default {
|
|
|
76
84
|
type: { summary: 'CSS.BORDER.COLOR' },
|
|
77
85
|
},
|
|
78
86
|
},
|
|
87
|
+
default: disabledArgType,
|
|
79
88
|
fontColor: {
|
|
80
89
|
...formatArgType({ COLOR_FONT }),
|
|
81
90
|
description: 'Applies a font color',
|
|
@@ -89,6 +98,7 @@ export default {
|
|
|
89
98
|
args: {
|
|
90
99
|
backgroundColor: COLOR_BACKGROUND.None,
|
|
91
100
|
borderColor: COLOR_BORDER.None,
|
|
101
|
+
default: 'Demo',
|
|
92
102
|
fontColor: COLOR_FONT.None,
|
|
93
103
|
},
|
|
94
104
|
parameters,
|
|
@@ -102,7 +112,6 @@ export const Default = {};
|
|
|
102
112
|
export const SurfaceAccent = {
|
|
103
113
|
args: {
|
|
104
114
|
backgroundColor: COLOR_BACKGROUND['SURFACE.ACCENT'],
|
|
105
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
106
115
|
},
|
|
107
116
|
};
|
|
108
117
|
|
|
@@ -116,41 +125,180 @@ export const SurfaceBrand = {
|
|
|
116
125
|
export const SurfaceGradient = {
|
|
117
126
|
args: {
|
|
118
127
|
backgroundColor: COLOR_BACKGROUND['SURFACE.GRADIENT'],
|
|
119
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
120
128
|
},
|
|
121
129
|
};
|
|
122
130
|
|
|
123
131
|
export const SurfaceVariant = {
|
|
124
132
|
args: {
|
|
125
133
|
backgroundColor: COLOR_BACKGROUND['SURFACE.VARIANT'],
|
|
126
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
127
134
|
},
|
|
128
135
|
};
|
|
129
136
|
|
|
130
|
-
export const
|
|
137
|
+
export const GlobalPrimaryBlue = {
|
|
138
|
+
args: {
|
|
139
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.BLUE'],
|
|
140
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const GlobalPrimaryGreen = {
|
|
145
|
+
args: {
|
|
146
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.GREEN'],
|
|
147
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const GlobalPrimaryLime = {
|
|
152
|
+
args: {
|
|
153
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.LIME'],
|
|
154
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export const GlobalPrimaryOrange = {
|
|
159
|
+
args: {
|
|
160
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.ORANGE'],
|
|
161
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const GlobalPrimaryPurple = {
|
|
166
|
+
args: {
|
|
167
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.PURPLE'],
|
|
168
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const GlobalPrimaryRed = {
|
|
173
|
+
args: {
|
|
174
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.RED'],
|
|
175
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const GlobalPrimarySalmon = {
|
|
180
|
+
args: {
|
|
181
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.SALMON'],
|
|
182
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const GlobalPrimaryTeal = {
|
|
187
|
+
args: {
|
|
188
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.TEAL'],
|
|
189
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const GlobalPrimaryYellow = {
|
|
194
|
+
args: {
|
|
195
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.YELLOW'],
|
|
196
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const GlobalSurfaceBlue = {
|
|
201
|
+
args: {
|
|
202
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.BLUE'],
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const GlobalSurfaceGreen = {
|
|
207
|
+
args: {
|
|
208
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.GREEN'],
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const GlobalSurfaceLime = {
|
|
213
|
+
args: {
|
|
214
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.LIME'],
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export const GlobalSurfaceOrange = {
|
|
219
|
+
args: {
|
|
220
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.ORANGE'],
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const GlobalSurfacePurple = {
|
|
225
|
+
args: {
|
|
226
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.PURPLE'],
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const GlobalSurfaceRed = {
|
|
231
|
+
args: {
|
|
232
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.RED'],
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export const GlobalSurfaceSalmon = {
|
|
237
|
+
args: {
|
|
238
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.SALMON'],
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export const GlobalSurfaceTeal = {
|
|
243
|
+
args: {
|
|
244
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.TEAL'],
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export const GlobalSurfaceYellow = {
|
|
249
|
+
args: {
|
|
250
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.YELLOW'],
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const StatusPrimaryError = {
|
|
255
|
+
args: {
|
|
256
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.ERROR'],
|
|
257
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export const StatusPrimaryInfo = {
|
|
262
|
+
args: {
|
|
263
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.INFO'],
|
|
264
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const StatusPrimarySuccess = {
|
|
269
|
+
args: {
|
|
270
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.SUCCESS'],
|
|
271
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export const StatusPrimaryWarning = {
|
|
276
|
+
args: {
|
|
277
|
+
backgroundColor: COLOR_BACKGROUND['GLOBAL.PRIMARY.WARNING'],
|
|
278
|
+
default: `<TideIcon class="tide-font-on-surface-inverse" icon="ai-description" />`,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const StatusSurfaceError = {
|
|
131
283
|
args: {
|
|
132
284
|
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.ERROR'],
|
|
133
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
134
285
|
},
|
|
135
286
|
};
|
|
136
287
|
|
|
137
|
-
export const
|
|
288
|
+
export const StatusSurfaceInfo = {
|
|
138
289
|
args: {
|
|
139
290
|
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.INFO'],
|
|
140
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
141
291
|
},
|
|
142
292
|
};
|
|
143
293
|
|
|
144
|
-
export const
|
|
294
|
+
export const StatusSurfaceSuccess = {
|
|
145
295
|
args: {
|
|
146
296
|
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.SUCCESS'],
|
|
147
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
148
297
|
},
|
|
149
298
|
};
|
|
150
299
|
|
|
151
|
-
export const
|
|
300
|
+
export const StatusSurfaceWarning = {
|
|
152
301
|
args: {
|
|
153
302
|
backgroundColor: COLOR_BACKGROUND['GLOBAL.SURFACE.WARNING'],
|
|
154
|
-
fontColor: COLOR_FONT['SURFACE.DEFAULT'],
|
|
155
303
|
},
|
|
156
304
|
};
|
|
@@ -105,7 +105,7 @@ export const Headline2 = {
|
|
|
105
105
|
|
|
106
106
|
export const Headline3 = {
|
|
107
107
|
args: {
|
|
108
|
-
type: TYPOGRAPHY['Headline
|
|
108
|
+
type: TYPOGRAPHY['Headline 3'],
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
111
|
|
|
@@ -117,7 +117,7 @@ export const Title1 = {
|
|
|
117
117
|
|
|
118
118
|
export const Title2 = {
|
|
119
119
|
args: {
|
|
120
|
-
type: TYPOGRAPHY['Title
|
|
120
|
+
type: TYPOGRAPHY['Title 2'],
|
|
121
121
|
},
|
|
122
122
|
};
|
|
123
123
|
|
|
@@ -129,7 +129,7 @@ export const Body1 = {
|
|
|
129
129
|
|
|
130
130
|
export const Body2 = {
|
|
131
131
|
args: {
|
|
132
|
-
type: TYPOGRAPHY['Body
|
|
132
|
+
type: TYPOGRAPHY['Body 2'],
|
|
133
133
|
},
|
|
134
134
|
};
|
|
135
135
|
|