react-restyle-components 0.2.22 → 0.2.24

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 (50) hide show
  1. package/README.md +0 -6
  2. package/lib/package.json +15 -4
  3. package/lib/src/App.js +12 -1
  4. package/lib/src/assets/styles/colors.css +217 -0
  5. package/lib/src/assets/styles/decorations.css +15 -0
  6. package/lib/src/assets/styles/fontface.css +17 -0
  7. package/lib/src/assets/styles/scrollbars.css +70 -0
  8. package/lib/src/assets/styles/typography.css +3 -0
  9. package/lib/src/core-components/atoms/button/Button.stories.d.ts +320 -0
  10. package/lib/src/core-components/atoms/button/Button.stories.js +66 -0
  11. package/lib/src/core-components/atoms/button/Button.test.d.ts +1 -0
  12. package/lib/src/core-components/atoms/button/Button.test.js +31 -0
  13. package/lib/src/core-components/atoms/button/Button.types.d.ts +36 -0
  14. package/lib/src/core-components/atoms/button/Button.types.js +1 -0
  15. package/lib/src/core-components/atoms/button/LinkButton.stories.d.ts +302 -0
  16. package/lib/src/core-components/atoms/button/LinkButton.stories.js +52 -0
  17. package/lib/src/core-components/atoms/button/ToggleButton.stories.d.ts +337 -0
  18. package/lib/src/core-components/atoms/button/ToggleButton.stories.js +62 -0
  19. package/lib/src/core-components/atoms/button/button.component.d.ts +6 -0
  20. package/lib/src/core-components/atoms/button/button.component.js +19 -0
  21. package/lib/src/core-components/atoms/button/button.module.css +477 -0
  22. package/lib/src/core-components/atoms/button/buttonGroup/ButtonGroup.stories.d.ts +53 -0
  23. package/lib/src/core-components/atoms/button/buttonGroup/ButtonGroup.stories.js +271 -0
  24. package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.d.ts +9 -0
  25. package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.js +4 -0
  26. package/lib/src/core-components/atoms/button/linkButton.component.d.ts +9 -0
  27. package/lib/src/core-components/atoms/button/linkButton.component.js +20 -0
  28. package/lib/src/core-components/atoms/button/toggleButton.component.d.ts +10 -0
  29. package/lib/src/core-components/atoms/button/toggleButton.component.js +21 -0
  30. package/lib/src/core-components/atoms/icons/icons.component.js +1 -1
  31. package/lib/src/core-components/atoms/pdf/pdf-typography.components.js +2 -2
  32. package/lib/src/core-components/atoms/tabs/tabs.component.d.ts +9 -2
  33. package/lib/src/core-components/atoms/tabs/tabs.component.js +14 -9
  34. package/lib/src/core-components/atoms/tooltip/Tooltip.module.css +44 -0
  35. package/lib/src/core-components/atoms/tooltip/Tooltip.stories.d.ts +31 -0
  36. package/lib/src/core-components/atoms/tooltip/Tooltip.stories.js +100 -0
  37. package/lib/src/core-components/atoms/tooltip/Tooltip.types.d.ts +23 -0
  38. package/lib/src/core-components/atoms/tooltip/Tooltip.types.js +1 -0
  39. package/lib/src/core-components/atoms/tooltip/tooltip.component.d.ts +16 -9
  40. package/lib/src/core-components/atoms/tooltip/tooltip.component.js +26 -24
  41. package/lib/src/core-components/index.d.ts +4 -1
  42. package/lib/src/core-components/index.js +4 -1
  43. package/lib/tc.css +1 -1
  44. package/package.json +15 -4
  45. package/lib/src/core-components/atoms/buttons/button.stories.d.ts +0 -6
  46. package/lib/src/core-components/atoms/buttons/button.stories.js +0 -36
  47. package/lib/src/core-components/atoms/buttons/buttons.component.d.ts +0 -11
  48. package/lib/src/core-components/atoms/buttons/buttons.component.js +0 -8
  49. package/lib/src/core-components/atoms/tooltip/tooltip.stories.d.ts +0 -6
  50. package/lib/src/core-components/atoms/tooltip/tooltip.stories.js +0 -13
