tide-design-system 2.5.0 → 2.5.2

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 (35) hide show
  1. package/.storybook/main.ts +2 -0
  2. package/README.md +3 -1
  3. package/dist/css/reset.css +5 -1
  4. package/dist/css/utilities-base.css +6 -6
  5. package/dist/css/utilities-responsive.css +24 -24
  6. package/dist/css/variables.css +3 -0
  7. package/dist/style.css +1 -1
  8. package/dist/tide-design-system.cjs +2 -2
  9. package/dist/tide-design-system.esm.d.ts +49 -9
  10. package/dist/tide-design-system.esm.js +887 -785
  11. package/docs/assets/full-bleed.gif +0 -0
  12. package/docs/assets/layout-grid-default.webp +0 -0
  13. package/docs/assets/layout-grid-fluid.webp +0 -0
  14. package/docs/assets/layout-grid.webp +0 -0
  15. package/docs/configuation.md +47 -0
  16. package/docs/grid-layout.md +83 -0
  17. package/index.ts +4 -0
  18. package/package.json +1 -1
  19. package/src/assets/css/reset.css +5 -1
  20. package/src/assets/css/utilities-base.css +6 -6
  21. package/src/assets/css/utilities-responsive.css +24 -24
  22. package/src/assets/css/variables.css +3 -0
  23. package/src/components/TideAlert.vue +1 -1
  24. package/src/components/TideInputSelect.vue +1 -1
  25. package/src/components/TideInputSelectDeprecated.vue +1 -1
  26. package/src/components/TideInputText.vue +2 -2
  27. package/src/components/TideInputTextDeprecated.vue +2 -2
  28. package/src/components/TideInputTextarea.vue +2 -2
  29. package/src/components/TideInputTextareaDeprecated.vue +2 -2
  30. package/src/components/TideModal.vue +1 -1
  31. package/src/components/TideRating.vue +93 -0
  32. package/src/components/TideSheet.vue +1 -1
  33. package/src/components/TideTabs.vue +58 -0
  34. package/src/stories/TideRating.stories.ts +120 -0
  35. package/src/stories/TideTabs.stories.ts +115 -0
