@saas-ui/react 3.0.0-next.33 → 3.0.0-next.35

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.
@@ -68,6 +68,12 @@ const SidebarFooter = withContext(Sidebar.Footer, 'footer');
68
68
  const SidebarTrack = withContext(Sidebar.Track, 'track', {
69
69
  forwardAsChild: true,
70
70
  });
71
+ /**
72
+ * Sidebar inset.
73
+ *
74
+ * @see Docs https://saas-ui.dev/docs/components/layout/sidebar
75
+ */
76
+ const SidebarInset = withContext('div', 'inset');
71
77
  const SidebarGroup = withContext(Sidebar.Group, 'group', {
72
78
  defaultProps: {
73
79
  role: 'group',
@@ -87,4 +93,4 @@ const SidebarNavButtonEndElement = withItemContext(Sidebar.NavItemEndElement, 'e
87
93
  },
88
94
  });
89
95
  const SidebarContext = Sidebar.Context;
90
- export { SidebarProvider as Provider, SidebarContext as Context, SidebarRoot as Root, SidebarTrigger as Trigger, SidebarFlyoutTrigger as FlyoutTrigger, SidebarBackdrop as Backdrop, SidebarHeader as Header, SidebarBody as Body, SidebarFooter as Footer, SidebarTrack as Track, SidebarGroup as Group, SidebarGroupHeader as GroupHeader, SidebarGroupTitle as GroupTitle, SidebarGroupEndElement as GroupEndElement, SidebarGroupContent as GroupContent, SidebarNavItem as NavItem, SidebarNavButton as NavButton, SidebarNavButtonEndElement as NavButtonEndElement, };
96
+ export { SidebarProvider as Provider, SidebarContext as Context, SidebarRoot as Root, SidebarTrigger as Trigger, SidebarFlyoutTrigger as FlyoutTrigger, SidebarBackdrop as Backdrop, SidebarHeader as Header, SidebarBody as Body, SidebarFooter as Footer, SidebarTrack as Track, SidebarInset as Inset, SidebarGroup as Group, SidebarGroupHeader as GroupHeader, SidebarGroupTitle as GroupTitle, SidebarGroupEndElement as GroupEndElement, SidebarGroupContent as GroupContent, SidebarNavItem as NavItem, SidebarNavButton as NavButton, SidebarNavButtonEndElement as NavButtonEndElement, };
@@ -1,4 +1,23 @@
1
- export declare const sidebarSlotRecipe: import("@chakra-ui/react").SlotRecipeDefinition<"body" | "backdrop" | "root" | "header" | "footer" | "group" | "trigger" | "track" | "flyoutTrigger" | "groupHeader" | "groupTitle" | "groupEndElement" | "groupContent", {
1
+ export declare const sidebarSlotRecipe: import("@chakra-ui/react").SlotRecipeDefinition<"inset" | "body" | "backdrop" | "root" | "header" | "footer" | "group" | "trigger" | "track" | "flyoutTrigger" | "groupHeader" | "groupTitle" | "groupEndElement" | "groupContent", {
2
+ variant: {
3
+ sidebar: {
4
+ root: {
5
+ borderRightWidth: "1px";
6
+ borderLeftColor: "sidebar.border";
7
+ };
8
+ inset: {};
9
+ };
10
+ inset: {
11
+ inset: {
12
+ borderColor: "sidebar.border";
13
+ borderWidth: "1px";
14
+ borderRadius: "panel.md";
15
+ marginBlock: "var(--inset-gap, {spacing.2})";
16
+ marginEnd: "var(--inset-gap, {spacing.2})";
17
+ overflow: "clip";
18
+ };
19
+ };
20
+ };
2
21
  mode: {
3
22
  collapsible: {
4
23
  root: {
@@ -15,6 +15,7 @@ export const sidebarSlotRecipe = defineSlotRecipe({
15
15
  'groupEndElement',
16
16
  'groupContent',
17
17
  'track',
18
+ 'inset',
18
19
  ],
19
20
  base: {
20
21
  root: {
@@ -139,8 +140,34 @@ export const sidebarSlotRecipe = defineSlotRecipe({
139
140
  flyoutTrigger: {
140
141
  display: 'none',
141
142
  },
143
+ inset: {
144
+ height: '100%',
145
+ minHeight: '0',
146
+ display: 'flex',
147
+ flexDirection: 'column',
148
+ bg: 'bg.content',
149
+ },
142
150
  },
143
151
  variants: {
152
+ variant: {
153
+ sidebar: {
154
+ root: {
155
+ borderRightWidth: '1px',
156
+ borderLeftColor: 'sidebar.border',
157
+ },
158
+ inset: {},
159
+ },
160
+ inset: {
161
+ inset: {
162
+ borderColor: 'sidebar.border',
163
+ borderWidth: '1px',
164
+ borderRadius: 'panel.md',
165
+ marginBlock: 'var(--inset-gap, {spacing.2})',
166
+ marginEnd: 'var(--inset-gap, {spacing.2})',
167
+ overflow: 'clip',
168
+ },
169
+ },
170
+ },
144
171
  mode: {
145
172
  collapsible: {
146
173
  root: {
@@ -229,7 +256,24 @@ export const sidebarSlotRecipe = defineSlotRecipe({
229
256
  },
230
257
  },
231
258
  },
259
+ compoundVariants: [
260
+ {
261
+ variant: 'inset',
262
+ mode: 'collapsible',
263
+ css: {
264
+ root: {
265
+ py: 'var(--inset-gap, {spacing.2})',
266
+ _closed: {
267
+ '& [class*="__inset"]': {
268
+ ps: 'var(--inset-gap, {spacing.2})',
269
+ },
270
+ },
271
+ },
272
+ },
273
+ },
274
+ ],
232
275
  defaultVariants: {
276
+ variant: 'sidebar',
233
277
  mode: 'collapsible',
234
278
  size: 'md',
235
279
  },
@@ -33,15 +33,14 @@ export const globalCss = defineGlobalStyles({
33
33
  '--global-font-body': 'fonts.body',
34
34
  '--global-color-border': 'colors.border',
35
35
  '--cursor-button': 'default',
36
- // '--radius-factor': '1',
37
- // '--radius-control': '1',
38
- // '--radius-panel': '1',
39
- // '--radius-indicator': '1',
40
36
  '--radius-full': '9999px',
41
37
  '--scale-factor': '1',
42
38
  '--overlay-translucency': '95%',
43
39
  '--overlay-effect': 'blur({blurs.lg})',
44
40
  '--backdrop-effect': 'none',
41
+ '--scrollbar-color': 'colors.border.emphasized',
42
+ scrollbarWidth: 'thin',
43
+ scrollbarColor: 'var(--scrollbar-color) transparent',
45
44
  },
46
45
  '.dark *': {
47
46
  '--overlay-translucency': '85%',
@@ -122,6 +122,12 @@ export declare const semanticColors: {
122
122
  _dark: string;
123
123
  };
124
124
  };
125
+ content: {
126
+ value: {
127
+ _light: string;
128
+ _dark: string;
129
+ };
130
+ };
125
131
  panel: {
126
132
  value: {
127
133
  _light: string;
@@ -33,10 +33,10 @@ export const semanticColors = defineSemanticTokens.colors({
33
33
  },
34
34
  sidebar: {
35
35
  bg: {
36
- value: { _light: '{colors.gray.100}', _dark: '{colors.gray.900}' },
36
+ value: { _light: '{colors.gray.100}', _dark: '{colors.black}' },
37
37
  },
38
38
  fg: {
39
- value: { _light: '{colors.gray.900}', _dark: '{colors.gray.200}' },
39
+ value: { _light: '{colors.gray.900}', _dark: '{colors.gray.100}' },
40
40
  },
41
41
  border: {
42
42
  value: { _light: '{colors.gray.200}', _dark: '{colors.gray.800}' },
@@ -66,13 +66,16 @@ export const semanticColors = defineSemanticTokens.colors({
66
66
  inverted: {
67
67
  value: { _light: '{colors.black}', _dark: '{colors.white}' },
68
68
  },
69
+ content: {
70
+ value: { _light: '{colors.gray.50}', _dark: '{colors.gray.950}' },
71
+ },
69
72
  panel: {
70
- value: { _light: '{colors.white}', _dark: '{colors.gray.950}' },
73
+ value: { _light: '{colors.white}', _dark: '{colors.gray.900}' },
71
74
  },
72
75
  overlay: {
73
76
  value: {
74
77
  _light: 'color-mix(in oklch, {colors.white} var(--overlay-translucency), transparent)',
75
- _dark: 'color-mix(in oklch, {colors.gray.800} var(--overlay-translucency), transparent)',
78
+ _dark: 'color-mix(in oklch, {colors.gray.900} var(--overlay-translucency), transparent)',
76
79
  },
77
80
  },
78
81
  backdrop: {
@@ -3,37 +3,37 @@ export const semanticShadows = defineSemanticTokens.shadows({
3
3
  xs: {
4
4
  value: {
5
5
  _light: '0px 1px 2px {colors.gray.900/5}, 0px 0px 1px {colors.gray.900/5}',
6
- _dark: '0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}',
6
+ _dark: '0px 1px 1px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
7
7
  },
8
8
  },
9
9
  sm: {
10
10
  value: {
11
11
  _light: '0px 2px 4px {colors.gray.900/5}, 0px 0px 2px {colors.gray.900/5}',
12
- _dark: '0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}',
12
+ _dark: '0px 2px 4px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
13
13
  },
14
14
  },
15
15
  md: {
16
16
  value: {
17
17
  _light: '0px 4px 8px {colors.gray.900/5}, 0px 0px 3px {colors.gray.900/5}',
18
- _dark: '0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}',
18
+ _dark: '0px 4px 8px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
19
19
  },
20
20
  },
21
21
  lg: {
22
22
  value: {
23
23
  _light: '0px 8px 16px {colors.gray.900/5}, 0px 0px 4px {colors.gray.900/5}',
24
- _dark: '0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}',
24
+ _dark: '0px 8px 16px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
25
25
  },
26
26
  },
27
27
  xl: {
28
28
  value: {
29
29
  _light: '0px 16px 24px {colors.gray.900/5}, 0px 0px 5px {colors.gray.900/5}',
30
- _dark: '0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}',
30
+ _dark: '0px 16px 24px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
31
31
  },
32
32
  },
33
33
  '2xl': {
34
34
  value: {
35
35
  _light: '0px 24px 40px {colors.gray.900/10}, 0px 0px 6px {colors.gray.900/5}',
36
- _dark: '0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}',
36
+ _dark: '0px 24px 40px {black/30}, 0px 0px 1px inset {colors.gray.300/5}',
37
37
  },
38
38
  },
39
39
  inner: {
@@ -45,7 +45,7 @@ export const semanticShadows = defineSemanticTokens.shadows({
45
45
  inset: {
46
46
  value: {
47
47
  _light: 'inset 0 1px 2px 0 {black/5}',
48
- _dark: 'inset 0 -1px 2px 0 {colors.gray.300/8}, inset 0 0 0 1px {colors.gray.300/8}',
48
+ _dark: 'inset 0 -1px 2px 0 {colors.gray.300/4}, inset 0 0 0 1px {colors.gray.300/4}',
49
49
  },
50
50
  },
51
51
  });