@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.
- package/dist/module/components/description-list/context.js +12 -0
- package/dist/module/components/description-list/context.js.map +1 -0
- package/dist/module/components/description-list/description-list-actions.js +17 -0
- package/dist/module/components/description-list/description-list-actions.js.map +1 -0
- package/dist/module/components/description-list/description-list-details.js +17 -0
- package/dist/module/components/description-list/description-list-details.js.map +1 -0
- package/dist/module/components/description-list/description-list-item.js +17 -0
- package/dist/module/components/description-list/description-list-item.js.map +1 -0
- package/dist/module/components/description-list/description-list-root.js +27 -0
- package/dist/module/components/description-list/description-list-root.js.map +1 -0
- package/dist/module/components/description-list/description-list-term.js +17 -0
- package/dist/module/components/description-list/description-list-term.js.map +1 -0
- package/dist/module/components/description-list/index.js +15 -0
- package/dist/module/components/description-list/index.js.map +1 -0
- package/dist/module/components/description-list/types.js +4 -0
- package/dist/module/components/description-list/types.js.map +1 -0
- package/dist/module/components/description-list/variants/default.js +53 -0
- package/dist/module/components/description-list/variants/default.js.map +1 -0
- package/dist/module/components/description-list/variants/index.js +7 -0
- package/dist/module/components/description-list/variants/index.js.map +1 -0
- package/dist/module/components/index.js +2 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/item/context.js +12 -0
- package/dist/module/components/item/context.js.map +1 -0
- package/dist/module/components/item/index.js +17 -0
- package/dist/module/components/item/index.js.map +1 -0
- package/dist/module/components/item/item-actions.js +17 -0
- package/dist/module/components/item/item-actions.js.map +1 -0
- package/dist/module/components/item/item-content.js +17 -0
- package/dist/module/components/item/item-content.js.map +1 -0
- package/dist/module/components/item/item-description.js +17 -0
- package/dist/module/components/item/item-description.js.map +1 -0
- package/dist/module/components/item/item-media.js +18 -0
- package/dist/module/components/item/item-media.js.map +1 -0
- package/dist/module/components/item/item-root.js +29 -0
- package/dist/module/components/item/item-root.js.map +1 -0
- package/dist/module/components/item/item-title.js +17 -0
- package/dist/module/components/item/item-title.js.map +1 -0
- package/dist/module/components/item/types.js +4 -0
- package/dist/module/components/item/types.js.map +1 -0
- package/dist/module/components/item/variants/default.js +91 -0
- package/dist/module/components/item/variants/default.js.map +1 -0
- package/dist/module/components/item/variants/index.js +11 -0
- package/dist/module/components/item/variants/index.js.map +1 -0
- package/dist/module/components/item/variants/muted.js +93 -0
- package/dist/module/components/item/variants/muted.js.map +1 -0
- package/dist/module/components/item/variants/outline.js +94 -0
- package/dist/module/components/item/variants/outline.js.map +1 -0
- package/dist/typescript/src/components/description-list/context.d.ts +8 -0
- package/dist/typescript/src/components/description-list/context.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/description-list-actions.d.ts +9 -0
- package/dist/typescript/src/components/description-list/description-list-actions.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/description-list-details.d.ts +9 -0
- package/dist/typescript/src/components/description-list/description-list-details.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/description-list-item.d.ts +9 -0
- package/dist/typescript/src/components/description-list/description-list-item.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/description-list-root.d.ts +11 -0
- package/dist/typescript/src/components/description-list/description-list-root.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/description-list-term.d.ts +10 -0
- package/dist/typescript/src/components/description-list/description-list-term.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/index.d.ts +19 -0
- package/dist/typescript/src/components/description-list/index.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/types.d.ts +14 -0
- package/dist/typescript/src/components/description-list/types.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/description-list/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/description-list/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/description-list/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/index.d.ts +2 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -1
- package/dist/typescript/src/components/item/context.d.ts +9 -0
- package/dist/typescript/src/components/item/context.d.ts.map +1 -0
- package/dist/typescript/src/components/item/index.d.ts +22 -0
- package/dist/typescript/src/components/item/index.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-actions.d.ts +9 -0
- package/dist/typescript/src/components/item/item-actions.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-content.d.ts +9 -0
- package/dist/typescript/src/components/item/item-content.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-description.d.ts +11 -0
- package/dist/typescript/src/components/item/item-description.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-media.d.ts +10 -0
- package/dist/typescript/src/components/item/item-media.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-root.d.ts +12 -0
- package/dist/typescript/src/components/item/item-root.d.ts.map +1 -0
- package/dist/typescript/src/components/item/item-title.d.ts +11 -0
- package/dist/typescript/src/components/item/item-title.d.ts.map +1 -0
- package/dist/typescript/src/components/item/types.d.ts +17 -0
- package/dist/typescript/src/components/item/types.d.ts.map +1 -0
- package/dist/typescript/src/components/item/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/item/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/item/variants/index.d.ts +9 -0
- package/dist/typescript/src/components/item/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/item/variants/muted.d.ts +3 -0
- package/dist/typescript/src/components/item/variants/muted.d.ts.map +1 -0
- package/dist/typescript/src/components/item/variants/outline.d.ts +3 -0
- package/dist/typescript/src/components/item/variants/outline.d.ts.map +1 -0
- package/dist/typescript/src/themes/types.d.ts +8 -0
- package/dist/typescript/src/themes/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/description-list/context.ts +17 -0
- package/src/components/description-list/description-list-actions.tsx +20 -0
- package/src/components/description-list/description-list-details.tsx +20 -0
- package/src/components/description-list/description-list-item.tsx +20 -0
- package/src/components/description-list/description-list-root.tsx +35 -0
- package/src/components/description-list/description-list-term.tsx +21 -0
- package/src/components/description-list/index.ts +20 -0
- package/src/components/description-list/types.ts +15 -0
- package/src/components/description-list/variants/default.tsx +50 -0
- package/src/components/description-list/variants/index.ts +5 -0
- package/src/components/index.ts +2 -0
- package/src/components/item/context.ts +18 -0
- package/src/components/item/index.ts +23 -0
- package/src/components/item/item-actions.tsx +20 -0
- package/src/components/item/item-content.tsx +20 -0
- package/src/components/item/item-description.tsx +27 -0
- package/src/components/item/item-media.tsx +22 -0
- package/src/components/item/item-root.tsx +38 -0
- package/src/components/item/item-title.tsx +22 -0
- package/src/components/item/types.ts +18 -0
- package/src/components/item/variants/default.tsx +71 -0
- package/src/components/item/variants/index.ts +9 -0
- package/src/components/item/variants/muted.tsx +73 -0
- package/src/components/item/variants/outline.tsx +74 -0
- package/src/themes/types.ts +8 -0
|
@@ -0,0 +1,73 @@
|
|
|
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 useItemVariantMuted(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
|
+
borderRadius: radius,
|
|
22
|
+
backgroundColor: colors.muted,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
media: {
|
|
26
|
+
default: {
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
mediaIcon: {
|
|
32
|
+
default: {
|
|
33
|
+
width: s.iconBox,
|
|
34
|
+
height: s.iconBox,
|
|
35
|
+
borderRadius: radius,
|
|
36
|
+
backgroundColor: colors.background,
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
content: {
|
|
42
|
+
default: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
gap: 2,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
default: {
|
|
49
|
+
fontFamily,
|
|
50
|
+
fontSize: fontSize * s.fontSize,
|
|
51
|
+
lineHeight: Math.round(fontSize * s.fontSize * 1.3),
|
|
52
|
+
fontWeight: "500",
|
|
53
|
+
color: colors.foreground,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
default: {
|
|
58
|
+
fontFamily,
|
|
59
|
+
fontSize: fontSize * s.descFontSize,
|
|
60
|
+
lineHeight: Math.round(fontSize * s.descFontSize * 1.4),
|
|
61
|
+
color: colors.mutedForeground,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
default: {
|
|
66
|
+
flexDirection: "row",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
gap: 8,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 useItemVariantOutline(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
|
+
borderWidth: 1,
|
|
22
|
+
borderColor: colors.border,
|
|
23
|
+
borderRadius: radius,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
media: {
|
|
27
|
+
default: {
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
mediaIcon: {
|
|
33
|
+
default: {
|
|
34
|
+
width: s.iconBox,
|
|
35
|
+
height: s.iconBox,
|
|
36
|
+
borderRadius: radius,
|
|
37
|
+
backgroundColor: colors.muted,
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
content: {
|
|
43
|
+
default: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
gap: 2,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
default: {
|
|
50
|
+
fontFamily,
|
|
51
|
+
fontSize: fontSize * s.fontSize,
|
|
52
|
+
lineHeight: Math.round(fontSize * s.fontSize * 1.3),
|
|
53
|
+
fontWeight: "500",
|
|
54
|
+
color: colors.foreground,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
description: {
|
|
58
|
+
default: {
|
|
59
|
+
fontFamily,
|
|
60
|
+
fontSize: fontSize * s.descFontSize,
|
|
61
|
+
lineHeight: Math.round(fontSize * s.descFontSize * 1.4),
|
|
62
|
+
color: colors.mutedForeground,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
actions: {
|
|
66
|
+
default: {
|
|
67
|
+
flexDirection: "row",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
gap: 8,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
}
|
package/src/themes/types.ts
CHANGED
|
@@ -49,10 +49,12 @@ import type { WeekCalendarStyles } from "../components/calendar/week-calendar/ty
|
|
|
49
49
|
import type { CardStyles } from "../components/card/types";
|
|
50
50
|
import type { CheckboxStyles } from "../components/checkbox/types";
|
|
51
51
|
import type { ComboboxStyles } from "../components/combobox/types";
|
|
52
|
+
import type { DescriptionListStyles } from "../components/description-list/types";
|
|
52
53
|
import type { EmptyStyles } from "../components/empty/types";
|
|
53
54
|
import type { FieldStyles } from "../components/field/types";
|
|
54
55
|
import type { IconButtonStyles } from "../components/icon-button/types";
|
|
55
56
|
import type { InputStyles } from "../components/input/types";
|
|
57
|
+
import type { ItemStyles } from "../components/item/types";
|
|
56
58
|
import type { LinkStyles } from "../components/link";
|
|
57
59
|
import type { MenuStyles } from "../components/menu/types";
|
|
58
60
|
import type { PhoneInputStyles } from "../components/phone-input/types";
|
|
@@ -104,6 +106,9 @@ export interface ComponentsConfig {
|
|
|
104
106
|
combobox?: {
|
|
105
107
|
styles?: ComboboxStyles;
|
|
106
108
|
};
|
|
109
|
+
descriptionList?: {
|
|
110
|
+
styles?: DescriptionListStyles;
|
|
111
|
+
};
|
|
107
112
|
empty?: {
|
|
108
113
|
styles?: EmptyStyles;
|
|
109
114
|
};
|
|
@@ -116,6 +121,9 @@ export interface ComponentsConfig {
|
|
|
116
121
|
input?: {
|
|
117
122
|
styles?: InputStyles;
|
|
118
123
|
};
|
|
124
|
+
item?: {
|
|
125
|
+
styles?: ItemStyles;
|
|
126
|
+
};
|
|
119
127
|
link?: {
|
|
120
128
|
styles?: LinkStyles;
|
|
121
129
|
};
|