@kalink-ui/seedly 0.25.0 → 0.26.0

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 (48) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/package.json +3 -3
  3. package/src/components/box/box.css.ts +21 -8
  4. package/src/components/box/box.responsive.ts +9 -0
  5. package/src/components/box/box.tsx +9 -3
  6. package/src/components/button/button.css.ts +199 -177
  7. package/src/components/button/button.responsive.ts +11 -0
  8. package/src/components/button/button.tsx +31 -10
  9. package/src/components/card/card.tsx +3 -1
  10. package/src/components/center/center.css.ts +23 -10
  11. package/src/components/center/center.responsive.ts +9 -0
  12. package/src/components/center/center.tsx +12 -3
  13. package/src/components/cluster/cluster.css.ts +116 -89
  14. package/src/components/cluster/cluster.responsive.ts +9 -0
  15. package/src/components/cluster/cluster.tsx +14 -3
  16. package/src/components/command/command-list.css.ts +24 -10
  17. package/src/components/command/command-list.responsive.ts +9 -0
  18. package/src/components/command/command-list.tsx +2 -2
  19. package/src/components/command/command.tsx +2 -2
  20. package/src/components/cover/cover.css.ts +23 -10
  21. package/src/components/cover/cover.responsive.ts +9 -0
  22. package/src/components/cover/cover.tsx +7 -3
  23. package/src/components/grid/grid.css.ts +21 -8
  24. package/src/components/grid/grid.responsive.ts +9 -0
  25. package/src/components/grid/grid.tsx +7 -3
  26. package/src/components/heading/heading.css.ts +75 -49
  27. package/src/components/heading/heading.responsive.ts +28 -0
  28. package/src/components/heading/heading.tsx +18 -9
  29. package/src/components/loader/loader.css.ts +31 -18
  30. package/src/components/loader/moon-loader.responsive.ts +9 -0
  31. package/src/components/loader/moon-loader.tsx +12 -3
  32. package/src/components/menu/menu-separator.css.ts +26 -10
  33. package/src/components/menu/menu-separator.responsive.ts +9 -0
  34. package/src/components/sidebar/sidebar.css.ts +21 -8
  35. package/src/components/sidebar/sidebar.responsive.ts +9 -0
  36. package/src/components/sidebar/sidebar.tsx +6 -3
  37. package/src/components/stack/stack.css.ts +61 -39
  38. package/src/components/stack/stack.responsive.ts +9 -0
  39. package/src/components/stack/stack.tsx +10 -3
  40. package/src/components/switcher/switcher.css.ts +21 -8
  41. package/src/components/switcher/switcher.responsive.ts +9 -0
  42. package/src/components/switcher/switcher.tsx +7 -3
  43. package/src/components/text/text.css.ts +78 -39
  44. package/src/components/text/text.responsive.ts +62 -0
  45. package/src/components/text/text.tsx +35 -8
  46. package/src/styles/breakpoints.ts +25 -0
  47. package/src/styles/index.ts +12 -0
  48. package/src/styles/responsive.ts +180 -0
@@ -0,0 +1,9 @@
1
+ import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
2
+
3
+ import { centerRecipe, guttersAt } from './center.css';
4
+
5
+ export const centerResponsive = responsiveRecipe({
6
+ recipe: centerRecipe,
7
+ at: { gutters: guttersAt },
8
+ order: defaultOrder,
9
+ });
@@ -2,10 +2,16 @@ import { PolymorphicComponentProps } from '@kalink-ui/dibbly';
2
2
  import { clsx } from 'clsx';
3
3
  import { ElementType } from 'react';
4
4
 
5
- import { centerRecipe, CenterVariants } from './center.css';
5
+ import { CenterVariants } from './center.css';
6
+ import { centerResponsive } from './center.responsive';
7
+
8
+ import type { Responsive } from '../../styles/responsive';
6
9
 
7
10
  export type CenterProps<TUse extends ElementType> =
8
- PolymorphicComponentProps<TUse> & CenterVariants;
11
+ PolymorphicComponentProps<TUse> &
12
+ Omit<CenterVariants, 'gutters'> & {
13
+ gutters?: Responsive<NonNullable<CenterVariants['gutters']>>;
14
+ };
9
15
 
