tide-design-system 2.2.15 → 2.3.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.
Files changed (50) hide show
  1. package/.storybook/preview.ts +8 -1
  2. package/dist/css/main.css +0 -6
  3. package/dist/css/reset.css +1 -1
  4. package/dist/css/utilities-base.css +541 -0
  5. package/dist/css/utilities-responsive.css +2717 -0
  6. package/dist/css/utilities.css +2 -442
  7. package/dist/css/variables.css +1 -1
  8. package/dist/style.css +1 -1
  9. package/dist/tide-design-system.cjs +2 -2
  10. package/dist/tide-design-system.esm.d.ts +16 -99
  11. package/dist/tide-design-system.esm.js +1177 -1169
  12. package/dist/utilities/storybook.ts +12 -3
  13. package/dist/utilities/validation.ts +5 -1
  14. package/index.ts +3 -18
  15. package/package.json +1 -1
  16. package/src/assets/css/main.css +0 -6
  17. package/src/assets/css/reset.css +1 -1
  18. package/src/assets/css/utilities-base.css +541 -0
  19. package/src/assets/css/utilities-responsive.css +2717 -0
  20. package/src/assets/css/utilities.css +2 -442
  21. package/src/assets/css/variables.css +1 -1
  22. package/src/components/TideImage.vue +7 -1
  23. package/src/components/TideInputCheckbox.vue +3 -5
  24. package/src/components/TideInputRadio.vue +18 -5
  25. package/src/components/TideInputText.vue +50 -50
  26. package/src/components/TideInputTextarea.vue +17 -22
  27. package/src/components/TidePopover.vue +8 -3
  28. package/src/contexts/sandbox/AppSandbox.vue +3 -1
  29. package/src/docs/integration-partial.md +0 -7
  30. package/src/stories/TideInputRadio.stories.ts +9 -0
  31. package/src/types/Styles.ts +5 -0
  32. package/src/utilities/storybook.ts +12 -3
  33. package/src/utilities/validation.ts +5 -1
  34. package/dist/css/dynamic-buttons.css +0 -346
  35. package/dist/css/dynamic-utilities.css +0 -152
  36. package/dist/css/utilities-lg.css +0 -444
  37. package/dist/css/utilities-md.css +0 -444
  38. package/dist/css/utilities-sm.css +0 -444
  39. package/dist/css/utilities-xl.css +0 -444
  40. package/src/assets/css/dynamic-buttons.css +0 -346
  41. package/src/assets/css/dynamic-utilities.css +0 -152
  42. package/src/assets/css/utilities-lg.css +0 -444
  43. package/src/assets/css/utilities-md.css +0 -444
  44. package/src/assets/css/utilities-sm.css +0 -444
  45. package/src/assets/css/utilities-xl.css +0 -444
  46. package/src/types/Detail.ts +0 -4
  47. package/src/types/FacetRange.ts +0 -84
  48. package/src/types/ListingMedia.ts +0 -43
  49. package/src/types/Raw.ts +0 -5
  50. package/src/types/RealmConfig.ts +0 -14
@@ -15,7 +15,6 @@
15
15
 
