tide-design-system 2.0.49 → 2.0.50

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/package.json CHANGED
@@ -36,8 +36,12 @@
36
36
  "vue": "^3.2.45",
37
37
  "vue-tsc": "^1.0.12"
38
38
  },
39
+ "homepage": "https://tide-design-system.netlify.app",
39
40
  "license": "MIT",
40
41
  "name": "tide-design-system",
42
+ "repository": {
43
+ "url": "https://github.com/traderinteractive/tide-design-system"
44
+ },
41
45
  "scripts": {
42
46
  "build": "npm run enforce && npm run build-vite",
43
47
  "build-storybook": "npm run build-vite && storybook build && cp -r src/assets/ storybook-static/",
@@ -57,5 +61,5 @@
57
61
  "main": "dist/tide-design-system.cjs",
58
62
  "module": "dist/tide-design-system.esm.js",
59
63
  "types": "dist/tide-design-system.esm.d.ts",
60
- "version": "2.0.49"
64
+ "version": "2.0.50"
61
65
  }
@@ -7,16 +7,20 @@
7
7
 
8
8
  type Props = {
9
9
  alt: string;
10
+ height?: string;
10
11
  isLazy?: boolean;
11
12
  sources?: Source[];
12
13
  src?: string;
14
+ width?: string;
13
15
  };
14
16
 
15
17
  const props = withDefaults(defineProps<Props>(), {
16
18
  alt: '',
19
+ height: undefined,
17
20
  isLazy: true,
18
21
  sources: () => [],
19
22
  src: undefined,
23
+ width: undefined,
20
24
  });
21
25
 
22
26
  const tideImage = ref();
@@ -37,7 +41,7 @@
37
41
  </script>
38
42
 
39
43
  <template>
40
- <picture :class="['tide-image']">
44
+ <picture :class="['tide-image', CSS.DISPLAY.BLOCK]">
41
45
  <source
42
46
  :key="source.srcset"
43
47
  :media="`(min-width:${source.media}px)`"
@@ -47,11 +51,13 @@
47
51
 
48
52
  <img
49
53
  :alt="alt"
50
- :class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL, CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
54
+ :class="[CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
51
55
  :fetchpriority="isLazy ? undefined : 'high'"
56
+ :height="height"
52
57
  :loading="props.isLazy ? 'lazy' : 'eager'"
53
58
  ref="tideImage"
54
59
  :src="src ?? imageDefault"
60
+ :width="width"
55
61
  @error="setImageFromDefault"
56
62
  />
57
63
  </picture>
@@ -31,9 +31,11 @@ const formatSnippet = (code: string, context: StoryContext) => {
31
31
  const hasSources = args.sources !== null;
32
32
  const hasSourcesLength = hasSources ? (args.sources as any).length > 0 : false;
33
33
 
34
+ if (args.height !== '') argsWithValues.push(`height="${args.height}"`);
34
35
  if (args.isLazy !== undefined) argsWithValues.push(`:is-lazy="${args.isLazy}"`);
35
36
  if (hasSources && hasSourcesLength) argsWithValues.push(`:sources="sources"`);
36
37
  if (args.src) argsWithValues.push(`:src="${args.src}"`);
38
+ if (args.width !== '') argsWithValues.push(`width="${args.width}"`);
37
39
 
38
40
  return `<TideImage ${argsWithValues.join(' ')} />`;
39
41
  };
@@ -58,6 +60,14 @@ export default {
58
60
  type: { summary: 'string' },
59
61
  },
60
62
  },
63
+ height: {
64
+ control: 'text',
65
+ description: 'Apply a "height" attribute to the internal image tag.',
66
+ table: {
67
+ defaultValue: { summary: 'None' },
68
+ type: { summary: 'number' },
69
+ },
70
+ },
61
71
  isLazy: {
62
72
  ...argTypeBooleanUnrequired,
63
73
  description: `Determines whether to delay loading until image is in viewport.`,
@@ -79,12 +89,22 @@ export default {
79
89
  type: { summary: 'string' },
80
90
  },
81
91
  },
92
+ width: {
93
+ control: 'text',
94
+ description: 'Apply a "width" attribute to the internal image tag.',
95
+ table: {
96
+ defaultValue: { summary: 'None' },
97
+ type: { summary: 'number' },
98
+ },
99
+ },
82
100
  },
83
101
  args: {
84
102
  alt: '',
103
+ height: '',
85
104
  isLazy: undefined,
86
105
  sources,
87
106
  src: 'https://placedog.net/375/400',
107
+ width: '',
88
108
  },
89
109
  component: TideImage,
90
110
  parameters,