@kushagradhawan/kookie-ui 0.1.25 → 0.1.27

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 (63) hide show
  1. package/components.css +18 -6
  2. package/dist/cjs/components/grid.props.d.ts +36 -0
  3. package/dist/cjs/components/grid.props.d.ts.map +1 -1
  4. package/dist/cjs/components/grid.props.js +1 -1
  5. package/dist/cjs/components/grid.props.js.map +3 -3
  6. package/dist/cjs/components/index.d.ts +1 -0
  7. package/dist/cjs/components/index.d.ts.map +1 -1
  8. package/dist/cjs/components/index.js +1 -1
  9. package/dist/cjs/components/index.js.map +3 -3
  10. package/dist/cjs/components/user-card.d.ts +12 -0
  11. package/dist/cjs/components/user-card.d.ts.map +1 -0
  12. package/dist/cjs/components/user-card.js +2 -0
  13. package/dist/cjs/components/user-card.js.map +7 -0
  14. package/dist/cjs/components/user-card.props.d.ts +63 -0
  15. package/dist/cjs/components/user-card.props.d.ts.map +1 -0
  16. package/dist/cjs/components/user-card.props.js +2 -0
  17. package/dist/cjs/components/user-card.props.js.map +7 -0
  18. package/dist/cjs/props/layout.props.d.ts +34 -0
  19. package/dist/cjs/props/layout.props.d.ts.map +1 -1
  20. package/dist/cjs/props/layout.props.js +1 -1
  21. package/dist/cjs/props/layout.props.js.map +3 -3
  22. package/dist/esm/components/grid.props.d.ts +36 -0
  23. package/dist/esm/components/grid.props.d.ts.map +1 -1
  24. package/dist/esm/components/grid.props.js +1 -1
  25. package/dist/esm/components/grid.props.js.map +3 -3
  26. package/dist/esm/components/index.d.ts +1 -0
  27. package/dist/esm/components/index.d.ts.map +1 -1
  28. package/dist/esm/components/index.js +1 -1
  29. package/dist/esm/components/index.js.map +3 -3
  30. package/dist/esm/components/user-card.d.ts +12 -0
  31. package/dist/esm/components/user-card.d.ts.map +1 -0
  32. package/dist/esm/components/user-card.js +2 -0
  33. package/dist/esm/components/user-card.js.map +7 -0
  34. package/dist/esm/components/user-card.props.d.ts +63 -0
  35. package/dist/esm/components/user-card.props.d.ts.map +1 -0
  36. package/dist/esm/components/user-card.props.js +2 -0
  37. package/dist/esm/components/user-card.props.js.map +7 -0
  38. package/dist/esm/props/layout.props.d.ts +34 -0
  39. package/dist/esm/props/layout.props.d.ts.map +1 -1
  40. package/dist/esm/props/layout.props.js +1 -1
  41. package/dist/esm/props/layout.props.js.map +3 -3
  42. package/layout/utilities.css +366 -12
  43. package/layout.css +366 -12
  44. package/package.json +1 -1
  45. package/src/components/_internal/base-menu.css +5 -5
  46. package/src/components/grid.props.tsx +58 -0
  47. package/src/components/image.css +1 -1
  48. package/src/components/index.css +1 -0
  49. package/src/components/index.tsx +1 -0
  50. package/src/components/user-card.css +29 -0
  51. package/src/components/user-card.props.tsx +45 -0
  52. package/src/components/user-card.tsx +102 -0
  53. package/src/props/layout.props.ts +38 -0
  54. package/src/styles/tokens/transition.css +5 -5
  55. package/src/styles/utilities/align-content.css +33 -0
  56. package/src/styles/utilities/align-self.css +2 -2
  57. package/src/styles/utilities/justify-items.css +21 -0
  58. package/src/styles/utilities/justify-self.css +21 -0
  59. package/src/styles/utilities/layout.css +3 -0
  60. package/styles.css +389 -23
  61. package/tokens/base.css +5 -5
  62. package/tokens.css +5 -5
  63. package/utilities.css +366 -12