16
16
  type Props = {
17
17
  autocomplete?: boolean;
18
- dataTrack?: string;
19
18
  disabled?: boolean;
20
19
  error?: ValidationError;
21
20
  hasClear?: boolean;
@@ -37,7 +36,6 @@
37
36
 
38
37
  const props = withDefaults(defineProps<Props>(), {
39
38
  autocomplete: false,
40
- dataTrack: '',
41
39
  disabled: false,
42
40
  error: false,
43
41
  hasClear: false,
@@ -70,7 +68,7 @@
70
68
  );
71
69
  const hasMinilabel = computed(() => hasFocus.value || !isEmpty.value);
72
70
  const isEmpty = computed(() => value.value === '' || value.value === undefined);
73
- const type = computed(() =>
71
+ const inputType = computed(() =>
74
72
  props.type === TEXT_INPUT_TYPE.PASSWORD && showPassword.value === true ? TEXT_INPUT_TYPE.TEXT : props.type
75
73
  );
76
74
 
@@ -145,9 +143,9 @@
145
143
  hasError && 'error',
146
144
  ]"
147
145
  >
148
- <div
146
+ <label
149
147
  :class="[
150
- 'tide-input-border',
148
+ 'tide-input-text-field',
151
149
  CSS.DISPLAY.FLEX,
152
150
  CSS.AXIS2.CENTER,
153
151
  CSS.GAP.HALF,
@@ -156,14 +154,15 @@
156
154
  CSS.BG.SURFACE.DEFAULT,
157
155
  hasClear ? [CSS.PADDING.RIGHT.HALF, CSS.PADDING.LEFT.ONE] : [CSS.PADDING.X.ONE],
158
156
  CSS.PADDING.Y.HALF,
159
- props.disabled ? CSS.CURSOR.NOT_ALLOWED : CSS.CURSOR.TEXT,
157
+ disabled ? CSS.CURSOR.NOT_ALLOWED : CSS.CURSOR.TEXT,
160
158
  ]"
159
+ :for="inputId"
161
160
  >
162
161
  <TideIcon
163
162
  :class="[CSS.FONT.COLOR.SURFACE.VARIANT]"
164
- :icon="props.iconLeading"
163
+ :icon="iconLeading"
165
164
  :size="SIZE.SMALL"
166
- v-if="props.iconLeading"
165
+ v-if="iconLeading"
167
166
  />
168
167
 
169
168
  <div :class="[CSS.DISPLAY.FLEX, CSS.AXIS2.CENTER, CSS.GAP.QUARTER, CSS.WIDTH.FULL]">
@@ -171,48 +170,43 @@
171
170
  :class="[
172
171
  'tide-input-text-prefix',
173
172
  CSS.FONT.ROLE.BODY_1,
174
- ,
175
173
  !hasError && CSS.FONT.COLOR.SURFACE.VARIANT,
176
174
  hasMinilabel ? '' : 'offset',
177
175
  ]"
178
- v-if="props.prefix"
176
+ v-if="prefix"
179
177
  >
180
- {{ props.prefix }}
178
+ {{ prefix }}
181
179
  </div>
182
180
 
183
- <div
184
- :class="[CSS.DISPLAY.FLEX, CSS.FLEX.DIRECTION.COLUMN, CSS.WIDTH.FULL]"
185
- @click.prevent="input?.focus()"
186
- >
187
- <label
181
+ <div :class="[CSS.DISPLAY.FLEX, CSS.FLEX.DIRECTION.COLUMN, CSS.WIDTH.FULL]">
182
+ <div
188
183
  :class="[
184
+ 'tide-input-text-label',
189
185
  hasMinilabel ? ['minilabel', CSS.FONT.ROLE.LABEL_3] : CSS.FONT.ROLE.LABEL_1,
190
186
  !hasError && CSS.FONT.COLOR.SURFACE.VARIANT,
191
187
  CSS.CURSOR.TEXT,
192
188
  CSS.POINTER_EVENTS.OFF,
193
189
  ]"
194
- :for="props.inputId"
195
190
  v-if="label"
196
191
  >
197
192
  {{ formattedLabel }}
198
- </label>
193
+ </div>
199
194
 
200
195
  <input
201
196
  :autocomplete="autocomplete ? 'on' : 'off'"
202
197
  :class="[CSS.WIDTH.FULL, disabled && CSS.CURSOR.NOT_ALLOWED, CSS.FONT.ROLE.BODY_1]"
203
- :data-track="props.dataTrack"
204
- :disabled="props.disabled"
205
- :maxlength="props.maxlength"
206
- :minlength="props.minlength"
207
- :name="props.name"
198
+ :disabled="disabled"
199
+ :maxlength="maxlength"
200
+ :minlength="minlength"
201
+ :name="name"
208
202
  ref="input"
209
- :required="props.required"
210
- :type="type"
203
+ :required="required"
204
+ :type="inputType"
211
205
  @change="handleValidation"
212
206
  @focus="handleFocus"
213
207
  @focusout="handleFocusOut"
214
208
  @input="handleInput"
215
- :id="props.inputId"
209
+ :id="inputId"
216
210
  v-model="value"
217
211
  />
218
212
  </div>
@@ -224,32 +218,38 @@
224
218
  !hasError && CSS.FONT.COLOR.SURFACE.VARIANT,
225
219
  hasMinilabel ? '' : 'offset',
226
220
  ]"
227
- v-if="props.suffix"
221
+ v-if="suffix"
228
222
  >
229
- {{ props.suffix }}
223
+ {{ suffix }}
230
224
  </div>
231
225
  </div>
232
226
 
233
- <TideIcon
234
- :class="[CSS.PADDING.Y.HALF, CSS.PADDING.FULL.HALF, CSS.CURSOR.POINTER]"
235
- :icon="ICON.CLOSE"
236
- :size="SIZE.SMALL"
227
+ <button
237
228
  @click="handleClear"
