@korsolutions/ui 0.0.96 → 0.0.97

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 (124) hide show
  1. package/dist/module/components/description-list/context.js +12 -0
  2. package/dist/module/components/description-list/context.js.map +1 -0
  3. package/dist/module/components/description-list/description-list-actions.js +17 -0
  4. package/dist/module/components/description-list/description-list-actions.js.map +1 -0
  5. package/dist/module/components/description-list/description-list-details.js +17 -0
  6. package/dist/module/components/description-list/description-list-details.js.map +1 -0
  7. package/dist/module/components/description-list/description-list-item.js +17 -0
  8. package/dist/module/components/description-list/description-list-item.js.map +1 -0
  9. package/dist/module/components/description-list/description-list-root.js +27 -0
  10. package/dist/module/components/description-list/description-list-root.js.map +1 -0
  11. package/dist/module/components/description-list/description-list-term.js +17 -0
  12. package/dist/module/components/description-list/description-list-term.js.map +1 -0
  13. package/dist/module/components/description-list/index.js +15 -0
  14. package/dist/module/components/description-list/index.js.map +1 -0
  15. package/dist/module/components/description-list/types.js +4 -0
  16. package/dist/module/components/description-list/types.js.map +1 -0
  17. package/dist/module/components/description-list/variants/default.js +53 -0
  18. package/dist/module/components/description-list/variants/default.js.map +1 -0
  19. package/dist/module/components/description-list/variants/index.js +7 -0
  20. package/dist/module/components/description-list/variants/index.js.map +1 -0
  21. package/dist/module/components/index.js +2 -0
  22. package/dist/module/components/index.js.map +1 -1
  23. package/dist/module/components/item/context.js +12 -0
  24. package/dist/module/components/item/context.js.map +1 -0
  25. package/dist/module/components/item/index.js +17 -0
  26. package/dist/module/components/item/index.js.map +1 -0
  27. package/dist/module/components/item/item-actions.js +17 -0
  28. package/dist/module/components/item/item-actions.js.map +1 -0
  29. package/dist/module/components/item/item-content.js +17 -0
  30. package/dist/module/components/item/item-content.js.map +1 -0
  31. package/dist/module/components/item/item-description.js +17 -0
  32. package/dist/module/components/item/item-description.js.map +1 -0
  33. package/dist/module/components/item/item-media.js +18 -0
  34. package/dist/module/components/item/item-media.js.map +1 -0
  35. package/dist/module/components/item/item-root.js +29 -0
  36. package/dist/module/components/item/item-root.js.map +1 -0
  37. package/dist/module/components/item/item-title.js +17 -0
  38. package/dist/module/components/item/item-title.js.map +1 -0
  39. package/dist/module/components/item/types.js +4 -0
  40. package/dist/module/components/item/types.js.map +1 -0
  41. package/dist/module/components/item/variants/default.js +91 -0
  42. package/dist/module/components/item/variants/default.js.map +1 -0
  43. package/dist/module/components/item/variants/index.js +11 -0
  44. package/dist/module/components/item/variants/index.js.map +1 -0
  45. package/dist/module/components/item/variants/muted.js +93 -0
  46. package/dist/module/components/item/variants/muted.js.map +1 -0
  47. package/dist/module/components/item/variants/outline.js +94 -0
  48. package/dist/module/components/item/variants/outline.js.map +1 -0
  49. package/dist/typescript/src/components/description-list/context.d.ts +8 -0
  50. package/dist/typescript/src/components/description-list/context.d.ts.map +1 -0
  51. package/dist/typescript/src/components/description-list/description-list-actions.d.ts +9 -0
  52. package/dist/typescript/src/components/description-list/description-list-actions.d.ts.map +1 -0
  53. package/dist/typescript/src/components/description-list/description-list-details.d.ts +9 -0
  54. package/dist/typescript/src/components/description-list/description-list-details.d.ts.map +1 -0
  55. package/dist/typescript/src/components/description-list/description-list-item.d.ts +9 -0
  56. package/dist/typescript/src/components/description-list/description-list-item.d.ts.map +1 -0
  57. package/dist/typescript/src/components/description-list/description-list-root.d.ts +11 -0
  58. package/dist/typescript/src/components/description-list/description-list-root.d.ts.map +1 -0
  59. package/dist/typescript/src/components/description-list/description-list-term.d.ts +10 -0
  60. package/dist/typescript/src/components/description-list/description-list-term.d.ts.map +1 -0
  61. package/dist/typescript/src/components/description-list/index.d.ts +19 -0
  62. package/dist/typescript/src/components/description-list/index.d.ts.map +1 -0
  63. package/dist/typescript/src/components/description-list/types.d.ts +14 -0
  64. package/dist/typescript/src/components/description-list/types.d.ts.map +1 -0
  65. package/dist/typescript/src/components/description-list/variants/default.d.ts +3 -0
  66. package/dist/typescript/src/components/description-list/variants/default.d.ts.map +1 -0
  67. package/dist/typescript/src/components/description-list/variants/index.d.ts +5 -0
  68. package/dist/typescript/src/components/description-list/variants/index.d.ts.map +1 -0
  69. package/dist/typescript/src/components/index.d.ts +2 -0
  70. package/dist/typescript/src/components/index.d.ts.map +1 -1
  71. package/dist/typescript/src/components/item/context.d.ts +9 -0
  72. package/dist/typescript/src/components/item/context.d.ts.map +1 -0
  73. package/dist/typescript/src/components/item/index.d.ts +22 -0
  74. package/dist/typescript/src/components/item/index.d.ts.map +1 -0
  75. package/dist/typescript/src/components/item/item-actions.d.ts +9 -0
  76. package/dist/typescript/src/components/item/item-actions.d.ts.map +1 -0
  77. package/dist/typescript/src/components/item/item-content.d.ts +9 -0
  78. package/dist/typescript/src/components/item/item-content.d.ts.map +1 -0
  79. package/dist/typescript/src/components/item/item-description.d.ts +11 -0
  80. package/dist/typescript/src/components/item/item-description.d.ts.map +1 -0
  81. package/dist/typescript/src/components/item/item-media.d.ts +10 -0
  82. package/dist/typescript/src/components/item/item-media.d.ts.map +1 -0
  83. package/dist/typescript/src/components/item/item-root.d.ts +12 -0
  84. package/dist/typescript/src/components/item/item-root.d.ts.map +1 -0
  85. package/dist/typescript/src/components/item/item-title.d.ts +11 -0
  86. package/dist/typescript/src/components/item/item-title.d.ts.map +1 -0
  87. package/dist/typescript/src/components/item/types.d.ts +17 -0
  88. package/dist/typescript/src/components/item/types.d.ts.map +1 -0
  89. package/dist/typescript/src/components/item/variants/default.d.ts +3 -0
  90. package/dist/typescript/src/components/item/variants/default.d.ts.map +1 -0
  91. package/dist/typescript/src/components/item/variants/index.d.ts +9 -0
  92. package/dist/typescript/src/components/item/variants/index.d.ts.map +1 -0
  93. package/dist/typescript/src/components/item/variants/muted.d.ts +3 -0
  94. package/dist/typescript/src/components/item/variants/muted.d.ts.map +1 -0
  95. package/dist/typescript/src/components/item/variants/outline.d.ts +3 -0
  96. package/dist/typescript/src/components/item/variants/outline.d.ts.map +1 -0
  97. package/dist/typescript/src/themes/types.d.ts +8 -0
  98. package/dist/typescript/src/themes/types.d.ts.map +1 -1
  99. package/package.json +1 -1
  100. package/src/components/description-list/context.ts +17 -0
  101. package/src/components/description-list/description-list-actions.tsx +20 -0
  102. package/src/components/description-list/description-list-details.tsx +20 -0
  103. package/src/components/description-list/description-list-item.tsx +20 -0
  104. package/src/components/description-list/description-list-root.tsx +35 -0
  105. package/src/components/description-list/description-list-term.tsx +21 -0
  106. package/src/components/description-list/index.ts +20 -0
  107. package/src/components/description-list/types.ts +15 -0
  108. package/src/components/description-list/variants/default.tsx +50 -0
  109. package/src/components/description-list/variants/index.ts +5 -0
  110. package/src/components/index.ts +2 -0
  111. package/src/components/item/context.ts +18 -0
  112. package/src/components/item/index.ts +23 -0
  113. package/src/components/item/item-actions.tsx +20 -0
  114. package/src/components/item/item-content.tsx +20 -0
  115. package/src/components/item/item-description.tsx +27 -0
  116. package/src/components/item/item-media.tsx +22 -0
  117. package/src/components/item/item-root.tsx +38 -0
  118. package/src/components/item/item-title.tsx +22 -0
  119. package/src/components/item/types.ts +18 -0
  120. package/src/components/item/variants/default.tsx +71 -0
  121. package/src/components/item/variants/index.ts +9 -0
  122. package/src/components/item/variants/muted.tsx +73 -0
  123. package/src/components/item/variants/outline.tsx +74 -0
  124. package/src/themes/types.ts +8 -0
