@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,46 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ function useSaveDelay(setNotificationStatus: (isShowing: boolean) => void, delay: number) {
4
+ const [updateTimer, setUpdateTimer] = useState<NodeJS.Timeout | undefined>(undefined)
5
+ const [notificationTimer, setNotificationTimer] = useState<NodeJS.Timeout | undefined>(undefined)
6
+
7
+ const restartTimer = (onSave: () => void) => {
8
+ clearTimeout(updateTimer)
9
+ setUpdateTimer(setTimeout(() => {
10
+ onSave()
11
+ setNotificationStatus(true)
12
+ // Show Saved Notification for fade animation duration
13
+ clearTimeout(notificationTimer)
14
+ setNotificationTimer(setTimeout(() => {
15
+ setNotificationStatus(false)
16
+ clearTimeout(notificationTimer)
17
+ }, delay))
18
+ clearTimeout(updateTimer)
19
+ }, delay))
20
+ }
21
+
22
+ const clearUpdateTimer = (hasSaved = true) => {
23
+ clearTimeout(updateTimer)
24
+ if (hasSaved) {
25
+ setNotificationStatus(true)
26
+ clearTimeout(notificationTimer)
27
+ setNotificationTimer(setTimeout(() => {
28
+ setNotificationStatus(false)
29
+ clearTimeout(notificationTimer)
30
+ }, delay))
31
+ } else {
32
+ setNotificationStatus(false)
33
+ }
34
+ }
35
+
36
+ useEffect(() => {
37
+ return () => {
38
+ clearTimeout(updateTimer)
39
+ clearTimeout(notificationTimer)
40
+ }
41
+ }, []) // eslint-disable-line react-hooks/exhaustive-deps
42
+
43
+ return { restartTimer, clearUpdateTimer }
44
+ }
45
+
46
+ export default useSaveDelay
@@ -0,0 +1,57 @@
1
+ import { useContext } from 'react'
2
+ import type { Dispatch, SetStateAction, PropsWithChildren } from 'react'
3
+ import { createContext, useState, useEffect } from 'react'
4
+ import type { Translation } from './useTranslation'
5
+
6
+ export type ThemeType = 'light' | 'dark'
7
+
8
+ export type ThemeTypeTranslation = Record<ThemeType, string>
9
+ export const defaultThemeTypeTranslation: Translation<ThemeTypeTranslation> = {
10
+ en: {
11
+ dark: 'Dark',
12
+ light: 'Light'
13
+ },
14
+ de: {
15
+ dark: 'Dunkel',
16
+ light: 'Hell'
17
+ }
18
+ }
19
+
20
+ type ThemeContextType = {
21
+ theme: ThemeType,
22
+ setTheme: Dispatch<SetStateAction<ThemeType>>,
23
+ }
24
+
25
+ export const ThemeContext = createContext<ThemeContextType>({
26
+ theme: 'light',
27
+ setTheme: (_: SetStateAction<ThemeType>) => {
28
+ },
29
+ })
30
+
31
+ type ThemeProviderProps = {
32
+ initialTheme?: ThemeType,
33
+ }
34
+
35
+ export const ThemeProvider = ({ children, initialTheme = 'light' }: PropsWithChildren<ThemeProviderProps>) => {
36
+ const [theme, setTheme] = useState<ThemeType>(initialTheme)
37
+
38
+ useEffect(() => {
39
+ if (theme !== initialTheme) {
40
+ console.warn('ThemeProvider initial state changed: Prefer using useTheme\'s setTheme instead')
41
+ setTheme(initialTheme)
42
+ }
43
+ }, [initialTheme]) // eslint-disable-line react-hooks/exhaustive-deps
44
+
45
+ useEffect(() => {
46
+ document.documentElement.setAttribute('data-theme', theme)
47
+ }, [theme])
48
+
49
+ return (
50
+ <ThemeContext.Provider value={{ theme, setTheme }}>
51
+ {children}
52
+ </ThemeContext.Provider>
53
+ )
54
+ }
55
+
56
+
57
+ export const useTheme = () => useContext(ThemeContext)
@@ -0,0 +1,43 @@
1
+ import type { Languages } from './useLanguage'
2
+ import { useLanguage } from './useLanguage'
3
+
4
+ export type Translation<T> = Record<Languages, T>
5
+
6
+ type OverwriteTranslationType<Translation extends Record<string, unknown>> = {
7
+ language?: Languages,
8
+ translation?: Partial<Record<Languages, Partial<Translation>>>,
9
+ }
10
+
11
+ /**
12
+ * Adds the `language` prop to the component props.
13
+ *
14
+ * @param Translation the type of the translation object
15
+ *
16
+ * @param Props the type of the component props, defaults to `Record<string, never>`,
17
+ * if you don't expect any other props other than `language` and get an
18
+ * error when using your component (because it uses `forwardRef` etc.)
19
+ * you can try out `Record<string, unknown>`, this might resolve your
20
+ * problem as `SomeType & never` is still `never` but `SomeType & unknown`
21
+ * is `SomeType` which means that adding back props (like `ref` etc.)
22
+ * works properly
23
+ */
24
+ export type PropsForTranslation<
25
+ Translation extends Record<string, unknown>,
26
+ Props = Record<string, never>
27
+ > = Props & {
28
+ overwriteTranslation?: OverwriteTranslationType<Translation>,
29
+ };
30
+
31
+ export const useTranslation = <Translation extends Record<string, unknown>>(
32
+ defaults: Record<Languages, Translation>,
33
+ translationOverwrite: OverwriteTranslationType<Translation> = {}
34
+ ) : Translation => {
35
+ const { language: languageProp, translation: overwrite } = translationOverwrite
36
+ const { language: inferredLanguage } = useLanguage()
37
+ const usedLanguage = languageProp ?? inferredLanguage
38
+ let defaultValues: Translation = defaults[usedLanguage]
39
+ if (overwrite && overwrite[usedLanguage]) {
40
+ defaultValues = { ...defaultValues, ...overwrite[usedLanguage] }
41
+ }
42
+ return defaultValues
43
+ }
package/index.ts ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@helpwave/hightide",
3
+ "description": "helpwave's component and theming library",
4
+ "author": "helpwave <support@helpwave.de> (https://helpwave.de)",
5
+ "homepage": "https://helpwave.de",
6
+ "repository": {
7
+ "url": "git+https://github.com/helpwave/hightide.git"
8
+ },
9
+ "license": "MPL-2.0",
10
+ "version": "0.0.1",
11
+ "main": "index.ts",
12
+ "type": "module",
13
+ "scripts": {
14
+ "storybook": "storybook dev -p 6006",
15
+ "build-storybook": "storybook build",
16
+ "lint": "tsc --noEmit && eslint ."
17
+ },
18
+ "dependencies": {
19
+ "@babel/core": "7.26.0",
20
+ "@headlessui/react": "1.7.19",
21
+ "@radix-ui/react-checkbox": "1.1.3",
22
+ "@storybook/addon-actions": "^8.6.12",
23
+ "@storybook/theming": "^8.6.12",
24
+ "@tailwindcss/postcss": "^4.0.17",
25
+ "@types/node": "20.17.10",
26
+ "@types/tinycolor2": "1.4.6",
27
+ "clsx": "^2.1.1",
28
+ "lucide-react": "0.468.0",
29
+ "react": "18.3.1",
30
+ "react-custom-scrollbars-2": "4.5.0",
31
+ "react-dom": "18.3.1",
32
+ "simplebar-core": "1.3.0",
33
+ "simplebar-react": "3.3.0",
34
+ "tailwindcss": "^4.1.3",
35
+ "tinycolor2": "1.6.0",
36
+ "typescript": "5.7.2",
37
+ "webpack": "5.97.1",
38
+ "zod": "3.24.1"
39
+ },
40
+ "devDependencies": {
41
+ "@babel/preset-env": "7.26.0",
42
+ "@babel/preset-react": "7.26.3",
43
+ "@babel/preset-typescript": "7.26.0",
44
+ "@helpwave/eslint-config": "^1.29.0",
45
+ "@storybook/addon-essentials": "^8.6.12",
46
+ "@storybook/addon-interactions": "^8.6.12",
47
+ "@storybook/addon-links": "^8.6.12",
48
+ "@storybook/blocks": "^8.6.12",
49
+ "@storybook/nextjs": "^8.6.12",
50
+ "@storybook/react": "^8.6.12",
51
+ "@types/react": "18.3.17",
52
+ "@types/react-dom": "18.3.5",
53
+ "eslint": "9.17.0",
54
+ "next": "15.2.4",
55
+ "prop-types": "15.8.1",
56
+ "storybook": "^8.6.12"
57
+ },
58
+ "peerDependencies": {
59
+ "react": "18.3.1",
60
+ "react-dom": "18.3.1"
61
+ },
62
+ "keywords": [
63
+ "react",
64
+ "tailwindcss",
65
+ "component-library",
66
+ "typscript"
67
+ ],
68
+ "bugs": {
69
+ "url": "https://github.com/helpwave/hightide/issues"
70
+ }
71
+ }
@@ -0,0 +1,7 @@
1
+ const config = {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ }
5
+ }
6
+
7
+ export default config
@@ -0,0 +1,23 @@
1
+ ## Adding a Story
2
+
3
+ You can use the `title` to change the displayed _hierarchy_.
4
+ **Make sure** that this _hierarchy_ is the **same as the path**
5
+ in which you have saved the story.
6
+
7
+ ```typescript
8
+ const meta = {
9
+ title: 'Category/Folder/ComponentGroup',
10
+ component: Circle,
11
+ } satisfies Meta<typeof Circle>
12
+
13
+ export default meta
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const CircleVariation: Story = {
17
+ args: {
18
+ radius: 40,
19
+ color: 'primary',
20
+ className: '',
21
+ },
22
+ }
23
+ ```
@@ -0,0 +1,54 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import type { ShadedColors } from '../../coloring/types'
3
+ import { shadingColorValues } from '../../coloring/types'
4
+ import { generateShadingColors } from '../../coloring/shading'
5
+
6
+ type StripeProps = {
7
+ shading: Partial<ShadedColors>,
8
+ };
9
+
10
+ const ColorStripe = ({ shading }: StripeProps) => {
11
+ const shades = generateShadingColors(shading)
12
+
13
+ return (
14
+ <div className="row">
15
+ {shadingColorValues.map((shade, index) => (
16
+ <div key={index} className="col gap-y-2 items-center relative">
17
+ <span className="font-bold">{shade}</span>
18
+ <div
19
+ style={{
20
+ backgroundColor: shades[shade],
21
+ width: 60,
22
+ height: 60,
23
+ }}
24
+ />
25
+ <span style={{ position: 'absolute', bottom: index % 2 === 0 ? '-24px' : '-48px' }}>{shades[shade].toUpperCase()}</span>
26
+ </div>
27
+ ))}
28
+ </div>
29
+ )
30
+ }
31
+
32
+ const meta = {
33
+ title: 'Coloring/Shading',
34
+ component: ColorStripe,
35
+ } satisfies Meta<typeof ColorStripe>
36
+
37
+ export default meta
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const ShadingWithFixedValues: Story = {
41
+ args: {
42
+ shading: {
43
+ 100: '#F5E2FD',
44
+ 200: '#EFD5FB',
45
+ 300: '#CDAFEF',
46
+ 400: '#AA96DF',
47
+ 500: '#B275CE',
48
+ 600: '#8E75CE',
49
+ 700: '#694BB4',
50
+ 800: '#8070A9',
51
+ 900: '#5D4D80',
52
+ },
53
+ },
54
+ }
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Circle } from '../../components/Circle'
3
+
4
+ const meta = {
5
+ title: 'Geometry/Circle',
6
+ component: Circle,
7
+ } satisfies Meta<typeof Circle>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const CircleVariation: Story = {
13
+ args: {
14
+ radius: 40,
15
+ },
16
+ }
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { AnimatedRing } from '../../../components/Ring'
3
+
4
+ const meta = {
5
+ title: 'Geometry/Rings',
6
+ component: AnimatedRing,
7
+ } satisfies Meta<typeof AnimatedRing>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const AnimatedRingVariation: Story = {
13
+ args: {
14
+ innerSize: 40,
15
+ width: 10,
16
+ fillAnimationDuration: 3,
17
+ },
18
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { RadialRings } from '../../../components/Ring'
3
+
4
+ const meta = {
5
+ title: 'Geometry/Rings',
6
+ component: RadialRings,
7
+ } satisfies Meta<typeof RadialRings>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const RadialRingsVariation: Story = {
13
+ args: {
14
+ waveWidth: 10,
15
+ sizeCircle1: 100,
16
+ sizeCircle2: 200,
17
+ sizeCircle3: 300
18
+ },
19
+ }
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Ring } from '../../../components/Ring'
3
+
4
+ const meta = {
5
+ title: 'Geometry/Rings',
6
+ component: Ring,
7
+ } satisfies Meta<typeof Ring>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const RingVariation: Story = {
13
+ args: {
14
+ innerSize: 40,
15
+ width: 10,
16
+ },
17
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { RingWave } from '../../../components/Ring'
3
+
4
+ const meta = {
5
+ title: 'Geometry/Rings',
6
+ component: RingWave,
7
+ } satisfies Meta<typeof RingWave>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const RingWaveVariation: Story = {
13
+ args: {
14
+ startInnerSize: 20,
15
+ endInnerSize: 50,
16
+ width: 5,
17
+ fillAnimationDuration: 3,
18
+ repeating: false,
19
+ },
20
+ }
@@ -0,0 +1,49 @@
1
+ import type { StoryFn } from '@storybook/react'
2
+ import { FAQSection } from '../../components/layout/FAQSection'
3
+ import { Helpwave } from '../../components/icons/Helpwave'
4
+
5
+ const meta = {
6
+ title: 'Layout',
7
+ component: FAQSection,
8
+ }
9
+
10
+ export default meta
11
+
12
+ export const FAQSectionVariation: StoryFn = () => (
13
+ <div className="bg-gray-100 p-4">
14
+ <FAQSection
15
+ entries={[
16
+ { id: 'question1', title: 'A Very Good Question?', content: { type: 'markdown', value: '\\negative{NO.}' } },
17
+ {
18
+ id: 'question2',
19
+ title: 'What is the first paragraph of the lorem ipsum?',
20
+ content: {
21
+ type: 'markdown',
22
+ value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget suscipit ex. In vitae leo metus.' +
23
+ ' Fusce gravida urna et magna consectetur mollis. Lorem ipsum dolor sit amet, consectetur adipiscing elit.' +
24
+ ' Etiam ac tellus purus. Integer vel sollicitudin leo. Integer nec interdum nisl. Nunc bibendum tellus vel' +
25
+ ' mollis cursus. Mauris eu luctus ipsum. Vivamus euismod nisi at odio tristique volutpat. Cras sed' +
26
+ ' facilisis neque, ac sagittis turpis. Maecenas et libero facilisis dui porta suscipit et in quam.' +
27
+ ' In hac habitasse platea dictumst. Donec nec sodales nibh, a pellentesque purus.'
28
+ }
29
+ },
30
+ {
31
+ id: 'question3',
32
+ title: 'Can I click this?',
33
+ content: {
34
+ type: 'markdown',
35
+ value: '\\positive{\\b{Yes, you can.}}'
36
+ }
37
+ },
38
+ {
39
+ id: 'question4',
40
+ title: 'What does the helpwave logo look like?',
41
+ content: {
42
+ type: 'custom',
43
+ value: (<div className="row justify-center"><Helpwave/></div>)
44
+ }
45
+ },
46
+ ]}
47
+ />
48
+ </div>
49
+ )
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { InputGroupExample } from '../../components/examples/InputGroupExample'
3
+
4
+ const meta = {
5
+ title: 'Layout',
6
+ component: InputGroupExample,
7
+ } satisfies Meta<typeof InputGroupExample>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const InputGroupVariation: Story = {
13
+ args: {
14
+ title: 'Title',
15
+ expanded: true,
16
+ isExpandable: true,
17
+ className: '',
18
+ },
19
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Table } from '../../components/Table'
3
+ import type { DataType } from '../../components/examples/TableExample'
4
+ import TableExample, { exampleData } from '../../components/examples/TableExample'
5
+
6
+ const meta: Meta<typeof Table<DataType>> = {
7
+ title: 'Layout/Table',
8
+ component: Table,
9
+ }
10
+
11
+ export default meta
12
+ type Story = StoryObj<typeof meta>;
13
+
14
+ export const TableExampleStory: Story = {
15
+ render: (args) => <TableExample data={args['data']}/>,
16
+ args: {
17
+ data: exampleData,
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TextImage } from '../../components/TextImage'
3
+
4
+ const meta = {
5
+ title: 'Layout/TextImage',
6
+ component: TextImage,
7
+ } satisfies Meta<typeof TextImage>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TextImageVariation: Story = {
13
+ args: {
14
+ title: 'This is the title',
15
+ description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras magna lorem, eleifend at mi nec, ' +
16
+ 'vehicula dignissim diam. Integer ut justo eget neque interdum viverra eu eu dolor. Nullam vulputate urna sed ' +
17
+ 'gravida facilisis. Phasellus volutpat elit luctus, sagittis libero sit amet, dapibus lacus.',
18
+ color: 'primary',
19
+ badge: 'Step #1',
20
+ imageUrl: 'https://images.unsplash.com/photo-1576091160550-2173dba999ef?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
21
+ contentClassName: '',
22
+ className: '',
23
+ },
24
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Chip } from '../../../components/ChipList'
3
+
4
+ const meta = {
5
+ title: 'Layout/Chip',
6
+ component: Chip,
7
+ } satisfies Meta<typeof Chip>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const ChipVariation: Story = {
13
+ args: {
14
+ children: 'Label',
15
+ className: '',
16
+ variant: 'normal',
17
+ color: 'default'
18
+ },
19
+ }
@@ -0,0 +1,27 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { ChipList } from '../../../components/ChipList'
3
+
4
+ const meta = {
5
+ title: 'Layout/Chip',
6
+ component: ChipList,
7
+ } satisfies Meta<typeof ChipList>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const ChipListVariation: Story = {
13
+ args: {
14
+ list: [
15
+ { children: 'Chip 1' },
16
+ { children: 'Chip 2' },
17
+ { children: 'Chip 3 with longer text' },
18
+ { children: 'Chip 4 different children', variant: 'fullyRounded' },
19
+ { children: 'Chip 5 with text' },
20
+ { children: 'Chip 6 custom style', className: '!bg-red-400' },
21
+ { children: 'Chip 7 in dark color', color: 'dark' },
22
+ { children: 'Chip 8 with very very long text' },
23
+ { children: 'Chip 9' },
24
+ ],
25
+ className: ''
26
+ },
27
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TileExample } from '../../../components/examples/TileExample'
3
+
4
+ const meta = {
5
+ title: 'Layout/Tile',
6
+ component: TileExample,
7
+ } satisfies Meta<typeof TileExample>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TileVariation: Story = {
13
+ args: {
14
+ title: { value: 'Title', className: '' },
15
+ description: { value: 'Description Text', className: 'textstyle-description' },
16
+ prefix: true,
17
+ suffix: true,
18
+ className: ''
19
+ },
20
+ }
@@ -0,0 +1,27 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { TileWithImage } from '../../../components/layout/Tile'
3
+
4
+ const meta = {
5
+ title: 'Layout/Tile',
6
+ component: TileWithImage,
7
+ } satisfies Meta<typeof TileWithImage>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const TileWithImageVariation: Story = {
13
+ args: {
14
+ title: { value: 'About helpwave', className: 'textstyle-title-lg' },
15
+ description: {
16
+ value: 'Regulatory burdens and high barriers to entry make it difficult for small companies to enter the market,' +
17
+ ' leading to a lack of competition. helpwave is here to change that. We offer a platform that brings everyone to' +
18
+ ' the table, not just the big companies.',
19
+ className: '!text-gray-200'
20
+ },
21
+ url: 'https://helpwave.de/favicon.ico',
22
+ imageLocation: 'prefix',
23
+ imageSize: { width: 100, height: 100 },
24
+ imageClassName: 'filter invert',
25
+ className: '!py-4 !px-6 !gap-x-6 bg-sky-900 text-white rounded-2xl min-h-[200px]'
26
+ },
27
+ }
@@ -0,0 +1,21 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { BreadCrumb } from '../../components/BreadCrumb'
3
+
4
+ const meta = {
5
+ title: 'Other/BreadCrumb',
6
+ component: BreadCrumb,
7
+ } satisfies Meta<typeof BreadCrumb>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const BreadCrumbVariation: Story = {
13
+ args: {
14
+ crumbs: [
15
+ { display: 'Organization', link: '' },
16
+ { display: 'Ward', link: '' },
17
+ { display: 'Bed', link: '' },
18
+ { display: 'Patient', link: '' },
19
+ ]
20
+ },
21
+ }
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { HelpwaveBadge } from '../../components/HelpwaveBadge'
3
+
4
+ const meta = {
5
+ title: 'Other/HelpwaveBadge',
6
+ component: HelpwaveBadge,
7
+ } satisfies Meta<typeof HelpwaveBadge>
8
+
9
+ export default meta
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const Basic: Story = {
13
+ args: {
14
+ size: 'small',
15
+ title: 'helpwave',
16
+ className: ''
17
+ },
18
+ }