238
- v-if="hasClear && props.type !== TEXT_INPUT_TYPE.PASSWORD"
239
- />
240
-
241
- <TideIcon
242
- :class="[CSS.PADDING.Y.HALF, CSS.PADDING.FULL.HALF, CSS.CURSOR.POINTER]"
243
- :icon="ICON.VISIBILITY"
244
- :size="SIZE.SMALL"
229
+ v-if="hasClear && type !== TEXT_INPUT_TYPE.PASSWORD"
230
+ >
231
+ <TideIcon
232
+ :class="[CSS.MARGIN.FULL.HALF]"
233
+ :icon="ICON.CLOSE"
234
+ :size="SIZE.SMALL"
235
+ />
236
+ </button>
237
+
238
+ <button
245
239
  @click="showPassword = !showPassword"
246
- v-if="props.type === TEXT_INPUT_TYPE.PASSWORD"
247
- />
248
- </div>
240
+ v-if="type === TEXT_INPUT_TYPE.PASSWORD"
241
+ >
242
+ <TideIcon
243
+ :class="[CSS.MARGIN.FULL.HALF]"
244
+ :icon="ICON.VISIBILITY"
245
+ :size="SIZE.SMALL"
246
+ />
247
+ </button>
248
+ </label>
249
249
 
250
250
  <div
251
251
  :class="[CSS.DISPLAY.FLEX, CSS.AXIS2.CENTER, CSS.GAP.QUARTER]"
252
- v-if="props.supportingText || hasError"
252
+ v-if="supportingText || hasError"
253
253
  >
254
254
  <TideIcon
255
255
  :class="[]"
@@ -259,19 +259,19 @@
259
259
  />
260
260
 
261
261
  <div :class="[CSS.FONT.ROLE.LABEL_3]">
262
- {{ hasError ? errorMessage : props.supportingText }}
262
+ {{ hasError ? errorMessage : supportingText }}
263
263
  </div>
264
264
  </div>
265
265
  </div>
266
266
  </template>
267
267
 
268
268
  <style scoped>