@@ -0,0 +1,102 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import classNames from 'classnames';
5
+
6
+ import { userCardPropDefs } from './user-card.props.js';
7
+ import { Avatar } from './avatar.js';
8
+ import { Card } from './card.js';
9
+ import { Text } from './text.js';
10
+ import { Flex } from './flex.js';
11
+ import { extractProps } from '../helpers/extract-props.js';
12
+ import { getSubtree } from '../helpers/get-subtree.js';
13
+ import { marginPropDefs } from '../props/margin.props.js';
14
+ import { useThemeContext } from './theme.js';
15
+
16
+ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
17
+ import type { MarginProps } from '../props/margin.props.js';
18
+ import type { GetPropDefTypes } from '../props/prop-def.js';
19
+
20
+ type UserCardOwnProps = GetPropDefTypes<typeof userCardPropDefs>;
21
+
22
+ type UserCardElement = React.ElementRef<'div'>;
23
+ interface UserCardProps
24
+ extends ComponentPropsWithout<'div', RemovedProps>,
25
+ MarginProps,
26
+ UserCardOwnProps {}
27
+
28
+ const UserCard = React.forwardRef<UserCardElement, UserCardProps>((props, forwardedRef) => {
29
+ const themeContext = useThemeContext();
30
+ const resolvedPanelBackground = props.panelBackground ?? themeContext.panelBackground;
31
+
32
+ const {
33
+ asChild,
34
+ children,
35
+ className,
36
+ src,
37
+ fallback,
38
+ name,
39
+ description,
40
+ avatarVariant,
41
+ radius,
42
+ color,
43
+ panelBackground,
44
+ flush,
45
+ ...restProps
46
+ } = extractProps(props, userCardPropDefs, marginPropDefs);
47
+
48
+ // Size mappings for avatar and text
49
+ const sizeMap = {
50
+ '1': { avatar: '1', name: '1', description: '0' },
51
+ '2': { avatar: '2', name: '2', description: '1' },
52
+ '3': { avatar: '3', name: '3', description: '2' },
53
+ '4': { avatar: '4', name: '4', description: '3' },
54
+ } as const;
55
+
56
+ const currentSize = props.size || '2';
57
+ const sizes = sizeMap[currentSize as keyof typeof sizeMap];
58
+
59
+ const content = (
60
+ <Flex align="center" gap="3">
61
+ <Avatar
62
+ size={sizes.avatar as any}
63
+ variant={avatarVariant}
64
+ radius={radius}
65
+ src={src}
66
+ fallback={fallback!}
67
+ color={color}
68
+ highContrast={props.highContrast}
69
+ />
70
+ <Flex direction="column" gap="0" style={{ minWidth: 0 }}>
71
+ <Text size={sizes.name as any} weight="medium" truncate>
72
+ {name}
73
+ </Text>
74
+ {description && (
75
+ <Text size={sizes.description as any} color="gray" truncate>
76
+ {description}
77
+ </Text>
78
+ )}
79
+ </Flex>
80
+ </Flex>
81
+ );
82
+
83
+ return (
84
+ <Card
85
+ {...restProps}
86
+ asChild={asChild}
87
+ size={props.size}
88
+ variant={props.variant}
89
+ panelBackground={resolvedPanelBackground}
90
+ flush={flush}
91
+ ref={forwardedRef}
92
+ className={classNames('rt-UserCard', className)}
93
+ >
94
+ {getSubtree({ asChild, children }, content)}
95
+ </Card>
96
+ );
97
+ });
98
+
99
+ UserCard.displayName = 'UserCard';
100
+
101
+ export { UserCard };
102
+ export type { UserCardProps };
@@ -10,6 +10,8 @@ const positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as
10
10
  const positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;
11
11
  const flexShrinkValues = ['0', '1'] as const;
12
12
  const flexGrowValues = ['0', '1'] as const;
13
+ const alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;
14
+ const justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;
13
15
 