10
16
  /**
11
17
  * A custom element for centering a block-level element horizontally,
@@ -24,7 +30,10 @@ export function Center<TUse extends ElementType>({
24
30
 
25
31
  return (
26
32
  <Comp
27
- className={clsx(centerRecipe({ andText, gutters, intrinsic }), className)}
33
+ className={clsx(
34
+ centerResponsive({ andText, gutters, intrinsic }),
35
+ className,
36
+ )}
28
37
  {...rest}
29
38
  />
30
39
  );
@@ -1,8 +1,105 @@
1
1
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
2
2
 
3
- import { mapContractVars, sys } from '../../styles';
3
+ import {
4
+ createResponsiveVariants,
5
+ defaultMedia,
6
+ mapContractVars,
7
+ sys,
8
+ } from '../../styles';
4
9
  import { components } from '../../styles/layers.css';
5
10
 
11
+ // Shared variant style maps so we can reuse them for responsive overrides
12
+ export const clusterSpacingStyles = mapContractVars(sys.spacing, (key) => ({
13
+ '@layer': {
14
+ [components]: {
15
+ gap: sys.spacing[key],
16
+ },
17
+ },
18
+ }));
19
+
20
+ export const clusterJustifyStyles = {
21
+ start: {
22
+ '@layer': {
23
+ [components]: {
24
+ justifyContent: 'flex-start',
25
+ },
26
+ },
27
+ },
28
+ end: {
29
+ '@layer': {
30
+ [components]: {
31
+ justifyContent: 'flex-end',
32
+ },
33
+ },
34
+ },
35
+ center: {
36
+ '@layer': {
37
+ [components]: {
38
+ justifyContent: 'center',
39
+ },
40
+ },
41
+ },
42
+ spaceBetween: {
43
+ '@layer': {
44
+ [components]: {
45
+ justifyContent: 'space-between',
46
+ },
47
+ },
48
+ },
49
+ spaceAround: {
50
+ '@layer': {
51
+ [components]: {
52
+ justifyContent: 'space-around',
53
+ },
54
+ },
55
+ },
56
+ spaceEvenly: {
57
+ '@layer': {
58
+ [components]: {
59
+ justifyContent: 'space-evenly',
60
+ },
61
+ },
62
+ },
63
+ } as const;
64
+
65
+ export const clusterAlignStyles = {
66
+ start: {
67
+ '@layer': {
68
+ [components]: {
69
+ alignItems: 'flex-start',
70
+ },
71
+ },
72
+ },
73
+ end: {
74
+ '@layer': {
75
+ [components]: {
76
+ alignItems: 'flex-end',
77
+ },
78
+ },
79
+ },
80
+ center: {
81
+ '@layer': {
82
+ [components]: {
83
+ alignItems: 'center',
84
+ },
85
+ },
86
+ },
87
+ stretch: {
88
+ '@layer': {
89
+ [components]: {
90
+ alignItems: 'stretch',
91
+ },
92
+ },
93
+ },
94
+ baseline: {
95
+ '@layer': {
96
+ [components]: {
97
+ alignItems: 'baseline',
98
+ },
99
+ },
100
+ },
101
+ } as const;
102
+
6
103
  export const clusterRecipe = recipe({
7
104
  base: {
8
105
  '@layer': {
@@ -19,102 +116,17 @@ export const clusterRecipe = recipe({
19
116
  /**
20
117
  * The spacing between items
21
118
  */
22
- spacing: mapContractVars(sys.spacing, (key) => ({
23
- '@layer': {
24
- [components]: {
25
- gap: sys.spacing[key],
26
- },
27
- },
28
- })),
119
+ spacing: clusterSpacingStyles,
29
120
 
30
121
  /**
31
122
  * The alignment of items along the main axis
32
123
  */
33
- justify: {
34
- start: {
35
- '@layer': {
36
- [components]: {
37
- justifyContent: 'flex-start',
38
- },
39
- },
40
- },
41
- end: {
42
- '@layer': {
43
- [components]: {
44
- justifyContent: 'flex-end',
45
- },
46
- },
47
- },
48
- center: {
49
- '@layer': {
50
- [components]: {
51
- justifyContent: 'center',
52
- },
53
- },
54
- },
55
- spaceBetween: {
56
- '@layer': {
57
- [components]: {
58
- justifyContent: 'space-between',
59
- },
60
- },
61
- },
62
- spaceAround: {
63
- '@layer': {
64
- [components]: {
65
- justifyContent: 'space-around',
66
- },
67
- },
68
- },
69
- spaceEvenly: {
70
- '@layer': {
71
- [components]: {
72
- justifyContent: 'space-evenly',
73
- },
74
- },
75
- },
76
- },
124
+ justify: clusterJustifyStyles,
77
125
 
78
126
  /**
79
127
  * The alignment of items along the cross axis
80
128
  */