269
- label {
269
+ .tide-input-text-label {
270
270
  height: 1.1875rem;
271
271
  transition: font-size var(--tide-animate), transform var(--tide-animate);
272
272
  }
273
273
 
274
- label:not(.minilabel),
274
+ .tide-input-text-label:not(.minilabel),
275
275
  .tide-input-text-prefix:not(.offset),
276
276
  .tide-input-text-suffix:not(.offset) {
277
277
  transform: translate(0, calc(9 / 16 * 1rem));
@@ -290,16 +290,16 @@
290
290
  color: var(--tide-error-primary);
291
291
  }
292
292
 
293
- .tide-input-text.error .tide-input-border {
293
+ .tide-input-text.error .tide-input-text-field {
294
294
  outline-color: var(--tide-error-border);
295
295
  background-color: var(--tide-error-surface);
296
296
  }
297
297
 
298
- .tide-input-text.error:focus-within .tide-input-border {
298
+ .tide-input-text.error:focus-within .tide-input-text-field {
299
299
  outline-color: var(--tide-error-border);
300
300
  }
301
301
 
302
- .tide-input-text:focus-within .tide-input-border {
302
+ .tide-input-text:focus-within .tide-input-text-field {
303
303
  --tide-input-outline-width: var(--tide-border-width-2);
304
304
  outline-color: var(--tide-surface-border-high);
305
305
  }
@@ -308,7 +308,7 @@
308
308
  outline: none;
309
309
  }
310
310
 
311
- .tide-input-border {
311
+ .tide-input-text-field {
312
312
  --tide-input-outline-width: var(--tide-border-width-1);
313
313
  outline: var(--tide-input-outline-width) solid var(--tide-border);
314
314
  outline-offset: calc(var(--tide-input-outline-width) * -1);
@@ -10,7 +10,6 @@
10
10
  import type { ValidationError } from '@/types/Validation';
11
11
 
12
12
  type Props = {
13
- dataTrack?: string;
14
13
  error?: ValidationError;
15
14
  inputId?: string;
16
15
  label?: string;
@@ -24,7 +23,6 @@
24
23
  };
25
24
 
26
25
  const props = withDefaults(defineProps<Props>(), {
27
- dataTrack: '',
28
26
  error: false,
29
27
  inputId: undefined,
30
28
  label: undefined,
@@ -93,7 +91,7 @@
93
91
  <div
94
92
  :class="['tide-input-textarea', CSS.DISPLAY.FLEX, CSS.FLEX.DIRECTION.COLUMN, CSS.GAP.QUARTER, hasError && 'error']"
95
93
  >
96
- <div
94
+ <label
97
95
  :class="[
98
96
  'tide-input-textarea-field',
99
97
  CSS.GAP.HALF,
@@ -103,42 +101,41 @@
103
101
  CSS.PADDING.TOP.HALF,
104
102
  CSS.OVERFLOW.XY.HIDDEN,
105
103
  CSS.BG.SURFACE.DEFAULT,
104
+ CSS.CURSOR.TEXT,
106
105
  ]"
106
+ :for="inputId"
107
107
  >
108
- <label
108
+ <div
109
109
  :class="[
110
+ 'tide-input-textarea-label',
110
111
  hasMinilabel ? ['minilabel', CSS.FONT.ROLE.LABEL_3] : CSS.FONT.ROLE.LABEL_1,
111
112
  !hasError && CSS.FONT.COLOR.SURFACE.VARIANT,
112
- CSS.CURSOR.TEXT,
113
113
  CSS.POINTER_EVENTS.OFF,
114
114
  ]"
115
- :for="props.inputId"
116
- ref="label"
117
115
  v-if="label"
118
116
  >
119
117
  {{ formattedLabel }}
120
- </label>
118
+ </div>
121
119
 
122
120
  <textarea
123
- :class="[CSS.WIDTH.FULL, CSS.FONT.ROLE.BODY_1]"
124
- :data-track="props.dataTrack"
125
- :maxlength="props.maxlength"
126
- :minlength="props.minlength"
127
- :name="props.name"
121
+ :class="[CSS.DISPLAY.BLOCK, CSS.WIDTH.FULL, CSS.FONT.ROLE.BODY_1]"
122
+ :maxlength="maxlength"
123
+ :minlength="minlength"
124
+ :name="name"
128
125
  ref="input"
129
- :required="props.required"
130
- :rows="props.rows"
126
+ :required="required"
127
+ :rows="rows"
131
128
  @change="handleValidation"
132
129
  @focus="handleFocus"
133
130
  @focusout="handleFocusOut"
134
- :id="props.inputId"
131
+ :id="inputId"
135
132
  v-model="value"
136
133
  />
137
- </div>
134
+ </label>
138
135
 
139
136
  <div
140
137
  :class="[CSS.DISPLAY.FLEX, CSS.AXIS2.CENTER, CSS.GAP.QUARTER]"
141
- v-if="props.supportingText || hasError"
138
+ v-if="supportingText || hasError"
142
139
  >
143
140
  <TideIcon
144
141
  :icon="ICON.ERROR"
@@ -147,7 +144,7 @@
147
144
  />
148
145
 
149
146
  <div :class="[CSS.FONT.ROLE.LABEL_3]">
150
- {{ hasError ? errorMessage : props.supportingText }}
147
+ {{ hasError ? errorMessage : supportingText }}
151
148
  </div>
152
149
  </div>
153
150
  </div>
@@ -157,10 +154,8 @@
157
154
  textarea {
158
155
  resize: vertical;
159
156
  }
160
- </style>
161
157
 
162
- <style scoped>
163
- label {
158
+ .tide-input-textarea-label {
164
159
  height: 1.1875rem;
165
160
  transition: font-size var(--tide-animate), transform var(--tide-animate);
166
161
  }
@@ -35,8 +35,9 @@
35
35
  const handlePermanentOpenBodyClick = (e: MouseEvent) => {
36
36
  if (!anchor.value || !floating.value) return;
37
37
  if (isClickOutside(e, [anchor.value, floating.value])) {
38
- e.stopImmediatePropagation();
39
38
  isToggledOpen.value = false;
39
+ e.preventDefault();
40
+ e.stopImmediatePropagation();
40
41
  }
41
42
  };
42
43
 
@@ -49,9 +50,13 @@
49
50
  };
50
51
 
51
52
  const handleAnchorElementClick = (e: MouseEvent) => {
52
- isToggledOpen.value = true;
53
- e.stopPropagation();
54
53
  e.preventDefault();
54
+ if (isToggledOpen.value) {
55
+ isToggledOpen.value = false;
56
+ isHovered.value = false;
57
+ } else {
58
+ isToggledOpen.value = true;
59
+ }
55
60
  };
56
61
 
57
62
  const addListenersToAnchorElement = () => {
@@ -1,4 +1,6 @@
1
- <script lang="ts" setup></script>
1
+ <script lang="ts" setup>
2
+ import {} from '../../../index';
3
+ </script>
2
4
 
3
5
  <template>
4
6
  <div />
@@ -12,17 +12,10 @@
12
12
  `import 'node_modules/tide-design-system/dist/css/main.css';`
13
13
 
14
14
  2. Cherry-picked:
15
- - `import 'node_modules/tide-design-system/dist/css/main.css';`
16
15
  - `import 'node_modules/tide-design-system/dist/css/fonts.css';`
17
16
  - `import 'node_modules/tide-design-system/dist/css/reset.css';`
18
17
  - `import 'node_modules/tide-design-system/dist/css/variables.css';`
19
18
  - `import 'node_modules/tide-design-system/dist/css/utilities.css';`
20
- - `import 'node_modules/tide-design-system/dist/css/utilities-sm.css';`
21
- - `import 'node_modules/tide-design-system/dist/css/utilities-md.css';`
22
- - `import 'node_modules/tide-design-system/dist/css/utilities-lg.css';`
23
- - `import 'node_modules/tide-design-system/dist/css/utilities-xl.css';`
24
- - `import 'node_modules/tide-design-system/dist/css/dynamic-buttons.css';`
25
- - `import 'node_modules/tide-design-system/dist/css/dynamic-utilities.css';`
26
19
  - `import 'node_modules/tide-design-system/dist/css/grid-layout.css';`
27
20
  2. Import realm-specific utilities (where applicable):
28
21
  - `import 'node_modules/tide-design-system/dist/css/realm/aero.css';`
@@ -64,6 +64,14 @@ export default {
64
64
  type: { summary: 'string' },
65
65
  },
66
66
  },
67
+ number: {
68
+ control: 'text',
69
+ description: 'Parenthetical response count',
70
+ table: {
71
+ defaultValue: { summary: 'None' },
72
+ type: { summary: 'number' },
73
+ },
74
+ },
67
75
  },
68
76
  args: {
69
77
  checked: undefined,
@@ -73,6 +81,7 @@ export default {
73
81
  inputId: '',
74
82
  label: 'Input label',
75
83
  name: '',
84
+ number: '',
76
85
  },
77
86
  component: TideInputRadio,
78
87
  parameters,
@@ -9,6 +9,7 @@ export const CSS = {
9
9
  ALIGN: {
10
10
  X: {
11
11
  CENTER: 'tide-text-center',
12
+ JUSTIFY: 'tide-text-justify',
12
13
  LEFT: 'tide-text-left',
13
14
  RIGHT: 'tide-text-right',
14
15
  },
@@ -478,6 +479,10 @@ export const CSS = {
478
479
  SNAP_ALIGN: {
479
480
  START: 'tide-scroll-snap-start',
480
481
  },
482
+ STRIKETHROUGH: {
483
+ OFF: 'tide-strikethrough-none',
484
+ ON: 'tide-strikethrough',
485
+ },
481
486
  TEXT_TRANSFORM: {
482
487
  LOWER: 'tide-text-transform-lower',
483
488
  NONE: 'tide-text-transform-none',
@@ -103,12 +103,21 @@ export const disabledArgType = {
103
103
 
104
104
  export const isProduction = process.env.NODE_ENV === 'production';
105
105
 
106
- export const doSomething = () => {
107
- alert('Did something.');
106
+ export const doSomething = (message: string = 'Did something.') => {
107
+ const doSomethingAlert = document.getElementById('do-something-alert');
108
+
109
+ if (!doSomethingAlert) return;
110
+
111
+ doSomethingAlert.innerHTML = message;
112
+ doSomethingAlert.style.opacity = '1';
113
+
114
+ setTimeout(() => {
115
+ doSomethingAlert.style.opacity = '0';
116
+ }, 1000);
108
117
  };
109
118
 
110
119
  export const doSomethingElse = () => {
111
- alert('Did something else.');
120
+ doSomething('Did something else.');
112
121
  };
113
122
 
114
123
  // Flatten a nested constant into a simple constant.
@@ -1,11 +1,15 @@
1
1
  import { priceToNumber } from '@/utilities/format';
2
2
 
3
- import type { RangeData } from '@/types/FacetRange';
4
3
  import type { StringInput } from '@/types/Form';
5
4
  import type { SelectOption } from '@/types/Select';
6
5
  import type { ValidationError, ValidationLength, ValidationResult, Validator } from '@/types/Validation';
7
6
  import type { Ref } from 'vue';
8
7
 
8
+ type RangeData = {
9
+ min: number | null;
10
+ max: number | null;
11
+ };
12
+
9
13
  export const errorMessageDefault = 'Please enter a valid value.';
10
14
 
11
15
  export const noError = {