tide-design-system 2.2.3 → 2.2.5
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 +3 -1
- package/.storybook/preview.ts +4 -3
- package/README.md +35 -5
- package/dist/css/grid-layout.css +10 -49
- package/dist/css/utilities-lg.css +4 -11
- package/dist/css/utilities-md.css +4 -12
- package/dist/css/utilities-sm.css +4 -11
- package/dist/css/utilities-xl.css +4 -11
- package/dist/css/utilities.css +4 -11
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +31 -36
- package/dist/tide-design-system.esm.js +1397 -1407
- package/dist/utilities/storybook.ts +12 -0
- package/package.json +1 -1
- package/src/assets/css/grid-layout.css +10 -49
- package/src/assets/css/utilities-lg.css +4 -11
- package/src/assets/css/utilities-md.css +4 -12
- package/src/assets/css/utilities-sm.css +4 -11
- package/src/assets/css/utilities-xl.css +4 -11
- package/src/assets/css/utilities.css +4 -11
- package/src/components/TideAlert.vue +27 -33
- package/src/components/TideBadge.vue +4 -1
- package/src/components/TideBadgeTrustedPartner.vue +8 -2
- package/src/components/TideBadgeVerifiedVehicle.vue +7 -2
- package/src/components/TideButton.vue +1 -1
- package/src/components/TideButtonIcon.vue +1 -1
- package/src/components/TideButtonPagination.vue +1 -1
- package/src/components/TideCarousel.vue +90 -55
- package/src/components/TideChipAction.vue +1 -1
- package/src/components/TideLink.vue +10 -1
- package/src/components/TideModal.vue +1 -1
- package/src/components/TideSeoLinks.vue +1 -1
- package/src/docs/development.md +125 -18
- package/src/docs/figma.md +43 -0
- package/src/docs/integration-full.md +80 -0
- package/src/docs/integration-partial.md +42 -0
- package/src/docs/migration.md +65 -0
- package/src/docs/storybook.md +29 -24
- package/src/docs/style-guide.md +22 -0
- package/src/docs/workflows.md +20 -0
- package/src/stories/FoundationsBorder.stories.ts +1 -1
- package/src/stories/FoundationsColor.stories.ts +1 -1
- package/src/stories/FoundationsGap.stories.ts +1 -1
- package/src/stories/FoundationsGrid.stories.ts +2 -185
- package/src/stories/FoundationsMargin.stories.ts +1 -1
- package/src/stories/FoundationsPadding.stories.ts +1 -1
- package/src/stories/FoundationsShadow.stories.ts +1 -1
- package/src/stories/FoundationsTransparency.stories.ts +1 -1
- package/src/stories/FoundationsTypography.stories.ts +1 -1
- package/src/stories/TideAccordionItem.stories.ts +1 -1
- package/src/stories/TideAlert.stories.ts +47 -3
- package/src/stories/TideBadge.stories.ts +1 -1
- package/src/stories/TideBadgeTrustedPartner.stories.ts +1 -1
- package/src/stories/TideBadgeVerifiedVehicle.stories.ts +1 -1
- package/src/stories/TideBreadCrumbs.stories.ts +1 -1
- package/src/stories/TideButton.stories.ts +1 -1
- package/src/stories/TideButtonIcon.stories.ts +1 -1
- package/src/stories/TideButtonPagination.stories.ts +1 -1
- package/src/stories/TideButtonSegmented.stories.ts +1 -1
- package/src/stories/TideCard.stories.ts +1 -1
- package/src/stories/TideCarousel.stories.ts +52 -10
- package/src/stories/TideChipAction.stories.ts +1 -1
- package/src/stories/TideChipFilter.stories.ts +1 -1
- package/src/stories/TideChipInput.stories.ts +1 -1
- package/src/stories/TideColumns.stories.ts +1 -1
- package/src/stories/TideDivider.stories.ts +1 -1
- package/src/stories/TideIcon.stories.ts +1 -1
- package/src/stories/TideImage.stories.ts +1 -1
- package/src/stories/TideImageBackground.stories.ts +1 -1
- package/src/stories/TideIndicator.stories.ts +1 -1
- package/src/stories/TideInputCheckbox.stories.ts +1 -1
- package/src/stories/TideInputRadio.stories.ts +1 -1
- package/src/stories/TideInputSelect.stories.ts +1 -1
- package/src/stories/TideInputText.stories.ts +1 -1
- package/src/stories/TideInputTextarea.stories.ts +1 -1
- package/src/stories/TideLink.stories.ts +8 -2
- package/src/stories/TideModal.stories.ts +1 -1
- package/src/stories/TidePagination.stories.ts +1 -1
- package/src/stories/TidePopover.stories.ts +1 -1
- package/src/stories/TideSeoLinks.stories.ts +1 -1
- package/src/stories/TideSwitch.stories.ts +1 -1
- package/src/types/Storybook.ts +0 -32
- package/src/types/Styles.ts +8 -232
- package/src/utilities/storybook.ts +12 -0
- package/src/docs/integration.md +0 -79
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# TIDE Migration
|
|
2
|
+
The first implementation of the TIDE Design System was developed directly within the `marketplace` repository in parallel with a comprehensive redesign/rebuild of the entire frontend of the 3-page core site (Homepage, Search Results Page, Vehicle Detail Page). When TIDE matured into TIDE 2.0 and was reinvisioned as an NPM package many months later, it was decided that development would continue on redesign/rebuild without a specific effort to replace the initial implementation to the modernized approach. As such, these migrations are being undertaken piecemeal as developer availability permits.
|
|
3
|
+
|
|
4
|
+
## Goals
|
|
5
|
+
1. All frontend structures within the `marketplace` repository that implement TIDE utilities, components, or supporting structures will, over time, be moved, adapted, or recreated in the TIDE repository.
|
|
6
|
+
2. Structures to be migrated:
|
|
7
|
+
1. Vue 3 components
|
|
8
|
+
2. TypeScript types
|
|
9
|
+
3. JavaScript/TypeScript utilities
|
|
10
|
+
4. CSS utilities
|
|
11
|
+
5. Unit tests
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
As TIDE structures become available in the TIDE repository, the TIDE team will work to identify redundant structures within the `marketplace` repository, create tickets detailing the work to reimplement these structures, and work with the relevant product teams to determine priority and ownership of these tasks.
|
|
15
|
+
|
|
16
|
+
1. Update imports:
|
|
17
|
+
|
|
18
|
+
❌ TIDE 1.0
|
|
19
|
+
```
|
|
20
|
+
import BasicSample from '@/components-core/BasicSample.vue';
|
|
21
|
+
import { SAMPLE } from '@/types/Sample';
|
|
22
|
+
import { getSample } from '@/utilities/sample';
|
|
23
|
+
|
|
24
|
+
import type { Sample } from '@/types/Sample';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
✅ TIDE 2.0
|
|
28
|
+
```
|
|
29
|
+
import {
|
|
30
|
+
BasicSample,
|
|
31
|
+
SAMPLE,
|
|
32
|
+
getSample,
|
|
33
|
+
} from 'tide-design-system';
|
|
34
|
+
|
|
35
|
+
import type { Sample } from 'tide-design-system';
|
|
36
|
+
```
|
|
37
|
+
2. Update all instances of component(s) under migration:
|
|
38
|
+
|
|
39
|
+
**Note**: TIDE 2.0 props, slots, emits, and other structures may not correspond 1:1 with their TIDE 1.0 counterparts. See [Storybook](https://tide-design-system.netlify.app/) for the proper implementation of a TIDE 2.0 utility or component.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
❌ TIDE 1.0
|
|
43
|
+
`<BasicSample />`
|
|
44
|
+
|
|
45
|
+
✅ TIDE 2.0
|
|
46
|
+
`<TideSample />`
|
|
47
|
+
3. Delete orphaned components:
|
|
48
|
+
|
|
49
|
+
`git rm frontend/src/components-core/BasicSample.vue`
|
|
50
|
+
|
|
51
|
+
4. Delete orphaned types:
|
|
52
|
+
|
|
53
|
+
`git rm frontend/src/types/Sample.ts`
|
|
54
|
+
|
|
55
|
+
5. Delete orphaned utilities:
|
|
56
|
+
|
|
57
|
+
`git rm frontend/src/utilities/sample.ts`
|
|
58
|
+
|
|
59
|
+
6. Delete orphaned unit tests:
|
|
60
|
+
- `git rm frontend/tests/components/BasicSample.spec.ts`
|
|
61
|
+
- `git rm frontend/tests/BasicSample.spec.ts`
|
|
62
|
+
- `git rm frontend/tests/utilities-sample.spec.ts`
|
|
63
|
+
|
|
64
|
+
7. Delete unused [JS constants](https://github.com/traderinteractive/marketplace/blob/qa/frontend/src/types/Styles.ts) (CSS_OLD)
|
|
65
|
+
8. Delete unused [CSS utilities](https://github.com/traderinteractive/marketplace/blob/qa/frontend/src/assets/css/utilities.css)
|
package/src/docs/storybook.md
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
# TIDE Storybook
|
|
2
|
-
|
|
3
|
-
Storybook is a frontend workshop for building, testing, and documenting UI components and styles in isolation.
|
|
2
|
+
[Storybook](https://tide-design-system.netlify.app) is a third-party frontend interface for providing dynamic, integrated documentation for custom UI components and styles in isolation.
|
|
4
3
|
|
|
5
4
|
## Benefits
|
|
5
|
+
The TIDE Storybook was implemented to facilitate collaboration between departments within the Trader Interactive development group:
|
|
6
|
+
- **Product Managers** can reference TIDE utilities and components when writing requirements for new pages and features.
|
|
7
|
+
- **Designers** can interact with TIDE utilities and components in real browser conditions independent from any specific business context.
|
|
8
|
+
- **Developers** can dynamically leverage components without having to become reacquinted with formatting standards, styling structures, or complex prop implementations.
|
|
9
|
+
- **QA Engineers** can compare changes under test to the intended design and behavior of TIDE structures absent the context of a consumer repository.
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
- **Designers** can interact with our components in real browser conditions independent from any specific context in our websites.
|
|
10
|
-
- **Engineers** can leverage our components without having to become reacquinted with formatting standards, styling structures, or complex prop implementations.
|
|
11
|
-
|
|
12
|
-
## TODO
|
|
13
|
-
- based in stories
|
|
14
|
-
- args -> props, etc.
|
|
15
|
-
|
|
16
|
-
## Public
|
|
17
|
-
|
|
18
|
-
The TIDE Storybook UI is currently hosted from Netlify, a free, third-party platform connected to the Trader developer's personal GitHub fork. This is a temporary measure, to be replaced by a permanent solution that integrates the private server deployment process into the `tide-design-system` repository of the `traderinteractive` GitHub account for hosting to users within the Trader VPN.
|
|
19
|
-
|
|
20
|
-
https://tide-design-system.netlify.app
|
|
11
|
+
## Hosting
|
|
12
|
+
TIDE Storybook is currently publicly hosted via Netlify, a free, third-party platform connected to a fork of the TIDE repository. This is a temporary measure, to be replaced by a permanent solution that integrates the private server deployment process directly into the `traderinteractive` GitHub account for hosting to users within the Trader VPN.
|
|
21
13
|
|
|
22
14
|
## Local Setup
|
|
23
|
-
|
|
24
15
|
1. Install dependencies:
|
|
25
16
|
|
|
26
17
|
`npm install`
|
|
@@ -30,10 +21,24 @@ https://tide-design-system.netlify.app
|
|
|
30
21
|
`npm run storybook`
|
|
31
22
|
|
|
32
23
|
## Storybook UI
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
1. **Sidebar** serves as table of contents along the left edge of the screen.
|
|
25
|
+
2. **Toolbar** offers project-level controls across the top of the screen.
|
|
26
|
+
3. **Canvas** contains an interactive demo.
|
|
27
|
+
4. **Code Snippet** displays live-updated markup implementation available to copy.
|
|
28
|
+
5. **Controls** determine the options passed into demo and code snippet.
|
|
29
|
+
6. **Stories** demonstrate all major features of a given structure.
|
|
30
|
+
|
|
31
|
+
## Using Storybook
|
|
32
|
+
### Utilities
|
|
33
|
+
1. Visit the [Storybook](https://tide-design-system.netlify.app) site.
|
|
34
|
+
2. Select the relevant utility from the Sidebar.
|
|
35
|
+
3. Use the Controls table to modify the options to reflect Jira requirements and/or Figma mock.
|
|
36
|
+
4. The Canvas panel is updated dynamically to reflect the options as implemented via the CSS utility classes.
|
|
37
|
+
5. The Code Snippet panel (activated by clicking the "Show code" button) is updated dynamically to demonstrate the correct implementation of the CSS utilities.
|
|
38
|
+
|
|
39
|
+
### Components
|
|
40
|
+
1. Visit the [Storybook](https://tide-design-system.netlify.app) site.
|
|
41
|
+
2. Select the relevant component from the Sidebar.
|
|
42
|
+
3. Use the Controls table to modify the options to reflect Jira requirements and/or Figma mock.
|
|
43
|
+
4. The Canvas panel is updated dynamically to demonstrate an interactive implementation of the correct component variant.
|
|
44
|
+
5. The Code Snippet panel (activated by clicking the "Show code" button) is updated dynamically to demonstrate the correct implementation of the TIDE component.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# TIDE Marketplace Style Guides
|
|
2
|
+
Each redesign realm has an unlinked, yet publicly-accessible Style Guide page that demonstrates the styling and behavior of all major TIDE styles and components in a realm-specific production environment.
|
|
3
|
+
|
|
4
|
+
## Benefits
|
|
5
|
+
The TIDE Marketplace Style Guides were implemented to facilitate collaboration between departments within the Trader Interactive development group:
|
|
6
|
+
- **Product Managers** can quickly review which TIDE structures are already integrated into the `marketplace` repository.
|
|
7
|
+
- **Designers** can quickly verify that TIDE structures accurately reflect the designs.
|
|
8
|
+
- **Developers** can quickly view the standard implementation of any given structure as both source code and distributed code.
|
|
9
|
+
- **QA Engineers** can quickly verify that the design and behavior of TIDE structures have not been unintentionally altered by a dependency upgrade under test.
|
|
10
|
+
|
|
11
|
+
## Links
|
|
12
|
+
- Current redesign realms:
|
|
13
|
+
- [ATV](https://www.atvtrader.com/style-guide)
|
|
14
|
+
- [Boatmart](https://www.boatmart.com/style-guide)
|
|
15
|
+
- [RV](https://www.rvtrader.com/style-guide)
|
|
16
|
+
- Forthcoming redesign realms:
|
|
17
|
+
- [Aero](https://www.aerotrader.com/style-guide)
|
|
18
|
+
- [Cycle](https://www.cycletrader.com/style-guide)
|
|
19
|
+
- [Equipment](https://www.equipmenttrader.com/style-guide)
|
|
20
|
+
- [PWC](https://www.pwctrader.com/style-guide)
|
|
21
|
+
- [Snow](https://www.snowmobiletrader.com/style-guide)
|
|
22
|
+
- [Truck](https://www.commercialtrucktrader.com/style-guide)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# TIDE Collaborative Workflows
|
|
2
|
+
|
|
3
|
+
## TIDE-first development
|
|
4
|
+
|
|
5
|
+
1. Identify a ticket on your product team's Jira backlog that has a dependency on an approved TIDE structure not yet present in the TIDE repository.
|
|
6
|
+
2. Contact the TIDE team via the [#ti-marketplaces-design-system-public](https://cargroup.enterprise.slack.com/archives/C08TEFUUE4X) Slack channel to discuss the dependency and to determine whether a TIDE ticket already exists in Jira or must be created, then mark the dependent ticket as `blocked by` the TIDE ticket via Jira's `Add > Linked work item` feature.
|
|
7
|
+
3. The TIDE team will estimate and prioritize the ticket and pull it into a TIDE sprint accordingly.
|
|
8
|
+
4. Once pulled into a sprint, the TIDE team will develop, peer review, test, and merge a new branch into the TIDE repository, then publish a new version of the `tide-design-system` package to the NPM registry.
|
|
9
|
+
5. The TIDE team will notify the owners of the dependent ticket that the blockage has been removed.
|
|
10
|
+
6. From the consumer repository, manually upgrade the dependency to the latest version of the `tide-design-system` package, then develop, peer review, test, and release the dependent ticket in the consumer repository as normal.
|
|
11
|
+
|
|
12
|
+
## Consumer-first development
|
|
13
|
+
|
|
14
|
+
1. Develop, peer review, test, and release the proposed TIDE structures in a consumer repository as with any other Jira task.
|
|
15
|
+
2. Create a ticket in the [TIDE Jira backlog](https://traderinteractive.atlassian.net/jira/software/c/projects/TIDE/boards/1092/backlog) identifying the relevant structures and requesting that they be migrated/adapted into the TIDE repository.
|
|
16
|
+
3. Post a message in the [#ti-marketplaces-design-system-public](https://cargroup.enterprise.slack.com/archives/C08TEFUUE4X) Slack channel to make the TIDE team aware of the proposal.
|
|
17
|
+
4. The TIDE team will review the proposal.
|
|
18
|
+
1. If accepted, the TIDE team will prioritize the ticket for development and release.
|
|
19
|
+
2. If not accepted, the TIDE team will contact the reporter for additional discussion before closing the Jira ticket as `Won't Do`.
|
|
20
|
+
5. Jira will automatically contact the Reporter of the ticket with relevant updates, including publication.
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import * as STYLES from '@/types/Storybook';
|
|
2
1
|
import { CSS } from '@/types/Styles';
|
|
3
|
-
import {
|
|
4
|
-
argTypeBoolean,
|
|
5
|
-
formatArgType,
|
|
6
|
-
getConstantsByValues,
|
|
7
|
-
lineBreak,
|
|
8
|
-
prependNoneAsEmpty,
|
|
9
|
-
tab,
|
|
10
|
-
} from '@/utilities/storybook';
|
|
2
|
+
import { argTypeBoolean, getConstantsByValues, lineBreak, tab } from '@/utilities/storybook';
|
|
11
3
|
|
|
12
4
|
import type { StoryContext } from '@storybook/vue3';
|
|
13
5
|
|
|
14
|
-
const GRID_END = prependNoneAsEmpty(STYLES.GRID_END);
|
|
15
|
-
const GRID_START = prependNoneAsEmpty(STYLES.GRID_START);
|
|
16
|
-
|
|
17
6
|
const formatArgs = (args: any) => {
|
|
18
7
|
args.class = formatClassNames(args).join(' ');
|
|
19
8
|
|
|
@@ -25,8 +14,6 @@ const formatClassNames = (args: any) => {
|
|
|
25
14
|
|
|
26
15
|
if (args.fluid) classNames.push(CSS.GRID.FLUID);
|
|
27
16
|
if (args.item) classNames.push(CSS.GRID.ITEM);
|
|
28
|
-
if (args.start) classNames.push(args.start);
|
|
29
|
-
if (args.end) classNames.push(args.end);
|
|
30
17
|
|
|
31
18
|
return classNames;
|
|
32
19
|
};
|
|
@@ -89,12 +76,6 @@ const render = (args: any) => ({
|
|
|
89
76
|
|
|
90
77
|
export default {
|
|
91
78
|
argTypes: {
|
|
92
|
-
end: {
|
|
93
|
-
...formatArgType({ GRID_END }),
|
|
94
|
-
description: `Ending column of grid item`,
|
|
95
|
-
if: { arg: 'fluid', neq: true },
|
|
96
|
-
name: 'End',
|
|
97
|
-
},
|
|
98
79
|
fluid: {
|
|
99
80
|
...argTypeBoolean,
|
|
100
81
|
description: `Determines whether grid item should extend to parent bounds`,
|
|
@@ -107,12 +88,6 @@ export default {
|
|
|
107
88
|
if: { arg: 'fluid', neq: true },
|
|
108
89
|
name: 'Item',
|
|
109
90
|
},
|
|
110
|
-
start: {
|
|
111
|
-
...formatArgType({ GRID_START }),
|
|
112
|
-
description: `Starting column of grid item`,
|
|
113
|
-
if: { arg: 'fluid', neq: true },
|
|
114
|
-
name: 'Start',
|
|
115
|
-
},
|
|
116
91
|
xl: {
|
|
117
92
|
...argTypeBoolean,
|
|
118
93
|
description: `Increases the maximum content width`,
|
|
@@ -120,16 +95,14 @@ export default {
|
|
|
120
95
|
},
|
|
121
96
|
},
|
|
122
97
|
args: {
|
|
123
|
-
end: GRID_END.None,
|
|
124
98
|
fluid: false,
|
|
125
99
|
item: false,
|
|
126
|
-
start: GRID_START.None,
|
|
127
100
|
xl: false,
|
|
128
101
|
},
|
|
129
102
|
parameters,
|
|
130
103
|
render,
|
|
131
104
|
tags: ['autodocs'],
|
|
132
|
-
title: '
|
|
105
|
+
title: 'Utilities/Grid',
|
|
133
106
|
};
|
|
134
107
|
|
|
135
108
|
export const Default = {};
|
|
@@ -151,159 +124,3 @@ export const XL = {
|
|
|
151
124
|
xl: true,
|
|
152
125
|
},
|
|
153
126
|
};
|
|
154
|
-
|
|
155
|
-
export const Start0 = {
|
|
156
|
-
args: {
|
|
157
|
-
start: GRID_START['Column 0'],
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export const Start1 = {
|
|
162
|
-
args: {
|
|
163
|
-
start: GRID_START['Column 1'],
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const Start2 = {
|
|
168
|
-
args: {
|
|
169
|
-
start: GRID_START['Column 2'],
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export const Start3 = {
|
|
174
|
-
args: {
|
|
175
|
-
start: GRID_START['Column 3'],
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export const Start4 = {
|
|
180
|
-
args: {
|
|
181
|
-
start: GRID_START['Column 4'],
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export const Start5 = {
|
|
186
|
-
args: {
|
|
187
|
-
start: GRID_START['Column 5'],
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export const Start6 = {
|
|
192
|
-
args: {
|
|
193
|
-
start: GRID_START['Column 6'],
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export const Start7 = {
|
|
198
|
-
args: {
|
|
199
|
-
start: GRID_START['Column 7'],
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export const Start8 = {
|
|
204
|
-
args: {
|
|
205
|
-
start: GRID_START['Column 8'],
|
|
206
|
-
},
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export const Start9 = {
|
|
210
|
-
args: {
|
|
211
|
-
start: GRID_START['Column 9'],
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export const Start10 = {
|
|
216
|
-
args: {
|
|
217
|
-
start: GRID_START['Column 10'],
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
export const Start11 = {
|
|
222
|
-
args: {
|
|
223
|
-
start: GRID_START['Column 11'],
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const Start12 = {
|
|
228
|
-
args: {
|
|
229
|
-
start: GRID_START['Column 12'],
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
export const End1 = {
|
|
234
|
-
args: {
|
|
235
|
-
end: GRID_END['Column 1'],
|
|
236
|
-
},
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
export const End2 = {
|
|
240
|
-
args: {
|
|
241
|
-
end: GRID_END['Column 2'],
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export const End3 = {
|
|
246
|
-
args: {
|
|
247
|
-
end: GRID_END['Column 3'],
|
|
248
|
-
},
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
export const End4 = {
|
|
252
|
-
args: {
|
|
253
|
-
end: GRID_END['Column 4'],
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
export const End5 = {
|
|
258
|
-
args: {
|
|
259
|
-
end: GRID_END['Column 5'],
|
|
260
|
-
},
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
export const End6 = {
|
|
264
|
-
args: {
|
|
265
|
-
end: GRID_END['Column 6'],
|
|
266
|
-
},
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
export const End7 = {
|
|
270
|
-
args: {
|
|
271
|
-
end: GRID_END['Column 7'],
|
|
272
|
-
},
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export const End8 = {
|
|
276
|
-
args: {
|
|
277
|
-
end: GRID_END['Column 8'],
|
|
278
|
-
},
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export const End9 = {
|
|
282
|
-
args: {
|
|
283
|
-
end: GRID_END['Column 9'],
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
export const End10 = {
|
|
288
|
-
args: {
|
|
289
|
-
end: GRID_END['Column 10'],
|
|
290
|
-
},
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
export const End11 = {
|
|
294
|
-
args: {
|
|
295
|
-
end: GRID_END['Column 11'],
|
|
296
|
-
},
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
export const End12 = {
|
|
300
|
-
args: {
|
|
301
|
-
end: GRID_END['Column 12'],
|
|
302
|
-
},
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export const End13 = {
|
|
306
|
-
args: {
|
|
307
|
-
end: GRID_END['Column 13'],
|
|
308
|
-
},
|
|
309
|
-
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
1
3
|
import TideAlert from '@/components/TideAlert.vue';
|
|
2
4
|
import * as STANDARD_ALERT from '@/types/Alert';
|
|
3
5
|
import {
|
|
4
6
|
argTypeBooleanUnrequired,
|
|
5
7
|
dataTrack,
|
|
8
|
+
disabledArgType,
|
|
9
|
+
doSomething,
|
|
6
10
|
formatArgType,
|
|
7
11
|
parameters,
|
|
8
12
|
prependNoneAsUndefined,
|
|
@@ -10,14 +14,31 @@ import {
|
|
|
10
14
|
|
|
11
15
|
const render = (args: any) => ({
|
|
12
16
|
components: { TideAlert },
|
|
17
|
+
methods: {
|
|
18
|
+
doSomething,
|
|
19
|
+
handleClose: () => {
|
|
20
|
+
action('TideAlert closed')({});
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const callback = eval(args.handleClose);
|
|
24
|
+
|
|
25
|
+
if (callback) {
|
|
26
|
+
callback();
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
alert('Please specify a valid handler in the "close" control.');
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
},
|
|
13
33
|
setup: () => ({ args }),
|
|
14
|
-
template: `<TideAlert v-bind="args">{{ args.default }}</TideAlert>`,
|
|
34
|
+
template: `<TideAlert @close="handleClose" v-bind="args">{{ args.default }}</TideAlert>`,
|
|
15
35
|
});
|
|
16
36
|
|
|
17
37
|
const ALERT = prependNoneAsUndefined(STANDARD_ALERT.ALERT);
|
|
18
38
|
|
|
19
39
|
export default {
|
|
20
40
|
argTypes: {
|
|
41
|
+
close: disabledArgType,
|
|
21
42
|
dataTrack,
|
|
22
43
|
default: {
|
|
23
44
|
control: 'text',
|
|
@@ -27,6 +48,17 @@ export default {
|
|
|
27
48
|
type: { summary: 'HTML' },
|
|
28
49
|
},
|
|
29
50
|
},
|
|
51
|
+
handleClose: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'JS code or function to execute on close event',
|
|
54
|
+
isEmit: true,
|
|
55
|
+
name: 'close',
|
|
56
|
+
table: {
|
|
57
|
+
category: 'Events',
|
|
58
|
+
defaultValue: { summary: 'None' },
|
|
59
|
+
type: { summary: '() => void' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
30
62
|
heading: {
|
|
31
63
|
control: 'text',
|
|
32
64
|
description: 'Heading text',
|
|
@@ -35,6 +67,10 @@ export default {
|
|
|
35
67
|
type: { summary: 'HTML' },
|
|
36
68
|
},
|
|
37
69
|
},
|
|
70
|
+
isDismissible: {
|
|
71
|
+
...argTypeBooleanUnrequired,
|
|
72
|
+
description: 'Determines whether the Alert can be closed by the user',
|
|
73
|
+
},
|
|
38
74
|
isToast: {
|
|
39
75
|
...argTypeBooleanUnrequired,
|
|
40
76
|
description: 'Determines whether the Alert is an overlay or displaces content',
|
|
@@ -47,12 +83,20 @@ export default {
|
|
|
47
83
|
},
|
|
48
84
|
},
|
|
49
85
|
},
|
|
50
|
-
args: {
|
|
86
|
+
args: {
|
|
87
|
+
dataTrack: '',
|
|
88
|
+
default: '',
|
|
89
|
+
handleClose: 'doSomething',
|
|
90
|
+
heading: 'Heading',
|
|
91
|
+
isDismissible: undefined,
|
|
92
|
+
isToast: undefined,
|
|
93
|
+
type: undefined,
|
|
94
|
+
},
|
|
51
95
|
component: TideAlert,
|
|
52
96
|
parameters,
|
|
53
97
|
render,
|
|
54
98
|
tags: ['autodocs'],
|
|
55
|
-
title: '
|
|
99
|
+
title: 'Components/TideAlert',
|
|
56
100
|
};
|
|
57
101
|
|
|
58
102
|
export const Demo = {};
|