@@ -43,10 +43,12 @@ import type { WeekCalendarStyles } from "../components/calendar/week-calendar/ty
43
43
  import type { CardStyles } from "../components/card/types";
44
44
  import type { CheckboxStyles } from "../components/checkbox/types";
45
45
  import type { ComboboxStyles } from "../components/combobox/types";
46
+ import type { DescriptionListStyles } from "../components/description-list/types";
46
47
  import type { EmptyStyles } from "../components/empty/types";
47
48
  import type { FieldStyles } from "../components/field/types";
48
49
  import type { IconButtonStyles } from "../components/icon-button/types";
49
50
  import type { InputStyles } from "../components/input/types";
51
+ import type { ItemStyles } from "../components/item/types";
50
52
  import type { LinkStyles } from "../components/link";
51
53
  import type { MenuStyles } from "../components/menu/types";
52
54
  import type { PhoneInputStyles } from "../components/phone-input/types";
@@ -97,6 +99,9 @@ export interface ComponentsConfig {
97
99
  combobox?: {
98
100
  styles?: ComboboxStyles;
99
101
  };
102
+ descriptionList?: {
103
+ styles?: DescriptionListStyles;
104
+ };
100
105
  empty?: {
101
106
  styles?: EmptyStyles;
102
107
  };
@@ -109,6 +114,9 @@ export interface ComponentsConfig {
109
114
  input?: {
110
115
  styles?: InputStyles;
111
116
  };
117
+ item?: {
118
+ styles?: ItemStyles;
119
+ };
112
120
  link?: {
113
121
  styles?: LinkStyles;
114
122
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/themes/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,KAAK,KAAK,GAAG,OAAO,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI,CAAC;AAEtD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC;IACf,iBAAiB,EAAE,KAAK,CAAC;IACzB,SAAS,EAAE,KAAK,CAAC;IACjB,mBAAmB,EAAE,KAAK,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,eAAe,EAAE,KAAK,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC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AAe,CAAC;KAC1B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,eAAe,CAAC;KAC1B,CAAC;IACF,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.96",
3
+ "version": "0.0.97",
4
4
  "bugs": {
5
5
  "url": "https://github.com/KorSoftwareSolutions/ui/issues"
6
6
  },
@@ -0,0 +1,17 @@
1
+ import { createContext, useContext } from "react";
2
+ import type { DescriptionListState, DescriptionListStyles } from "./types";
3
+
4
+ export interface DescriptionListContext {
5
+ state: DescriptionListState;
6
+ styles?: DescriptionListStyles;
7
+ }
8
+
9
+ export const DescriptionListContext = createContext<DescriptionListContext | undefined>(undefined);
10
+
11
+ export const useDescriptionList = () => {
12
+ const context = useContext(DescriptionListContext);
13
+ if (!context) {
14
+ throw new Error("useDescriptionList must be used within a DescriptionList.Root");
15
+ }
16
+ return context;
17
+ };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useDescriptionList } from "./context";
6
+
7
+ export interface DescriptionListActionsProps {
8
+ children?: React.ReactNode;
9
+
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+
13
+ export function DescriptionListActions(props: PropsWithRender<DescriptionListActionsProps>) {
14
+ const dl = useDescriptionList();
15
+
16
+ const composedStyle = calculateComposedStyles(dl.styles, dl.state, "actions", props.style);
17
+
18
+ const Component = props.render ?? View;
19
+ return <Component {...props} style={composedStyle} />;
20
+ }
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { type StyleProp, Text, type TextStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useDescriptionList } from "./context";
6
+
7
+ export interface DescriptionListDetailsProps {
8
+ children?: React.ReactNode;
9
+
10
+ style?: StyleProp<TextStyle>;
11
+ }
12
+
13
+ export function DescriptionListDetails(props: PropsWithRender<DescriptionListDetailsProps>) {
14
+ const dl = useDescriptionList();
15
+
16
+ const composedStyle = calculateComposedStyles(dl.styles, dl.state, "details", props.style);
17
+
18
+ const Component = props.render ?? Text;
19
+ return <Component {...props} style={composedStyle} />;
20
+ }
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useDescriptionList } from "./context";
6
+
7
+ export interface DescriptionListItemProps {
8
+ children?: React.ReactNode;
9
+
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+
13
+ export function DescriptionListItem(props: PropsWithRender<DescriptionListItemProps>) {
14
+ const dl = useDescriptionList();
15
+
16
+ const composedStyle = calculateComposedStyles(dl.styles, dl.state, "item", props.style);
17
+
18
+ const Component = props.render ?? View;
19
+ return <Component {...props} style={composedStyle} />;
20
+ }
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useComponentConfig } from "../../themes/provider";
4
+ import type { PropsWithRender } from "../../types/props.types";
5
+ import { calculateComposedStyles, mergeStyles } from "../../utils/calculate-styles";
6
+ import { DescriptionListContext } from "./context";
7
+ import { DescriptionListVariants } from "./variants";
8
+
9
+ export interface DescriptionListRootProps {
10
+ variant?: keyof typeof DescriptionListVariants;
11
+ children?: React.ReactNode;
12
+
13
+ style?: StyleProp<ViewStyle>;
14
+ }
15
+
16
+ export function DescriptionListRoot(props: PropsWithRender<DescriptionListRootProps>) {
17
+ const variantStyles = DescriptionListVariants[props.variant || "default"]();
18
+ const componentConfig = useComponentConfig("descriptionList");
19
+
20
+ const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
21
+
22
+ const composedStyle = calculateComposedStyles(mergedStyles, "default", "root", props.style);
23
+
24
+ const Component = props.render ?? View;
25
+ return (
26
+ <DescriptionListContext.Provider
27
+ value={{
28
+ state: "default",
29
+ styles: mergedStyles,
30
+ }}
31
+ >
32
+ <Component {...props} style={composedStyle} />
33
+ </DescriptionListContext.Provider>
34
+ );
35
+ }
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { type StyleProp, Text, type TextStyle } from "react-native";
3
+ import type { TextChildren } from "../../types/element.types";
4
+ import type { PropsWithRender } from "../../types/props.types";
5
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
6
+ import { useDescriptionList } from "./context";
7
+
8
+ export interface DescriptionListTermProps {
9
+ children?: TextChildren;
10
+
11
+ style?: StyleProp<TextStyle>;
12
+ }
13
+
14
+ export function DescriptionListTerm(props: PropsWithRender<DescriptionListTermProps>) {
15
+ const dl = useDescriptionList();
16
+
17
+ const composedStyle = calculateComposedStyles(dl.styles, dl.state, "term", props.style);
18
+
19
+ const Component = props.render ?? Text;
20
+ return <Component {...props} style={composedStyle} />;
21
+ }
@@ -0,0 +1,20 @@
1
+ import { DescriptionListActions } from "./description-list-actions";
2
+ import { DescriptionListDetails } from "./description-list-details";
3
+ import { DescriptionListItem } from "./description-list-item";
4
+ import { DescriptionListRoot } from "./description-list-root";
5
+ import { DescriptionListTerm } from "./description-list-term";
6
+
7
+ export const DescriptionList = {
8
+ Root: DescriptionListRoot,
9
+ Item: DescriptionListItem,
10
+ Term: DescriptionListTerm,
11
+ Details: DescriptionListDetails,
12
+ Actions: DescriptionListActions,
13
+ };
14
+
15
+ export type { DescriptionListRootProps } from "./description-list-root";
16
+ export type { DescriptionListItemProps } from "./description-list-item";
17
+ export type { DescriptionListTermProps } from "./description-list-term";
18
+ export type { DescriptionListDetailsProps } from "./description-list-details";
19
+ export type { DescriptionListActionsProps } from "./description-list-actions";
20
+ export type { DescriptionListStyles } from "./types";
@@ -0,0 +1,15 @@
1
+ import type { DescriptionListRootProps } from "./description-list-root";
2
+ import type { DescriptionListItemProps } from "./description-list-item";
3
+ import type { DescriptionListTermProps } from "./description-list-term";
4
+ import type { DescriptionListDetailsProps } from "./description-list-details";
5
+ import type { DescriptionListActionsProps } from "./description-list-actions";
6
+
7
+ export type DescriptionListState = "default";
8
+
9
+ export interface DescriptionListStyles {
10
+ root?: Partial<Record<DescriptionListState, DescriptionListRootProps["style"]>>;
11
+ item?: Partial<Record<DescriptionListState, DescriptionListItemProps["style"]>>;
12
+ term?: Partial<Record<DescriptionListState, DescriptionListTermProps["style"]>>;
13
+ details?: Partial<Record<DescriptionListState, DescriptionListDetailsProps["style"]>>;
14
+ actions?: Partial<Record<DescriptionListState, DescriptionListActionsProps["style"]>>;
15
+ }
@@ -0,0 +1,50 @@
1
+ import { useThemedStyles } from "../../../utils/use-themed-styles";
2
+ import type { DescriptionListStyles } from "../types";
3
+
4
+ export function useDescriptionListVariantDefault(): DescriptionListStyles {
5
+ return useThemedStyles(
6
+ ({ colors, fontFamily, fontSize }): DescriptionListStyles => ({
7
+ root: {
8
+ default: {
9
+ gap: 0,
10
+ },
11
+ },
12
+ item: {
13
+ default: {
14
+ flexDirection: "row",
15
+ alignItems: "center",
16
+ paddingVertical: 12,
17
+ borderTopWidth: 1,
18
+ borderTopColor: colors.border,
19
+ gap: 16,
20
+ },
21
+ },
22
+ term: {
23
+ default: {
24
+ fontFamily,
25
+ fontSize: fontSize * 0.875,
26
+ lineHeight: Math.round(fontSize * 0.875 * 1.5),
27
+ fontWeight: "500",
28
+ color: colors.mutedForeground,
29
+ width: "40%",
30
+ },
31
+ },
32
+ details: {
33
+ default: {
34
+ fontFamily,
35
+ fontSize: fontSize * 0.875,
36
+ lineHeight: Math.round(fontSize * 0.875 * 1.5),
37
+ color: colors.foreground,
38
+ flex: 1,
39
+ },
40
+ },
41
+ actions: {
42
+ default: {
43
+ flexDirection: "row",
44
+ alignItems: "center",
45
+ gap: 8,
46
+ },
47
+ },
48
+ }),
49
+ );
50
+ }
@@ -0,0 +1,5 @@
1
+ import { useDescriptionListVariantDefault } from "./default";
2
+
3
+ export const DescriptionListVariants = {
4
+ default: useDescriptionListVariantDefault,
5
+ };
@@ -7,12 +7,14 @@ export * from "./calendar";
7
7
  export * from "./card";
8
8
  export * from "./checkbox";
9
9
  export * from "./combobox";
10
+ export * from "./description-list";
10
11
  export * from "./empty";
11
12
  export * from "./field";
12
13
  export * from "./full-screen-spinner";
13
14
  export * from "./icon";
14
15
  export * from "./icon-button";
15
16
  export * from "./input";
17
+ export * from "./item";
16
18
  export * from "./link";
17
19
  export * from "./list";
18
20
  export * from "./menu";
@@ -0,0 +1,18 @@
1
+ import { createContext, useContext } from "react";
2
+ import type { ItemState, ItemStyles } from "./types";
3
+
4
+ export interface ItemContext {
5
+ state: ItemState;
6
+ styles?: ItemStyles;
7
+ size: "default" | "sm" | "xs";
8
+ }
9
+
10
+ export const ItemContext = createContext<ItemContext | undefined>(undefined);
11
+
12
+ export const useItem = () => {
13
+ const context = useContext(ItemContext);
14
+ if (!context) {
15
+ throw new Error("useItem must be used within an Item.Root");
16
+ }
17
+ return context;
18
+ };
@@ -0,0 +1,23 @@
1
+ import { ItemActions } from "./item-actions";
2
+ import { ItemContent } from "./item-content";
3
+ import { ItemDescription } from "./item-description";
4
+ import { ItemMedia } from "./item-media";
5
+ import { ItemRoot } from "./item-root";
6
+ import { ItemTitle } from "./item-title";
7
+
8
+ export const Item = {
9
+ Root: ItemRoot,
10
+ Media: ItemMedia,
11
+ Content: ItemContent,
12
+ Title: ItemTitle,
13
+ Description: ItemDescription,
14
+ Actions: ItemActions,
15
+ };
16
+
17
+ export type { ItemRootProps } from "./item-root";
18
+ export type { ItemMediaProps } from "./item-media";
19
+ export type { ItemContentProps } from "./item-content";
20
+ export type { ItemTitleProps } from "./item-title";
21
+ export type { ItemDescriptionProps } from "./item-description";
22
+ export type { ItemActionsProps } from "./item-actions";
23
+ export type { ItemStyles } from "./types";
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useItem } from "./context";
6
+
7
+ export interface ItemActionsProps {
8
+ children?: React.ReactNode;
9
+
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+
13
+ export function ItemActions(props: PropsWithRender<ItemActionsProps>) {
14
+ const item = useItem();
15
+
16
+ const composedStyle = calculateComposedStyles(item.styles, item.state, "actions", props.style);
17
+
18
+ const Component = props.render ?? View;
19
+ return <Component {...props} style={composedStyle} />;
20
+ }
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useItem } from "./context";
6
+
7
+ export interface ItemContentProps {
8
+ children?: React.ReactNode;
9
+
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+
13
+ export function ItemContent(props: PropsWithRender<ItemContentProps>) {
14
+ const item = useItem();
15
+
16
+ const composedStyle = calculateComposedStyles(item.styles, item.state, "content", props.style);
17
+
18
+ const Component = props.render ?? View;
19
+ return <Component {...props} style={composedStyle} />;
20
+ }
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { type StyleProp, Text, type TextStyle } from "react-native";
3
+ import type { TextChildren } from "../../types/element.types";
4
+ import type { PropsWithRender } from "../../types/props.types";
5
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
6
+ import { useItem } from "./context";
7
+
8
+ export interface ItemDescriptionProps {
9
+ children?: TextChildren;
10
+ numberOfLines?: number;
11
+
12
+ style?: StyleProp<TextStyle>;
13
+ }
14
+
15
+ export function ItemDescription(props: PropsWithRender<ItemDescriptionProps>) {
16
+ const item = useItem();
17
+
18
+ const composedStyle = calculateComposedStyles(
19
+ item.styles,
20
+ item.state,
21
+ "description",
22
+ props.style,
23
+ );
24
+
25
+ const Component = props.render ?? Text;
26
+ return <Component {...props} style={composedStyle} />;
27
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import type { PropsWithRender } from "../../types/props.types";
4
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
5
+ import { useItem } from "./context";
6
+
7
+ export interface ItemMediaProps {
8
+ variant?: "default" | "icon";
9
+ children?: React.ReactNode;
10
+
11
+ style?: StyleProp<ViewStyle>;
12
+ }
13
+
14
+ export function ItemMedia(props: PropsWithRender<ItemMediaProps>) {
15
+ const item = useItem();
16
+
17
+ const styleKey = props.variant === "icon" ? "mediaIcon" : "media";
18
+ const composedStyle = calculateComposedStyles(item.styles, item.state, styleKey, props.style);
19
+
20
+ const Component = props.render ?? View;
21
+ return <Component {...props} style={composedStyle} />;
22
+ }
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useComponentConfig } from "../../themes/provider";
4
+ import type { PropsWithRender } from "../../types/props.types";
5
+ import { calculateComposedStyles, mergeStyles } from "../../utils/calculate-styles";
6
+ import { ItemContext } from "./context";
7
+ import { ItemVariants } from "./variants";
8
+
9
+ export interface ItemRootProps {
10
+ variant?: keyof typeof ItemVariants;
11
+ size?: "default" | "sm" | "xs";
12
+ children?: React.ReactNode;
13
+
14
+ style?: StyleProp<ViewStyle>;
15
+ }
16
+
17
+ export function ItemRoot(props: PropsWithRender<ItemRootProps>) {
18
+ const size = props.size ?? "default";
19
+ const variantStyles = ItemVariants[props.variant || "default"](size);
20
+ const componentConfig = useComponentConfig("item");
21
+
22
+ const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
23
+
24
+ const composedStyle = calculateComposedStyles(mergedStyles, "default", "root", props.style);
25
+
26
+ const Component = props.render ?? View;
27
+ return (
28
+ <ItemContext.Provider
29
+ value={{
30
+ state: "default",
31
+ styles: mergedStyles,
32
+ size,
33
+ }}
34
+ >
35
+ <Component {...props} style={composedStyle} />
36
+ </ItemContext.Provider>
37
+ );
38
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { type StyleProp, Text, type TextStyle } from "react-native";
3
+ import type { TextChildren } from "../../types/element.types";
4
+ import type { PropsWithRender } from "../../types/props.types";
5
+ import { calculateComposedStyles } from "../../utils/calculate-styles";
6
+ import { useItem } from "./context";
7
+
8
+ export interface ItemTitleProps {
9
+ children?: TextChildren;
10
+ numberOfLines?: number;
11
+
12
+ style?: StyleProp<TextStyle>;
13
+ }
14
+
15
+ export function ItemTitle(props: PropsWithRender<ItemTitleProps>) {
16
+ const item = useItem();
17
+
18
+ const composedStyle = calculateComposedStyles(item.styles, item.state, "title", props.style);
19
+
20
+ const Component = props.render ?? Text;
21
+ return <Component {...props} style={composedStyle} />;
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { ItemRootProps } from "./item-root";
2
+ import type { ItemMediaProps } from "./item-media";
3
+ import type { ItemContentProps } from "./item-content";
4
+ import type { ItemTitleProps } from "./item-title";
5
+ import type { ItemDescriptionProps } from "./item-description";
6
+ import type { ItemActionsProps } from "./item-actions";
7
+
8
+ export type ItemState = "default";
9
+
10
+ export interface ItemStyles {
11
+ root?: Partial<Record<ItemState, ItemRootProps["style"]>>;
12
+ media?: Partial<Record<ItemState, ItemMediaProps["style"]>>;
13
+ mediaIcon?: Partial<Record<ItemState, ItemMediaProps["style"]>>;
14
+ content?: Partial<Record<ItemState, ItemContentProps["style"]>>;
15
+ title?: Partial<Record<ItemState, ItemTitleProps["style"]>>;
16
+ description?: Partial<Record<ItemState, ItemDescriptionProps["style"]>>;
17
+ actions?: Partial<Record<ItemState, ItemActionsProps["style"]>>;
18
+ }
@@ -0,0 +1,71 @@
1
+ import { useThemedStyles } from "../../../utils/use-themed-styles";
2
+ import type { ItemStyles } from "../types";
3
+
4
+ const sizeConfig = {
5
+ default: { padding: 12, gap: 12, iconBox: 40, fontSize: 1, descFontSize: 0.875 },
6
+ sm: { padding: 8, gap: 10, iconBox: 32, fontSize: 0.875, descFontSize: 0.8125 },
7
+ xs: { padding: 6, gap: 8, iconBox: 28, fontSize: 0.8125, descFontSize: 0.75 },
8
+ } as const;
9
+
10
+ export function useItemVariantDefault(size: "default" | "sm" | "xs" = "default"): ItemStyles {
11
+ const s = sizeConfig[size];
12
+
13
+ return useThemedStyles(
14
+ ({ colors, radius, fontFamily, fontSize }): ItemStyles => ({
15
+ root: {
16
+ default: {
17
+ flexDirection: "row",
18
+ alignItems: "center",
19
+ padding: s.padding,
20
+ gap: s.gap,
21
+ },
22
+ },
23
+ media: {
24
+ default: {
25
+ alignItems: "center",
26
+ justifyContent: "center",
27
+ },
28
+ },
29
+ mediaIcon: {
30
+ default: {
31
+ width: s.iconBox,
32
+ height: s.iconBox,
33
+ borderRadius: radius,
34
+ backgroundColor: colors.muted,
35
+ alignItems: "center",
36
+ justifyContent: "center",
37
+ },
38
+ },
39
+ content: {
40
+ default: {
41
+ flex: 1,
42
+ gap: 2,
43
+ },
44
+ },
45
+ title: {
46
+ default: {
47
+ fontFamily,
48
+ fontSize: fontSize * s.fontSize,
49
+ lineHeight: Math.round(fontSize * s.fontSize * 1.3),
50
+ fontWeight: "500",
51
+ color: colors.foreground,
52
+ },
53
+ },
54
+ description: {
55
+ default: {
56
+ fontFamily,
57
+ fontSize: fontSize * s.descFontSize,
58
+ lineHeight: Math.round(fontSize * s.descFontSize * 1.4),
59
+ color: colors.mutedForeground,
60
+ },
61
+ },
62
+ actions: {
63
+ default: {
64
+ flexDirection: "row",
65
+ alignItems: "center",
66
+ gap: 8,
67
+ },
68
+ },
69
+ }),
70
+ );
71
+ }
@@ -0,0 +1,9 @@
1
+ import { useItemVariantDefault } from "./default";
2
+ import { useItemVariantMuted } from "./muted";
3
+ import { useItemVariantOutline } from "./outline";
4
+
5
+ export const ItemVariants = {
6
+ default: useItemVariantDefault,
7
+ outline: useItemVariantOutline,
8
+ muted: useItemVariantMuted,
9
+ };