@helpwave/hightide 0.0.1

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 (162) hide show
  1. package/.storybook/main.ts +24 -0
  2. package/.storybook/preview.tsx +67 -0
  3. package/LICENSE +373 -0
  4. package/README.md +8 -0
  5. package/coloring/shading.ts +46 -0
  6. package/coloring/types.ts +13 -0
  7. package/components/Avatar.tsx +58 -0
  8. package/components/AvatarGroup.tsx +48 -0
  9. package/components/BreadCrumb.tsx +35 -0
  10. package/components/Button.tsx +236 -0
  11. package/components/ChipList.tsx +89 -0
  12. package/components/Circle.tsx +27 -0
  13. package/components/ErrorComponent.tsx +40 -0
  14. package/components/Expandable.tsx +61 -0
  15. package/components/HelpwaveBadge.tsx +35 -0
  16. package/components/HideableContentSection.tsx +43 -0
  17. package/components/InputGroup.tsx +72 -0
  18. package/components/LoadingAndErrorComponent.tsx +47 -0
  19. package/components/LoadingAnimation.tsx +40 -0
  20. package/components/LoadingButton.tsx +27 -0
  21. package/components/MarkdownInterpreter.tsx +278 -0
  22. package/components/Pagination.tsx +65 -0
  23. package/components/Profile.tsx +124 -0
  24. package/components/ProgressIndicator.tsx +58 -0
  25. package/components/Ring.tsx +286 -0
  26. package/components/SearchableList.tsx +69 -0
  27. package/components/SortButton.tsx +33 -0
  28. package/components/Span.tsx +0 -0
  29. package/components/StepperBar.tsx +124 -0
  30. package/components/Table.tsx +330 -0
  31. package/components/TechRadar.tsx +247 -0
  32. package/components/TextImage.tsx +86 -0
  33. package/components/TimeDisplay.tsx +121 -0
  34. package/components/Tooltip.tsx +92 -0
  35. package/components/VerticalDivider.tsx +51 -0
  36. package/components/date/DatePicker.tsx +164 -0
  37. package/components/date/DayPicker.tsx +95 -0
  38. package/components/date/TimePicker.tsx +167 -0
  39. package/components/date/YearMonthPicker.tsx +130 -0
  40. package/components/examples/InputGroupExample.tsx +58 -0
  41. package/components/examples/MultiSelectExample.tsx +57 -0
  42. package/components/examples/SearchableSelectExample.tsx +34 -0
  43. package/components/examples/SelectExample.tsx +28 -0
  44. package/components/examples/StackingModals.tsx +54 -0
  45. package/components/examples/TableExample.tsx +159 -0
  46. package/components/examples/TextareaExample.tsx +23 -0
  47. package/components/examples/TileExample.tsx +25 -0
  48. package/components/examples/Title.tsx +0 -0
  49. package/components/examples/date/DateTimePickerExample.tsx +53 -0
  50. package/components/examples/properties/CheckboxPropertyExample.tsx +29 -0
  51. package/components/examples/properties/DatePropertyExample.tsx +44 -0
  52. package/components/examples/properties/MultiSelectPropertyExample.tsx +39 -0
  53. package/components/examples/properties/NumberPropertyExample.tsx +28 -0
  54. package/components/examples/properties/SelectPropertyExample.tsx +39 -0
  55. package/components/examples/properties/TextPropertyExample.tsx +30 -0
  56. package/components/icons/Helpwave.tsx +51 -0
  57. package/components/icons/Tag.tsx +29 -0
  58. package/components/layout/Carousel.tsx +396 -0
  59. package/components/layout/DividerInserter.tsx +37 -0
  60. package/components/layout/FAQSection.tsx +57 -0
  61. package/components/layout/Tile.tsx +67 -0
  62. package/components/modals/ConfirmDialog.tsx +105 -0
  63. package/components/modals/DiscardChangesDialog.tsx +71 -0
  64. package/components/modals/InputModal.tsx +26 -0
  65. package/components/modals/LanguageModal.tsx +76 -0
  66. package/components/modals/Modal.tsx +149 -0
  67. package/components/modals/ModalRegister.tsx +45 -0
  68. package/components/properties/CheckboxProperty.tsx +62 -0
  69. package/components/properties/DateProperty.tsx +58 -0
  70. package/components/properties/MultiSelectProperty.tsx +82 -0
  71. package/components/properties/NumberProperty.tsx +86 -0
  72. package/components/properties/PropertyBase.tsx +84 -0
  73. package/components/properties/SelectProperty.tsx +67 -0
  74. package/components/properties/TextProperty.tsx +81 -0
  75. package/components/user-input/Checkbox.tsx +139 -0
  76. package/components/user-input/DateAndTimePicker.tsx +156 -0
  77. package/components/user-input/Input.tsx +192 -0
  78. package/components/user-input/Label.tsx +32 -0
  79. package/components/user-input/Menu.tsx +75 -0
  80. package/components/user-input/MultiSelect.tsx +158 -0
  81. package/components/user-input/ScrollPicker.tsx +240 -0
  82. package/components/user-input/SearchableSelect.tsx +36 -0
  83. package/components/user-input/Select.tsx +132 -0
  84. package/components/user-input/Textarea.tsx +86 -0
  85. package/components/user-input/ToggleableInput.tsx +115 -0
  86. package/eslint.config.js +3 -0
  87. package/globals.css +488 -0
  88. package/hooks/useHoverState.ts +88 -0
  89. package/hooks/useLanguage.tsx +78 -0
  90. package/hooks/useLocalStorage.tsx +33 -0
  91. package/hooks/useOutsideClick.ts +25 -0
  92. package/hooks/useSaveDelay.ts +46 -0
  93. package/hooks/useTheme.tsx +57 -0
  94. package/hooks/useTranslation.ts +43 -0
  95. package/index.ts +0 -0
  96. package/package.json +71 -0
  97. package/postcss.config.mjs +7 -0
  98. package/stories/README.md +23 -0
  99. package/stories/coloring/shading.stories.tsx +54 -0
  100. package/stories/geometry/Circle.stories.tsx +16 -0
  101. package/stories/geometry/rings/AnimatedRing.stories.tsx +18 -0
  102. package/stories/geometry/rings/RadialRings.stories.tsx +19 -0
  103. package/stories/geometry/rings/Ring.stories.tsx +17 -0
  104. package/stories/geometry/rings/RingWave.stories.tsx +20 -0
  105. package/stories/layout/FAQSection.stories.tsx +49 -0
  106. package/stories/layout/InputGroup.stories.tsx +19 -0
  107. package/stories/layout/Table.stories.tsx +19 -0
  108. package/stories/layout/TextImage.stories.tsx +24 -0
  109. package/stories/layout/chip/Chip.stories.tsx +19 -0
  110. package/stories/layout/chip/ChipList.stories.tsx +27 -0
  111. package/stories/layout/tile/Tile.stories.ts +20 -0
  112. package/stories/layout/tile/TileWithImage.stories.tsx +27 -0
  113. package/stories/other/BreadCrumbs.stories.tsx +21 -0
  114. package/stories/other/HelpwaveBadge.stories.tsx +18 -0
  115. package/stories/other/HelpwaveSpinner.stories.tsx +19 -0
  116. package/stories/other/MarkdownInterpreter.stories.tsx +18 -0
  117. package/stories/other/Profile.stories.tsx +52 -0
  118. package/stories/other/SearchableList.stories.tsx +21 -0
  119. package/stories/other/StackingModals.stories.tsx +16 -0
  120. package/stories/other/TechRadar.stories.tsx +14 -0
  121. package/stories/other/Translation.stories.tsx +56 -0
  122. package/stories/other/VerticalDivider.stories.tsx +20 -0
  123. package/stories/other/avatar/Avatar.stories.tsx +19 -0
  124. package/stories/other/avatar/AvatarGroup.stories.tsx +26 -0
  125. package/stories/other/tooltip/Tooltip.stories.tsx +30 -0
  126. package/stories/other/tooltip/TooltipStack.stories.tsx +39 -0
  127. package/stories/user-action/button/LoadingButton.stories.tsx +21 -0
  128. package/stories/user-action/button/OutlineButton.stories.tsx +22 -0
  129. package/stories/user-action/button/SolidButton.stories.tsx +22 -0
  130. package/stories/user-action/button/TextButton.stories.tsx +22 -0
  131. package/stories/user-action/input/Checkbox.stories.tsx +20 -0
  132. package/stories/user-action/input/Label.stories.tsx +18 -0
  133. package/stories/user-action/input/ScrollPicker.stories.tsx +20 -0
  134. package/stories/user-action/input/Textarea.stories.tsx +22 -0
  135. package/stories/user-action/input/date/DatePicker.stories.tsx +23 -0
  136. package/stories/user-action/input/date/DateTimePicker.stories.tsx +26 -0
  137. package/stories/user-action/input/date/DayPicker.stories.tsx +20 -0
  138. package/stories/user-action/input/date/TimePicker.stories.tsx +20 -0
  139. package/stories/user-action/input/date/YearMonthPicker.stories.tsx +21 -0
  140. package/stories/user-action/input/select/MultiSelect.stories.tsx +39 -0
  141. package/stories/user-action/input/select/SearchableSelect.stories.tsx +32 -0
  142. package/stories/user-action/input/select/Select.stories.tsx +30 -0
  143. package/stories/user-action/properties/CheckboxProperty.stories.tsx +20 -0
  144. package/stories/user-action/properties/DateProperty.stories.tsx +21 -0
  145. package/stories/user-action/properties/MultiSelectProperty.stories.tsx +33 -0
  146. package/stories/user-action/properties/NumberProperty.stories.tsx +21 -0
  147. package/stories/user-action/properties/PropertyBase.stories.tsx +28 -0
  148. package/stories/user-action/properties/SingleSelectProperty.stories.tsx +35 -0
  149. package/stories/user-action/properties/TextProperty.stories.tsx +20 -0
  150. package/tsconfig.json +20 -0
  151. package/util/array.ts +115 -0
  152. package/util/builder.ts +9 -0
  153. package/util/date.ts +180 -0
  154. package/util/easeFunctions.ts +37 -0
  155. package/util/emailValidation.ts +3 -0
  156. package/util/loopingArray.ts +94 -0
  157. package/util/math.ts +3 -0
  158. package/util/news.ts +43 -0
  159. package/util/noop.ts +1 -0
  160. package/util/simpleSearch.ts +65 -0
  161. package/util/storage.ts +37 -0
  162. package/util/types.ts +4 -0
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Helpwave } from '../../components/icons/Helpwave'
3
+
4
+ const meta = {
5
+ title: 'Other/Spinner',
6
+ component: Helpwave,
7
+ } satisfies Meta<typeof Helpwave>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const Basic: Story = {
13
+ args: {
14
+ color: 'currentColor',
15
+ animate: 'loading',
16
+ width: 128,
17
+ height: 128,
18
+ },
19
+ }
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { MarkdownInterpreter } from '../../components/MarkdownInterpreter'
3
+
4
+ const meta = {
5
+ title: 'Other/MarkdownInterpreter',
6
+ component: MarkdownInterpreter,
7
+ } satisfies Meta<typeof MarkdownInterpreter>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const MarkdownInterpreterVariation: Story = {
13
+ args: {
14
+ text: '\\helpwave \\i{italic} \\{Escape\\} \\\\ \\b{bold} \\u{underline} ' +
15
+ '\\space{space-grotesk} \\newline Newline \\positive{positive} \\negative{negative} \\warn{warn} ' +
16
+ '\\primary{primary} \\b{\\i{\\u{bold and italic and underlined \\primary{also primary}}}}',
17
+ },
18
+ }
@@ -0,0 +1,52 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Profile } from '../../components/Profile'
3
+ import { Helpwave } from '../../components/icons/Helpwave'
4
+ import { MarkdownInterpreter } from '../../components/MarkdownInterpreter'
5
+ import { Chip } from '../../components/ChipList'
6
+
7
+ const meta = {
8
+ title: 'Other/Profile',
9
+ component: Profile,
10
+ } satisfies Meta<typeof Profile>
11
+
12
+ export default meta
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const ProfileVariation: Story = {
16
+ render: (args) => {
17
+ return (<Profile {...args}/>)
18
+ },
19
+ args: {
20
+ name: 'helpwave Member',
21
+ role: 'Chief Executive Officer',
22
+ roleBadge: 'CEO',
23
+ imageUrl: 'https://cdn.helpwave.de/boringavatar.svg',
24
+ badge: (
25
+ <Chip className="row gap-x-2 items-center justify-center" color="dark">
26
+ <Helpwave size={24}/>
27
+ <MarkdownInterpreter text={'\\helpwave'}/>
28
+ </Chip>
29
+ ),
30
+ tags: ['development', 'frontend', 'cloud', 'backend'],
31
+ info: 'This is an additional Information Text.',
32
+ socials: [
33
+ {
34
+ type: 'github',
35
+ url: 'https://github.com',
36
+ },
37
+ {
38
+ type: 'mail',
39
+ url: 'mailto:mail@helpwave.de',
40
+ },
41
+ {
42
+ type: 'linkedin',
43
+ url: 'https://www.linkedin.com/',
44
+ },
45
+ {
46
+ type: 'website',
47
+ url: 'https://helpwave.de',
48
+ },
49
+ ],
50
+ imageClassName: 'w-[200px] h-[200px]'
51
+ },
52
+ }
@@ -0,0 +1,21 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { SearchableList } from '../../components/SearchableList'
3
+
4
+ const meta = {
5
+ title: 'Other/SearchableList',
6
+ component: SearchableList<string>,
7
+ } satisfies Meta<typeof SearchableList<string>>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const SearchableListVariation: Story = {
13
+ args: {
14
+ list: ['Apple', 'Banana', 'Pineapple', 'Pear', 'Strawberry', 'Raspberry', 'Wildberry'],
15
+ initialSearch: '',
16
+ searchMapping: value => [value],
17
+ itemMapper: value => <span>{value}</span>,
18
+ className: '',
19
+ overwriteTranslation: {},
20
+ },
21
+ }
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { StackingModals } from '../../components/examples/StackingModals'
3
+
4
+ const meta: Meta = {
5
+ title: 'Other/StackingModals',
6
+ component: StackingModals,
7
+ }
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const StackingModalsStory: Story = {
13
+ render: () => <StackingModals />,
14
+ args: {
15
+ }
16
+ }
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TechRadar } from '../../components/TechRadar'
3
+
4
+ const meta = {
5
+ title: 'Other/TechRadar',
6
+ component: TechRadar,
7
+ } satisfies Meta<typeof TechRadar>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TechRadarStory: Story = {
13
+ render: () => <TechRadar />,
14
+ }
@@ -0,0 +1,56 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import type { Languages } from '../../hooks/useLanguage'
3
+ import type { PropsForTranslation } from '../../hooks/useTranslation'
4
+ import { useTranslation } from '../../hooks/useTranslation'
5
+
6
+ type TranslationExampleTranslation = {
7
+ welcome: string,
8
+ goodToSeeYou: string,
9
+ page: (page: number) => string,
10
+ }
11
+
12
+ const defaultTranslationExampleTranslations: Record<Languages, TranslationExampleTranslation> = {
13
+ en: {
14
+ welcome: 'Welcome',
15
+ goodToSeeYou: 'Good to see you',
16
+ page: (page) => `Page ${page}`
17
+ },
18
+ de: {
19
+ welcome: 'Willkommen',
20
+ goodToSeeYou: 'Schön dich zu sehen',
21
+ page: (page) => `Seite ${page}`
22
+ }
23
+ }
24
+
25
+ type TranslationExampleProps = {
26
+ name: string,
27
+ }
28
+
29
+ /**
30
+ * Simple TranslationExample component to demonstrate some translations
31
+ */
32
+ const TranslationExample = ({ overwriteTranslation, name }:PropsForTranslation<TranslationExampleTranslation, TranslationExampleProps>) => {
33
+ const translation = useTranslation(defaultTranslationExampleTranslations, overwriteTranslation)
34
+ return (
35
+ <p className="rounded bg-surface text-on-surface p-1 px-2">
36
+ {translation.welcome}{'! '}
37
+ {translation.goodToSeeYou}{', '}
38
+ <span className="text-primary">{name}</span>{'. '}
39
+ {translation.page(123)}
40
+ </p>
41
+ )
42
+ }
43
+
44
+ const meta = {
45
+ title: 'Other/Translation',
46
+ component: TranslationExample,
47
+ } satisfies Meta<typeof TranslationExample>
48
+
49
+ export default meta
50
+ type Story = StoryObj<typeof meta>;
51
+
52
+ export const TranslationStory: Story = {
53
+ args: {
54
+ name: 'Name'
55
+ }
56
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { VerticalDivider } from '../../components/VerticalDivider'
3
+
4
+ const meta = {
5
+ title: 'Other/VerticalDivider',
6
+ component: VerticalDivider,
7
+ } satisfies Meta<typeof VerticalDivider>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const VerticalDividerBasic: Story = {
13
+ args: {
14
+ width: 1,
15
+ height: 100,
16
+ strokeWidth: 4,
17
+ dashLength: 6,
18
+ dashGap: 6,
19
+ },
20
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Avatar } from '../../../components/Avatar'
3
+
4
+ const meta = {
5
+ title: 'Other/Avatar',
6
+ component: Avatar,
7
+ } satisfies Meta<typeof Avatar>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const AvatarVariation: Story = {
13
+ args: {
14
+ alt: 'altText',
15
+ avatarUrl: 'https://helpwave.de/favicon.ico',
16
+ size: 'small',
17
+ className: ''
18
+ },
19
+ }
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { AvatarGroup } from '../../../components/AvatarGroup'
3
+
4
+ const meta = {
5
+ title: 'Other/Avatar',
6
+ component: AvatarGroup,
7
+ } satisfies Meta<typeof AvatarGroup>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const AvatarGroupVariation: Story = {
13
+ args: {
14
+ avatars: [
15
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
16
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
17
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
18
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
19
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
20
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
21
+ { alt: 'altText', avatarUrl: 'https://helpwave.de/favicon.ico' },
22
+ ],
23
+ maxShownProfiles: 5,
24
+ size: 'tiny'
25
+ },
26
+ }
@@ -0,0 +1,30 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import type { TooltipProps } from '../../../components/Tooltip'
3
+ import { Tooltip } from '../../../components/Tooltip'
4
+
5
+ type TooltipExampleProps = Omit<TooltipProps, 'children' | 'tooltip'> & { tooltipText: string }
6
+
7
+ const TooltipExample = ({ tooltipText, ...props } : TooltipExampleProps) => {
8
+ return (
9
+ <Tooltip tooltip={tooltipText} {...props}><span className="bg-primary text-white px-2 py-1 rounded-lg">Hover over me</span></Tooltip>
10
+ )
11
+ }
12
+
13
+ const meta = {
14
+ title: 'Other/Tooltip',
15
+ component: TooltipExample,
16
+ } satisfies Meta<typeof TooltipExample>
17
+
18
+ export default meta
19
+ type Story = StoryObj<typeof meta>;
20
+
21
+ export const TooltipExampleStory: Story = {
22
+ args: {
23
+ tooltipText: 'Tooltip',
24
+ animationDelay: 700,
25
+ position: 'bottom',
26
+ zIndex: 10,
27
+ containerClassName: '',
28
+ tooltipClassName: ''
29
+ },
30
+ }
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import type { TooltipProps } from '../../../components/Tooltip'
3
+ import { Tooltip } from '../../../components/Tooltip'
4
+
5
+ type TooltipStackExampleProps = Omit<TooltipProps, 'children' | 'tooltip'>
6
+
7
+ const TooltipStackExample = ({ ...props }: TooltipStackExampleProps) => {
8
+ return (
9
+ <Tooltip tooltip={(
10
+ <Tooltip zIndex={11} tooltip={(
11
+ <span>Try to hover <Tooltip tooltip="Great right?" zIndex={12}>
12
+ <span className="font-bold underline">here</span>
13
+ </Tooltip></span>
14
+ )}>This is a Text on which you can hover to show
15
+ another Tooltip
16
+ </Tooltip>
17
+ )} {...props}>
18
+ <span className="bg-primary text-white px-2 py-1 rounded-lg">Hover over me</span>
19
+ </Tooltip>
20
+ )
21
+ }
22
+
23
+ const meta = {
24
+ title: 'Other/Tooltip',
25
+ component: TooltipStackExample,
26
+ } satisfies Meta<typeof TooltipStackExample>
27
+
28
+ export default meta
29
+ type Story = StoryObj<typeof meta>;
30
+
31
+ export const TooltipStackExampleStory: Story = {
32
+ args: {
33
+ animationDelay: 700,
34
+ position: 'right',
35
+ zIndex: 10,
36
+ containerClassName: '',
37
+ tooltipClassName: ''
38
+ },
39
+ }
@@ -0,0 +1,21 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { LoadingButton } from '../../../components/LoadingButton'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Button',
6
+ component: LoadingButton,
7
+ } satisfies Meta<typeof LoadingButton>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const LoadingButtonVariation: Story = {
13
+ args: {
14
+ children: 'Modify my `isLoading` properties',
15
+ color: 'primary',
16
+ size: 'medium',
17
+ disabled: false,
18
+ className: 'rounded',
19
+ isLoading: false,
20
+ },
21
+ }
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { OutlineButton } from '../../../components/Button'
3
+ import { action } from '@storybook/addon-actions'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Button',
7
+ component: OutlineButton,
8
+ } satisfies Meta<typeof OutlineButton>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const OutlineButtonVariation: Story = {
14
+ args: {
15
+ children: 'Test',
16
+ color: 'primary',
17
+ size: 'medium',
18
+ disabled: false,
19
+ className: 'rounded',
20
+ onClick: action('Clicked'),
21
+ },
22
+ }
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { SolidButton } from '../../../components/Button'
3
+ import { action } from '@storybook/addon-actions'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Button',
7
+ component: SolidButton,
8
+ } satisfies Meta<typeof SolidButton>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const SolidButtonVariation: Story = {
14
+ args: {
15
+ children: 'Test',
16
+ color: 'primary',
17
+ size: 'medium',
18
+ disabled: false,
19
+ className: 'rounded',
20
+ onClick: action('Clicked'),
21
+ },
22
+ }
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TextButton } from '../../../components/Button'
3
+ import { action } from '@storybook/addon-actions'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Button',
7
+ component: TextButton,
8
+ } satisfies Meta<typeof TextButton>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const TextButtonVariation: Story = {
14
+ args: {
15
+ children: 'Test',
16
+ color: 'negative',
17
+ size: 'medium',
18
+ disabled: false,
19
+ className: 'rounded',
20
+ onClick: action('Clicked'),
21
+ },
22
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { UncontrolledCheckbox } from '../../../components/user-input/Checkbox'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Checkbox',
6
+ component: UncontrolledCheckbox,
7
+ } satisfies Meta<typeof UncontrolledCheckbox>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const CheckboxVariation: Story = {
13
+ args: {
14
+ defaultValue: true,
15
+ disabled: false,
16
+ id: 'checkbox1',
17
+ size: 'medium',
18
+ label: { name: 'Click me ^^', labelType: 'labelMedium', className: '' },
19
+ },
20
+ }
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Label } from '../../../components/user-input/Label'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Input',
6
+ component: Label,
7
+ } satisfies Meta<typeof Label>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const LabelVariation: Story = {
13
+ args: {
14
+ name: 'LabelText',
15
+ labelType: 'labelMedium',
16
+ className: '',
17
+ },
18
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { ScrollPicker } from '../../../components/user-input/ScrollPicker'
3
+ import { range } from '../../../util/array'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Input/ScrollPicker',
7
+ component: ScrollPicker<number>,
8
+ } satisfies Meta<typeof ScrollPicker<number>>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const ChipVariation: Story = {
14
+ args: {
15
+ options: range(0, 59),
16
+ mapping: (value) => value.toString(),
17
+ selected: 55,
18
+ disabled: false
19
+ },
20
+ }
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TextareaExample } from '../../../components/examples/TextareaExample'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Input',
6
+ component: TextareaExample,
7
+ } satisfies Meta<typeof TextareaExample>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TextareaVariation: Story = {
13
+ args: {
14
+ value: 'Text',
15
+ label: { name: 'Label' },
16
+ id: 'text',
17
+ headline: '',
18
+ disclaimer: '',
19
+ resizable: false,
20
+ className: '',
21
+ },
22
+ }
@@ -0,0 +1,23 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { addDuration, subtractDuration } from '../../../../util/date'
3
+ import { ControlledDatePicker } from '../../../../components/date/DatePicker'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Input/Date',
7
+ component: ControlledDatePicker,
8
+ } satisfies Meta<typeof ControlledDatePicker>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const DatePickerVariation: Story = {
14
+ args: {
15
+ value: new Date(),
16
+ start: subtractDuration(new Date(), { years: 50 }),
17
+ end: addDuration(new Date(), { years: 50 }),
18
+ initialDisplay: 'day',
19
+ className: '',
20
+ yearMonthPickerProps: {},
21
+ dayPickerProps: {},
22
+ },
23
+ }
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { DateTimePickerExample } from '../../../../components/examples/date/DateTimePickerExample'
3
+ import { addDuration, subtractDuration } from '../../../../util/date'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Input/Date',
7
+ component: DateTimePickerExample,
8
+ } satisfies Meta<typeof DateTimePickerExample>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const DateTimePickerVariation: Story = {
14
+ args: {
15
+ mode: 'dateTime',
16
+ value: new Date(),
17
+ start: subtractDuration(new Date(), { years: 50 }),
18
+ end: addDuration(new Date(), { years: 50 }),
19
+ is24HourFormat: true,
20
+ minuteIncrement: '5min',
21
+ weekStart: 'monday',
22
+ initialDisplay: 'day',
23
+ markToday: true,
24
+ showValueOpen: false,
25
+ },
26
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { DayPickerControlled } from '../../../../components/date/DayPicker'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Input/Date',
6
+ component: DayPickerControlled,
7
+ } satisfies Meta<typeof DayPickerControlled>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const DayPickerVariation: Story = {
13
+ args: {
14
+ displayedMonth: new Date(),
15
+ selected: new Date(),
16
+ markToday: true,
17
+ weekStart: 'monday',
18
+ className: 'h-max-[300px]'
19
+ },
20
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { ControlledTimePicker } from '../../../../components/date/TimePicker'
3
+
4
+ const meta = {
5
+ title: 'User-Action/Input/Date',
6
+ component: ControlledTimePicker,
7
+ } satisfies Meta<typeof ControlledTimePicker>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TimePickerVariation: Story = {
13
+ args: {
14
+ time: new Date(),
15
+ is24HourFormat: true,
16
+ minuteIncrement: '5min',
17
+ maxHeight: 300,
18
+ className: ''
19
+ },
20
+ }
@@ -0,0 +1,21 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { addDuration, subtractDuration } from '../../../../util/date'
3
+ import { ControlledYearMonthPicker } from '../../../../components/date/YearMonthPicker'
4
+
5
+ const meta = {
6
+ title: 'User-Action/Input/Date',
7
+ component: ControlledYearMonthPicker,
8
+ } satisfies Meta<typeof ControlledYearMonthPicker>
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const YearMonthPickerVariation: Story = {
14
+ args: {
15
+ start: subtractDuration(new Date(), { years: 50 }),
16
+ end: addDuration(new Date(), { years: 50 }),
17
+ className: 'max-w-[200px]',
18
+ maxHeight: 300,
19
+ showValueOpen: false
20
+ },
21
+ }