81
- align: {
82
- start: {
83
- '@layer': {
84
- [components]: {
85
- alignItems: 'flex-start',
86
- },
87
- },
88
- },
89
- end: {
90
- '@layer': {
91
- [components]: {
92
- alignItems: 'flex-end',
93
- },
94
- },
95
- },
96
- center: {
97
- '@layer': {
98
- [components]: {
99
- alignItems: 'center',
100
- },
101
- },
102
- },
103
- stretch: {
104
- '@layer': {
105
- [components]: {
106
- alignItems: 'stretch',
107
- },
108
- },
109
- },
110
- baseline: {
111
- '@layer': {
112
- [components]: {
113
- alignItems: 'baseline',
114
- },
115
- },
116
- },
117
- },
129
+ align: clusterAlignStyles,
118
130
 
119
131
  direction: {
120
132
  row: {
@@ -136,3 +148,18 @@ export const clusterRecipe = recipe({
136
148
  });
137
149
 
138
150
  export type ClusterVariants = NonNullable<RecipeVariants<typeof clusterRecipe>>;
151
+
152
+ export const spacingAt = createResponsiveVariants({
153
+ styles: clusterSpacingStyles,
154
+ media: defaultMedia,
155
+ });
156
+
157
+ export const justifyAt = createResponsiveVariants({
158
+ styles: clusterJustifyStyles,
159
+ media: defaultMedia,
160
+ });
161
+
162
+ export const alignAt = createResponsiveVariants({
163
+ styles: clusterAlignStyles,
164
+ media: defaultMedia,
165
+ });
@@ -0,0 +1,9 @@
1
+ import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
2
+
3
+ import { alignAt, clusterRecipe, justifyAt, spacingAt } from './cluster.css';
4
+
5
+ export const clusterResponsive = responsiveRecipe({
6
+ recipe: clusterRecipe,
7
+ at: { spacing: spacingAt, justify: justifyAt, align: alignAt },
8
+ order: defaultOrder,
9
+ });
@@ -2,10 +2,18 @@ import { PolymorphicComponentProps } from '@kalink-ui/dibbly';
2
2
  import { clsx } from 'clsx';
3
3
  import { ElementType } from 'react';
4
4
 
5
- import { clusterRecipe, ClusterVariants } from './cluster.css';
5
+ import { ClusterVariants } from './cluster.css';
6
+ import { clusterResponsive } from './cluster.responsive';
7
+
8
+ import type { Responsive } from '../../styles/responsive';
6
9
 
7
10
  export type ClusterProps<TUse extends ElementType> =
8
- PolymorphicComponentProps<TUse> & ClusterVariants;
11
+ PolymorphicComponentProps<TUse> &
12
+ Omit<ClusterVariants, 'spacing' | 'justify' | 'align'> & {
13
+ spacing?: Responsive<NonNullable<ClusterVariants['spacing']>>;
14
+ justify?: Responsive<NonNullable<ClusterVariants['justify']>>;
15
+ align?: Responsive<NonNullable<ClusterVariants['align']>>;
16
+ };
9
17
 
10
18
  /**
11
19
  * A custom element for grouping items, with control over the margin between them
@@ -23,7 +31,10 @@ export function Cluster<TUse extends ElementType>({
23
31
 
24
32
  return (
25
33
  <Comp
26
- className={clsx(clusterRecipe({ spacing, align, justify }), className)}
34
+ className={clsx(
35
+ clusterResponsive({ spacing, align, justify }),
36
+ className,
37
+ )}
27
38
  {...rest}
28
39
  />
29
40
  );
@@ -1,11 +1,28 @@
1
1
  import { createVar, globalStyle } from '@vanilla-extract/css';
2
2
  import { recipe } from '@vanilla-extract/recipes';
3
3
 
4
- import { mapContractVars, sys, transition } from '../../styles';
4
+ import {
5
+ createResponsiveVariants,
6
+ defaultMedia,
7
+ mapContractVars,
8
+ sys,
9
+ transition,
10
+ } from '../../styles';
5
11
  import { components } from '../../styles/layers.css';
6
12
 
7
13
  const spacingVar = createVar();
8
14
 
15
+ // Shared variant style maps so we can reuse them for responsive overrides
16
+ export const commandListSpacingStyles = mapContractVars(sys.spacing, (key) => ({
17
+ '@layer': {
18
+ [components]: {
19
+ vars: {
20
+ [spacingVar]: sys.spacing[key],
21
+ },
22
+ },
23
+ },
24
+ }));
25
+
9
26
  export const commandList = recipe({
10
27
  base: {
11
28
  '@layer': {
@@ -27,15 +44,7 @@ export const commandList = recipe({
27
44
  },
28
45
 
29
46
  variants: {
30
- spacing: mapContractVars(sys.spacing, (key) => ({
31
- '@layer': {
32
- [components]: {
33
- vars: {
34
- [spacingVar]: sys.spacing[key],
35
- },
36
- },
37
- },
38
- })),
47
+ spacing: commandListSpacingStyles,
39
48
  },
40
49
  });
41
50
 
@@ -48,3 +57,8 @@ globalStyle(`${commandList.classNames.base} [cmdk-list-sizer]`, {
48
57
  },
49
58
  },
50
59
  });
60
+
61
+ export const spacingAt = createResponsiveVariants({
62
+ styles: commandListSpacingStyles,
63
+ media: defaultMedia,
64
+ });
@@ -0,0 +1,9 @@
1
+ import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
2
+
3
+ import { commandList, spacingAt } from './command-list.css';
4
+
5
+ export const commandListResponsive = responsiveRecipe({
6
+ recipe: commandList,
7
+ at: { spacing: spacingAt },
8
+ order: defaultOrder,
9
+ });
@@ -6,7 +6,7 @@ import { ComponentPropsWithRef } from 'react';
6
6
 
7
7
  import { StackProps } from '../stack';
8
8
 
9
- import { commandList } from './command-list.css';
9
+ import { commandListResponsive } from './command-list.responsive';
10
10
 
11
11
  type CommandListProps = ComponentPropsWithRef<typeof CommandPrimitive.List> & {
12
12
  spacing?: StackProps<'div'>['spacing'];
@@ -19,7 +19,7 @@ export function CommandList({
19
19
  }: CommandListProps) {
20
20
  return (
21
21
  <CommandPrimitive.List
22
- className={clsx(commandList({ spacing }), className)}
22
+ className={clsx(commandListResponsive({ spacing }), className)}
23
23
  asChild
24
24
  {...props}
25
25
  />
@@ -4,10 +4,10 @@ import { clsx } from 'clsx';
4
4
  import { Command as CommandPrimitive } from 'cmdk';
5
5
  import { ComponentPropsWithRef } from 'react';
6
6
 
7
- import { Stack, StackVariants } from '../stack';
7
+ import { Stack, StackProps } from '../stack';
8
8
 
9
9
  export type CommandProps = ComponentPropsWithRef<typeof CommandPrimitive> & {
10
- spacing?: StackVariants['spacing'];
10
+ spacing?: StackProps<'div'>['spacing'];
11
11
  };
12
12
 
13
13
  export function Command({
@@ -1,12 +1,28 @@
1
1
  import { createVar, globalStyle } from '@vanilla-extract/css';
2
2
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
3
 
4
- import { sys, mapContractVars } from '../../styles';
4
+ import {
5
+ createResponsiveVariants,
6
+ defaultMedia,
7
+ sys,
8
+ mapContractVars,
9
+ } from '../../styles';
5
10
  import { components } from '../../styles/layers.css';
6
11
 
7
12
  const spaceVar = createVar();
8
13
  export const minSizeVar = createVar();
9
14
 
15
+ // Shared variant style maps so we can reuse them for responsive overrides
16
+ export const coverSpacingStyles = mapContractVars(sys.spacing, (key) => ({
17
+ '@layer': {
18
+ [components]: {
19
+ vars: {
20
+ [spaceVar]: sys.spacing[key],
21
+ },
22
+ },
23
+ },
24
+ }));
25
+
10
26
  export const coverRecipe = recipe({
11
27
  base: {
12
28
  '@layer': {
@@ -27,15 +43,7 @@ export const coverRecipe = recipe({
27
43
  /**
28
44
  * The spacing between items
29
45
  */
30
- spacing: mapContractVars(sys.spacing, (key) => ({
31
- '@layer': {
32
- [components]: {
33
- vars: {
34
- [spaceVar]: sys.spacing[key],
35
- },
36
- },
37
- },
38
- })),
46
+ spacing: coverSpacingStyles,
39
47
  },
40
48
  });