14
16
  const layoutPropDefs = {
15
17
  ...paddingPropDefs,
@@ -358,6 +360,40 @@ const layoutPropDefs = {
358
360
  customProperties: ['--grid-row-end'],
359
361
  responsive: true,
360
362
  },
363
+ /**
364
+ * Sets the CSS **align-self** property.
365
+ * Supports a subset of the corresponding CSS values and responsive objects.
366
+ *
367
+ * @example
368
+ * alignSelf="center"
369
+ * alignSelf={{ sm: 'start', lg: 'center' }}
370
+ *
371
+ * @link
372
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self
373
+ */
374
+ alignSelf: {
375
+ type: 'enum',
376
+ className: 'rt-r-as',
377
+ values: alignSelfValues,
378
+ responsive: true,
379
+ },
380
+ /**
381
+ * Sets the CSS **justify-self** property.
382
+ * Supports a subset of the corresponding CSS values and responsive objects.
383
+ *
384
+ * @example
385
+ * justifySelf="center"
386
+ * justifySelf={{ sm: 'start', lg: 'center' }}
387
+ *
388
+ * @link
389
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self
390
+ */
391
+ justifySelf: {
392
+ type: 'enum',
393
+ className: 'rt-r-js',
394
+ values: justifySelfValues,
395
+ responsive: true,
396
+ },
361
397
  } satisfies {
362
398
  position: PropDef<(typeof positionValues)[number]>;
363
399
  inset: PropDef<(typeof positionEdgeValues)[number]>;
@@ -378,6 +414,8 @@ const layoutPropDefs = {
378
414
  gridRowStart: PropDef<string>;
379
415
  gridRowEnd: PropDef<string>;
380
416
  gridArea: PropDef<string>;
417
+ alignSelf: PropDef<(typeof alignSelfValues)[number]>;
418
+ justifySelf: PropDef<(typeof justifySelfValues)[number]>;
381
419
  };
382
420
 
383
421
  // Use all of the imported prop defs to ensure that JSDoc works
@@ -1,10 +1,10 @@
1
1
  .radix-themes {
2
2
  /* Duration tokens */
3
- --duration-1: 50ms; /* Micro interactions */
4
- --duration-2: 100ms; /* Fast transitions */
5
- --duration-3: 150ms; /* Standard transitions */
6
- --duration-4: 200ms; /* Slower transitions */
7
- --duration-5: 300ms; /* Slow animations */
3
+ --duration-1: 75ms; /* Micro interactions */
4
+ --duration-2: 125ms; /* Fast transitions */
5
+ --duration-3: 175ms; /* Standard transitions */
6
+ --duration-4: 225ms; /* Slower transitions */
7
+ --duration-5: 325ms; /* Slow animations */
8
8
 
9
9
  /* Easing tokens */
10
10
  --ease-1: ease-out; /* Fast start, slow end */
@@ -0,0 +1,33 @@
1
+ @breakpoints {
2
+ .rt-r-ac-start {
3
+ align-content: start;
4
+ }
5
+
6
+ .rt-r-ac-center {
7
+ align-content: center;
8
+ }
9
+
10
+ .rt-r-ac-end {
11
+ align-content: end;
12
+ }
13
+
14
+ .rt-r-ac-baseline {
15
+ align-content: baseline;
16
+ }
17
+
18
+ .rt-r-ac-stretch {
19
+ align-content: stretch;
20
+ }
21
+
22
+ .rt-r-ac-space-between {
23
+ align-content: space-between;
24
+ }
25
+
26
+ .rt-r-ac-space-around {
27
+ align-content: space-around;
28
+ }
29
+
30
+ .rt-r-ac-space-evenly {
31
+ align-content: space-evenly;
32
+ }
33
+ }
@@ -1,6 +1,6 @@
1
1
  @breakpoints {
2
2
  .rt-r-as-start {
3
- align-self: flex-start;
3
+ align-self: start;
4
4
  }
5
5
 
6
6
  .rt-r-as-center {
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  .rt-r-as-end {
11
- align-self: flex-end;
11
+ align-self: end;
12
12
  }
13
13
 
14
14
  .rt-r-as-baseline {
@@ -0,0 +1,21 @@
1
+ @breakpoints {
2
+ .rt-r-ji-start {
3
+ justify-items: start;
4
+ }
5
+
6
+ .rt-r-ji-center {
7
+ justify-items: center;
8
+ }
9
+
10
+ .rt-r-ji-end {
11
+ justify-items: end;
12
+ }
13
+
14
+ .rt-r-ji-baseline {
15
+ justify-items: baseline;
16
+ }
17
+
18
+ .rt-r-ji-stretch {
19
+ justify-items: stretch;
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ @breakpoints {
2
+ .rt-r-js-start {
3
+ justify-self: start;
4
+ }
5
+
6
+ .rt-r-js-center {
7
+ justify-self: center;
8
+ }
9
+
10
+ .rt-r-js-end {
11
+ justify-self: end;
12
+ }
13
+
14
+ .rt-r-js-baseline {
15
+ justify-self: baseline;
16
+ }
17
+
18
+ .rt-r-js-stretch {
19
+ justify-self: stretch;
20
+ }
21
+ }
@@ -1,5 +1,6 @@
1
1
  @import '../breakpoints.css';
2
2
 
3
+ @import './align-content.css';
3
4
  @import './align-items.css';
4
5
  @import './align-self.css';
5
6
  @import './display.css';
@@ -25,6 +26,8 @@
25
26
  @import './max-height.css';
26
27
  @import './inset.css';
27
28
  @import './justify-content.css';
29
+ @import './justify-items.css';
30
+ @import './justify-self.css';
28
31
  @import './margin.css';
29
32
  @import './overflow.css';
30
33
  @import './padding.css';