@sonic-equipment/ui 0.0.13 → 0.0.15

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 (41) hide show
  1. package/dist/base.css +4 -5
  2. package/dist/buttons/add-to-cart-button/add-to-cart-button.d.ts +8 -0
  3. package/dist/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +17 -0
  4. package/dist/buttons/button/button.d.ts +4 -2
  5. package/dist/buttons/button/button.stories.d.ts +4 -1
  6. package/dist/buttons/favorite/favorite-button.stories.d.ts +1 -1
  7. package/dist/buttons/icon-button/icon-button.stories.d.ts +1 -1
  8. package/dist/cards/product-card/product-card.d.ts +12 -7
  9. package/dist/cards/product-card/product-card.stories.d.ts +27 -1
  10. package/dist/display/product-price/product-price.d.ts +4 -8
  11. package/dist/display/product-price/product-price.stories.d.ts +1 -2
  12. package/dist/fonts.css +32 -32
  13. package/dist/{inputs → forms}/checkbox/checkbox.stories.d.ts +1 -1
  14. package/dist/forms/field-error/field-error.d.ts +5 -0
  15. package/dist/forms/field-error/field-error.stories.d.ts +15 -0
  16. package/dist/forms/input/input.d.ts +13 -0
  17. package/dist/forms/input/input.stories.d.ts +27 -0
  18. package/dist/forms/label/label.d.ts +6 -0
  19. package/dist/forms/label/label.stories.d.ts +15 -0
  20. package/dist/forms/number-field/number-field.d.ts +31 -0
  21. package/dist/forms/number-field/number-field.stories.d.ts +32 -0
  22. package/dist/forms/text-field/text-field.d.ts +28 -0
  23. package/dist/forms/text-field/text-field.stories.d.ts +24 -0
  24. package/dist/forms/textarea/textarea.d.ts +13 -0
  25. package/dist/forms/textarea/textarea.stories.d.ts +19 -0
  26. package/dist/icons/dehashed/dehashed-outlined-icon.d.ts +2 -0
  27. package/dist/icons/hashed/hashed-outlined-icon.d.ts +2 -0
  28. package/dist/index.d.ts +149 -29
  29. package/dist/index.js +251 -31
  30. package/dist/lists/product-overview-grid/product-overview-grid.d.ts +5 -0
  31. package/dist/lists/product-overview-grid/product-overview-grid.stories.d.ts +14 -0
  32. package/dist/media/image/image.d.ts +21 -0
  33. package/dist/media/image/image.stories.d.ts +16 -0
  34. package/dist/product-listing/product-listing.d.ts +1 -4
  35. package/dist/product-listing/product-listing.stories.d.ts +2 -2
  36. package/dist/shared/types/price.d.ts +5 -0
  37. package/dist/styles.css +549 -70
  38. package/dist/typography/heading/heading.stories.d.ts +2 -2
  39. package/package.json +50 -34
  40. package/dist/icons/arrows/left-arrow-filled-icon.d.ts +0 -2
  41. /package/dist/{inputs → forms}/checkbox/checkbox.d.ts +0 -0
package/dist/base.css CHANGED
@@ -7,12 +7,11 @@
7
7
  html {
8
8
  font-family: var(--font-family-sonic);
9
9
  font-size: var(--font-size-base);
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+ font-synthesis: none;
13
+ text-rendering: optimizelegibility;
10
14
  -webkit-text-size-adjust: none;
11
15
  -moz-text-size-adjust: none;
12
16
  text-size-adjust: none;
13
-
14
- font-synthesis: none;
15
- text-rendering: optimizeLegibility;
16
- -webkit-font-smoothing: antialiased;
17
- -moz-osx-font-smoothing: grayscale;
18
17
  }