41
49
 
@@ -78,3 +86,8 @@ globalStyle(`${coverRecipe.classNames.base} > [data-cover-center]`, {
78
86
  });
79
87
 
80
88
  export type CoverVariants = NonNullable<RecipeVariants<typeof coverRecipe>>;
89
+
90
+ export const spacingAt = createResponsiveVariants({
91
+ styles: coverSpacingStyles,
92
+ media: defaultMedia,
93
+ });
@@ -0,0 +1,9 @@
1
+ import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
2
+
3
+ import { coverRecipe, spacingAt } from './cover.css';
4
+
5
+ export const coverResponsive = responsiveRecipe({
6
+ recipe: coverRecipe,
7
+ at: { spacing: spacingAt },
8
+ order: defaultOrder,
9
+ });
@@ -5,14 +5,18 @@ import { assignInlineVars } from '@vanilla-extract/dynamic';
5
5
  import { clsx } from 'clsx';
6
6
  import { ElementType } from 'react';
7
7
 
8
- import { coverRecipe, CoverVariants, minSizeVar } from './cover.css';
8
+ import { CoverVariants, minSizeVar } from './cover.css';
9
+ import { coverResponsive } from './cover.responsive';
10
+
11
+ import type { Responsive } from '../../styles/responsive';
9
12
 
