@frontify/fondue-components 1.0.0 → 1.1.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.
- package/dist/fondue-components.js +10 -0
- package/dist/fondue-components.js.map +1 -0
- package/dist/fondue-components10.js +38 -0
- package/dist/fondue-components10.js.map +1 -0
- package/dist/fondue-components11.js +10 -0
- package/dist/fondue-components11.js.map +1 -0
- package/dist/fondue-components12.js +5 -0
- package/dist/fondue-components12.js.map +1 -0
- package/dist/fondue-components13.js +33 -0
- package/dist/fondue-components13.js.map +1 -0
- package/dist/fondue-components14.js +602 -0
- package/dist/fondue-components14.js.map +1 -0
- package/dist/fondue-components15.js +2363 -0
- package/dist/fondue-components15.js.map +1 -0
- package/dist/fondue-components16.js +146 -0
- package/dist/fondue-components16.js.map +1 -0
- package/dist/fondue-components17.js +5 -0
- package/dist/fondue-components17.js.map +1 -0
- package/dist/fondue-components18.js +5 -0
- package/dist/fondue-components18.js.map +1 -0
- package/dist/fondue-components19.js +32 -0
- package/dist/fondue-components19.js.map +1 -0
- package/dist/fondue-components2.js +2 -0
- package/dist/fondue-components2.js.map +1 -0
- package/dist/fondue-components3.js +49 -0
- package/dist/fondue-components3.js.map +1 -0
- package/dist/fondue-components4.js +56 -0
- package/dist/fondue-components4.js.map +1 -0
- package/dist/fondue-components5.js +38 -0
- package/dist/fondue-components5.js.map +1 -0
- package/dist/fondue-components6.js +9 -0
- package/dist/fondue-components6.js.map +1 -0
- package/dist/fondue-components7.js +144 -0
- package/dist/fondue-components7.js.map +1 -0
- package/dist/fondue-components8.js +108 -0
- package/dist/fondue-components8.js.map +1 -0
- package/dist/fondue-components9.js +105 -0
- package/dist/fondue-components9.js.map +1 -0
- package/dist/index.d.ts +122 -0
- package/dist/style.css +1 -0
- package/package.json +9 -3
- package/.eslintignore +0 -4
- package/.eslintrc.cjs +0 -33
- package/.prettierignore +0 -1
- package/.prettierrc +0 -17
- package/.storybook/DocumentationTemplate.mdx +0 -25
- package/.storybook/main.ts +0 -29
- package/.storybook/preview.ts +0 -54
- package/CHANGELOG.md +0 -24
- package/playwright/index.html +0 -12
- package/playwright/index.ts +0 -3
- package/playwright.config.ts +0 -29
- package/postcss.config.cjs +0 -8
- package/scripts/createNewComponent.ts +0 -42
- package/scripts/templates/__tests__/component.ct.tsx +0 -25
- package/scripts/templates/__tests__/component.spec.tsx +0 -24
- package/scripts/templates/component.stories.ts +0 -35
- package/scripts/templates/component.ts +0 -25
- package/scripts/templates/index.ts +0 -15
- package/scripts/templates/styles/componentStyles.tsx +0 -16
- package/scripts/transforms.ts +0 -13
- package/scripts/types.ts +0 -7
- package/src/components/Button/Button.stories.tsx +0 -57
- package/src/components/Button/Button.tsx +0 -111
- package/src/components/Button/styles/buttonStyles.ts +0 -175
- package/src/components/Button/styles/iconStyles.ts +0 -152
- package/src/components/Button/styles/textStyles.ts +0 -149
- package/src/components/Button/tests/Button.ct.tsx +0 -61
- package/src/components/Button/tests/Button.spec.tsx +0 -34
- package/src/components/Divider/Divider.stories.ts +0 -47
- package/src/components/Divider/Divider.tsx +0 -69
- package/src/components/Divider/__tests__/Divider.spec.tsx +0 -88
- package/src/components/LoadingBar/LoadingBar.stories.tsx +0 -32
- package/src/components/LoadingBar/LoadingBar.tsx +0 -68
- package/src/components/LoadingBar/styles/loadingBarStyles.ts +0 -38
- package/src/components/LoadingBar/tests/LoadingBar.ct.tsx +0 -39
- package/src/index.ts +0 -7
- package/src/setupTests.ts +0 -19
- package/src/styles.css +0 -33
- package/src/utilities/focusStyle.ts +0 -12
- package/src/utilities/styleUtilities.ts +0 -19
- package/src/utilities/tests/styleUtilities.spec.ts +0 -114
- package/tailwind.config.ts +0 -148
- package/tsconfig.json +0 -26
- package/tsconfig.node.json +0 -21
- package/vite.config.ts +0 -67
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
4
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
5
|
+
import { ReactElement } from 'react';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { RefAttributes } from 'react';
|
|
8
|
+
|
|
9
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement | null>>;
|
|
10
|
+
|
|
11
|
+
declare type ButtonEmphasis = 'default' | 'weak' | 'strong';
|
|
12
|
+
|
|
13
|
+
declare type ButtonProps = {
|
|
14
|
+
/**
|
|
15
|
+
* @default null
|
|
16
|
+
*/
|
|
17
|
+
type?: ButtonType;
|
|
18
|
+
/**
|
|
19
|
+
* @default null
|
|
20
|
+
*/
|
|
21
|
+
title?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @default 'default'
|
|
24
|
+
*/
|
|
25
|
+
style?: ButtonStyle;
|
|
26
|
+
/**
|
|
27
|
+
* @default 'strong'
|
|
28
|
+
*/
|
|
29
|
+
emphasis?: ButtonEmphasis;
|
|
30
|
+
/**
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
hideLabel?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @default 'medium'
|
|
36
|
+
*/
|
|
37
|
+
size?: ButtonSize;
|
|
38
|
+
/**
|
|
39
|
+
* @default 'medium'
|
|
40
|
+
*/
|
|
41
|
+
rounding?: ButtonRounding;
|
|
42
|
+
/**
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
hugWidth?: boolean;
|
|
50
|
+
icon?: ReactElement;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
onClick?: (event?: MouseEvent_2<HTMLButtonElement>) => void;
|
|
53
|
+
'aria-label'?: string;
|
|
54
|
+
'aria-describedby'?: string;
|
|
55
|
+
'data-test-id'?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare type ButtonRounding = 'medium' | 'full';
|
|
59
|
+
|
|
60
|
+
declare type ButtonSize = 'small' | 'medium' | 'large';
|
|
61
|
+
|
|
62
|
+
declare type ButtonStyle = 'default' | 'positive' | 'negative' | 'danger' | 'loud';
|
|
63
|
+
|
|
64
|
+
declare type ButtonType = 'button' | 'submit' | 'reset';
|
|
65
|
+
|
|
66
|
+
export declare const Divider: ({ vertical, style, height, "data-test-id": dataTestId, color, }: DividerProps) => ReactElement;
|
|
67
|
+
|
|
68
|
+
declare type DividerHeight = 'small' | 'medium' | 'large';
|
|
69
|
+
|
|
70
|
+
declare type DividerProps = {
|
|
71
|
+
style?: DividerStyle;
|
|
72
|
+
height?: DividerHeight;
|
|
73
|
+
color?: string;
|
|
74
|
+
vertical?: boolean;
|
|
75
|
+
'data-test-id'?: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
declare type DividerStyle = 'noline' | 'dashed' | 'solid' | 'dotted';
|
|
79
|
+
|
|
80
|
+
export declare const LoadingBar: ForwardRefExoticComponent<LoadingBarProps & RefAttributes<HTMLDivElement>>;
|
|
81
|
+
|
|
82
|
+
declare type LoadingBarProps = {
|
|
83
|
+
/**
|
|
84
|
+
* The current value of the loading bar. If `null`, the loading bar will be in an indeterminate state.
|
|
85
|
+
* @default null
|
|
86
|
+
*/
|
|
87
|
+
value: number | null;
|
|
88
|
+
/**
|
|
89
|
+
* @default 100
|
|
90
|
+
*/
|
|
91
|
+
max?: number;
|
|
92
|
+
/**
|
|
93
|
+
* @default 'fondue-loading-bar'
|
|
94
|
+
*/
|
|
95
|
+
'data-test-id'?: string;
|
|
96
|
+
/**
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
rounded?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* @default 'default'
|
|
102
|
+
*/
|
|
103
|
+
style?: 'default' | 'positive' | 'negative';
|
|
104
|
+
/**
|
|
105
|
+
* @default 'medium'
|
|
106
|
+
*/
|
|
107
|
+
size?: 'small' | 'medium' | 'large' | 'x-large';
|
|
108
|
+
getValueLabel?: (value: number, max: number) => string;
|
|
109
|
+
} & ({
|
|
110
|
+
'aria-label': string;
|
|
111
|
+
} | {
|
|
112
|
+
'aria-labelledby': string;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export { }
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
declare module 'vitest' {
|
|
119
|
+
interface Assertion<T = any> extends jest.Matchers<void, T>, TestingLibraryMatchers<T, void> {
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk Frontify,Arial,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Menlo,Courier,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(147 197 253 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(147 197 253 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.tw-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.tw-pointer-events-none{pointer-events:none}.tw-relative{position:relative}.tw-m-0{margin:0}.tw-mx-5{margin-left:1.25rem;margin-right:1.25rem}.tw--ml-0{margin-left:-0px}.tw--ml-0\.5{margin-left:-.125rem}.tw--ml-1{margin-left:-.25rem}.tw-mb-0{margin-bottom:0}.tw-mr-1{margin-right:.25rem}.tw-mr-1\.5{margin-right:.375rem}.tw-mr-2{margin-right:.5rem}.tw-mt-0{margin-top:0}.tw-flex{display:flex}.tw-aspect-square{aspect-ratio:1 / 1}.tw-h-1{height:.25rem}.tw-h-12{height:3rem}.tw-h-2{height:.5rem}.tw-h-3{height:.75rem}.tw-h-4{height:1rem}.tw-h-6{height:1.5rem}.tw-h-9{height:2.25rem}.tw-h-full{height:100%}.tw-w-full{width:100%}.tw-w-px{width:1px}.tw-origin-left-right{transform-origin:0% 50%}.tw--translate-x-\[calc\(100\%-var\(--loading-bar-value\)\)\]{--tw-translate-x: calc(calc(100% - var(--loading-bar-value)) * -1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes tw-loading-bar-infinite{0%{transform:translate(0) scaleX(0)}40%{transform:translate(0) scaleX(.4)}to{transform:translate(100%) scaleX(.5)}}.tw-animate-loading-bar-infinite{animation:tw-loading-bar-infinite 1s infinite linear}.tw-cursor-pointer{cursor:pointer}.tw-flex-col{flex-direction:column}.tw-items-start{align-items:flex-start}.tw-items-end{align-items:flex-end}.tw-items-center{align-items:center}.tw-justify-center{justify-content:center}.tw-self-stretch{align-self:stretch}.tw-overflow-hidden{overflow:hidden}.tw-rounded{border-radius:var(--radius)}.tw-rounded-full{border-radius:9999px}.tw-border{border-width:var(--line-width)}.tw-border-2{border-width:2px}.tw-border-r{border-right-width:var(--line-width)}.tw-border-t{border-top-width:var(--line-width)}.tw-border-solid{border-style:solid}.tw-border-dashed{border-style:dashed}.tw-border-dotted{border-style:dotted}.tw-border-none{border-style:none}.tw-border-black{--tw-border-opacity: 1;border-color:rgb(45 50 50 / var(--tw-border-opacity))}.tw-border-box-selected-strong{border-color:var(--box-selected-strong-color)}.tw-border-button-border{border-color:var(--button-border-color)}.tw-border-button-danger-border{border-color:var(--button-danger-border-color)}.tw-border-button-negative-border{border-color:var(--button-negative-border-color)}.tw-border-button-positive-border{border-color:var(--button-positive-border-color)}.tw-border-button-strong-border{border-color:var(--button-strong-border-color)}.tw-border-button-strong-negative-border{border-color:var(--button-strong-negative-border-color)}.tw-border-button-strong-positive-border{border-color:var(--button-strong-positive-border-color)}.tw-border-transparent{border-color:transparent}.tw-bg-box-disabled{background-color:var(--box-disabled-color)}.tw-bg-box-negative{background-color:var(--box-negative-color)}.tw-bg-box-positive{background-color:var(--box-positive-color)}.tw-bg-box-selected{background-color:var(--box-selected-color)}.tw-bg-box-selected-strong{background-color:var(--box-selected-strong-color)}.tw-bg-button-background{background-color:var(--button-background-color)}.tw-bg-button-danger-background{background-color:var(--button-danger-background-color)}.tw-bg-button-negative-background{background-color:var(--button-negative-background-color)}.tw-bg-button-positive-background{background-color:var(--button-positive-background-color)}.tw-bg-button-strong-background{background-color:var(--button-strong-background-color)}.tw-bg-button-strong-negative-background{background-color:var(--button-strong-negative-background-color)}.tw-bg-button-strong-positive-background{background-color:var(--button-strong-positive-background-color)}.tw-bg-text-interactive{background-color:var(--text-color-interactive)}.tw-bg-text-negative{background-color:var(--text-color-negative)}.tw-bg-text-positive{background-color:var(--text-color-positive)}.tw-p-2{padding:.5rem}.tw-p-8{padding:2rem}.tw-px-0{padding-left:0;padding-right:0}.tw-px-2{padding-left:.5rem;padding-right:.5rem}.tw-px-4{padding-left:1rem;padding-right:1rem}.tw-px-6{padding-left:1.5rem;padding-right:1.5rem}.tw-font-body{font-family:var(--body-family)}.tw-text-body-large{font-size:var(--body-size-large);line-height:var(--body-size-large-line-height)}.tw-text-body-medium{font-size:var(--body-size-medium);line-height:var(--body-size-medium-line-height)}.tw-text-body-small{font-size:var(--body-size-small);line-height:var(--body-size-small-line-height)}.tw-font-medium{font-weight:500}.tw-leading-none{line-height:1}.tw-text-box-disabled-inverse{color:var(--box-disabled-color-inverse)}.tw-text-box-selected-inverse{color:var(--box-selected-inverse-color)}.tw-text-box-selected-strong-inverse{color:var(--box-selected-strong-inverse-color)}.tw-text-button-danger-icon{color:var(--button-danger-icon-color)}.tw-text-button-danger-text{color:var(--button-danger-text-color)}.tw-text-button-icon{color:var(--button-icon-color)}.tw-text-button-negative-icon{color:var(--button-negative-icon-color)}.tw-text-button-negative-text{color:var(--button-negative-text-color)}.tw-text-button-positive-icon{color:var(--button-positive-icon-color)}.tw-text-button-positive-text{color:var(--button-positive-text-color)}.tw-text-button-strong-icon{color:var(--button-strong-icon-color)}.tw-text-button-strong-negative-icon{color:var(--button-strong-negative-icon-color)}.tw-text-button-strong-negative-text{color:var(--button-strong-negative-text-color)}.tw-text-button-strong-positive-icon{color:var(--button-strong-positive-icon-color)}.tw-text-button-strong-positive-text{color:var(--button-strong-positive-text-color)}.tw-text-button-text{color:var(--button-text-color)}.tw-outline-none{outline:2px solid transparent;outline-offset:2px}.tw-ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.tw-ring-inset{--tw-ring-inset: inset}.tw-ring-blue{--tw-ring-opacity: 1;--tw-ring-color: rgb(94 158 214 / var(--tw-ring-opacity))}.tw-ring-offset-2{--tw-ring-offset-width: 2px}.tw-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.focus-within\:tw-outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}.focus-within\:tw-ring-4:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:tw-ring-blue:focus-within{--tw-ring-opacity: 1;--tw-ring-color: rgb(94 158 214 / var(--tw-ring-opacity))}.focus-within\:tw-ring-offset-2:focus-within{--tw-ring-offset-width: 2px}.hover\:tw-border-button-border:hover{border-color:var(--button-border-color)}.hover\:tw-border-button-negative-border:hover{border-color:var(--button-negative-border-color)}.hover\:tw-border-button-positive-border:hover{border-color:var(--button-positive-border-color)}.hover\:tw-bg-box-selected-hover:hover{background-color:var(--box-selected-color-hover)}.hover\:tw-bg-box-selected-strong-hover:hover{background-color:var(--box-selected-strong-color-hover)}.hover\:tw-bg-button-background-hover:hover{background-color:var(--button-background-color-hover)}.hover\:tw-bg-button-danger-background-hover:hover{background-color:var(--button-danger-background-color-hover)}.hover\:tw-bg-button-negative-background-hover:hover{background-color:var(--button-negative-background-color-hover)}.hover\:tw-bg-button-positive-background-hover:hover{background-color:var(--button-positive-background-color-hover)}.hover\:tw-bg-button-strong-background-hover:hover{background-color:var(--button-strong-background-color-hover)}.hover\:tw-bg-button-strong-negative-background-hover:hover{background-color:var(--button-strong-negative-background-color-hover)}.hover\:tw-bg-button-strong-positive-background-hover:hover{background-color:var(--button-strong-positive-background-color-hover)}.focus-visible\:tw-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:tw-ring-4:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:tw-ring-blue:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(94 158 214 / var(--tw-ring-opacity))}.focus-visible\:tw-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\:tw-bg-box-selected-pressed:active{background-color:var(--box-selected-color-pressed)}.active\:tw-bg-box-selected-strong-pressed:active{background-color:var(--box-selected-strong-color-pressed)}.active\:tw-bg-button-background-pressed:active{background-color:var(--button-background-color-pressed)}.active\:tw-bg-button-danger-background-pressed:active{background-color:var(--button-danger-background-color-pressed)}.active\:tw-bg-button-negative-background-pressed:active{background-color:var(--button-negative-background-color-pressed)}.active\:tw-bg-button-positive-background-pressed:active{background-color:var(--button-positive-background-color-pressed)}.active\:tw-bg-button-strong-background-pressed:active{background-color:var(--button-strong-background-color-pressed)}.active\:tw-bg-button-strong-negative-background-pressed:active{background-color:var(--button-strong-negative-background-color-pressed)}.active\:tw-bg-button-strong-positive-background-pressed:active{background-color:var(--button-strong-positive-background-color-pressed)}.tw-group:hover .group-hover\:tw-text-box-selected-inverse-hover{color:var(--box-selected-inverse-color-hover)}.tw-group:hover .group-hover\:tw-text-box-selected-strong-inverse{color:var(--box-selected-strong-inverse-color)}.tw-group:active .group-active\:tw-text-box-selected-inverse-pressed{color:var(--box-selected-inverse-color-pressed)}.tw-group:active .group-active\:tw-text-box-selected-strong-inverse{color:var(--box-selected-strong-inverse-color)}.dark\:tw-ring-offset-black:is(.tw-dark *){--tw-ring-offset-color: #2d3232}.focus-within\:dark\:tw-ring-offset-black:is(.tw-dark *):focus-within{--tw-ring-offset-color: #2d3232}.focus-visible\:dark\:tw-ring-offset-black:is(.tw-dark *):focus-visible{--tw-ring-offset-color: #2d3232}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/fondue-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"homepage": "https://github.com/Frontify/fondue",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"./styles": "./dist/style.css"
|
|
23
23
|
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
24
27
|
"engines": {
|
|
25
28
|
"node": ">=18"
|
|
26
29
|
},
|
|
@@ -35,15 +38,16 @@
|
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"@etchteam/storybook-addon-status": "^4.2.4",
|
|
37
40
|
"@frontify/eslint-config-react": "^0.17.6",
|
|
38
|
-
"@frontify/fondue-tokens": "^3.5.0",
|
|
39
41
|
"@playwright/experimental-ct-react": "1.41.2",
|
|
40
42
|
"@storybook/addon-a11y": "^8.0.8",
|
|
41
43
|
"@storybook/addon-essentials": "^8.0.8",
|
|
42
44
|
"@storybook/addon-interactions": "^8.0.8",
|
|
43
45
|
"@storybook/addon-links": "^8.0.8",
|
|
44
46
|
"@storybook/blocks": "^8.0.8",
|
|
47
|
+
"@storybook/manager-api": "^8.0.8",
|
|
45
48
|
"@storybook/react": "^8.0.8",
|
|
46
49
|
"@storybook/react-vite": "^8.0.8",
|
|
50
|
+
"@storybook/theming": "^8.0.8",
|
|
47
51
|
"@tailwindcss/forms": "^0.5.7",
|
|
48
52
|
"@testing-library/jest-dom": "^6.4.2",
|
|
49
53
|
"@testing-library/react": "^15.0.1",
|
|
@@ -52,6 +56,7 @@
|
|
|
52
56
|
"@vitejs/plugin-react": "^4.2.1",
|
|
53
57
|
"@vitest/coverage-v8": "^1.4.0",
|
|
54
58
|
"@vitest/ui": "^1.4.0",
|
|
59
|
+
"autoprefixer": "^10.4.19",
|
|
55
60
|
"chalk": "^5.3.0",
|
|
56
61
|
"eslint": "^8.57.0",
|
|
57
62
|
"eslint-plugin-notice": "^0.9.10",
|
|
@@ -72,7 +77,8 @@
|
|
|
72
77
|
"vite-plugin-dts": "^3.8.1",
|
|
73
78
|
"vite-tsconfig-paths": "^4.3.2",
|
|
74
79
|
"vitest": "^1.4.0",
|
|
75
|
-
"@frontify/fondue-icons": "^0.2.0"
|
|
80
|
+
"@frontify/fondue-icons": "^0.2.0",
|
|
81
|
+
"@frontify/fondue-tokens": "^3.5.0"
|
|
76
82
|
},
|
|
77
83
|
"scripts": {
|
|
78
84
|
"build": "vite build",
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
root: true,
|
|
5
|
-
extends: ['@frontify/eslint-config-react', 'plugin:storybook/recommended'],
|
|
6
|
-
plugins: ['notice'],
|
|
7
|
-
settings: {
|
|
8
|
-
react: {
|
|
9
|
-
version: 'detect',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
parserOptions: {
|
|
13
|
-
project: ['tsconfig.json', 'tsconfig.node.json'],
|
|
14
|
-
tsconfigRootDir: __dirname,
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
},
|
|
17
|
-
overrides: [
|
|
18
|
-
{
|
|
19
|
-
files: ['*.js', '*.ts', '*.tsx'],
|
|
20
|
-
rules: {
|
|
21
|
-
'notice/notice': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
template: '/* (c) Copyright Frontify Ltd., all rights reserved. */\n\n',
|
|
25
|
-
messages: {
|
|
26
|
-
whenFailedToMatch: 'No Frontify copyright header set.',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
CHANGELOG.md
|
package/.prettierrc
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"printWidth": 120,
|
|
3
|
-
"tabWidth": 4,
|
|
4
|
-
"singleQuote": true,
|
|
5
|
-
"trailingComma": "all",
|
|
6
|
-
"arrowParens": "always",
|
|
7
|
-
"endOfLine": "lf",
|
|
8
|
-
"overrides": [
|
|
9
|
-
{
|
|
10
|
-
"files": ["tsconfig.json", "tsconfig.*.json"],
|
|
11
|
-
"options": {
|
|
12
|
-
"parser": "json",
|
|
13
|
-
"trailingComma": "none"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ArgTypes, Canvas, Controls, Description, Markdown, Meta, Source, Stories, Title } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
<div className="tw-mx-5 sb-unstyled">
|
|
4
|
-
|
|
5
|
-
<Meta isTemplate />
|
|
6
|
-
|
|
7
|
-
<Title />
|
|
8
|
-
|
|
9
|
-
<Description />
|
|
10
|
-
|
|
11
|
-
## Preview
|
|
12
|
-
|
|
13
|
-
<Canvas sourceState="shown" />
|
|
14
|
-
|
|
15
|
-
## Controls
|
|
16
|
-
|
|
17
|
-
<Controls />
|
|
18
|
-
|
|
19
|
-
## API
|
|
20
|
-
|
|
21
|
-
<ArgTypes />
|
|
22
|
-
|
|
23
|
-
<Stories />
|
|
24
|
-
|
|
25
|
-
</div>
|
package/.storybook/main.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from '@storybook/react-vite';
|
|
2
|
-
|
|
3
|
-
const config: StorybookConfig = {
|
|
4
|
-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
5
|
-
addons: [
|
|
6
|
-
'@etchteam/storybook-addon-status',
|
|
7
|
-
'@storybook/addon-a11y',
|
|
8
|
-
'@storybook/addon-essentials',
|
|
9
|
-
'@storybook/addon-interactions',
|
|
10
|
-
'@storybook/addon-links',
|
|
11
|
-
'storybook-dark-mode',
|
|
12
|
-
],
|
|
13
|
-
framework: {
|
|
14
|
-
name: '@storybook/react-vite',
|
|
15
|
-
options: {},
|
|
16
|
-
},
|
|
17
|
-
docs: {
|
|
18
|
-
autodocs: 'tag',
|
|
19
|
-
defaultName: 'Documentation',
|
|
20
|
-
},
|
|
21
|
-
viteFinal(config) {
|
|
22
|
-
// @ts-expect-error untyped name property
|
|
23
|
-
config.plugins = (config.plugins ?? []).filter((plugin) => plugin?.name !== 'vite:dts');
|
|
24
|
-
|
|
25
|
-
return config;
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default config;
|
package/.storybook/preview.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import "@frontify/fondue-tokens/styles";
|
|
2
|
-
import type { Preview } from '@storybook/react';
|
|
3
|
-
import '../src/styles.css';
|
|
4
|
-
import DocumentationTemplate from './DocumentationTemplate.mdx';
|
|
5
|
-
|
|
6
|
-
const preview: Preview = {
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
page: DocumentationTemplate,
|
|
10
|
-
toc: {
|
|
11
|
-
title: 'Table of contents',
|
|
12
|
-
headingSelector: 'h2, h3',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
controls: {
|
|
16
|
-
matchers: {
|
|
17
|
-
color: /(background|color)$/i,
|
|
18
|
-
date: /Date$/i,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
status: {
|
|
22
|
-
type: 'legacy',
|
|
23
|
-
statuses: {
|
|
24
|
-
released: {
|
|
25
|
-
background: 'rgb(50, 210, 182)',
|
|
26
|
-
color: '#ffffff',
|
|
27
|
-
description: 'This component is stable and released',
|
|
28
|
-
},
|
|
29
|
-
in_progress: {
|
|
30
|
-
background: 'rgb(154, 126, 254)',
|
|
31
|
-
color: '#ffffff',
|
|
32
|
-
description: 'This component is in progress',
|
|
33
|
-
},
|
|
34
|
-
planned: {
|
|
35
|
-
background: 'rgb(254, 194, 50)',
|
|
36
|
-
color: '#ffffff',
|
|
37
|
-
description: 'This component is planned to be revamped',
|
|
38
|
-
},
|
|
39
|
-
legacy: {
|
|
40
|
-
background: 'rgb(129, 132, 132)',
|
|
41
|
-
color: '#ffffff',
|
|
42
|
-
description: 'This is a legacy component',
|
|
43
|
-
},
|
|
44
|
-
deprecated: {
|
|
45
|
-
background: 'rgb(153, 33, 54)',
|
|
46
|
-
color: '#ffffff',
|
|
47
|
-
description: 'This is a legacy component',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default preview;
|
package/CHANGELOG.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# @frontify/fondue-components
|
|
2
|
-
|
|
3
|
-
## 1.0.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [#1807](https://github.com/Frontify/fondue/pull/1807) [`fc35a50`](https://github.com/Frontify/fondue/commit/fc35a509e641604eaf2a4b644c573929c3440be3) Thanks [@noahwaldner](https://github.com/noahwaldner)! - refactor: Finalized Monorepo transition, added subexport for new components, added contribution guidelines and readme
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- [#1798](https://github.com/Frontify/fondue/pull/1798) [`99c8cea`](https://github.com/Frontify/fondue/commit/99c8cea49a6148206c127ebde6f559e17f5980bf) Thanks [@noahwaldner](https://github.com/noahwaldner)! - refactor: refactored button approach to size/variants
|
|
12
|
-
|
|
13
|
-
- [#1811](https://github.com/Frontify/fondue/pull/1811) [`4fa8007`](https://github.com/Frontify/fondue/commit/4fa8007bf973494ff4621f526d8f2919115f95ff) Thanks [@noahwaldner](https://github.com/noahwaldner)! - fix: housekeeping for v12 release
|
|
14
|
-
|
|
15
|
-
- [#1806](https://github.com/Frontify/fondue/pull/1806) [`246dfb8`](https://github.com/Frontify/fondue/commit/246dfb8112b68341de8cfd25a71cf3729848395d) Thanks [@noahwaldner](https://github.com/noahwaldner)! - feat: add packages sub-export to `@frontify/fondue`
|
|
16
|
-
|
|
17
|
-
- Updated dependencies [[`fc35a50`](https://github.com/Frontify/fondue/commit/fc35a509e641604eaf2a4b644c573929c3440be3), [`99c8cea`](https://github.com/Frontify/fondue/commit/99c8cea49a6148206c127ebde6f559e17f5980bf), [`246dfb8`](https://github.com/Frontify/fondue/commit/246dfb8112b68341de8cfd25a71cf3729848395d)]:
|
|
18
|
-
- @frontify/fondue-icons@0.2.0
|
|
19
|
-
|
|
20
|
-
## 0.1.0
|
|
21
|
-
|
|
22
|
-
### Minor Changes
|
|
23
|
-
|
|
24
|
-
- [#1731](https://github.com/Frontify/fondue/pull/1731) [`ef0519d`](https://github.com/Frontify/fondue/commit/ef0519d8021204b280b65812c98686b4ce3b909e) Thanks [@noahwaldner](https://github.com/noahwaldner)! - added export for the new components in fondue
|
package/playwright/index.html
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Testing Page</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="./index.ts"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
package/playwright/index.ts
DELETED
package/playwright.config.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { defineConfig, devices } from '@playwright/experimental-ct-react';
|
|
4
|
-
import tsConfigPaths from 'vite-tsconfig-paths';
|
|
5
|
-
|
|
6
|
-
// https://playwright.dev/docs/test-configuration
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
testDir: './src',
|
|
9
|
-
snapshotDir: './__snapshots__',
|
|
10
|
-
timeout: 10_000,
|
|
11
|
-
fullyParallel: true,
|
|
12
|
-
forbidOnly: !!process.env.CI,
|
|
13
|
-
retries: process.env.CI ? 2 : 0,
|
|
14
|
-
workers: process.env.CI ? 1 : undefined,
|
|
15
|
-
reporter: 'html',
|
|
16
|
-
testMatch: '**/*.ct.{ts,tsx}',
|
|
17
|
-
use: {
|
|
18
|
-
trace: 'on-first-retry',
|
|
19
|
-
ctPort: 3100,
|
|
20
|
-
ctViteConfig: {
|
|
21
|
-
plugins: [tsConfigPaths()],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
projects: [
|
|
25
|
-
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
|
|
26
|
-
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
|
|
27
|
-
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
|
|
28
|
-
],
|
|
29
|
-
});
|
package/postcss.config.cjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
4
|
-
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
|
|
7
|
-
import templates from './templates';
|
|
8
|
-
|
|
9
|
-
(() => {
|
|
10
|
-
const componentName = process.argv[3] || process.argv[2];
|
|
11
|
-
|
|
12
|
-
if (!componentName) {
|
|
13
|
-
console.error(chalk.red('You need to supply a component name.'));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.log(`Creating ${componentName} component...`);
|
|
18
|
-
|
|
19
|
-
const componentDirectory = `./src/components/${componentName}`;
|
|
20
|
-
|
|
21
|
-
if (existsSync(componentDirectory)) {
|
|
22
|
-
console.error(chalk.red(`Component ${componentName} already exists.`));
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const generatedTemplates = templates.map((template) => template(componentName));
|
|
27
|
-
|
|
28
|
-
mkdirSync(componentDirectory);
|
|
29
|
-
|
|
30
|
-
for (const template of generatedTemplates) {
|
|
31
|
-
let directory = componentDirectory;
|
|
32
|
-
if (template.subdirectory) {
|
|
33
|
-
directory = `${componentDirectory}/${template.subdirectory}`;
|
|
34
|
-
if (!existsSync(directory)) {
|
|
35
|
-
mkdirSync(`${componentDirectory}/${template.subdirectory}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
writeFileSync(`${directory}/${componentName}${template.extension}`, template.content);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
console.log(chalk.green(`Component created in ${componentDirectory}`));
|
|
42
|
-
})();
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { toKebabCase } from '../../transforms';
|
|
4
|
-
import { type ComponentFileBuilderResponse } from '../../types';
|
|
5
|
-
|
|
6
|
-
export const Setup = (componentName: string): ComponentFileBuilderResponse => ({
|
|
7
|
-
content: `/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
8
|
-
|
|
9
|
-
import { expect, test } from '@playwright/experimental-ct-react';
|
|
10
|
-
|
|
11
|
-
import { ${componentName} } from "../${componentName}";
|
|
12
|
-
|
|
13
|
-
const ${componentName}_TEST_ID = "test-${toKebabCase(componentName)}";
|
|
14
|
-
const ${componentName}_TEXT = "sample ${toKebabCase(componentName)}";
|
|
15
|
-
|
|
16
|
-
test('should render without error', async ({ mount }) => {
|
|
17
|
-
const component = await mount(<${componentName} data-test-id={${componentName}_TEST_ID}>{${componentName}_TEXT}</${componentName}>);
|
|
18
|
-
await expect(component).toBeVisible()
|
|
19
|
-
await expect(component).toContainText(${componentName}_TEXT)
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
`,
|
|
23
|
-
extension: '.ct.tsx',
|
|
24
|
-
subdirectory: '__tests__',
|
|
25
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { toKebabCase } from '../../transforms';
|
|
4
|
-
import { type ComponentFileBuilderResponse } from '../../types';
|
|
5
|
-
|
|
6
|
-
export const Setup = (componentName: string): ComponentFileBuilderResponse => ({
|
|
7
|
-
content: `/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
8
|
-
|
|
9
|
-
import { ${componentName} } from "../${componentName}";
|
|
10
|
-
|
|
11
|
-
const ${componentName}_TEST_ID = "test-${toKebabCase(componentName)}";
|
|
12
|
-
const ${componentName}_TEXT = "sample ${toKebabCase(componentName)}";
|
|
13
|
-
|
|
14
|
-
describe("${componentName} Component", () => {
|
|
15
|
-
it("should render foo text correctly", () => {
|
|
16
|
-
const { getByTestId } = render(<${componentName} data-test-id={${componentName}_TEST_ID}>{${componentName}_TEXT}</${componentName}>);
|
|
17
|
-
const component = getByTestId(${componentName}_TEST_ID);
|
|
18
|
-
expect(component).toContain(${componentName}_TEXT);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
`,
|
|
22
|
-
extension: '.spec.tsx',
|
|
23
|
-
subdirectory: '__tests__',
|
|
24
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { type ComponentFileBuilderResponse } from '../types';
|
|
4
|
-
|
|
5
|
-
// We aren't really in a story
|
|
6
|
-
// eslint-disable-next-line storybook/default-exports
|
|
7
|
-
export const Setup = (componentName: string): ComponentFileBuilderResponse => ({
|
|
8
|
-
content: `/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
9
|
-
|
|
10
|
-
import { type Meta, type StoryObj } from "@storybook/react";
|
|
11
|
-
|
|
12
|
-
import { ${componentName} } from "./${componentName}";
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof ${componentName}>;
|
|
15
|
-
const meta: Meta<typeof ${componentName}> = {
|
|
16
|
-
component: ${componentName},
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
parameters: {
|
|
19
|
-
status: {
|
|
20
|
-
type: 'in_progress',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
args: {},
|
|
24
|
-
};
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
name: 'Text Label Only',
|
|
29
|
-
args: {
|
|
30
|
-
children: 'Hello World',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
`,
|
|
34
|
-
extension: '.stories.ts',
|
|
35
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { toKebabCase } from '../transforms';
|
|
4
|
-
import { type ComponentFileBuilderResponse } from '../types';
|
|
5
|
-
|
|
6
|
-
export const Setup = (componentName: string): ComponentFileBuilderResponse => ({
|
|
7
|
-
content: `/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
8
|
-
|
|
9
|
-
import { type ReactNode } from "react";
|
|
10
|
-
|
|
11
|
-
import { ${componentName}Styles } from './styles/${componentName}Styles';
|
|
12
|
-
|
|
13
|
-
export type ${componentName}Props = { children?: ReactNode; };
|
|
14
|
-
|
|
15
|
-
export const ${componentName} = ({ children }: ${componentName}Props) => {
|
|
16
|
-
return (
|
|
17
|
-
<div className={${componentName}Styles()} data-test-id="${toKebabCase(componentName)}">
|
|
18
|
-
{children}
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
${componentName}.displayName = "${componentName}";
|
|
23
|
-
`,
|
|
24
|
-
extension: '.tsx',
|
|
25
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import * as componentVisualTests from './__tests__/component.ct';
|
|
4
|
-
import * as componentFunctionalTests from './__tests__/component.spec';
|
|
5
|
-
import * as component from './component';
|
|
6
|
-
import * as componentStories from './component.stories';
|
|
7
|
-
import * as componentStyles from './styles/componentStyles';
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
component.Setup,
|
|
11
|
-
componentStories.Setup,
|
|
12
|
-
componentFunctionalTests.Setup,
|
|
13
|
-
componentVisualTests.Setup,
|
|
14
|
-
componentStyles.Setup,
|
|
15
|
-
];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { type ComponentFileBuilderResponse } from '../../types';
|
|
4
|
-
|
|
5
|
-
export const Setup = (componentName: string): ComponentFileBuilderResponse => ({
|
|
6
|
-
content: `/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
7
|
-
|
|
8
|
-
import { sv } from '#/utilities/styleUtilities';
|
|
9
|
-
|
|
10
|
-
export const ${componentName}Styles = sv({
|
|
11
|
-
base: "tw-block",
|
|
12
|
-
})
|
|
13
|
-
`,
|
|
14
|
-
extension: 'Styles.tsx',
|
|
15
|
-
subdirectory: 'styles',
|
|
16
|
-
});
|