@saas-ui/react 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/app-shell/index.d.cts +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/navbar/index.d.cts +3 -3
- package/dist/components/navbar/index.d.ts +3 -3
- package/dist/components/persona/index.d.cts +1 -1
- package/dist/components/persona/index.d.ts +1 -1
- package/dist/components/sidebar/index.d.cts +12 -12
- package/dist/components/sidebar/index.d.ts +12 -12
- package/dist/index.cjs +2 -12
- package/dist/index.js +2 -12
- package/package.json +4 -6
- package/src/components/app-shell/app-shell.recipe.ts +0 -52
- package/src/components/app-shell/app-shell.stories.tsx +0 -51
- package/src/components/app-shell/app-shell.tsx +0 -94
- package/src/components/app-shell/index.ts +0 -3
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +0 -17
- package/src/components/breadcrumbs/breadcrumb.tsx +0 -36
- package/src/components/breadcrumbs/index.ts +0 -1
- package/src/components/breadcrumbs/namespace.ts +0 -8
- package/src/components/button/button.recipe.ts +0 -182
- package/src/components/button/button.stories.tsx +0 -99
- package/src/components/button/button.tsx +0 -55
- package/src/components/button/index.ts +0 -2
- package/src/components/checkbox/checkbox.tsx +0 -26
- package/src/components/checkbox/index.ts +0 -2
- package/src/components/close-button/close-button.stories.tsx +0 -12
- package/src/components/close-button/close-button.tsx +0 -18
- package/src/components/close-button/index.ts +0 -2
- package/src/components/command/command.recipe.ts +0 -17
- package/src/components/command/command.stories.tsx +0 -47
- package/src/components/command/command.tsx +0 -50
- package/src/components/command/index.ts +0 -1
- package/src/components/dialog/dialog.tsx +0 -67
- package/src/components/dialog/index.ts +0 -1
- package/src/components/dialog/namespace.ts +0 -18
- package/src/components/drawer/drawer.tsx +0 -57
- package/src/components/drawer/index.ts +0 -3
- package/src/components/drawer/namespace.ts +0 -19
- package/src/components/grid-list/grid-list.recipe.ts +0 -113
- package/src/components/icon-badge/icon-badge.recipe.ts +0 -57
- package/src/components/icon-badge/icon-badge.stories.tsx +0 -38
- package/src/components/icon-badge/icon-badge.tsx +0 -59
- package/src/components/icon-badge/index.ts +0 -2
- package/src/components/icons/create-icon.tsx +0 -41
- package/src/components/icons/icons.tsx +0 -119
- package/src/components/icons/index.ts +0 -1
- package/src/components/input-group/index.ts +0 -1
- package/src/components/input-group/input-group.tsx +0 -46
- package/src/components/link/index.ts +0 -2
- package/src/components/link/link.stories.tsx +0 -17
- package/src/components/link/link.test.tsx +0 -33
- package/src/components/link/link.tsx +0 -27
- package/src/components/loading-overlay/index.ts +0 -1
- package/src/components/loading-overlay/loading-overlay.recipe.ts +0 -61
- package/src/components/loading-overlay/loading-overlay.stories.tsx +0 -68
- package/src/components/loading-overlay/loading-overlay.tsx +0 -54
- package/src/components/loading-overlay/namespace.ts +0 -7
- package/src/components/navbar/index.ts +0 -1
- package/src/components/navbar/namespace.ts +0 -9
- package/src/components/navbar/navbar.recipe.ts +0 -109
- package/src/components/navbar/navbar.stories.tsx +0 -435
- package/src/components/navbar/navbar.test.tsx +0 -49
- package/src/components/navbar/navbar.tsx +0 -39
- package/src/components/number-input/index.ts +0 -2
- package/src/components/number-input/number-input.tsx +0 -41
- package/src/components/password-input/index.ts +0 -2
- package/src/components/password-input/password-input.tsx +0 -93
- package/src/components/persona/index.ts +0 -2
- package/src/components/persona/namespace.ts +0 -18
- package/src/components/persona/persona-primitive.tsx +0 -220
- package/src/components/persona/persona.recipe.ts +0 -94
- package/src/components/persona/persona.stories.tsx +0 -101
- package/src/components/persona/persona.tsx +0 -142
- package/src/components/pin-input/index.ts +0 -2
- package/src/components/pin-input/pin-input.tsx +0 -36
- package/src/components/radio/index.ts +0 -2
- package/src/components/radio/radio.tsx +0 -27
- package/src/components/search-input/index.ts +0 -2
- package/src/components/search-input/search-input.stories.tsx +0 -63
- package/src/components/search-input/search-input.tsx +0 -134
- package/src/components/select/index.ts +0 -1
- package/src/components/select/namespace.ts +0 -18
- package/src/components/select/select.tsx +0 -135
- package/src/components/sidebar/index.ts +0 -7
- package/src/components/sidebar/namespace.ts +0 -27
- package/src/components/sidebar/sidebar-item.recipe.ts +0 -65
- package/src/components/sidebar/sidebar.recipe.ts +0 -237
- package/src/components/sidebar/sidebar.stories.tsx +0 -903
- package/src/components/sidebar/sidebar.tsx +0 -208
- package/src/components/spinner/index.ts +0 -2
- package/src/components/spinner/spinner.stories.tsx +0 -19
- package/src/components/spinner/spinner.tsx +0 -21
- package/src/components/steps/index.ts +0 -1
- package/src/components/steps/namespace.ts +0 -16
- package/src/components/steps/steps.tsx +0 -82
- package/src/components/switch/index.ts +0 -3
- package/src/components/switch/switch.tsx +0 -39
- package/src/compositions/accordion.tsx +0 -47
- package/src/compositions/action-bar.tsx +0 -40
- package/src/compositions/alert.tsx +0 -51
- package/src/compositions/avatar.tsx +0 -74
- package/src/compositions/blockquote.tsx +0 -31
- package/src/compositions/checkbox-card.tsx +0 -57
- package/src/compositions/checkbox.tsx +0 -25
- package/src/compositions/clipboard.tsx +0 -107
- package/src/compositions/color-mode.tsx +0 -65
- package/src/compositions/data-list.tsx +0 -37
- package/src/compositions/empty-state.tsx +0 -34
- package/src/compositions/field.tsx +0 -33
- package/src/compositions/file-button.tsx +0 -166
- package/src/compositions/hover-card.tsx +0 -35
- package/src/compositions/link-button.tsx +0 -12
- package/src/compositions/menu.tsx +0 -108
- package/src/compositions/native-select.tsx +0 -57
- package/src/compositions/pagination.tsx +0 -207
- package/src/compositions/popover.tsx +0 -58
- package/src/compositions/progress-circle.tsx +0 -37
- package/src/compositions/progress.tsx +0 -40
- package/src/compositions/prose.tsx +0 -264
- package/src/compositions/provider.tsx +0 -12
- package/src/compositions/radio-card.tsx +0 -57
- package/src/compositions/radio.tsx +0 -24
- package/src/compositions/rating.tsx +0 -27
- package/src/compositions/segmented-control.tsx +0 -47
- package/src/compositions/skeleton.tsx +0 -44
- package/src/compositions/slider.tsx +0 -53
- package/src/compositions/stat.tsx +0 -75
- package/src/compositions/status.tsx +0 -29
- package/src/compositions/stepper-input.tsx +0 -49
- package/src/compositions/tag.tsx +0 -39
- package/src/compositions/timeline.tsx +0 -17
- package/src/compositions/toaster.tsx +0 -43
- package/src/compositions/toggle-tip.tsx +0 -62
- package/src/compositions/tooltip.tsx +0 -46
- package/src/index.ts +0 -7
- package/src/preset.ts +0 -9
- package/src/provider/index.ts +0 -4
- package/src/provider/sui-provider.tsx +0 -34
- package/src/provider/use-link.test.tsx +0 -60
- package/src/provider/use-link.tsx +0 -13
- package/src/styled-system/create-recipe-context.tsx +0 -91
- package/src/styled-system/create-slot-recipe-context.tsx +0 -188
- package/src/styled-system/empty.ts +0 -7
- package/src/styled-system/factory.types.ts +0 -11
- package/src/theme/animation-styles.ts +0 -53
- package/src/theme/breakpoints.ts +0 -11
- package/src/theme/conditions.ts +0 -26
- package/src/theme/fluid-font-sizes.ts +0 -65
- package/src/theme/global-css.ts +0 -94
- package/src/theme/index.ts +0 -72
- package/src/theme/layer-styles.ts +0 -116
- package/src/theme/recipes/chakra/accordion.ts +0 -145
- package/src/theme/recipes/chakra/action-bar.ts +0 -62
- package/src/theme/recipes/chakra/alert.ts +0 -157
- package/src/theme/recipes/chakra/avatar.ts +0 -141
- package/src/theme/recipes/chakra/badge.ts +0 -67
- package/src/theme/recipes/chakra/blockquote.ts +0 -83
- package/src/theme/recipes/chakra/breadcrumb.ts +0 -94
- package/src/theme/recipes/chakra/card.ts +0 -99
- package/src/theme/recipes/chakra/checkbox-card.ts +0 -212
- package/src/theme/recipes/chakra/checkbox.ts +0 -70
- package/src/theme/recipes/chakra/checkmark.ts +0 -83
- package/src/theme/recipes/chakra/code.ts +0 -17
- package/src/theme/recipes/chakra/collapsible.ts +0 -20
- package/src/theme/recipes/chakra/container.ts +0 -26
- package/src/theme/recipes/chakra/data-list.ts +0 -80
- package/src/theme/recipes/chakra/dialog.ts +0 -225
- package/src/theme/recipes/chakra/drawer.ts +0 -201
- package/src/theme/recipes/chakra/editable.ts +0 -88
- package/src/theme/recipes/chakra/empty-state.ts +0 -88
- package/src/theme/recipes/chakra/field.ts +0 -68
- package/src/theme/recipes/chakra/fieldset.ts +0 -62
- package/src/theme/recipes/chakra/file-upload.ts +0 -96
- package/src/theme/recipes/chakra/heading.ts +0 -27
- package/src/theme/recipes/chakra/hover-card.ts +0 -68
- package/src/theme/recipes/chakra/icon.ts +0 -30
- package/src/theme/recipes/chakra/input-addon.ts +0 -40
- package/src/theme/recipes/chakra/input.ts +0 -96
- package/src/theme/recipes/chakra/kbd.ts +0 -60
- package/src/theme/recipes/chakra/link.ts +0 -37
- package/src/theme/recipes/chakra/list.ts +0 -67
- package/src/theme/recipes/chakra/mark.ts +0 -27
- package/src/theme/recipes/chakra/menu.ts +0 -124
- package/src/theme/recipes/chakra/native-select.ts +0 -140
- package/src/theme/recipes/chakra/number-input.ts +0 -115
- package/src/theme/recipes/chakra/pin-input.ts +0 -27
- package/src/theme/recipes/chakra/popover.ts +0 -86
- package/src/theme/recipes/chakra/progress-circle.ts +0 -94
- package/src/theme/recipes/chakra/progress.ts +0 -127
- package/src/theme/recipes/chakra/radio-card.ts +0 -220
- package/src/theme/recipes/chakra/radio-group.ts +0 -72
- package/src/theme/recipes/chakra/radiomark.ts +0 -107
- package/src/theme/recipes/chakra/rating-group.ts +0 -94
- package/src/theme/recipes/chakra/segment-group.ts +0 -117
- package/src/theme/recipes/chakra/select.ts +0 -282
- package/src/theme/recipes/chakra/separator.ts +0 -51
- package/src/theme/recipes/chakra/skeleton.ts +0 -53
- package/src/theme/recipes/chakra/skip-nav-link.ts +0 -34
- package/src/theme/recipes/chakra/slider.ts +0 -178
- package/src/theme/recipes/chakra/spinner.ts +0 -32
- package/src/theme/recipes/chakra/stat.ts +0 -79
- package/src/theme/recipes/chakra/status.ts +0 -48
- package/src/theme/recipes/chakra/steps.ts +0 -218
- package/src/theme/recipes/chakra/switch.ts +0 -167
- package/src/theme/recipes/chakra/table.ts +0 -172
- package/src/theme/recipes/chakra/tabs.ts +0 -280
- package/src/theme/recipes/chakra/tag.ts +0 -131
- package/src/theme/recipes/chakra/textarea.ts +0 -88
- package/src/theme/recipes/chakra/timeline.ts +0 -138
- package/src/theme/recipes/chakra/toast.ts +0 -96
- package/src/theme/recipes/chakra/tooltip.ts +0 -40
- package/src/theme/recipes.ts +0 -46
- package/src/theme/semantic-tokens/colors.ts +0 -403
- package/src/theme/semantic-tokens/radii.ts +0 -7
- package/src/theme/semantic-tokens/shadows.ts +0 -52
- package/src/theme/slot-recipes.ts +0 -104
- package/src/theme/text-styles.ts +0 -39
- package/src/theme/tokens/animations.ts +0 -8
- package/src/theme/tokens/aspect-ratios.ts +0 -10
- package/src/theme/tokens/blurs.ts +0 -12
- package/src/theme/tokens/borders.ts +0 -9
- package/src/theme/tokens/colors.ts +0 -177
- package/src/theme/tokens/cursor.ts +0 -12
- package/src/theme/tokens/durations.ts +0 -11
- package/src/theme/tokens/easings.ts +0 -10
- package/src/theme/tokens/font-sizes.ts +0 -20
- package/src/theme/tokens/font-weights.ts +0 -13
- package/src/theme/tokens/fonts.ts +0 -15
- package/src/theme/tokens/keyframes.ts +0 -173
- package/src/theme/tokens/letter-spacing.ts +0 -9
- package/src/theme/tokens/line-heights.ts +0 -19
- package/src/theme/tokens/radius.ts +0 -18
- package/src/theme/tokens/sizes.ts +0 -71
- package/src/theme/tokens/spacing.ts +0 -38
- package/src/theme/tokens/z-indices.ts +0 -34
- package/src/theme/utils.ts +0 -46
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { IconProps } from '@chakra-ui/react'
|
|
2
|
-
import { createIcon as _createIcon } from '@chakra-ui/react'
|
|
3
|
-
|
|
4
|
-
interface CreateIconOptions {
|
|
5
|
-
/**
|
|
6
|
-
* The icon `svg` viewBox
|
|
7
|
-
* @default "0 0 24 24"
|
|
8
|
-
*/
|
|
9
|
-
viewBox?: string
|
|
10
|
-
/**
|
|
11
|
-
* The `svg` path or group element
|
|
12
|
-
* @type React.ReactElement | React.ReactElement[]
|
|
13
|
-
*/
|
|
14
|
-
path?: React.ReactElement | React.ReactElement[]
|
|
15
|
-
/**
|
|
16
|
-
* If the `svg` has a single path, simply copy the path's `d` attribute
|
|
17
|
-
*/
|
|
18
|
-
d?: string
|
|
19
|
-
/**
|
|
20
|
-
* The display name useful in the dev tools
|
|
21
|
-
*/
|
|
22
|
-
displayName?: string
|
|
23
|
-
/**
|
|
24
|
-
* Default props automatically passed to the component; overwriteable
|
|
25
|
-
*/
|
|
26
|
-
defaultProps?: IconProps
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const createIcon = (props: CreateIconOptions) => {
|
|
30
|
-
return _createIcon({
|
|
31
|
-
viewBox: '0 0 24 24',
|
|
32
|
-
defaultProps: {
|
|
33
|
-
fill: 'none',
|
|
34
|
-
stroke: 'currentColor',
|
|
35
|
-
strokeWidth: '2',
|
|
36
|
-
strokeLinecap: 'round',
|
|
37
|
-
strokeLinejoin: 'round',
|
|
38
|
-
},
|
|
39
|
-
...props,
|
|
40
|
-
})
|
|
41
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { createIcon } from './create-icon'
|
|
2
|
-
|
|
3
|
-
export const ChevronUpIcon = createIcon({
|
|
4
|
-
displayName: 'ChevronUpIcon',
|
|
5
|
-
path: <polyline points="18 15 12 9 6 15"></polyline>,
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export const ChevronDownIcon = createIcon({
|
|
9
|
-
displayName: 'ChevronDownIcon',
|
|
10
|
-
path: <polyline points="6 9 12 15 18 9"></polyline>,
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export const ChevronLeftIcon = createIcon({
|
|
14
|
-
displayName: 'ChevronLeftIcon',
|
|
15
|
-
path: <polyline points="15 18 9 12 15 6"></polyline>,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
export const ChevronRightIcon = createIcon({
|
|
19
|
-
displayName: 'ChevronRightIcon',
|
|
20
|
-
path: <polyline points="9 18 15 12 9 6"></polyline>,
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export const HamburgerIcon = createIcon({
|
|
24
|
-
displayName: 'ChevronDownIcon',
|
|
25
|
-
path: (
|
|
26
|
-
<g fill="none">
|
|
27
|
-
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
28
|
-
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
29
|
-
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
30
|
-
</g>
|
|
31
|
-
),
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
export const CloseIcon = createIcon({
|
|
35
|
-
displayName: 'CloseIcon',
|
|
36
|
-
path: (
|
|
37
|
-
<g>
|
|
38
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
39
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
40
|
-
</g>
|
|
41
|
-
),
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
export const FilterIcon = createIcon({
|
|
45
|
-
displayName: 'FilterIcon',
|
|
46
|
-
path: (
|
|
47
|
-
<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon>
|
|
48
|
-
),
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
export const CalendarIcon = createIcon({
|
|
52
|
-
displayName: 'CalendarIcon',
|
|
53
|
-
path: (
|
|
54
|
-
<g>
|
|
55
|
-
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
56
|
-
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
57
|
-
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
58
|
-
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
59
|
-
</g>
|
|
60
|
-
),
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
export const PlusIcon = createIcon({
|
|
64
|
-
displayName: 'PlusIcon',
|
|
65
|
-
path: (
|
|
66
|
-
<g>
|
|
67
|
-
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
68
|
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
69
|
-
</g>
|
|
70
|
-
),
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
export const MinusIcon = createIcon({
|
|
74
|
-
displayName: 'MinusIcon',
|
|
75
|
-
path: (
|
|
76
|
-
<g>
|
|
77
|
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
78
|
-
</g>
|
|
79
|
-
),
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
export const ViewOffIcon = createIcon({
|
|
83
|
-
displayName: 'ViewOffIcon',
|
|
84
|
-
path: (
|
|
85
|
-
<g>
|
|
86
|
-
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
|
|
87
|
-
<line x1="1" y1="1" x2="23" y2="23"></line>
|
|
88
|
-
</g>
|
|
89
|
-
),
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
export const ViewIcon = createIcon({
|
|
93
|
-
displayName: 'ViewOffIcon',
|
|
94
|
-
path: (
|
|
95
|
-
<g>
|
|
96
|
-
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
97
|
-
<circle cx="12" cy="12" r="3"></circle>
|
|
98
|
-
</g>
|
|
99
|
-
),
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
export const SearchIcon = createIcon({
|
|
103
|
-
displayName: 'SearchIcon',
|
|
104
|
-
path: (
|
|
105
|
-
<g>
|
|
106
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
107
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
108
|
-
</g>
|
|
109
|
-
),
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
export const CheckIcon = createIcon({
|
|
113
|
-
displayName: 'CheckIcon',
|
|
114
|
-
path: (
|
|
115
|
-
<g>
|
|
116
|
-
<polyline points="20 6 9 17 4 12"></polyline>
|
|
117
|
-
</g>
|
|
118
|
-
),
|
|
119
|
-
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './icons.tsx'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './input-group'
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { cloneElement, forwardRef, isValidElement } from 'react'
|
|
2
|
-
|
|
3
|
-
import type { BoxProps, InputElementProps } from '@chakra-ui/react'
|
|
4
|
-
import { Group, InputElement } from '@chakra-ui/react'
|
|
5
|
-
|
|
6
|
-
export interface InputGroupProps extends BoxProps {
|
|
7
|
-
startElementProps?: InputElementProps
|
|
8
|
-
endElementProps?: InputElementProps
|
|
9
|
-
startElement?: React.ReactNode
|
|
10
|
-
endElement?: React.ReactNode
|
|
11
|
-
children: React.ReactNode
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(
|
|
15
|
-
function InputGroup(props, ref) {
|
|
16
|
-
const {
|
|
17
|
-
startElement,
|
|
18
|
-
startElementProps,
|
|
19
|
-
endElement,
|
|
20
|
-
endElementProps,
|
|
21
|
-
children,
|
|
22
|
-
...rest
|
|
23
|
-
} = props
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Group ref={ref} display="flex" {...rest}>
|
|
27
|
-
{startElement && (
|
|
28
|
-
<InputElement pointerEvents="none" {...startElementProps}>
|
|
29
|
-
{startElement}
|
|
30
|
-
</InputElement>
|
|
31
|
-
)}
|
|
32
|
-
{isValidElement(children) &&
|
|
33
|
-
cloneElement(children, {
|
|
34
|
-
...(startElement && { ps: 'calc(var(--input-height) - 6px)' }),
|
|
35
|
-
...(endElement && { pe: 'calc(var(--input-height) - 6px)' }),
|
|
36
|
-
...children.props,
|
|
37
|
-
})}
|
|
38
|
-
{endElement && (
|
|
39
|
-
<InputElement placement="end" {...endElementProps}>
|
|
40
|
-
{endElement}
|
|
41
|
-
</InputElement>
|
|
42
|
-
)}
|
|
43
|
-
</Group>
|
|
44
|
-
)
|
|
45
|
-
},
|
|
46
|
-
)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
import { Link } from './'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Link',
|
|
7
|
-
component: Link,
|
|
8
|
-
} as Meta
|
|
9
|
-
|
|
10
|
-
type Story = StoryObj<typeof Link>
|
|
11
|
-
|
|
12
|
-
export const Default: Story = {
|
|
13
|
-
args: {
|
|
14
|
-
href: '#',
|
|
15
|
-
children: 'Link',
|
|
16
|
-
},
|
|
17
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
import { render } from '@saas-ui/test-utils'
|
|
4
|
-
|
|
5
|
-
import { SaasProvider } from '../provider'
|
|
6
|
-
|
|
7
|
-
import { Link } from './link'
|
|
8
|
-
|
|
9
|
-
interface LinkComponentProps {
|
|
10
|
-
href: string
|
|
11
|
-
children: React.ReactNode
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const LinkComponent: React.FC<LinkComponentProps> = (props) => {
|
|
15
|
-
const { children, href, ...rest } = props
|
|
16
|
-
return (
|
|
17
|
-
<a href={href} {...rest} className="saas-ui-link">
|
|
18
|
-
{children}
|
|
19
|
-
</a>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const renderLink = (ui: React.ReactNode) => {
|
|
24
|
-
return render(<SaasProvider linkComponent={LinkComponent}>{ui}</SaasProvider>)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
test('should render the link', async () => {
|
|
28
|
-
const { getByText } = renderLink(<Link>Test</Link>)
|
|
29
|
-
|
|
30
|
-
const link = getByText('Test')
|
|
31
|
-
|
|
32
|
-
expect(link).toHaveClass('saas-ui-link')
|
|
33
|
-
})
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { Link as ChakraLink, LinkProps } from '@chakra-ui/react'
|
|
4
|
-
|
|
5
|
-
import { useLink } from '../../provider'
|
|
6
|
-
|
|
7
|
-
export type { LinkProps }
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Chakra UI `Link` component wrapped in a router specific link component.
|
|
11
|
-
* Falls back to a plain `Link` if no Saas UI context is available or no `linkComponent` is configured
|
|
12
|
-
* The router link component can be configured in `SaasProvider`.
|
|
13
|
-
* @see https://saas-ui.dev/docs/core/getting-started
|
|
14
|
-
*/
|
|
15
|
-
export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
|
|
16
|
-
(props, ref) => {
|
|
17
|
-
const LinkComponent = useLink()
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<ChakraLink asChild>
|
|
21
|
-
<LinkComponent ref={ref} {...props} />
|
|
22
|
-
</ChakraLink>
|
|
23
|
-
)
|
|
24
|
-
},
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
Link.displayName = 'Link'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as LoadingOverlay from './namespace.ts'
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { defineSlotRecipe } from '@chakra-ui/react'
|
|
2
|
-
|
|
3
|
-
export const loadingOverlaySlotRecipe = defineSlotRecipe({
|
|
4
|
-
className: 'sui-loading-overlay',
|
|
5
|
-
slots: ['root', 'text'],
|
|
6
|
-
base: {
|
|
7
|
-
root: {
|
|
8
|
-
display: 'flex',
|
|
9
|
-
flexDirection: 'column',
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
p: 4,
|
|
13
|
-
transitionProperty: 'opacity',
|
|
14
|
-
transitionDuration: 'slower',
|
|
15
|
-
_open: {
|
|
16
|
-
opacity: 1,
|
|
17
|
-
},
|
|
18
|
-
_closed: {
|
|
19
|
-
opacity: 0,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
variants: {
|
|
24
|
-
variant: {
|
|
25
|
-
fill: {
|
|
26
|
-
root: {
|
|
27
|
-
flex: 1,
|
|
28
|
-
height: '100%',
|
|
29
|
-
bg: {
|
|
30
|
-
base: 'whiteAlpha.400',
|
|
31
|
-
_dark: 'blackAlpha.400',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
fullscreen: {
|
|
36
|
-
root: {
|
|
37
|
-
position: 'fixed',
|
|
38
|
-
inset: 0,
|
|
39
|
-
zIndex: 'modal',
|
|
40
|
-
bg: {
|
|
41
|
-
base: 'white',
|
|
42
|
-
_dark: 'gray.800',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
overlay: {
|
|
47
|
-
root: {
|
|
48
|
-
position: 'absolute',
|
|
49
|
-
inset: 0,
|
|
50
|
-
bg: {
|
|
51
|
-
base: 'whiteAlpha.300',
|
|
52
|
-
_dark: 'blackAlpha.300',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
defaultVariants: {
|
|
59
|
-
variant: 'fill',
|
|
60
|
-
},
|
|
61
|
-
})
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
import { Button, Card, Container, Text } from '@chakra-ui/react'
|
|
4
|
-
|
|
5
|
-
import { LoadingOverlay } from './index.ts'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/LoadingOverlay',
|
|
9
|
-
decorators: [
|
|
10
|
-
(Story: any) => (
|
|
11
|
-
<Container mt="40px">
|
|
12
|
-
<Story />
|
|
13
|
-
</Container>
|
|
14
|
-
),
|
|
15
|
-
],
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Basic = () => (
|
|
19
|
-
<Card.Root width="400px" height="200px" overflow="hidden">
|
|
20
|
-
<LoadingOverlay.Root>
|
|
21
|
-
<LoadingOverlay.Spinner />
|
|
22
|
-
</LoadingOverlay.Root>
|
|
23
|
-
</Card.Root>
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
export const Overlay = () => (
|
|
27
|
-
<Card.Root width="400px" height="200px" pos="relative" p="4">
|
|
28
|
-
<Text>This content will be overlayed.</Text>
|
|
29
|
-
<LoadingOverlay.Root variant="overlay">
|
|
30
|
-
<LoadingOverlay.Spinner />
|
|
31
|
-
</LoadingOverlay.Root>
|
|
32
|
-
</Card.Root>
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
export const Fullscreen = () => (
|
|
36
|
-
<LoadingOverlay.Root variant="fullscreen">
|
|
37
|
-
<LoadingOverlay.Spinner />
|
|
38
|
-
</LoadingOverlay.Root>
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
export const WithText = () => (
|
|
42
|
-
<Card.Root width="400px" height="200px">
|
|
43
|
-
<LoadingOverlay.Root borderRadius="md">
|
|
44
|
-
<LoadingOverlay.Text>Loading...</LoadingOverlay.Text>
|
|
45
|
-
</LoadingOverlay.Root>
|
|
46
|
-
</Card.Root>
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
export const ExitAnimation = () => {
|
|
50
|
-
const [loading, setLoading] = React.useState(false)
|
|
51
|
-
|
|
52
|
-
React.useEffect(() => {
|
|
53
|
-
if (loading) {
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
setLoading(false)
|
|
56
|
-
}, 4000)
|
|
57
|
-
}
|
|
58
|
-
}, [loading])
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Card.Root width="400px" height="200px" pos="relative" p="4">
|
|
62
|
-
<Button onClick={() => setLoading(true)}>Show loader</Button>
|
|
63
|
-
<LoadingOverlay.Root variant="overlay" loading={loading}>
|
|
64
|
-
<LoadingOverlay.Spinner />
|
|
65
|
-
</LoadingOverlay.Root>
|
|
66
|
-
</Card.Root>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Presence,
|
|
5
|
-
type PresenceBaseProps,
|
|
6
|
-
splitPresenceProps,
|
|
7
|
-
} from '@ark-ui/react/presence'
|
|
8
|
-
import {
|
|
9
|
-
HTMLChakraProps,
|
|
10
|
-
SlotRecipeProps,
|
|
11
|
-
chakra,
|
|
12
|
-
createSlotRecipeContext,
|
|
13
|
-
} from '@chakra-ui/react'
|
|
14
|
-
|
|
15
|
-
import { Spinner } from '#components/spinner'
|
|
16
|
-
|
|
17
|
-
const { useStyles, withContext, withProvider } = createSlotRecipeContext({
|
|
18
|
-
key: 'loadingOverlay',
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
export const useLoadingOverlayStyles = useStyles
|
|
22
|
-
|
|
23
|
-
export interface LoadingOverlayProps
|
|
24
|
-
extends HTMLChakraProps<'div'>,
|
|
25
|
-
SlotRecipeProps<'loadingOverlay'>,
|
|
26
|
-
PresenceBaseProps {
|
|
27
|
-
/**
|
|
28
|
-
* Show or hide the LoadingOverlay.
|
|
29
|
-
* @default true
|
|
30
|
-
*/
|
|
31
|
-
loading?: boolean
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const LoadingOverlay: React.FC<LoadingOverlayProps> = (props) => {
|
|
35
|
-
const { children, loading = true, ...rest } = props
|
|
36
|
-
|
|
37
|
-
const [presenceProps, rootProps] = splitPresenceProps(rest)
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Presence present={loading} {...presenceProps} asChild>
|
|
41
|
-
<chakra.div {...rootProps}>{children}</chakra.div>
|
|
42
|
-
</Presence>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const LoadingOverlayRoot = withProvider(LoadingOverlay, 'root')
|
|
47
|
-
|
|
48
|
-
LoadingOverlayRoot.displayName = 'LoadingOverlay'
|
|
49
|
-
|
|
50
|
-
export const LoadingOverlaySpinner = Spinner
|
|
51
|
-
|
|
52
|
-
export interface LoadingTextProps extends HTMLChakraProps<'p'> {}
|
|
53
|
-
|
|
54
|
-
export const LoadingOverlayText = withContext('p', 'text')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as Navbar from './namespace'
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { defineSlotRecipe } from '@chakra-ui/react'
|
|
2
|
-
|
|
3
|
-
export const navbarSlotRecipe = defineSlotRecipe({
|
|
4
|
-
className: 'sui-navbar',
|
|
5
|
-
slots: ['root', 'content', 'brand', 'item'],
|
|
6
|
-
base: {
|
|
7
|
-
root: {
|
|
8
|
-
display: 'flex',
|
|
9
|
-
zIndex: 'layer-3',
|
|
10
|
-
width: 'full',
|
|
11
|
-
height: 'auto',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
justifyContent: 'center',
|
|
14
|
-
top: 0,
|
|
15
|
-
insetX: 0,
|
|
16
|
-
transitionProperty: 'common',
|
|
17
|
-
transitionDuration: 'normal',
|
|
18
|
-
transitionTimingFunction: 'ease-in-out',
|
|
19
|
-
_hidden: {
|
|
20
|
-
transform: 'translateY(-100%)',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
content: {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
justifyContent: 'space-between',
|
|
27
|
-
width: 'full',
|
|
28
|
-
height: 'var(--navbar-height)',
|
|
29
|
-
flexWrap: 'nowrap',
|
|
30
|
-
},
|
|
31
|
-
brand: {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
justifyContent: 'flex-start',
|
|
35
|
-
height: 'full',
|
|
36
|
-
bg: 'transparent',
|
|
37
|
-
textDecoration: 'none',
|
|
38
|
-
color: 'inherit',
|
|
39
|
-
whiteSpace: 'nowrap',
|
|
40
|
-
boxSizing: 'border-box',
|
|
41
|
-
},
|
|
42
|
-
item: {
|
|
43
|
-
bg: 'transparent',
|
|
44
|
-
color: 'currentColor',
|
|
45
|
-
display: 'inline-flex',
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
justifyContent: 'center',
|
|
48
|
-
textDecoration: 'none',
|
|
49
|
-
whiteSpace: 'nowrap',
|
|
50
|
-
boxSizing: 'border-box',
|
|
51
|
-
borderRadius: 'md',
|
|
52
|
-
transitionProperty: 'common',
|
|
53
|
-
transitionDuration: 'normal',
|
|
54
|
-
lineHeight: 1,
|
|
55
|
-
_focusVisible: {
|
|
56
|
-
outline: 'none',
|
|
57
|
-
boxShadow: 'outline',
|
|
58
|
-
},
|
|
59
|
-
_hover: {
|
|
60
|
-
bg: 'blackAlpha.100',
|
|
61
|
-
textDecoration: 'none',
|
|
62
|
-
_dark: {
|
|
63
|
-
bg: 'whiteAlpha.200',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
_active: {
|
|
67
|
-
fontWeight: 'semibold',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
variants: {
|
|
72
|
-
variant: {
|
|
73
|
-
neutral: {
|
|
74
|
-
root: {
|
|
75
|
-
bg: 'bg.panel',
|
|
76
|
-
color: 'fg',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
solid: {
|
|
80
|
-
root: {
|
|
81
|
-
bg: 'colorPalette.500',
|
|
82
|
-
color: 'colorPalette.contrast',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
size: {
|
|
87
|
-
md: {
|
|
88
|
-
root: {
|
|
89
|
-
fontSize: 'sm',
|
|
90
|
-
},
|
|
91
|
-
content: {
|
|
92
|
-
px: {
|
|
93
|
-
base: 4,
|
|
94
|
-
lg: 6,
|
|
95
|
-
},
|
|
96
|
-
gap: 4,
|
|
97
|
-
},
|
|
98
|
-
item: {
|
|
99
|
-
px: 3,
|
|
100
|
-
h: 8,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
defaultVariants: {
|
|
106
|
-
variant: 'neutral',
|
|
107
|
-
size: 'md',
|
|
108
|
-
},
|
|
109
|
-
})
|