10
13
  type CoverProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> &
11
- CoverVariants & {
14
+ Omit<CoverVariants, 'spacing'> & {
12
15
  /**
13
16
  * The minimum height of the cover
14
17
  */
15
18
  minSize?: string;
19
+ spacing?: Responsive<NonNullable<CoverVariants['spacing']>>;
16
20
  };
17
21
 
18
22
  /**
@@ -34,7 +38,7 @@ export function Cover<TUse extends ElementType>({
34
38
 
35
39
  return (
36
40
  <Comp
37
- className={clsx(coverRecipe({ spacing }), className)}
41
+ className={clsx(coverResponsive({ spacing }), className)}
38
42
  style={assignInlineVars({
39
43
  ...(minSize && { [minSizeVar]: minSize }),
40
44
  })}
@@ -1,11 +1,25 @@
1
1
  import { createVar } from '@vanilla-extract/css';
2
2
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
3
 
4
- import { sys, mapContractVars } from '../../styles';
4
+ import {
5
+ createResponsiveVariants,
6
+ defaultMedia,
7
+ sys,
8
+ mapContractVars,
9
+ } from '../../styles';
5
10
  import { components } from '../../styles/layers.css';
6
11
 
7
12
  export const minSizeVar = createVar();
8
13
 
14
+ // Shared variant style maps so we can reuse them for responsive overrides
15
+ export const gridSpacingStyles = mapContractVars(sys.spacing, (key) => ({
16
+ '@layer': {
17
+ [components]: {
18
+ gridGap: sys.spacing[key],
19
+ },
20
+ },
21
+ }));
22
+
9
23
  export const gridRecipe = recipe({
10
24
  base: {
11
25
  '@layer': {
@@ -24,14 +38,13 @@ export const gridRecipe = recipe({
24
38
  /**
25
39
  * The spacing between the grid cell
26
40
  */
27
- spacing: mapContractVars(sys.spacing, (key) => ({
28
- '@layer': {
29
- [components]: {
30
- gridGap: sys.spacing[key],
31
- },
32
- },
33
- })),
41
+ spacing: gridSpacingStyles,
34
42
  },
35
43
  });
36
44
 
37
45
  export type GridVariants = NonNullable<RecipeVariants<typeof gridRecipe>>;
46
+
47
+ export const spacingAt = createResponsiveVariants({
48
+ styles: gridSpacingStyles,
49
+ media: defaultMedia,
50
+ });
@@ -0,0 +1,9 @@
1
+ import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
2
+
3
+ import { gridRecipe, spacingAt } from './grid.css';
4
+
5
+ export const gridResponsive = responsiveRecipe({
6
+ recipe: gridRecipe,
7
+ at: { spacing: spacingAt },
8
+ order: defaultOrder,
9
+ });
@@ -5,14 +5,18 @@ import { assignInlineVars } from '@vanilla-extract/dynamic';
5
5
  import { clsx } from 'clsx';
6
6
  import { ElementType } from 'react';
7
7
 
8
- import { gridRecipe, GridVariants, minSizeVar } from './grid.css';
8
+ import { GridVariants, minSizeVar } from './grid.css';
9
+ import { gridResponsive } from './grid.responsive';
10
+
11
+ import type { Responsive } from '../../styles/responsive';
9
12
 
10
13
  type GridProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> &
11
- GridVariants & {
14
+ Omit<GridVariants, 'spacing'> & {
12
15
  /**
13
16
  * The minimum size of a grid cell
14
17
  */
15
18
  minSize?: string;
19
+ spacing?: Responsive<NonNullable<GridVariants['spacing']>>;
16
20
  };
17
21
 
18
22
  /**
@@ -33,7 +37,7 @@ export function Grid<TUse extends ElementType>({
33
37
 
34
38
  return (
35
39
  <Comp
36
- className={clsx(gridRecipe({ spacing }), className)}
40
+ className={clsx(gridResponsive({ spacing }), className)}
37
41
  style={assignInlineVars({
38
42
  ...(minSize && { [minSizeVar]: minSize }),
39
43
  })}