@@ -0,0 +1,120 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { ref, watchEffect } from 'vue';
3
+
4
+ import TideRating from '@/components/TideRating.vue';
5
+ import { argTypeBooleanUnrequired, change, doSomething, parameters } from '@/utilities/storybook';
6
+
7
+ import type { StoryContext } from '@storybook/vue3';
8
+
9
+ type Args = InstanceType<typeof TideRating>['$props'] & {
10
+ handleChange: string;
11
+ vModel: number;
12
+ };
13
+
14
+ const maxRating = 10;
15
+
16
+ const render = (args: Args, context: StoryContext) => ({
17
+ components: { TideRating },
18
+ methods: {
19
+ doSomething,
20
+ handleChange: (index: number) => {
21
+ action('Current rating')(index);
22
+ context.updateArgs({ ...args, vModel: index });
23
+
24
+ try {
25
+ const callback = eval(args.handleChange);
26
+
27
+ if (callback) {
28
+ callback();
29
+ }
30
+ } catch {
31
+ alert('Please specify a valid handler in the "change" control.');
32
+ }
33
+ },
34
+ },
35
+ setup: () => {
36
+ const ratingValue = ref<number>(args.vModel);
37
+
38
+ watchEffect(() => {
39
+ ratingValue.value = args.vModel;
40
+ });
41
+
42
+ return {
43
+ args,
44
+ ratingValue,
45
+ };
46
+ },
47
+ template: '<TideRating v-model="ratingValue" @update:modelValue="handleChange" v-bind="args" />',
48
+ });
49
+
50
+ export default {
51
+ argTypes: {
52
+ description: {
53
+ control: 'text',
54
+ description: 'Determines the text displayed below the title',
55
+ table: {
56
+ defaultValue: { summary: 'None' },
57
+ type: { summary: 'string' },
58
+ },
59
+ },
60
+ handleChange: {
61
+ ...change,
62
+ control: 'text',
63
+ description: 'JS code or function to execute on change event',
64
+ name: 'update:modelValue',
65
+ table: {
66
+ category: 'Events',
67
+ defaultValue: { summary: 'None' },
68
+ type: { summary: '() => void' },
69
+ },
70
+ },
71
+ maxRating: {
72
+ control: 'text',
73
+ description: 'Maximum rating value / Number of segments',
74
+ table: {
75
+ defaultValue: { summary: 10 },
76
+ type: { summary: 'number' },
77
+ },
78
+ },
79
+ showRating: {
80
+ ...argTypeBooleanUnrequired,
81
+ description: 'Determines whether to display the current rating value',
82
+ },
83
+ title: {
84
+ control: 'text',
85
+ description: 'Determines the title text displayed above the rating component',
86
+ table: {
87
+ defaultValue: { summary: 'None' },
88
+ type: { summary: 'string' },
89
+ },
90
+ },
91
+ vModel: {
92
+ control: {
93
+ type: 'select',
94
+ },
95
+ description: 'Data binding to Vue ref (selected rating index)',
96
+ isDynamic: true,
97
+ options: Array.from({ length: maxRating + 1 }, (_, i) => i),
98
+ table: {
99
+ category: 'Native',
100
+ defaultValue: { summary: 'None' },
101
+ type: { summary: 'Ref<number>' },
102
+ },
103
+ },
104
+ },
105
+ args: {
106
+ description: 'Description',
107
+ handleChange: 'doSomething',
108
+ maxRating: '10',
109
+ showRating: undefined,
110
+ title: 'Title',
111
+ vModel: 0,
112
+ },
113
+ component: TideRating,
114
+ parameters,
115
+ render,
116
+ tags: ['autodocs'],
117
+ title: 'Components/TideRating',
118
+ };
119
+
120
+ export const Demo = {};
@@ -0,0 +1,115 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { ref, watchEffect } from 'vue';
3
+
4
+ import TideTabs from '@/components/TideTabs.vue';
5
+ import { change, disabledArgType, doSomething, parameters } from '@/utilities/storybook';
6
+
7
+ import type { Tab } from '@/types/Tab';
8
+ import type { StoryContext } from '@storybook/vue3';
9
+
10
+ type Args = InstanceType<typeof TideTabs>['$props'] & {
11
+ handleChange: string;
12
+ vModel: number;
13
+ };
14
+
15
+ const tabs: Tab[] = [
16
+ {
17
+ dataTrack: 'Tab 0 Click',
18
+ label: 'First Tab',
19
+ },
20
+ {
21
+ dataTrack: 'Tab 1 Click',
22
+ label: 'Second Tab',
23
+ },
24
+ {
25
+ dataTrack: 'Tab 2 Click',
26
+ label: 'Third Tab',
27
+ },
28
+ {
29
+ dataTrack: 'Tab 3 Click',
30
+ label: 'Fourth Tab',
31
+ },
32
+ ];
33
+
34
+ const render = (args: Args, context: StoryContext) => ({
35
+ components: { TideTabs },
36
+ methods: {
37
+ doSomething,
38
+ handleChange: (index: number) => {
39
+ action('Current tab')(index);
40
+ context.updateArgs({ ...args, vModel: index });
41
+
42
+ try {
43
+ const callback = eval(args.handleChange);
44
+
45
+ if (callback) {
46
+ callback();
47
+ }
48
+ } catch {
49
+ alert('Please specify a valid handler in the "change" control.');
50
+ }
51
+ },
52
+ },
53
+ setup: () => {
54
+ const currentTab = ref<number>(args.vModel);
55
+
56
+ watchEffect(() => {
57
+ currentTab.value = args.vModel;
58
+ });
59
+
60
+ return {
61
+ args,
62
+ currentTab,
63
+ };
64
+ },
65
+ template: `<TideTabs @update:modelValue="handleChange" v-bind="args" v-model="currentTab" />`,
66
+ });
67
+
68
+ export default {
69
+ argTypes: {
70
+ change: disabledArgType,
71
+ handleChange: {
72
+ ...change,
73
+ name: 'update:modelValue',
74
+ table: {
75
+ category: 'Events',
76
+ defaultValue: { summary: 'None' },
77
+ type: { summary: '(tabIndex: number) => void' },
78
+ },
79
+ },
80
+ tabs: {
81
+ control: 'object',
82
+ description: 'Sets labels and callback for each tab',
83
+ isCustom: true,
84
+ table: {
85
+ defaultValue: { summary: 'None' },
86
+ type: { summary: 'Tab[]' },
87
+ },
88
+ },
89
+ vModel: {
90
+ control: {
91
+ type: 'select',
92
+ },
93
+ description: 'Data binding to Vue ref (active tab index)',
94
+ isDynamic: true,
95
+ options: Object.keys(tabs).map((index) => parseInt(index)),
96
+ table: {
97
+ category: 'Native',
98
+ defaultValue: { summary: 'None' },
99
+ type: { summary: 'Ref<number>' },
100
+ },
101
+ },
102
+ },
103
+ args: {
104
+ handleChange: 'doSomething',
105
+ tabs,
106
+ vModel: 0,
107
+ },
108
+ component: TideTabs,
109
+ parameters,
110
+ render,
111
+ tags: ['autodocs'],
112
+ title: 'Components/TideTabs',
113
+ };
114
+
115
+ export const Demo = {};