@@ -0,0 +1,8 @@
1
+ type AddToCartState = 'initial' | 'spinner' | 'manual-input';
2
+ interface AddToCartButtonProps {
3
+ initialState?: AddToCartState;
4
+ onChange?: (quantity: number) => void;
5
+ quantity: number;
6
+ }
7
+ export declare function AddToCartButton({ initialState, onChange, quantity, }: AddToCartButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { AddToCartButton } from './add-to-cart-button';
3
+ declare const meta: {
4
+ args: {
5
+ onChange: import("@storybook/test").Mock<[quantity: number], void>;
6
+ quantity: number;
7
+ };
8
+ component: typeof AddToCartButton;
9
+ tags: string[];
10
+ title: string;
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const InitialState: Story;
15
+ export declare const SpinnerState: Story;
16
+ export declare const ManualInputState: Story;
17
+ export declare const RightAligned: Story;
@@ -1,14 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  export interface ButtonProps {
3
3
  _pseudo?: 'none' | 'focus' | 'hover' | 'active';
4
- children: string;
4
+ children?: string;
5
5
  className?: string;
6
6
  color?: 'primary' | 'secondary';
7
+ condensed?: boolean;
7
8
  icon?: React.ReactNode;
8
9
  isDisabled?: boolean;
9
10
  onPress?: VoidFunction;
10
11
  size?: 'md' | 'lg';
12
+ type?: 'button' | 'submit' | 'reset';
11
13
  variant?: 'solid' | 'outline' | 'ghost';
12
14
  withArrow?: boolean;
13
15
  }
14
- export declare function Button({ _pseudo, children, className, color, icon, isDisabled, onPress, size, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function Button({ _pseudo, children, className, color, condensed, icon, isDisabled, onPress, size, type, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,8 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { Button } from './button';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<[], void>;
5
+ onPress: import("@storybook/test").Mock<[], void>;
6
+ size: "lg";
6
7
  };
7
8
  component: typeof Button;
8
9
  parameters: {
@@ -21,3 +22,5 @@ export declare const WithArrow: Story;
21
22
  export declare const Outlined: Story;
22
23
  export declare const SecondaryActive: Story;
23
24
  export declare const Ghost: Story;
25
+ export declare const SizeMD: Story;
26
+ export declare const SizeMDCondensed: Story;
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
  import { FavoriteButton } from './favorite-button';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<[], void>;
5
+ onPress: import("@storybook/test").Mock<[], void>;
6
6
  };
7
7
  component: typeof FavoriteButton;
8
8
  parameters: {
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { IconButton } from './icon-button';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<[], void>;
5
+ onPress: import("@storybook/test").Mock<[], void>;
6
6
  };
7
7
  component: typeof IconButton;
8
8
  parameters: {
@@ -1,9 +1,14 @@
1
- import { ComponentType } from 'react';
2
- import type { Product } from 'shared/types/product';
1
+ import { ReactElement } from 'react';
2
+ import { ImageProps } from 'media/image/image';
3
+ import type { ProductPrice as ProductPriceType } from 'shared/types/price';
3
4
  export interface ProductCardProps {
4
- favoriteButton: ComponentType<{
5
- productId: string;
6
- }>;
7
- product: Product;
5
+ addToCartButton: ReactElement;
6
+ favoriteButton?: ReactElement;
7
+ image: ImageProps;
8
+ onClick: React.MouseEventHandler<HTMLDivElement>;
9
+ price: ProductPriceType;
10
+ sku: string;
11
+ tag?: 'new' | 'sale';
12
+ title: string;
8
13
  }
9
- export declare function ProductCard({ favoriteButton: FavoriteButton, product, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, image: { alt, fit, src, title: imageTitle }, onClick, price, sku, tag, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,29 @@
1
+ /// <reference types="react" />
1
2
  import { StoryObj } from '@storybook/react';
2
3
  import { ProductCard } from './product-card';
3
4
  declare const meta: {
5
+ args: {
6
+ addToCartButton: import("react/jsx-runtime").JSX.Element;
7
+ favoriteButton: import("react/jsx-runtime").JSX.Element;
8
+ image: {
9
+ alt: string;
10
+ fit: "contain";
11
+ src: string;
12
+ title: string;
13
+ };
14
+ onClick: import("@storybook/test").Mock<[event: import("react").MouseEvent<HTMLDivElement, MouseEvent>], void>;
15
+ sku: string;
16
+ tag: "new";
17
+ };
4
18
  component: typeof ProductCard;
5
19
  parameters: {
20
+ backgrounds: {
21
+ default: string;
22
+ values: {
23
+ name: string;
24
+ value: string;
25
+ }[];
26
+ };
6
27
  layout: string;
7
28
  };
8
29
  tags: string[];
@@ -10,4 +31,9 @@ declare const meta: {
10
31
  };
11
32
  export default meta;
12
33
  type Story = StoryObj<typeof meta>;
13
- export declare const Default: Story;
34
+ export declare const Large: Story;
35
+ export declare const Medium: Story;
36
+ export declare const Small: Story;
37
+ export declare const LargeLongText: Story;
38
+ export declare const MediumLongText: Story;
39
+ export declare const SmallLongText: Story;
@@ -1,11 +1,7 @@
1
- interface Price {
2
- exclVat: number;
3
- inclVat: number;
4
- }
5
1
  export interface ProductPriceProps {
6
- current: Price;
2
+ className?: string;
3
+ current: number;
7
4
  includeVat?: boolean;
8
- original?: Price;
5
+ original?: number;
9
6
  }
10
- export declare function ProductPrice({ current, includeVat, original, }: ProductPriceProps): import("react/jsx-runtime").JSX.Element | undefined;
11
- export {};
7
+ export declare function ProductPrice({ className, current, includeVat, original, }: ProductPriceProps): import("react/jsx-runtime").JSX.Element | undefined;
@@ -10,6 +10,5 @@ declare const meta: {
10
10
  };
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
- export declare const InclVat: Story;
14
- export declare const ExclVat: Story;
13
+ export declare const WithOriginalPrice: Story;
15
14
  export declare const WithoutOriginalPrice: Story;
package/dist/fonts.css CHANGED
@@ -7,191 +7,191 @@
7
7
  @font-face {
8
8
  font-display: swap;
9
9
  font-family: 'Pancetta';
10
+ font-style: normal;
11
+ font-weight: 100;
10
12
  src:
11
13
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100022/fonts/pancetta/pancettapro-thin-webfont.woff2')
12
14
  format('woff2'),
13
15
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100018/fonts/pancetta/pancettapro-thin-webfont.woff')
14
16
  format('woff');
15
- font-weight: 100;
16
- font-style: normal;
17
17
  }
18
18
 
19
19
  @font-face {
20
20
  font-display: swap;
21
21
  font-family: 'Pancetta';
22
+ font-style: italic;
23
+ font-weight: 100;
22
24
  src:
23
25
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100030/fonts/pancetta/pancettapro-thinitalic-webfont.woff2')
24
26
  format('woff2'),
25
27
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100042/fonts/pancetta/pancettapro-thinitalic-webfont.woff')
26
28
  format('woff');
27
- font-weight: 100;
28
- font-style: italic;
29
29
  }
30
30
 
31
31
  @font-face {
32
32
  font-display: swap;
33
33
  font-family: 'Pancetta';
34
+ font-style: normal;
35
+ font-weight: 200;
34
36
  src:
35
37
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099957/fonts/pancetta/pancettapro-extralight-webfont.woff2')
36
38
  format('woff2'),
37
39
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099944/fonts/pancetta/pancettapro-extralight-webfont.woff')
38
40
  format('woff');
39
- font-weight: 200;
40
- font-style: normal;
41
41
  }
42
42
 
43
43
  @font-face {
44
44
  font-display: swap;
45
45
  font-family: 'Pancetta';
46
+ font-style: italic;
47
+ font-weight: 200;
46
48
  src:
47
49
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099964/fonts/pancetta/pancettapro-extralightitalic-webfont.woff2')
48
50
  format('woff2'),
49
51
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099960/fonts/pancetta/pancettapro-extralightitalic-webfont.woff')
50
52
  format('woff');
51
- font-weight: 200;
52
- font-style: italic;
53
53
  }
54
54
 
55
55
  @font-face {
56
56
  font-display: swap;
57
57
  font-family: 'Pancetta';
58
+ font-style: normal;
59
+ font-weight: 300;
58
60
  src:
59
61
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099985/fonts/pancetta/pancettapro-light-webfont.woff2')
60
62
  format('woff2'),
61
63
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099977/fonts/pancetta/pancettapro-light-webfont.woff')
62
64
  format('woff');
63
- font-weight: 300;
64
- font-style: normal;
65
65
  }
66
66
 
67
67
  @font-face {
68
68
  font-display: swap;
69
69
  font-family: 'Pancetta';
70
+ font-style: italic;
71
+ font-weight: 300;
70
72
  src:
71
73
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100009/fonts/pancetta/pancettapro-lightitalic-webfont.woff2')
72
74
  format('woff2'),
73
75
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099989/fonts/pancetta/pancettapro-lightitalic-webfont.woff')
74
76
  format('woff');
75
- font-weight: 300;
76
- font-style: italic;
77
77
  }
78
78
 
79
79
  @font-face {
80
80
  font-display: swap;
81
81
  font-family: 'Pancetta';
82
+ font-style: normal;
83
+ font-weight: normal;
82
84
  src:
83
85
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100013/fonts/pancetta/pancettapro-regular-webfont.woff2')
84
86
  format('woff2'),
85
87
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100005/fonts/pancetta/pancettapro-regular-webfont.woff')
86
88
  format('woff');
87
- font-weight: 400;
88
- font-style: normal;
89
89
  }
90
90
 
91
91
  @font-face {
92
92
  font-display: swap;
93
93
  font-family: 'Pancetta';
94
+ font-style: italic;
95
+ font-weight: normal;
94
96
  src:
95
97
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099973/fonts/pancetta/pancettapro-italic-webfont.woff2')
96
98
  format('woff2'),
97
99
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099969/fonts/pancetta/pancettapro-italic-webfont.woff')
98
100
  format('woff');
99
- font-weight: 400;
100
- font-style: italic;
101
101
  }
102
102
 
103
103
  @font-face {
104
104
  font-display: swap;
105
105
  font-family: 'Pancetta';
106
+ font-style: normal;
107
+ font-weight: 500;
106
108
  src:
107
109
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099997/fonts/pancetta/pancettapro-medium-webfont.woff2')
108
110
  format('woff2'),
109
111
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099981/fonts/pancetta/pancettapro-medium-webfont.woff')
110
112
  format('woff');
111
- font-weight: 500;
112
- font-style: normal;
113
113
  }
114
114
 
115
115
  @font-face {
116
116
  font-display: swap;
117
117
  font-family: 'Pancetta';
118
+ font-style: italic;
119
+ font-weight: 500;
118
120
  src:
119
121
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100001/fonts/pancetta/pancettapro-mediumitalic-webfont.woff2')
120
122
  format('woff2'),
121
123
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099993/fonts/pancetta/pancettapro-mediumitalic-webfont.woff')
122
124
  format('woff');
123
- font-weight: 500;
124
- font-style: italic;
125
125
  }
126
126
 
127
127
  @font-face {
128
128
  font-display: swap;
129
129
  font-family: 'Pancetta';
130
+ font-style: normal;
131
+ font-weight: 600;
130
132
  src:
131
133
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100038/fonts/pancetta/pancettapro-semibold-webfont.woff2')
132
134
  format('woff2'),
133
135
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100034/fonts/pancetta/pancettapro-semibold-webfont.woff')
134
136
  format('woff');
135
- font-weight: 600;
136
- font-style: normal;
137
137
  }
138
138
 
139
139
  @font-face {
140
140
  font-display: swap;
141
141
  font-family: 'Pancetta';
142
+ font-style: italic;
143
+ font-weight: 600;
142
144
  src:
143
145
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100026/fonts/pancetta/pancettapro-semibolditalic-webfont.woff2')
144
146
  format('woff2'),
145
147
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100047/fonts/pancetta/pancettapro-semibolditalic-webfont.woff')
146
148
  format('woff');
147
- font-weight: 600;
148
- font-style: italic;
149
149
  }
150
150
 
151
151
  @font-face {
152
152
  font-display: swap;
153
153
  font-family: 'Pancetta';
154
+ font-style: normal;
155
+ font-weight: bold;
154
156
  src:
155
157
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099948/fonts/pancetta/pancettapro-bold-webfont.woff2')
156
158
  format('woff2'),
157
159
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099932/fonts/pancetta/pancettapro-bold-webfont.woff')
158
160
  format('woff');
159
- font-weight: 700;
160
- font-style: normal;
161
161
  }
162
162
 
163
163
  @font-face {
164
164
  font-display: swap;
165
165
  font-family: 'Pancetta';
166
+ font-style: italic;
167
+ font-weight: bold;
166
168
  src:
167
169
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099952/fonts/pancetta/pancettapro-bolditalic-webfont.woff2')
168
170
  format('woff2'),
169
171
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099936/fonts/pancetta/pancettapro-bolditalic-webfont.woff')
170
172
  format('woff');
171
- font-weight: 700;
172
- font-style: italic;
173
173
  }
174
174
 
175
175
  @font-face {
176
176
  font-display: swap;
177
177
  font-family: 'Pancetta';
178
+ font-style: normal;
179
+ font-weight: 900;
178
180
  src:
179
181
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099929/fonts/pancetta/pancettapro-black-webfont.woff2')
180
182
  format('woff2'),
181
183
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099921/fonts/pancetta/pancettapro-black-webfont.woff')
182
184
  format('woff');
183
- font-weight: 900;
184
- font-style: normal;
185
185
  }
186
186
 
187
187
  @font-face {
188
188
  font-display: swap;
189
189
  font-family: 'Pancetta';
190
+ font-style: italic;
191
+ font-weight: 900;
190
192
  src:
191
193
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099941/fonts/pancetta/pancettapro-blackitalic-webfont.woff2')
192
194
  format('woff2'),
193
195
  url('https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099924/fonts/pancetta/pancettapro-blackitalic-webfont.woff')
194
196
  format('woff');
195
- font-weight: 900;
196
- font-style: italic;
197
197
  }
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { Checkbox } from './checkbox';
3
3
  declare const meta: {
4
4
  args: {
5
- onChange: import("@vitest/spy").Mock<[isSelected: boolean], void>;
5
+ onChange: import("@storybook/test").Mock<[isSelected: boolean], void>;
6
6
  };
7
7
  component: typeof Checkbox;
8
8
  parameters: {
@@ -0,0 +1,5 @@
1
+ interface FieldErrorProps {
2
+ children?: string;
3
+ }
4
+ export declare function FieldError({ children }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { FieldError } from './field-error';
3
+ declare const meta: {
4
+ args: {};
5
+ component: typeof FieldError;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ title: string;
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof FieldError>;
14
+ export declare const Default: Story;
15
+ export declare const PredefinedErrorMessage: Story;
@@ -0,0 +1,13 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { Input as AriaInput } from 'react-aria-components';
3
+ export interface InputProps extends Omit<ComponentProps<typeof AriaInput>, 'size'> {
4
+ _pseudo?: 'focus' | 'none';
5
+ autoGrow?: boolean;
6
+ size?: 'md' | 'lg';
7
+ value?: string | number;
8
+ }
9
+ /**
10
+ * This component is used to create an input that grows as the user types.
11
+ * It uses a shadow input to calculate the width of the input.
12
+ */
13
+ export declare const Input: FC<InputProps>;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ import { Input } from './input';
4
+ declare const meta: {
5
+ argTypes: {
6
+ value: {
7
+ control: {
8
+ type: "text";
9
+ };
10
+ };
11
+ };
12
+ args: {
13
+ size: "lg";
14
+ };
15
+ component: import("react").FC<import("./input").InputProps>;
16
+ parameters: {
17
+ layout: string;
18
+ };
19
+ tags: string[];
20
+ title: string;
21
+ };
22
+ export default meta;
23
+ type Story = StoryObj<typeof Input>;
24
+ export declare const Default: Story;
25
+ export declare const Focus: Story;
26
+ export declare const Controlled: Story;
27
+ export declare const Uncontrolled: Story;
@@ -0,0 +1,6 @@
1
+ interface LabelProps {
2
+ children: string;
3
+ isRequired?: boolean;
4
+ }
5
+ export declare function Label({ children, isRequired }: LabelProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { Label } from './label';
3
+ declare const meta: {
4
+ args: {};
5
+ component: typeof Label;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ title: string;
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof Label>;
14
+ export declare const Default: Story;
15
+ export declare const Required: Story;
@@ -0,0 +1,31 @@
1
+ import { FormEventHandler, KeyboardEvent } from 'react';
2
+ export type NumberFieldSize = 'md' | 'lg';
3
+ interface NumberFieldProps {
4
+ autoFocus?: boolean;
5
+ autoGrow?: boolean;
6
+ defaultValue?: number;
7
+ formatOptions?: Intl.NumberFormatOptions;
8
+ isDisabled?: boolean;
9
+ isInvalid?: boolean;
10
+ isReadOnly?: boolean;
11
+ isRequired?: boolean;
12
+ label: string;
13
+ maxLength?: number;
14
+ maxValue?: number;
15
+ minValue?: number;
16
+ name?: string;
17
+ onChange?: (value: number) => void;
18
+ onInput?: FormEventHandler<HTMLInputElement>;
19
+ onKeyUp?: (e: KeyboardEvent) => void;
20
+ placeholder?: string;
21
+ showLabel?: boolean;
22
+ size?: NumberFieldSize;
23
+ value?: number;
24
+ withButtons?: boolean;
25
+ }
26
+ /**
27
+ * This component is used to create a number field.
28
+ * This field can also grow when a user types in text.
29
+ */
30
+ export declare function NumberField({ autoFocus, autoGrow, defaultValue, formatOptions, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel, size, value, withButtons, }: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,32 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { NumberField } from './number-field';
3
+ declare const meta: {
4
+ args: {
5
+ onChange: {
6
+ (...data: any[]): void;
7
+ (message?: any, ...optionalParams: any[]): void;
8
+ (message?: any, ...optionalParams: any[]): void;
9
+ };
10
+ size: "lg";
11
+ };
12
+ component: typeof NumberField;
13
+ parameters: {
14
+ layout: string;
15
+ };
16
+ tags: string[];
17
+ title: string;
18
+ };
19
+ export default meta;
20
+ type Story = StoryObj<typeof NumberField>;
21
+ export declare const Default: Story;
22
+ export declare const DefaultMinMaxValue: Story;
23
+ export declare const Formatting: Story;
24
+ export declare const Placeholder: Story;
25
+ export declare const Label: Story;
26
+ export declare const AutoGrow: Story;
27
+ export declare const AutoGrowWithButtons: Story;
28
+ export declare const AutoGrowSizeMD: Story;
29
+ export declare const Required: Story;
30
+ export declare const Disabled: Story;
31
+ export declare const Invalid: Story;
32
+ export declare const Validation: Story;
@@ -0,0 +1,28 @@
1
+ import { FormEventHandler, KeyboardEvent } from 'react';
2
+ interface TextFieldProps {
3
+ autoFocus?: boolean;
4
+ autoGrow?: boolean;
5
+ defaultValue?: string;
6
+ isDisabled?: boolean;
7
+ isInvalid?: boolean;
8
+ isMultiline?: boolean;
9
+ isReadOnly?: boolean;
10
+ isRequired?: boolean;
11
+ label: string;
12
+ maxLength?: number;
13
+ onChange?: (value: string) => void;
14
+ onInput?: FormEventHandler<HTMLInputElement>;
15
+ onKeyUp?: (e: KeyboardEvent) => void;
16
+ placeholder?: string;
17
+ rows?: number;
18
+ showLabel?: boolean;
19
+ size?: 'md' | 'lg';
20
+ value?: string;
21
+ }
22
+ /**
23
+ * This component is used to create a text field.
24
+ * It can be used as a single line input or as a textarea.
25
+ * This field can also grow when a user types in text.
26
+ */
27
+ export declare function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, onChange, onInput, onKeyUp, placeholder, rows, showLabel, size, value, }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
28
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { TextField } from './text-field';
3
+ declare const meta: {
4
+ component: typeof TextField;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ title: string;
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof TextField>;
13
+ export declare const Default: Story;
14
+ export declare const Placeholder: Story;
15
+ export declare const Label: Story;
16
+ export declare const AutoGrow: Story;
17
+ export declare const AutoGrowSizeMD: Story;
18
+ export declare const Required: Story;
19
+ export declare const Disabled: Story;
20
+ export declare const Invalid: Story;
21
+ export declare const Validation: Story;
22
+ export declare const Multline: Story;
23
+ export declare const MultlineAutoGrow: Story;
24
+ export declare const MultlineSizeMD: Story;
@@ -0,0 +1,13 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { TextArea as AriaTextArea } from 'react-aria-components';
3
+ export interface TextAreaProps extends Omit<ComponentProps<typeof AriaTextArea>, 'size'> {
4
+ autoGrow?: boolean;
5
+ size?: 'md' | 'lg';
6
+ }
7
+ /**
8
+ * This component is used to create a textarea that can grow as the user types.
9
+ * It uses the scrollHeight property to calculate the height of the textarea.
10
+ * The initial height is calculated based on the style of the textarea.
11
+ * The height is updated everytime the user types.
12
+ */
13
+ export declare const TextArea: FC<TextAreaProps>;