@korsolutions/ui 0.0.49 → 0.0.50

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 (117) hide show
  1. package/dist/module/components/index.js +0 -2
  2. package/dist/module/components/index.js.map +1 -1
  3. package/dist/module/index.js +3 -0
  4. package/dist/module/index.js.map +1 -1
  5. package/dist/module/primitives/card/card-body.js.map +1 -1
  6. package/dist/module/primitives/card/card-footer.js.map +1 -1
  7. package/dist/module/primitives/card/card-header.js.map +1 -1
  8. package/dist/module/primitives/card/card-root.js +4 -2
  9. package/dist/module/primitives/card/card-root.js.map +1 -1
  10. package/dist/module/primitives/card/card-title.js.map +1 -1
  11. package/dist/module/primitives/card/index.js +4 -4
  12. package/dist/module/primitives/card/index.js.map +1 -1
  13. package/dist/module/{components → primitives}/card/variants/default.js +11 -4
  14. package/dist/module/primitives/card/variants/default.js.map +1 -0
  15. package/dist/module/{components → primitives}/card/variants/index.js.map +1 -1
  16. package/dist/module/primitives/index.js +2 -0
  17. package/dist/module/primitives/index.js.map +1 -1
  18. package/dist/module/primitives/list/index.js +5 -0
  19. package/dist/module/primitives/list/index.js.map +1 -0
  20. package/dist/module/primitives/list/list-root.js +15 -0
  21. package/dist/module/primitives/list/list-root.js.map +1 -0
  22. package/dist/module/primitives/typography/index.js +4 -0
  23. package/dist/module/primitives/typography/index.js.map +1 -0
  24. package/dist/module/{components → primitives}/typography/typography.js +3 -3
  25. package/dist/module/primitives/typography/typography.js.map +1 -0
  26. package/dist/module/{components → primitives}/typography/variants/body-lg.js.map +1 -1
  27. package/dist/module/{components → primitives}/typography/variants/body-md.js.map +1 -1
  28. package/dist/module/{components → primitives}/typography/variants/body-sm.js.map +1 -1
  29. package/dist/module/{components → primitives}/typography/variants/heading-lg.js.map +1 -1
  30. package/dist/module/{components → primitives}/typography/variants/heading-md.js.map +1 -1
  31. package/dist/module/{components → primitives}/typography/variants/heading-sm.js.map +1 -1
  32. package/dist/module/{components → primitives}/typography/variants/index.js.map +1 -1
  33. package/dist/module/themes/default/colors.js +8 -8
  34. package/dist/module/themes/default/colors.js.map +1 -1
  35. package/dist/typescript/src/components/index.d.ts +0 -2
  36. package/dist/typescript/src/components/index.d.ts.map +1 -1
  37. package/dist/typescript/src/index.d.ts +3 -0
  38. package/dist/typescript/src/index.d.ts.map +1 -1
  39. package/dist/typescript/src/primitives/card/card-body.d.ts +2 -2
  40. package/dist/typescript/src/primitives/card/card-body.d.ts.map +1 -1
  41. package/dist/typescript/src/primitives/card/card-footer.d.ts +2 -2
  42. package/dist/typescript/src/primitives/card/card-footer.d.ts.map +1 -1
  43. package/dist/typescript/src/primitives/card/card-header.d.ts +2 -2
  44. package/dist/typescript/src/primitives/card/card-header.d.ts.map +1 -1
  45. package/dist/typescript/src/primitives/card/card-root.d.ts +4 -4
  46. package/dist/typescript/src/primitives/card/card-root.d.ts.map +1 -1
  47. package/dist/typescript/src/primitives/card/card-title.d.ts +4 -3
  48. package/dist/typescript/src/primitives/card/card-title.d.ts.map +1 -1
  49. package/dist/typescript/src/primitives/card/index.d.ts +7 -7
  50. package/dist/typescript/src/primitives/card/index.d.ts.map +1 -1
  51. package/dist/typescript/src/{components → primitives}/card/variants/default.d.ts.map +1 -1
  52. package/dist/typescript/src/{components → primitives}/card/variants/index.d.ts.map +1 -1
  53. package/dist/typescript/src/primitives/index.d.ts +2 -0
  54. package/dist/typescript/src/primitives/index.d.ts.map +1 -1
  55. package/dist/typescript/src/primitives/list/index.d.ts +3 -0
  56. package/dist/typescript/src/primitives/list/index.d.ts.map +1 -0
  57. package/dist/typescript/src/primitives/list/list-root.d.ts +13 -0
  58. package/dist/typescript/src/primitives/list/list-root.d.ts.map +1 -0
  59. package/dist/typescript/src/primitives/typography/index.d.ts +2 -0
  60. package/dist/typescript/src/primitives/typography/index.d.ts.map +1 -0
  61. package/dist/typescript/src/{components → primitives}/typography/typography.d.ts.map +1 -1
  62. package/dist/typescript/src/{components → primitives}/typography/variants/body-lg.d.ts.map +1 -1
  63. package/dist/typescript/src/{components → primitives}/typography/variants/body-md.d.ts.map +1 -1
  64. package/dist/typescript/src/{components → primitives}/typography/variants/body-sm.d.ts.map +1 -1
  65. package/dist/typescript/src/{components → primitives}/typography/variants/heading-lg.d.ts.map +1 -1
  66. package/dist/typescript/src/{components → primitives}/typography/variants/heading-md.d.ts.map +1 -1
  67. package/dist/typescript/src/{components → primitives}/typography/variants/heading-sm.d.ts.map +1 -1
  68. package/dist/typescript/src/{components → primitives}/typography/variants/index.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/src/components/index.ts +0 -2
  71. package/src/index.tsx +4 -0
  72. package/src/primitives/card/card-body.tsx +2 -3
  73. package/src/primitives/card/card-footer.tsx +2 -3
  74. package/src/primitives/card/card-header.tsx +2 -3
  75. package/src/primitives/card/card-root.tsx +8 -7
  76. package/src/primitives/card/card-title.tsx +4 -4
  77. package/src/primitives/card/index.ts +7 -7
  78. package/src/{components → primitives}/card/variants/default.tsx +10 -3
  79. package/src/primitives/index.ts +2 -0
  80. package/src/primitives/list/index.ts +5 -0
  81. package/src/primitives/list/list-root.tsx +23 -0
  82. package/src/primitives/typography/index.ts +1 -0
  83. package/src/{components → primitives}/typography/typography.tsx +5 -3
  84. package/src/themes/default/colors.ts +8 -8
  85. package/dist/module/components/card/card.js +0 -21
  86. package/dist/module/components/card/card.js.map +0 -1
  87. package/dist/module/components/card/variants/default.js.map +0 -1
  88. package/dist/module/components/typography/typography.js.map +0 -1
  89. package/dist/typescript/src/components/card/card.d.ts +0 -10
  90. package/dist/typescript/src/components/card/card.d.ts.map +0 -1
  91. package/src/components/card/card.tsx +0 -26
  92. /package/dist/module/{components → primitives}/card/variants/index.js +0 -0
  93. /package/dist/module/{components → primitives}/typography/variants/body-lg.js +0 -0
  94. /package/dist/module/{components → primitives}/typography/variants/body-md.js +0 -0
  95. /package/dist/module/{components → primitives}/typography/variants/body-sm.js +0 -0
  96. /package/dist/module/{components → primitives}/typography/variants/heading-lg.js +0 -0
  97. /package/dist/module/{components → primitives}/typography/variants/heading-md.js +0 -0
  98. /package/dist/module/{components → primitives}/typography/variants/heading-sm.js +0 -0
  99. /package/dist/module/{components → primitives}/typography/variants/index.js +0 -0
  100. /package/dist/typescript/src/{components → primitives}/card/variants/default.d.ts +0 -0
  101. /package/dist/typescript/src/{components → primitives}/card/variants/index.d.ts +0 -0
  102. /package/dist/typescript/src/{components → primitives}/typography/typography.d.ts +0 -0
  103. /package/dist/typescript/src/{components → primitives}/typography/variants/body-lg.d.ts +0 -0
  104. /package/dist/typescript/src/{components → primitives}/typography/variants/body-md.d.ts +0 -0
  105. /package/dist/typescript/src/{components → primitives}/typography/variants/body-sm.d.ts +0 -0
  106. /package/dist/typescript/src/{components → primitives}/typography/variants/heading-lg.d.ts +0 -0
  107. /package/dist/typescript/src/{components → primitives}/typography/variants/heading-md.d.ts +0 -0
  108. /package/dist/typescript/src/{components → primitives}/typography/variants/heading-sm.d.ts +0 -0
  109. /package/dist/typescript/src/{components → primitives}/typography/variants/index.d.ts +0 -0
  110. /package/src/{components → primitives}/card/variants/index.ts +0 -0
  111. /package/src/{components → primitives}/typography/variants/body-lg.tsx +0 -0
  112. /package/src/{components → primitives}/typography/variants/body-md.tsx +0 -0
  113. /package/src/{components → primitives}/typography/variants/body-sm.tsx +0 -0
  114. /package/src/{components → primitives}/typography/variants/heading-lg.tsx +0 -0
  115. /package/src/{components → primitives}/typography/variants/heading-md.tsx +0 -0
  116. /package/src/{components → primitives}/typography/variants/heading-sm.tsx +0 -0
  117. /package/src/{components → primitives}/typography/variants/index.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../../src/components/typography/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,KAAK,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,OAAO,CAAC,EAAE,MAAM,OAAO,kBAAkB,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAIhD"}
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../../src/primitives/typography/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,KAAK,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,OAAO,CAAC,EAAE,MAAM,OAAO,kBAAkB,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAMhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"body-lg.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/body-lg.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
1
+ {"version":3,"file":"body-lg.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/body-lg.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
@@ -1 +1 @@
1
- {"version":3,"file":"body-md.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/body-md.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
1
+ {"version":3,"file":"body-md.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/body-md.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
@@ -1 +1 @@
1
- {"version":3,"file":"body-sm.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/body-sm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
1
+ {"version":3,"file":"body-sm.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/body-sm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,SAAS,CAShD"}
@@ -1 +1 @@
1
- {"version":3,"file":"heading-lg.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/heading-lg.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
1
+ {"version":3,"file":"heading-lg.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/heading-lg.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"heading-md.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/heading-md.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
1
+ {"version":3,"file":"heading-md.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/heading-md.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"heading-sm.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/heading-sm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
1
+ {"version":3,"file":"heading-sm.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/heading-sm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,uBAAuB,IAAI,SAAS,CAUnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/typography/variants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,kBAAkB;;;;;;;CAO9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/typography/variants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,kBAAkB;;;;;;;CAO9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,7 +4,6 @@ export * from "./avatar/avatar";
4
4
  export * from "./badge/badge";
5
5
  export * from "./button/button";
6
6
  export * from "./calendar/calendar";
7
- export * from "./card/card";
8
7
  export * from "./checkbox";
9
8
  export * from "./dropdown-menu/dropdown-menu";
10
9
  export * from "./empty/empty";
@@ -17,4 +16,3 @@ export * from "./select/select";
17
16
  export * from "./tabs";
18
17
  export * from "./textarea/textarea";
19
18
  export * from "./toast/index";
20
- export * from "./typography/typography";
package/src/index.tsx CHANGED
@@ -31,4 +31,8 @@ export { useTheme } from "./themes/provider";
31
31
  export * from "./themes/types";
32
32
 
33
33
  export * from "./primitives/alert";
34
+ export * from "./primitives/card";
35
+ export * from "./primitives/list";
36
+ export * from "./primitives/typography";
37
+
34
38
  export * from "./safe-area";
@@ -1,3 +1,4 @@
1
+ import type { PropsWithRender } from "@/types/props.types";
1
2
  import { calculateComposedStyles } from "@/utils/calculate-styles";
2
3
  import React from "react";
3
4
  import { type StyleProp, View, type ViewStyle } from "react-native";
@@ -6,12 +7,10 @@ import { useCard } from "./context";
6
7
  export interface CardBodyProps {
7
8
  children?: React.ReactNode;
8
9
 
9
- render?: (props: CardBodyProps) => React.ReactNode;
10
-
11
10
  style?: StyleProp<ViewStyle>;
12
11
  }
13
12
 
14
- export function CardBody(props: CardBodyProps) {
13
+ export function CardBody(props: PropsWithRender<CardBodyProps>) {
15
14
  const card = useCard();
16
15
 
17
16
  const composedStyle = calculateComposedStyles(card.styles, card.state, "body", props.style);
@@ -1,3 +1,4 @@
1
+ import type { PropsWithRender } from "@/types/props.types";
1
2
  import { calculateComposedStyles } from "@/utils/calculate-styles";
2
3
  import React from "react";
3
4
  import { type StyleProp, View, type ViewStyle } from "react-native";
@@ -6,12 +7,10 @@ import { useCard } from "./context";
6
7
  export interface CardFooterProps {
7
8
  children?: React.ReactNode;
8
9
 
9
- render?: (props: CardFooterProps) => React.ReactNode;
10
-
11
10
  style?: StyleProp<ViewStyle>;
12
11
  }
13
12
 
14
- export function CardFooter(props: CardFooterProps) {
13
+ export function CardFooter(props: PropsWithRender<CardFooterProps>) {
15
14
  const card = useCard();
16
15
 
17
16
  const composedStyle = calculateComposedStyles(card.styles, card.state, "footer", props.style);
@@ -1,3 +1,4 @@
1
+ import type { PropsWithRender } from "@/types/props.types";
1
2
  import { calculateComposedStyles } from "@/utils/calculate-styles";
2
3
  import React from "react";
3
4
  import { type StyleProp, View, type ViewStyle } from "react-native";
@@ -6,12 +7,10 @@ import { useCard } from "./context";
6
7
  export interface CardHeaderProps {
7
8
  children?: React.ReactNode;
8
9
 
9
- render?: (props: CardHeaderProps) => React.ReactNode;
10
-
11
10
  style?: StyleProp<ViewStyle>;
12
11
  }
13
12
 
14
- export function CardHeader(props: CardHeaderProps) {
13
+ export function CardHeader(props: PropsWithRender<CardHeaderProps>) {
15
14
  const card = useCard();
16
15
 
17
16
  const composedStyle = calculateComposedStyles(card.styles, card.state, "header", props.style);
@@ -1,27 +1,28 @@
1
+ import type { PropsWithRender } from "@/types/props.types";
1
2
  import { calculateComposedStyles } from "@/utils/calculate-styles";
2
3
  import React from "react";
3
4
  import { type StyleProp, View, type ViewStyle } from "react-native";
4
5
  import { CardContext } from "./context";
5
- import type { CardStyles } from "./types";
6
+ import { CardVariants } from "./variants";
6
7
 
7
8
  export interface CardRootProps {
9
+ variant?: keyof typeof CardVariants;
8
10
  children?: React.ReactNode;
9
11
 
10
- render?: (props: CardRootProps) => React.ReactNode;
11
-
12
12
  style?: StyleProp<ViewStyle>;
13
- styles?: CardStyles;
14
13
  }
15
14
 
16
- export function CardRoot(props: CardRootProps) {
17
- const composedStyle = calculateComposedStyles(props.styles, "default", "root", props.style);
15
+ export function CardRoot(props: PropsWithRender<CardRootProps>) {
16
+ const variantStyles = CardVariants[props.variant || "default"]();
17
+
18
+ const composedStyle = calculateComposedStyles(variantStyles, "default", "root", props.style);
18
19
 
19
20
  const Component = props.render ?? View;
20
21
  return (
21
22
  <CardContext.Provider
22
23
  value={{
23
24
  state: "default",
24
- styles: props.styles,
25
+ styles: variantStyles,
25
26
  }}
26
27
  >
27
28
  <Component {...props} style={composedStyle} />
@@ -1,17 +1,17 @@
1
+ import type { TextChildren } from "@/types/element.types";
2
+ import type { PropsWithRender } from "@/types/props.types";
1
3
  import { calculateComposedStyles } from "@/utils/calculate-styles";
2
4
  import React from "react";
3
5
  import { type StyleProp, Text, type TextStyle } from "react-native";
4
6
  import { useCard } from "./context";
5
7
 
6
8
  export interface CardTitleProps {
7
- children?: string;
8
-
9
- render?: (props: CardTitleProps) => React.ReactNode;
9
+ children?: TextChildren;
10
10
 
11
11
  style?: StyleProp<TextStyle>;
12
12
  }
13
13
 
14
- export function CardTitle(props: CardTitleProps) {
14
+ export function CardTitle(props: PropsWithRender<CardTitleProps>) {
15
15
  const card = useCard();
16
16
 
17
17
  const composedStyle = calculateComposedStyles(card.styles, card.state, "title", props.style);
@@ -1,10 +1,10 @@
1
- import { CardRoot } from "./card-root";
2
- import { CardHeader } from "./card-header";
3
- import { CardTitle } from "./card-title";
4
1
  import { CardBody } from "./card-body";
5
2
  import { CardFooter } from "./card-footer";
3
+ import { CardHeader } from "./card-header";
4
+ import { CardRoot } from "./card-root";
5
+ import { CardTitle } from "./card-title";
6
6
 
7
- export const CardPrimitive = {
7
+ export const Card = {
8
8
  Root: CardRoot,
9
9
  Header: CardHeader,
10
10
  Title: CardTitle,
@@ -12,9 +12,9 @@ export const CardPrimitive = {
12
12
  Footer: CardFooter,
13
13
  };
14
14
 
15
- export type { CardRootProps } from "./card-root";
16
- export type { CardHeaderProps } from "./card-header";
17
- export type { CardTitleProps } from "./card-title";
18
15
  export type { CardBodyProps } from "./card-body";
19
16
  export type { CardFooterProps } from "./card-footer";
17
+ export type { CardHeaderProps } from "./card-header";
18
+ export type { CardRootProps } from "./card-root";
19
+ export type { CardTitleProps } from "./card-title";
20
20
  export type { CardStyles } from "./types";
@@ -10,13 +10,12 @@ export function useCardVariantDefault(): CardStyles {
10
10
  borderColor: colors.border,
11
11
  borderRadius: radius,
12
12
  backgroundColor: colors.surface,
13
- paddingVertical: 24,
14
- gap: 24,
15
13
  },
16
14
  },
17
15
  header: {
18
16
  default: {
19
17
  paddingHorizontal: 24,
18
+ paddingTop: 24,
20
19
  },
21
20
  },
22
21
  title: {
@@ -29,10 +28,18 @@ export function useCardVariantDefault(): CardStyles {
29
28
  },
30
29
  body: {
31
30
  default: {
31
+ padding: 24,
32
+ gap: 24,
33
+ },
34
+ },
35
+ footer: {
36
+ default: {
37
+ flexDirection: "row",
32
38
  paddingHorizontal: 24,
39
+ paddingBottom: 24,
33
40
  gap: 24,
34
41
  },
35
42
  },
36
- })
43
+ }),
37
44
  );
38
45
  }
@@ -11,6 +11,7 @@ export * from "./dropdown-menu";
11
11
  export * from "./empty";
12
12
  export * from "./field";
13
13
  export * from "./input";
14
+ export * from "./list";
14
15
  export * from "./popover";
15
16
  export * from "./portal";
16
17
  export * from "./progress";
@@ -18,3 +19,4 @@ export * from "./select";
18
19
  export * from "./tabs";
19
20
  export * from "./textarea";
20
21
  export * from "./toast";
22
+ export * from "./typography";
@@ -0,0 +1,5 @@
1
+ import { ListRoot } from "./list-root";
2
+
3
+ export const List = ListRoot;
4
+
5
+ export type { ListProps } from "./list-root";
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+
3
+ export interface ListProps<T> {
4
+ data: readonly T[];
5
+ keyExtractor: (item: T, index: number) => string;
6
+ renderItem: (info: { item: T; index: number }) => React.ReactElement;
7
+ renderEmpty?: () => React.ReactElement;
8
+ renderSeparator?: () => React.ReactElement;
9
+ }
10
+
11
+ export const ListRoot = <T,>(props: ListProps<T>) => {
12
+ return (
13
+ <>
14
+ {props.data.length === 0 && props.renderEmpty?.()}
15
+ {props.data.map((item, index) => (
16
+ <React.Fragment key={props.keyExtractor(item, index) ?? index}>
17
+ {props.renderItem({ item, index })}
18
+ {props.data.length - 1 !== index && props.renderSeparator?.()}
19
+ </React.Fragment>
20
+ ))}
21
+ </>
22
+ );
23
+ };
@@ -0,0 +1 @@
1
+ export * from "./typography";
@@ -7,7 +7,9 @@ export interface TypographyProps extends RnTextProps {
7
7
  }
8
8
 
9
9
  export function Typography(props: TypographyProps) {
10
- const useVariantStyles = TypographyVariants[props.variant ?? "body-md"];
11
- const variantStyles = useVariantStyles();
12
- return <RnText {...props} style={variantStyles} />;
10
+ const variantStyles = TypographyVariants[props.variant ?? "body-md"]();
11
+
12
+ const combinedStyles = [variantStyles, props.style];
13
+
14
+ return <RnText {...props} style={combinedStyles} />;
13
15
  }
@@ -16,10 +16,10 @@ export const lightColors: Colors = {
16
16
  border: "hsla(224, 0%, 90%, 1)",
17
17
  surface: "hsla(224, 0%, 100%, 1)",
18
18
 
19
- danger: "hsla(352, 100%, 41%, 1)",
20
- success: "hsla(227, 70%, 40%, 1)",
21
- warning: "hsla(212, 100%, 79%, 1)",
22
- info: "hsla(221, 86%, 54%, 1)",
19
+ danger: "hsla(360, 100%, 45%, 1)",
20
+ success: "hsla(140, 100%, 40%, 1)",
21
+ warning: "hsla(31, 92%, 45%, 1)",
22
+ info: "hsla(210, 92%, 45%, 1)",
23
23
  };
24
24
 
25
25
  export const darkColors: Colors = {
@@ -38,8 +38,8 @@ export const darkColors: Colors = {
38
38
  border: "hsla(224, 0%, 16%, 1)",
39
39
  surface: "hsla(224, 0%, 9%, 1)",
40
40
 
41
- danger: "hsla(359, 100%, 70%, 1)",
42
- success: "hsla(227, 70%, 40%, 1)",
43
- warning: "hsla(212, 100%, 79%, 1)",
44
- info: "hsla(221, 86%, 54%, 1)",
41
+ danger: "hsla(360, 100%, 45%, 1)",
42
+ success: "hsla(140, 100%, 40%, 1)",
43
+ warning: "hsla(31, 92%, 45%, 1)",
44
+ info: "hsla(210, 92%, 45%, 1)",
45
45
  };
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- import { CardPrimitive } from "../../primitives/index.js";
4
- import React from "react";
5
- import { CardVariants } from "./variants/index.js";
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- export function Card(props) {
8
- const useVariantStyles = CardVariants[props.variant || "default"];
9
- const styles = useVariantStyles();
10
- return /*#__PURE__*/_jsxs(CardPrimitive.Root, {
11
- styles: styles,
12
- children: [!!props.title && /*#__PURE__*/_jsx(CardPrimitive.Header, {
13
- children: /*#__PURE__*/_jsx(CardPrimitive.Title, {
14
- children: props.title
15
- })
16
- }), /*#__PURE__*/_jsx(CardPrimitive.Body, {
17
- children: props.children
18
- })]
19
- });
20
- }
21
- //# sourceMappingURL=card.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CardPrimitive","React","CardVariants","jsx","_jsx","jsxs","_jsxs","Card","props","useVariantStyles","variant","styles","Root","children","title","Header","Title","Body"],"sourceRoot":"../../../../src","sources":["components/card/card.tsx"],"mappings":";;AAAA,SAASA,aAAa;AACtB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY;AAAqB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS1C,OAAO,SAASC,IAAIA,CAACC,KAAgB,EAAE;EACrC,MAAMC,gBAAgB,GAAGP,YAAY,CAACM,KAAK,CAACE,OAAO,IAAI,SAAS,CAAC;EACjE,MAAMC,MAAM,GAAGF,gBAAgB,CAAC,CAAC;EAEjC,oBACEH,KAAA,CAACN,aAAa,CAACY,IAAI;IAACD,MAAM,EAAEA,MAAO;IAAAE,QAAA,GAChC,CAAC,CAACL,KAAK,CAACM,KAAK,iBACZV,IAAA,CAACJ,aAAa,CAACe,MAAM;MAAAF,QAAA,eACnBT,IAAA,CAACJ,aAAa,CAACgB,KAAK;QAAAH,QAAA,EAAEL,KAAK,CAACM;MAAK,CAAsB;IAAC,CACpC,CACvB,eACDV,IAAA,CAACJ,aAAa,CAACiB,IAAI;MAAAJ,QAAA,EAAEL,KAAK,CAACK;IAAQ,CAAqB,CAAC;EAAA,CACvC,CAAC;AAEzB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["useThemedStyles","useCardVariantDefault","colors","radius","fontFamily","fontSize","root","default","borderWidth","borderColor","border","borderRadius","backgroundColor","surface","paddingVertical","gap","header","paddingHorizontal","title","fontWeight","color","foreground","body"],"sourceRoot":"../../../../../src","sources":["components/card/variants/default.tsx"],"mappings":";;AACA,SAASA,eAAe;AAExB,OAAO,SAASC,qBAAqBA,CAAA,EAAe;EAClD,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAAkB;IACzDC,IAAI,EAAE;MACJC,OAAO,EAAE;QACPC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAEP,MAAM,CAACQ,MAAM;QAC1BC,YAAY,EAAER,MAAM;QACpBS,eAAe,EAAEV,MAAM,CAACW,OAAO;QAC/BC,eAAe,EAAE,EAAE;QACnBC,GAAG,EAAE;MACP;IACF,CAAC;IACDC,MAAM,EAAE;MACNT,OAAO,EAAE;QACPU,iBAAiB,EAAE;MACrB;IACF,CAAC;IACDC,KAAK,EAAE;MACLX,OAAO,EAAE;QACPH,UAAU;QACVC,QAAQ,EAAEA,QAAQ,GAAG,IAAI;QACzBc,UAAU,EAAE,KAAK;QACjBC,KAAK,EAAElB,MAAM,CAACmB;MAChB;IACF,CAAC;IACDC,IAAI,EAAE;MACJf,OAAO,EAAE;QACPU,iBAAiB,EAAE,EAAE;QACrBF,GAAG,EAAE;MACP;IACF;EACF,CAAC,CACH,CAAC;AACH","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Text","RnText","TypographyVariants","jsx","_jsx","Typography","props","useVariantStyles","variant","variantStyles","style"],"sourceRoot":"../../../../src","sources":["components/typography/typography.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,IAAIC,MAAM,QAAuC,cAAc;AAC5E,SAASC,kBAAkB;AAAqB,SAAAC,GAAA,IAAAC,IAAA;AAMhD,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,gBAAgB,GAAGL,kBAAkB,CAACI,KAAK,CAACE,OAAO,IAAI,SAAS,CAAC;EACvE,MAAMC,aAAa,GAAGF,gBAAgB,CAAC,CAAC;EACxC,oBAAOH,IAAA,CAACH,MAAM;IAAA,GAAKK,KAAK;IAAEI,KAAK,EAAED;EAAc,CAAE,CAAC;AACpD","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { CardVariants } from "./variants";
3
- interface CardProps {
4
- title?: string;
5
- children: React.ReactNode;
6
- variant?: keyof typeof CardVariants;
7
- }
8
- export declare function Card(props: CardProps): React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../../src/components/card/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,UAAU,SAAS;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,OAAO,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACrC;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,qBAcpC"}
@@ -1,26 +0,0 @@
1
- import { CardPrimitive } from "@/primitives";
2
- import React from "react";
3
- import { CardVariants } from "./variants";
4
-
5
- interface CardProps {
6
- title?: string;
7
- children: React.ReactNode;
8
-
9
- variant?: keyof typeof CardVariants;
10
- }
11
-
12
- export function Card(props: CardProps) {
13
- const useVariantStyles = CardVariants[props.variant || "default"];
14
- const styles = useVariantStyles();
15
-
16
- return (
17
- <CardPrimitive.Root styles={styles}>
18
- {!!props.title && (
19
- <CardPrimitive.Header>
20
- <CardPrimitive.Title>{props.title}</CardPrimitive.Title>
21
- </CardPrimitive.Header>
22
- )}
23
- <CardPrimitive.Body>{props.children}</CardPrimitive.Body>
24
- </CardPrimitive.Root>
25
- );
26
- }