@@ -0,0 +1,337 @@
1
+ import React from 'react';
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: React.ForwardRefExoticComponent<Omit<import("./Button.types").ButtonProps, "variant"> & {
6
+ labelClassName?: string | undefined;
7
+ contentClassName?: string | undefined;
8
+ active?: boolean | undefined;
9
+ variant?: "brand" | "accent" | undefined;
10
+ } & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
11
+ tags: string[];
12
+ decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react/dist/types-a5624094").R, {
13
+ className?: string | undefined;
14
+ focus?: "none" | "visible" | "focus" | undefined;
15
+ loading?: boolean | undefined;
16
+ tooltip?: string | undefined;
17
+ level?: "primary" | "secondary" | undefined;
18
+ scale?: "s" | "xl" | "l" | "m" | "xs" | "xxs" | undefined;
19
+ iconOnly?: boolean | undefined;
20
+ labelClassName?: string | undefined;
21
+ contentClassName?: string | undefined;
22
+ active?: boolean | undefined;
23
+ variant?: "brand" | "accent" | undefined;
24
+ accept?: string | undefined;
25
+ alt?: string | undefined;
26
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
27
+ capture?: boolean | "user" | "environment" | undefined;
28
+ checked?: boolean | undefined;
29
+ disabled?: boolean | undefined;
30
+ form?: string | undefined;
31
+ formAction?: string | undefined;
32
+ formEncType?: string | undefined;
33
+ formMethod?: string | undefined;
34
+ formNoValidate?: boolean | undefined;
35
+ formTarget?: string | undefined;
36
+ height?: string | number | undefined;
37
+ list?: string | undefined;
38
+ max?: string | number | undefined;
39
+ maxLength?: number | undefined;
40
+ min?: string | number | undefined;
41
+ minLength?: number | undefined;
42
+ multiple?: boolean | undefined;
43
+ name?: string | undefined;
44
+ pattern?: string | undefined;
45
+ placeholder?: string | undefined;
46
+ readOnly?: boolean | undefined;
47
+ required?: boolean | undefined;
48
+ size?: number | undefined;
49
+ src?: string | undefined;
50
+ step?: string | number | undefined;
51
+ type?: React.HTMLInputTypeAttribute | undefined;
52
+ value?: string | number | readonly string[] | undefined;
53
+ width?: string | number | undefined;
54
+ onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
55
+ defaultChecked?: boolean | undefined;
56
+ defaultValue?: string | number | readonly string[] | undefined;
57
+ suppressContentEditableWarning?: boolean | undefined;
58
+ suppressHydrationWarning?: boolean | undefined;
59
+ accessKey?: string | undefined;
60
+ autoCapitalize?: (string & {}) | "off" | "on" | "none" | "sentences" | "words" | "characters" | undefined;
61
+ autoFocus?: boolean | undefined;
62
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
63
+ contextMenu?: string | undefined;
64
+ dir?: string | undefined;
65
+ draggable?: (boolean | "true" | "false") | undefined;
66
+ enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
67
+ hidden?: boolean | undefined;
68
+ id?: string | undefined;
69
+ lang?: string | undefined;
70
+ nonce?: string | undefined;
71
+ slot?: string | undefined;
72
+ spellCheck?: (boolean | "true" | "false") | undefined;
73
+ style?: React.CSSProperties | undefined;
74
+ tabIndex?: number | undefined;
75
+ title?: string | undefined;
76
+ translate?: "yes" | "no" | undefined;
77
+ radioGroup?: string | undefined;
78
+ role?: React.AriaRole | undefined;
79
+ about?: string | undefined;
80
+ content?: string | undefined;
81
+ datatype?: string | undefined;
82
+ inlist?: any;
83
+ prefix?: string | undefined;
84
+ property?: string | undefined;
85
+ rel?: string | undefined;
86
+ resource?: string | undefined;
87
+ rev?: string | undefined;
88
+ typeof?: string | undefined;
89
+ vocab?: string | undefined;
90
+ autoCorrect?: string | undefined;
91
+ autoSave?: string | undefined;
92
+ color?: string | undefined;
93
+ itemProp?: string | undefined;
94
+ itemScope?: boolean | undefined;
95
+ itemType?: string | undefined;
96
+ itemID?: string | undefined;
97
+ itemRef?: string | undefined;
98
+ results?: number | undefined;
99
+ security?: string | undefined;
100
+ unselectable?: "off" | "on" | undefined;
101
+ inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
102
+ is?: string | undefined;
103
+ "aria-activedescendant"?: string | undefined;
104
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
105
+ "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
106
+ "aria-braillelabel"?: string | undefined;
107
+ "aria-brailleroledescription"?: string | undefined;
108
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
109
+ "aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
110
+ "aria-colcount"?: number | undefined;
111
+ "aria-colindex"?: number | undefined;
112
+ "aria-colindextext"?: string | undefined;
113
+ "aria-colspan"?: number | undefined;
114
+ "aria-controls"?: string | undefined;
115
+ "aria-current"?: boolean | "time" | "date" | "true" | "false" | "page" | "step" | "location" | undefined;
116
+ "aria-describedby"?: string | undefined;
117
+ "aria-description"?: string | undefined;
118
+ "aria-details"?: string | undefined;
119
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
120
+ "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
121
+ "aria-errormessage"?: string | undefined;
122
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
123
+ "aria-flowto"?: string | undefined;
124
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
125
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
126
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
127
+ "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
128
+ "aria-keyshortcuts"?: string | undefined;
129
+ "aria-label"?: string | undefined;
130
+ "aria-labelledby"?: string | undefined;
131
+ "aria-level"?: number | undefined;
132
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
133
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
134
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
135
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
136
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
137
+ "aria-owns"?: string | undefined;
138
+ "aria-placeholder"?: string | undefined;
139
+ "aria-posinset"?: number | undefined;
140
+ "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
141
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
142
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
143
+ "aria-required"?: (boolean | "true" | "false") | undefined;
144
+ "aria-roledescription"?: string | undefined;
145
+ "aria-rowcount"?: number | undefined;
146
+ "aria-rowindex"?: number | undefined;
147
+ "aria-rowindextext"?: string | undefined;
148
+ "aria-rowspan"?: number | undefined;
149
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
150
+ "aria-setsize"?: number | undefined;
151
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
152
+ "aria-valuemax"?: number | undefined;
153
+ "aria-valuemin"?: number | undefined;
154
+ "aria-valuenow"?: number | undefined;
155
+ "aria-valuetext"?: string | undefined;
156
+ children?: React.ReactNode;
157
+ dangerouslySetInnerHTML?: {
158
+ __html: string | TrustedHTML;
159
+ } | undefined;
160
+ onCopy?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
161
+ onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
162
+ onCut?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
163
+ onCutCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
164
+ onPaste?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
165
+ onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
166
+ onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement> | undefined;
167
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
168
+ onCompositionStart?: React.CompositionEventHandler<HTMLInputElement> | undefined;
169
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
170
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement> | undefined;
171
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
172
+ onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
173
+ onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
174
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
175
+ onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
176
+ onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
177
+ onBeforeInput?: React.FormEventHandler<HTMLInputElement> | undefined;
178
+ onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
179
+ onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
180
+ onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
181
+ onReset?: React.FormEventHandler<HTMLInputElement> | undefined;
182
+ onResetCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
183
+ onSubmit?: React.FormEventHandler<HTMLInputElement> | undefined;
184
+ onSubmitCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
185
+ onInvalid?: React.FormEventHandler<HTMLInputElement> | undefined;
186
+ onInvalidCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
187
+ onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
188
+ onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
189
+ onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
190
+ onErrorCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
191
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
192
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
193
+ onKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
194
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
195
+ onKeyUp?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
196
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
197
+ onAbort?: React.ReactEventHandler<HTMLInputElement> | undefined;
198
+ onAbortCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
199
+ onCanPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
200
+ onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
201
+ onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement> | undefined;
202
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
203
+ onDurationChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
204
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
205
+ onEmptied?: React.ReactEventHandler<HTMLInputElement> | undefined;
206
+ onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
207
+ onEncrypted?: React.ReactEventHandler<HTMLInputElement> | undefined;
208
+ onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
209
+ onEnded?: React.ReactEventHandler<HTMLInputElement> | undefined;
210
+ onEndedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
211
+ onLoadedData?: React.ReactEventHandler<HTMLInputElement> | undefined;
212
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
213
+ onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement> | undefined;
214
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
215
+ onLoadStart?: React.ReactEventHandler<HTMLInputElement> | undefined;
216
+ onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
217
+ onPause?: React.ReactEventHandler<HTMLInputElement> | undefined;
218
+ onPauseCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
219
+ onPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
220
+ onPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
221
+ onPlaying?: React.ReactEventHandler<HTMLInputElement> | undefined;
222
+ onPlayingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
223
+ onProgress?: React.ReactEventHandler<HTMLInputElement> | undefined;
224
+ onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
225
+ onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
226
+ onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
227
+ onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
228
+ onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
229
+ onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
230
+ onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
231
+ onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
232
+ onSeekingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
233
+ onStalled?: React.ReactEventHandler<HTMLInputElement> | undefined;
234
+ onStalledCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
235
+ onSuspend?: React.ReactEventHandler<HTMLInputElement> | undefined;
236
+ onSuspendCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
237
+ onTimeUpdate?: React.ReactEventHandler<HTMLInputElement> | undefined;
238
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
239
+ onVolumeChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
240
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
241
+ onWaiting?: React.ReactEventHandler<HTMLInputElement> | undefined;
242
+ onWaitingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
243
+ onAuxClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
244
+ onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
245
+ onClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
246
+ onClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
247
+ onContextMenu?: React.MouseEventHandler<HTMLInputElement> | undefined;
248
+ onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
249
+ onDoubleClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
250
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
251
+ onDrag?: React.DragEventHandler<HTMLInputElement> | undefined;
252
+ onDragCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
253
+ onDragEnd?: React.DragEventHandler<HTMLInputElement> | undefined;
254
+ onDragEndCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
255
+ onDragEnter?: React.DragEventHandler<HTMLInputElement> | undefined;
256
+ onDragEnterCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
257
+ onDragExit?: React.DragEventHandler<HTMLInputElement> | undefined;
258
+ onDragExitCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
259
+ onDragLeave?: React.DragEventHandler<HTMLInputElement> | undefined;
260
+ onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
261
+ onDragOver?: React.DragEventHandler<HTMLInputElement> | undefined;
262
+ onDragOverCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
263
+ onDragStart?: React.DragEventHandler<HTMLInputElement> | undefined;
264
+ onDragStartCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
265
+ onDrop?: React.DragEventHandler<HTMLInputElement> | undefined;
266
+ onDropCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
267
+ onMouseDown?: React.MouseEventHandler<HTMLInputElement> | undefined;
268
+ onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
269
+ onMouseEnter?: React.MouseEventHandler<HTMLInputElement> | undefined;
270
+ onMouseLeave?: React.MouseEventHandler<HTMLInputElement> | undefined;
271
+ onMouseMove?: React.MouseEventHandler<HTMLInputElement> | undefined;
272
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
273
+ onMouseOut?: React.MouseEventHandler<HTMLInputElement> | undefined;
274
+ onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
275
+ onMouseOver?: React.MouseEventHandler<HTMLInputElement> | undefined;
276
+ onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
277
+ onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
278
+ onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
279
+ onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
280
+ onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
281
+ onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
282
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
283
+ onTouchEnd?: React.TouchEventHandler<HTMLInputElement> | undefined;
284
+ onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
285
+ onTouchMove?: React.TouchEventHandler<HTMLInputElement> | undefined;
286
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
287
+ onTouchStart?: React.TouchEventHandler<HTMLInputElement> | undefined;
288
+ onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
289
+ onPointerDown?: React.PointerEventHandler<HTMLInputElement> | undefined;
290
+ onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
291
+ onPointerMove?: React.PointerEventHandler<HTMLInputElement> | undefined;
292
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
293
+ onPointerUp?: React.PointerEventHandler<HTMLInputElement> | undefined;
294
+ onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
295
+ onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
296
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
297
+ onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
298
+ onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
299
+ onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
300
+ onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
301
+ onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
302
+ onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
303
+ onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
304
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
305
+ onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
306
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
307
+ onScroll?: React.UIEventHandler<HTMLInputElement> | undefined;
308
+ onScrollCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
309
+ onWheel?: React.WheelEventHandler<HTMLInputElement> | undefined;
310
+ onWheelCapture?: React.WheelEventHandler<HTMLInputElement> | undefined;
311
+ onAnimationStart?: React.AnimationEventHandler<HTMLInputElement> | undefined;
312
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
313
+ onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement> | undefined;
314
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
315
+ onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement> | undefined;
316
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
317
+ onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
318
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
319
+ ref?: React.LegacyRef<HTMLInputElement> | undefined;
320
+ key?: React.Key | null | undefined;
321
+ }>) => React.JSX.Element)[];
322
+ argTypes: {
323
+ disabled: {
324
+ control: "boolean";
325
+ };
326
+ onChange: {
327
+ action: string;
328
+ };
329
+ };
330
+ };
331
+ export default meta;
332
+ type Story = StoryObj<typeof meta>;
333
+ export declare const TextOnly: Story;
334
+ export declare const TextWithIconAtStart: Story;
335
+ export declare const TextWithIconAtEnd: Story;
336
+ export declare const IconOnly: Story;
337
+ export declare const Loading: Story;
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { BrowserRouter } from 'react-router-dom';
3
+ import Attach from '../../../assets/icons/attach.svg';
4
+ import { TooltipProvider } from '../tooltip/tooltip.component';
5
+ import { ToggleButton } from './toggleButton.component';
6
+ import { useState } from 'react';
7
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
8
+ const meta = {
9
+ title: 'Design System/Atoms/ToggleButton',
10
+ component: ToggleButton,
11
+ tags: ['autodocs'],
12
+ decorators: [
13
+ (Story) => (React.createElement(BrowserRouter, null,
14
+ React.createElement(TooltipProvider, null,
15
+ React.createElement(Story, null)))),
16
+ ],
17
+ argTypes: {
18
+ disabled: { control: 'boolean' },
19
+ onChange: { action: 'clicked' },
20
+ },
21
+ };
22
+ export default meta;
23
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
24
+ export const TextOnly = {
25
+ args: {
26
+ children: 'Button',
27
+ },
28
+ };
29
+ export const TextWithIconAtStart = {
30
+ render: (args) => (React.createElement(ToggleButton, { ...args },
31
+ React.createElement(Attach, null),
32
+ " Go to attachments")),
33
+ args: {},
34
+ };
35
+ export const TextWithIconAtEnd = {
36
+ render: (args) => (React.createElement(ToggleButton, { ...args },
37
+ "Go to attachments ",
38
+ React.createElement(Attach, null))),
39
+ args: {},
40
+ };
41
+ export const IconOnly = {
42
+ render: (args) => (React.createElement(ToggleButton, { ...args },
43
+ React.createElement(Attach, null))),
44
+ args: {
45
+ iconOnly: true,
46
+ },
47
+ };
48
+ export const Loading = {
49
+ render: function Render(args) {
50
+ const [loading, setLoading] = useState(false);
51
+ const [active, setActive] = useState(false);
52
+ const handleClick = () => {
53
+ setLoading(true);
54
+ setTimeout(() => {
55
+ setLoading(false);
56
+ setActive(!active);
57
+ }, 1000);
58
+ };
59
+ return (React.createElement(ToggleButton, { iconOnly: true, checked: active, onChange: handleClick, ...args, loading: loading, onClick: handleClick },
60
+ React.createElement(Attach, null)));
61
+ },
62
+ };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from './Button.types';
3
+ /**
4
+ * It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
5
+ */
6
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { forwardRef } from 'react';
3
+ import clsx from 'clsx';
4
+ import s from './button.module.css';
5
+ import { Tooltip } from '../tooltip/tooltip.component';
6
+ /**
7
+ * It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
8
+ */
9
+ export const Button = forwardRef(({ tooltip, disabled = false, type = 'button', className, level = 'primary', variant = 'brand', scale = 'm', iconOnly = false, children, focus = 'visible', loading = false, ...args }, ref) => {
10
+ const buttonClasses = clsx(s.reset_button, s.button, s[`button-level-${level}`], s[`button-theme-${variant}`], s[`button-size-${scale}`], iconOnly && s[`button-icon-only`], focus === 'focus' && [s.focus], focus === 'visible' && s[`focus-visible`], loading && s.loading, className);
11
+ const button = (React.createElement("button", { ref: ref, ...args, className: buttonClasses, type: type, disabled: disabled }, children));
12
+ if (tooltip) {
13
+ return (React.createElement(Tooltip, { content: tooltip, padding: "s" }, button));
14
+ }
15
+ else {
16
+ return button;
17
+ }
18
+ });
19
+ Button.displayName = 'Button';