@elaraai/east-ui 0.0.1-beta.3 → 0.0.1-beta.5
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/README.md +3 -2
- package/dist/src/buttons/button/index.d.ts +57 -0
- package/dist/src/buttons/button/index.d.ts.map +1 -1
- package/dist/src/buttons/button/index.js +57 -0
- package/dist/src/buttons/button/index.js.map +1 -1
- package/dist/src/buttons/icon-button/index.d.ts +62 -0
- package/dist/src/buttons/icon-button/index.d.ts.map +1 -1
- package/dist/src/buttons/icon-button/index.js +62 -0
- package/dist/src/buttons/icon-button/index.js.map +1 -1
- package/dist/src/charts/index.d.ts +603 -18
- package/dist/src/charts/index.d.ts.map +1 -1
- package/dist/src/charts/index.js +603 -20
- package/dist/src/charts/index.js.map +1 -1
- package/dist/src/charts/sparkline/index.d.ts +47 -0
- package/dist/src/charts/sparkline/index.d.ts.map +1 -1
- package/dist/src/charts/sparkline/index.js +47 -0
- package/dist/src/charts/sparkline/index.js.map +1 -1
- package/dist/src/collections/data-list/index.d.ts +89 -0
- package/dist/src/collections/data-list/index.d.ts.map +1 -1
- package/dist/src/collections/data-list/index.js +89 -0
- package/dist/src/collections/data-list/index.js.map +1 -1
- package/dist/src/collections/gantt/index.d.ts +692 -4
- package/dist/src/collections/gantt/index.d.ts.map +1 -1
- package/dist/src/collections/gantt/index.js +177 -4
- package/dist/src/collections/gantt/index.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +511 -0
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +99 -0
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/collections/tree-view/index.d.ts +170 -0
- package/dist/src/collections/tree-view/index.d.ts.map +1 -1
- package/dist/src/collections/tree-view/index.js +170 -0
- package/dist/src/collections/tree-view/index.js.map +1 -1
- package/dist/src/component.d.ts +103 -0
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +15 -1
- package/dist/src/component.js.map +1 -1
- package/dist/src/container/card/index.d.ts +266 -0
- package/dist/src/container/card/index.d.ts.map +1 -1
- package/dist/src/container/card/index.js +60 -0
- package/dist/src/container/card/index.js.map +1 -1
- package/dist/src/disclosure/accordion/index.d.ts +495 -0
- package/dist/src/disclosure/accordion/index.d.ts.map +1 -1
- package/dist/src/disclosure/accordion/index.js +83 -0
- package/dist/src/disclosure/accordion/index.js.map +1 -1
- package/dist/src/disclosure/carousel/index.d.ts +266 -4
- package/dist/src/disclosure/carousel/index.d.ts.map +1 -1
- package/dist/src/disclosure/carousel/index.js +60 -4
- package/dist/src/disclosure/carousel/index.js.map +1 -1
- package/dist/src/disclosure/tabs/index.d.ts +591 -0
- package/dist/src/disclosure/tabs/index.d.ts.map +1 -1
- package/dist/src/disclosure/tabs/index.js +179 -0
- package/dist/src/disclosure/tabs/index.js.map +1 -1
- package/dist/src/display/avatar/index.d.ts +35 -0
- package/dist/src/display/avatar/index.d.ts.map +1 -1
- package/dist/src/display/avatar/index.js +35 -0
- package/dist/src/display/avatar/index.js.map +1 -1
- package/dist/src/display/badge/index.d.ts +35 -0
- package/dist/src/display/badge/index.d.ts.map +1 -1
- package/dist/src/display/badge/index.js +35 -0
- package/dist/src/display/badge/index.js.map +1 -1
- package/dist/src/display/icon/index.d.ts +78 -6
- package/dist/src/display/icon/index.d.ts.map +1 -1
- package/dist/src/display/icon/index.js +78 -6
- package/dist/src/display/icon/index.js.map +1 -1
- package/dist/src/display/stat/index.d.ts +67 -2
- package/dist/src/display/stat/index.d.ts.map +1 -1
- package/dist/src/display/stat/index.js +68 -3
- package/dist/src/display/stat/index.js.map +1 -1
- package/dist/src/display/tag/index.d.ts +48 -0
- package/dist/src/display/tag/index.d.ts.map +1 -1
- package/dist/src/display/tag/index.js +48 -0
- package/dist/src/display/tag/index.js.map +1 -1
- package/dist/src/feedback/alert/index.d.ts +64 -0
- package/dist/src/feedback/alert/index.d.ts.map +1 -1
- package/dist/src/feedback/alert/index.js +64 -0
- package/dist/src/feedback/alert/index.js.map +1 -1
- package/dist/src/feedback/progress/index.d.ts +54 -0
- package/dist/src/feedback/progress/index.d.ts.map +1 -1
- package/dist/src/feedback/progress/index.js +54 -0
- package/dist/src/feedback/progress/index.js.map +1 -1
- package/dist/src/forms/checkbox/index.d.ts +38 -0
- package/dist/src/forms/checkbox/index.d.ts.map +1 -1
- package/dist/src/forms/checkbox/index.js +38 -0
- package/dist/src/forms/checkbox/index.js.map +1 -1
- package/dist/src/forms/field/index.d.ts +248 -0
- package/dist/src/forms/field/index.d.ts.map +1 -1
- package/dist/src/forms/field/index.js +42 -0
- package/dist/src/forms/field/index.js.map +1 -1
- package/dist/src/forms/fieldset/index.d.ts +30 -3
- package/dist/src/forms/fieldset/index.d.ts.map +1 -1
- package/dist/src/forms/fieldset/index.js +30 -3
- package/dist/src/forms/fieldset/index.js.map +1 -1
- package/dist/src/forms/file-upload/index.d.ts +48 -4
- package/dist/src/forms/file-upload/index.d.ts.map +1 -1
- package/dist/src/forms/file-upload/index.js +48 -4
- package/dist/src/forms/file-upload/index.js.map +1 -1
- package/dist/src/forms/input/index.d.ts +93 -14
- package/dist/src/forms/input/index.d.ts.map +1 -1
- package/dist/src/forms/input/index.js +93 -14
- package/dist/src/forms/input/index.js.map +1 -1
- package/dist/src/forms/select/index.d.ts +10 -6
- package/dist/src/forms/select/index.d.ts.map +1 -1
- package/dist/src/forms/select/index.js +10 -6
- package/dist/src/forms/select/index.js.map +1 -1
- package/dist/src/forms/slider/index.d.ts +15 -0
- package/dist/src/forms/slider/index.d.ts.map +1 -1
- package/dist/src/forms/slider/index.js +15 -0
- package/dist/src/forms/slider/index.js.map +1 -1
- package/dist/src/forms/switch/index.d.ts +20 -0
- package/dist/src/forms/switch/index.d.ts.map +1 -1
- package/dist/src/forms/switch/index.js +20 -0
- package/dist/src/forms/switch/index.js.map +1 -1
- package/dist/src/forms/tags-input/index.d.ts +33 -4
- package/dist/src/forms/tags-input/index.d.ts.map +1 -1
- package/dist/src/forms/tags-input/index.js +33 -4
- package/dist/src/forms/tags-input/index.js.map +1 -1
- package/dist/src/forms/textarea/index.d.ts +36 -4
- package/dist/src/forms/textarea/index.d.ts.map +1 -1
- package/dist/src/forms/textarea/index.js +36 -4
- package/dist/src/forms/textarea/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/layout/box/index.d.ts +341 -0
- package/dist/src/layout/box/index.d.ts.map +1 -1
- package/dist/src/layout/box/index.js +135 -0
- package/dist/src/layout/box/index.js.map +1 -1
- package/dist/src/layout/grid/index.d.ts +515 -0
- package/dist/src/layout/grid/index.d.ts.map +1 -1
- package/dist/src/layout/grid/index.js +103 -0
- package/dist/src/layout/grid/index.js.map +1 -1
- package/dist/src/layout/separator/index.d.ts +41 -0
- package/dist/src/layout/separator/index.d.ts.map +1 -1
- package/dist/src/layout/separator/index.js +41 -0
- package/dist/src/layout/separator/index.js.map +1 -1
- package/dist/src/layout/splitter/index.d.ts +504 -0
- package/dist/src/layout/splitter/index.d.ts.map +1 -1
- package/dist/src/layout/splitter/index.js +92 -0
- package/dist/src/layout/splitter/index.js.map +1 -1
- package/dist/src/layout/stack/index.d.ts +364 -0
- package/dist/src/layout/stack/index.d.ts.map +1 -1
- package/dist/src/layout/stack/index.js +158 -0
- package/dist/src/layout/stack/index.js.map +1 -1
- package/dist/src/overlays/action-bar/index.d.ts +105 -0
- package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
- package/dist/src/overlays/action-bar/index.js +105 -0
- package/dist/src/overlays/action-bar/index.js.map +1 -1
- package/dist/src/overlays/dialog/index.d.ts +500 -0
- package/dist/src/overlays/dialog/index.d.ts.map +1 -1
- package/dist/src/overlays/dialog/index.js +88 -0
- package/dist/src/overlays/dialog/index.js.map +1 -1
- package/dist/src/overlays/drawer/index.d.ts +476 -0
- package/dist/src/overlays/drawer/index.d.ts.map +1 -1
- package/dist/src/overlays/drawer/index.js +64 -0
- package/dist/src/overlays/drawer/index.js.map +1 -1
- package/dist/src/overlays/hover-card/index.d.ts +489 -0
- package/dist/src/overlays/hover-card/index.d.ts.map +1 -1
- package/dist/src/overlays/hover-card/index.js +77 -0
- package/dist/src/overlays/hover-card/index.js.map +1 -1
- package/dist/src/overlays/menu/index.d.ts +338 -8
- package/dist/src/overlays/menu/index.d.ts.map +1 -1
- package/dist/src/overlays/menu/index.js +132 -8
- package/dist/src/overlays/menu/index.js.map +1 -1
- package/dist/src/overlays/popover/index.d.ts +496 -0
- package/dist/src/overlays/popover/index.d.ts.map +1 -1
- package/dist/src/overlays/popover/index.js +84 -0
- package/dist/src/overlays/popover/index.js.map +1 -1
- package/dist/src/overlays/toggle-tip/index.d.ts +273 -0
- package/dist/src/overlays/toggle-tip/index.d.ts.map +1 -1
- package/dist/src/overlays/toggle-tip/index.js +67 -0
- package/dist/src/overlays/toggle-tip/index.js.map +1 -1
- package/dist/src/overlays/tooltip/index.d.ts +284 -0
- package/dist/src/overlays/tooltip/index.d.ts.map +1 -1
- package/dist/src/overlays/tooltip/index.js +78 -0
- package/dist/src/overlays/tooltip/index.js.map +1 -1
- package/dist/src/typography/code/index.d.ts +61 -0
- package/dist/src/typography/code/index.d.ts.map +1 -0
- package/dist/src/typography/code/index.js +65 -0
- package/dist/src/typography/code/index.js.map +1 -0
- package/dist/src/typography/code/types.d.ts +56 -0
- package/dist/src/typography/code/types.d.ts.map +1 -0
- package/dist/src/typography/code/types.js +39 -0
- package/dist/src/typography/code/types.js.map +1 -0
- package/dist/src/typography/code-block/index.d.ts +86 -0
- package/dist/src/typography/code-block/index.d.ts.map +1 -0
- package/dist/src/typography/code-block/index.js +78 -0
- package/dist/src/typography/code-block/index.js.map +1 -0
- package/dist/src/typography/code-block/types.d.ts +100 -0
- package/dist/src/typography/code-block/types.d.ts.map +1 -0
- package/dist/src/typography/code-block/types.js +70 -0
- package/dist/src/typography/code-block/types.js.map +1 -0
- package/dist/src/typography/heading/index.d.ts +92 -0
- package/dist/src/typography/heading/index.d.ts.map +1 -0
- package/dist/src/typography/heading/index.js +73 -0
- package/dist/src/typography/heading/index.js.map +1 -0
- package/dist/src/typography/heading/types.d.ts +108 -0
- package/dist/src/typography/heading/types.d.ts.map +1 -0
- package/dist/src/typography/heading/types.js +76 -0
- package/dist/src/typography/heading/types.js.map +1 -0
- package/dist/src/typography/highlight/index.d.ts +48 -0
- package/dist/src/typography/highlight/index.d.ts.map +1 -0
- package/dist/src/typography/highlight/index.js +60 -0
- package/dist/src/typography/highlight/index.js.map +1 -0
- package/dist/src/typography/highlight/types.d.ts +26 -0
- package/dist/src/typography/highlight/types.d.ts.map +1 -0
- package/dist/src/typography/highlight/types.js +21 -0
- package/dist/src/typography/highlight/types.js.map +1 -0
- package/dist/src/typography/index.d.ts +16 -120
- package/dist/src/typography/index.d.ts.map +1 -1
- package/dist/src/typography/index.js +24 -128
- package/dist/src/typography/index.js.map +1 -1
- package/dist/src/typography/link/index.d.ts +56 -0
- package/dist/src/typography/link/index.d.ts.map +1 -0
- package/dist/src/typography/link/index.js +66 -0
- package/dist/src/typography/link/index.js.map +1 -0
- package/dist/src/typography/link/types.d.ts +49 -0
- package/dist/src/typography/link/types.d.ts.map +1 -0
- package/dist/src/typography/link/types.js +38 -0
- package/dist/src/typography/link/types.js.map +1 -0
- package/dist/src/typography/list/index.d.ts +59 -0
- package/dist/src/typography/list/index.d.ts.map +1 -0
- package/dist/src/typography/list/index.js +61 -0
- package/dist/src/typography/list/index.js.map +1 -0
- package/dist/src/typography/list/types.d.ts +47 -0
- package/dist/src/typography/list/types.d.ts.map +1 -0
- package/dist/src/typography/list/types.js +36 -0
- package/dist/src/typography/list/types.js.map +1 -0
- package/dist/src/typography/mark/index.d.ts +57 -0
- package/dist/src/typography/mark/index.d.ts.map +1 -0
- package/dist/src/typography/mark/index.js +58 -0
- package/dist/src/typography/mark/index.js.map +1 -0
- package/dist/src/typography/mark/types.d.ts +49 -0
- package/dist/src/typography/mark/types.d.ts.map +1 -0
- package/dist/src/typography/mark/types.js +38 -0
- package/dist/src/typography/mark/types.js.map +1 -0
- package/dist/src/typography/text/index.d.ts +122 -0
- package/dist/src/typography/text/index.d.ts.map +1 -0
- package/dist/src/typography/text/index.js +130 -0
- package/dist/src/typography/text/index.js.map +1 -0
- package/dist/src/typography/{types.d.ts → text/types.d.ts} +2 -2
- package/dist/src/typography/text/types.d.ts.map +1 -0
- package/dist/src/typography/{types.js → text/types.js} +1 -1
- package/dist/src/typography/text/types.js.map +1 -0
- package/package.json +1 -1
- package/dist/src/typography/types.d.ts.map +0 -1
- package/dist/src/typography/types.js.map +0 -1
|
@@ -2,132 +2,28 @@
|
|
|
2
2
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* const text = Text.Root("Hello");
|
|
30
|
-
*
|
|
31
|
-
* // Styled text with string literals
|
|
32
|
-
* const styledText = Text.Root("World", {
|
|
33
|
-
* color: "blue.500",
|
|
34
|
-
* fontWeight: "bold",
|
|
35
|
-
* textAlign: "center",
|
|
36
|
-
* });
|
|
37
|
-
*
|
|
38
|
-
* // Access the type
|
|
39
|
-
* const textType = Text.Types.Text;
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
function createText(value, style) {
|
|
43
|
-
const fontWeightValue = style?.fontWeight
|
|
44
|
-
? (typeof style.fontWeight === "string"
|
|
45
|
-
? East.value(variant(style.fontWeight, null), FontWeightType)
|
|
46
|
-
: style.fontWeight)
|
|
47
|
-
: undefined;
|
|
48
|
-
const fontStyleValue = style?.fontStyle
|
|
49
|
-
? (typeof style.fontStyle === "string"
|
|
50
|
-
? East.value(variant(style.fontStyle, null), FontStyleType)
|
|
51
|
-
: style.fontStyle)
|
|
52
|
-
: undefined;
|
|
53
|
-
const fontSize = style?.fontSize
|
|
54
|
-
? (typeof style.fontSize === "string"
|
|
55
|
-
? East.value(variant(style.fontSize, null), SizeType)
|
|
56
|
-
: style.fontSize)
|
|
57
|
-
: undefined;
|
|
58
|
-
const textTransformValue = style?.textTransform
|
|
59
|
-
? (typeof style.textTransform === "string"
|
|
60
|
-
? East.value(variant(style.textTransform, null), TextTransformType)
|
|
61
|
-
: style.textTransform)
|
|
62
|
-
: undefined;
|
|
63
|
-
const textAlignValue = style?.textAlign
|
|
64
|
-
? (typeof style.textAlign === "string"
|
|
65
|
-
? East.value(variant(style.textAlign, null), TextAlignType)
|
|
66
|
-
: style.textAlign)
|
|
67
|
-
: undefined;
|
|
68
|
-
const borderWidthValue = style?.borderWidth
|
|
69
|
-
? (typeof style.borderWidth === "string"
|
|
70
|
-
? East.value(variant(style.borderWidth, null), BorderWidthType)
|
|
71
|
-
: style.borderWidth)
|
|
72
|
-
: undefined;
|
|
73
|
-
const borderStyleValue = style?.borderStyle
|
|
74
|
-
? (typeof style.borderStyle === "string"
|
|
75
|
-
? East.value(variant(style.borderStyle, null), BorderStyleType)
|
|
76
|
-
: style.borderStyle)
|
|
77
|
-
: undefined;
|
|
78
|
-
const textOverflowValue = style?.textOverflow
|
|
79
|
-
? (typeof style.textOverflow === "string"
|
|
80
|
-
? East.value(variant(style.textOverflow, null), TextOverflowType)
|
|
81
|
-
: style.textOverflow)
|
|
82
|
-
: undefined;
|
|
83
|
-
const whiteSpaceValue = style?.whiteSpace
|
|
84
|
-
? (typeof style.whiteSpace === "string"
|
|
85
|
-
? East.value(variant(style.whiteSpace, null), WhiteSpaceType)
|
|
86
|
-
: style.whiteSpace)
|
|
87
|
-
: undefined;
|
|
88
|
-
const overflowValue = style?.overflow
|
|
89
|
-
? (typeof style.overflow === "string"
|
|
90
|
-
? East.value(variant(style.overflow, null), OverflowType)
|
|
91
|
-
: style.overflow)
|
|
92
|
-
: undefined;
|
|
93
|
-
return East.value(variant("Text", {
|
|
94
|
-
value: value,
|
|
95
|
-
color: style?.color ? variant("some", style.color) : variant("none", null),
|
|
96
|
-
background: style?.background ? variant("some", style.background) : variant("none", null),
|
|
97
|
-
fontWeight: fontWeightValue ? variant("some", fontWeightValue) : variant("none", null),
|
|
98
|
-
fontStyle: fontStyleValue ? variant("some", fontStyleValue) : variant("none", null),
|
|
99
|
-
fontSize: fontSize ? variant("some", fontSize) : variant("none", null),
|
|
100
|
-
textTransform: textTransformValue ? variant("some", textTransformValue) : variant("none", null),
|
|
101
|
-
textAlign: textAlignValue ? variant("some", textAlignValue) : variant("none", null),
|
|
102
|
-
textOverflow: textOverflowValue ? variant("some", textOverflowValue) : variant("none", null),
|
|
103
|
-
whiteSpace: whiteSpaceValue ? variant("some", whiteSpaceValue) : variant("none", null),
|
|
104
|
-
overflow: overflowValue ? variant("some", overflowValue) : variant("none", null),
|
|
105
|
-
borderWidth: borderWidthValue ? variant("some", borderWidthValue) : variant("none", null),
|
|
106
|
-
borderStyle: borderStyleValue ? variant("some", borderStyleValue) : variant("none", null),
|
|
107
|
-
borderColor: style?.borderColor ? variant("some", style.borderColor) : variant("none", null),
|
|
108
|
-
}), UIComponentType);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Text component for displaying styled text content.
|
|
112
|
-
*
|
|
113
|
-
* @remarks
|
|
114
|
-
* Use `Text.Root(value, style)` to create text, or access `Text.Types.Text` for the East type.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts
|
|
118
|
-
* import { Text } from "@elaraai/east-ui";
|
|
119
|
-
*
|
|
120
|
-
* // Create styled text
|
|
121
|
-
* const text = Text.Root("Hello", { color: "blue.500", fontWeight: "bold" });
|
|
122
|
-
*
|
|
123
|
-
* // Access the type
|
|
124
|
-
* const textType = Text.Types.Text;
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
export const Text = {
|
|
128
|
-
Root: createText,
|
|
129
|
-
Types: {
|
|
130
|
-
Text: TextType,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
5
|
+
// Text
|
|
6
|
+
export { Text } from "./text/index.js";
|
|
7
|
+
export { TextType } from "./text/types.js";
|
|
8
|
+
// Code
|
|
9
|
+
export { Code } from "./code/index.js";
|
|
10
|
+
export { CodeType, CodeVariantType } from "./code/types.js";
|
|
11
|
+
// Heading
|
|
12
|
+
export { Heading } from "./heading/index.js";
|
|
13
|
+
export { HeadingType, HeadingSizeType, HeadingAsType } from "./heading/types.js";
|
|
14
|
+
// Link
|
|
15
|
+
export { Link } from "./link/index.js";
|
|
16
|
+
export { LinkType, LinkVariantType } from "./link/types.js";
|
|
17
|
+
// Highlight
|
|
18
|
+
export { Highlight } from "./highlight/index.js";
|
|
19
|
+
export { HighlightType } from "./highlight/types.js";
|
|
20
|
+
// Mark
|
|
21
|
+
export { Mark } from "./mark/index.js";
|
|
22
|
+
export { MarkType, MarkVariantType } from "./mark/types.js";
|
|
23
|
+
// List
|
|
24
|
+
export { List } from "./list/index.js";
|
|
25
|
+
export { ListType, ListVariantType } from "./list/types.js";
|
|
26
|
+
// CodeBlock
|
|
27
|
+
export { CodeBlock } from "./code-block/index.js";
|
|
28
|
+
export { CodeBlockType } from "./code-block/types.js";
|
|
133
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typography/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typography/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAE3D,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAE5E,UAAU;AACV,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAEpG,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAE5E,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAuB,MAAM,sBAAsB,CAAC;AAE1E,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAE5E,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAE5E,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAuB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type SubtypeExprOrValue, type ExprType, StringType } from "@elaraai/east";
|
|
6
|
+
import { UIComponentType } from "../../component.js";
|
|
7
|
+
import { type LinkStyle } from "./types.js";
|
|
8
|
+
export { LinkType, LinkVariantType, type LinkStyle } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Creates a Link component for navigation.
|
|
11
|
+
*
|
|
12
|
+
* @param value - The link text to display
|
|
13
|
+
* @param href - URL the link points to
|
|
14
|
+
* @param style - Optional styling configuration
|
|
15
|
+
* @returns An East expression representing the link component
|
|
16
|
+
*/
|
|
17
|
+
declare function createLink(value: SubtypeExprOrValue<StringType>, href: SubtypeExprOrValue<StringType>, style?: LinkStyle): ExprType<UIComponentType>;
|
|
18
|
+
/**
|
|
19
|
+
* Link component for accessible navigation.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Use `Link.Root(value, href, style)` to create navigation links.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { East } from "@elaraai/east";
|
|
27
|
+
* import { Link, UIComponentType } from "@elaraai/east-ui";
|
|
28
|
+
*
|
|
29
|
+
* const example = East.function([], UIComponentType, $ => {
|
|
30
|
+
* return Link.Root("Visit our site", "https://example.com", {
|
|
31
|
+
* external: true,
|
|
32
|
+
* colorPalette: "blue",
|
|
33
|
+
* });
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const Link: {
|
|
38
|
+
readonly Root: typeof createLink;
|
|
39
|
+
readonly Types: {
|
|
40
|
+
readonly Link: import("@elaraai/east").StructType<{
|
|
41
|
+
value: StringType;
|
|
42
|
+
href: StringType;
|
|
43
|
+
external: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
44
|
+
variant: import("@elaraai/east").OptionType<import("@elaraai/east").VariantType<{
|
|
45
|
+
underline: import("@elaraai/east").NullType;
|
|
46
|
+
plain: import("@elaraai/east").NullType;
|
|
47
|
+
}>>;
|
|
48
|
+
colorPalette: import("@elaraai/east").OptionType<StringType>;
|
|
49
|
+
}>;
|
|
50
|
+
readonly Variant: import("@elaraai/east").VariantType<{
|
|
51
|
+
underline: import("@elaraai/east").NullType;
|
|
52
|
+
plain: import("@elaraai/east").NullType;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/link/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAEb,UAAU,EAEb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAMvE;;;;;;;GAOG;AACH,iBAAS,UAAU,CACf,KAAK,EAAE,kBAAkB,CAAC,UAAU,CAAC,EACrC,IAAI,EAAE,kBAAkB,CAAC,UAAU,CAAC,EACpC,KAAK,CAAC,EAAE,SAAS,GAClB,QAAQ,CAAC,eAAe,CAAC,CAoB3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;CAMP,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { East, StringType, variant, } from "@elaraai/east";
|
|
6
|
+
import { UIComponentType } from "../../component.js";
|
|
7
|
+
import { LinkType, LinkVariantType } from "./types.js";
|
|
8
|
+
// Re-export types
|
|
9
|
+
export { LinkType, LinkVariantType } from "./types.js";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Link Component
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Creates a Link component for navigation.
|
|
15
|
+
*
|
|
16
|
+
* @param value - The link text to display
|
|
17
|
+
* @param href - URL the link points to
|
|
18
|
+
* @param style - Optional styling configuration
|
|
19
|
+
* @returns An East expression representing the link component
|
|
20
|
+
*/
|
|
21
|
+
function createLink(value, href, style) {
|
|
22
|
+
const variantValue = style?.variant
|
|
23
|
+
? (typeof style.variant === "string"
|
|
24
|
+
? East.value(variant(style.variant, null), LinkVariantType)
|
|
25
|
+
: style.variant)
|
|
26
|
+
: undefined;
|
|
27
|
+
const externalValue = style?.external !== undefined
|
|
28
|
+
? (typeof style.external === "boolean"
|
|
29
|
+
? style.external
|
|
30
|
+
: style.external)
|
|
31
|
+
: undefined;
|
|
32
|
+
return East.value(variant("Link", {
|
|
33
|
+
value: value,
|
|
34
|
+
href: href,
|
|
35
|
+
external: externalValue !== undefined ? variant("some", externalValue) : variant("none", null),
|
|
36
|
+
variant: variantValue ? variant("some", variantValue) : variant("none", null),
|
|
37
|
+
colorPalette: style?.colorPalette ? variant("some", style.colorPalette) : variant("none", null),
|
|
38
|
+
}), UIComponentType);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Link component for accessible navigation.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Use `Link.Root(value, href, style)` to create navigation links.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { East } from "@elaraai/east";
|
|
49
|
+
* import { Link, UIComponentType } from "@elaraai/east-ui";
|
|
50
|
+
*
|
|
51
|
+
* const example = East.function([], UIComponentType, $ => {
|
|
52
|
+
* return Link.Root("Visit our site", "https://example.com", {
|
|
53
|
+
* external: true,
|
|
54
|
+
* colorPalette: "blue",
|
|
55
|
+
* });
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const Link = {
|
|
60
|
+
Root: createLink,
|
|
61
|
+
Types: {
|
|
62
|
+
Link: LinkType,
|
|
63
|
+
Variant: LinkVariantType,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/typography/link/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGH,IAAI,EACJ,UAAU,EACV,OAAO,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AAEvE,kBAAkB;AAClB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AAEvE,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;;;;;;GAOG;AACH,SAAS,UAAU,CACf,KAAqC,EACrC,IAAoC,EACpC,KAAiB;IAEjB,MAAM,YAAY,GAAG,KAAK,EAAE,OAAO;QAC/B,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;YAChC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,eAAe,CAAC;YAC3D,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,aAAa,GAAG,KAAK,EAAE,QAAQ,KAAK,SAAS;QAC/C,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,QAAQ,KAAK,SAAS;YAClC,CAAC,CAAC,KAAK,CAAC,QAAQ;YAChB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;QACrB,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QAC9B,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;QAC9F,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;QAC7E,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;KAClG,CAAC,EAAE,eAAe,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;KAC3B;CACK,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type SubtypeExprOrValue, OptionType, StringType, StructType, VariantType, NullType, BooleanType } from "@elaraai/east";
|
|
6
|
+
/**
|
|
7
|
+
* Link variant type for different link styles.
|
|
8
|
+
*
|
|
9
|
+
* @property underline - Always show underline
|
|
10
|
+
* @property plain - No underline by default
|
|
11
|
+
*/
|
|
12
|
+
export declare const LinkVariantType: VariantType<{
|
|
13
|
+
underline: NullType;
|
|
14
|
+
plain: NullType;
|
|
15
|
+
}>;
|
|
16
|
+
export type LinkVariantType = typeof LinkVariantType;
|
|
17
|
+
export type LinkVariantLiteral = "underline" | "plain";
|
|
18
|
+
/**
|
|
19
|
+
* The concrete East type for Link component data.
|
|
20
|
+
*
|
|
21
|
+
* @property value - The link text to display
|
|
22
|
+
* @property href - URL the link points to
|
|
23
|
+
* @property external - Whether to open in new tab
|
|
24
|
+
* @property variant - Visual style variant
|
|
25
|
+
* @property colorPalette - Color scheme for the link
|
|
26
|
+
*/
|
|
27
|
+
export declare const LinkType: StructType<{
|
|
28
|
+
value: StringType;
|
|
29
|
+
href: StringType;
|
|
30
|
+
external: OptionType<BooleanType>;
|
|
31
|
+
variant: OptionType<VariantType<{
|
|
32
|
+
underline: NullType;
|
|
33
|
+
plain: NullType;
|
|
34
|
+
}>>;
|
|
35
|
+
colorPalette: OptionType<StringType>;
|
|
36
|
+
}>;
|
|
37
|
+
export type LinkType = typeof LinkType;
|
|
38
|
+
/**
|
|
39
|
+
* Style configuration for Link components.
|
|
40
|
+
*/
|
|
41
|
+
export type LinkStyle = {
|
|
42
|
+
/** Whether to open in new tab */
|
|
43
|
+
external?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
44
|
+
/** Visual style variant */
|
|
45
|
+
variant?: SubtypeExprOrValue<LinkVariantType> | LinkVariantLiteral;
|
|
46
|
+
/** Color palette (e.g., "blue", "teal") */
|
|
47
|
+
colorPalette?: SubtypeExprOrValue<StringType>;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/typography/link/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,KAAK,kBAAkB,EACvB,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACd,MAAM,eAAe,CAAC;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;EAG1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,OAAO,CAAC;AAMvD;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;EAMnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AAMvC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;IACrD,2BAA2B;IAC3B,OAAO,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,kBAAkB,CAAC;IACnE,2CAA2C;IAC3C,YAAY,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;CACjD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { OptionType, StringType, StructType, VariantType, NullType, BooleanType, } from "@elaraai/east";
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// Link Variant Type
|
|
8
|
+
// ============================================================================
|
|
9
|
+
/**
|
|
10
|
+
* Link variant type for different link styles.
|
|
11
|
+
*
|
|
12
|
+
* @property underline - Always show underline
|
|
13
|
+
* @property plain - No underline by default
|
|
14
|
+
*/
|
|
15
|
+
export const LinkVariantType = VariantType({
|
|
16
|
+
underline: NullType,
|
|
17
|
+
plain: NullType,
|
|
18
|
+
});
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// Link Type
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* The concrete East type for Link component data.
|
|
24
|
+
*
|
|
25
|
+
* @property value - The link text to display
|
|
26
|
+
* @property href - URL the link points to
|
|
27
|
+
* @property external - Whether to open in new tab
|
|
28
|
+
* @property variant - Visual style variant
|
|
29
|
+
* @property colorPalette - Color scheme for the link
|
|
30
|
+
*/
|
|
31
|
+
export const LinkType = StructType({
|
|
32
|
+
value: StringType,
|
|
33
|
+
href: StringType,
|
|
34
|
+
external: OptionType(BooleanType),
|
|
35
|
+
variant: OptionType(LinkVariantType),
|
|
36
|
+
colorPalette: OptionType(StringType),
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/typography/link/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEH,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,GACd,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACvC,SAAS,EAAE,QAAQ;IACnB,KAAK,EAAE,QAAQ;CAClB,CAAC,CAAC;AAKH,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC/B,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC;IACpC,YAAY,EAAE,UAAU,CAAC,UAAU,CAAC;CACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type SubtypeExprOrValue, type ExprType, StringType, ArrayType } from "@elaraai/east";
|
|
6
|
+
import { UIComponentType } from "../../component.js";
|
|
7
|
+
import { type ListStyle } from "./types.js";
|
|
8
|
+
export { ListType, ListVariantType, type ListStyle } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Creates a List component.
|
|
11
|
+
*
|
|
12
|
+
* @param items - Array of list items (strings or config objects)
|
|
13
|
+
* @param style - Optional styling configuration
|
|
14
|
+
* @returns An East expression representing the list component
|
|
15
|
+
*/
|
|
16
|
+
declare function createList(items: SubtypeExprOrValue<ArrayType<StringType>>, style?: ListStyle): ExprType<UIComponentType>;
|
|
17
|
+
/**
|
|
18
|
+
* List component for ordered and unordered lists.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Use `List.Root(items, style)` to create lists. Items can be simple strings
|
|
22
|
+
* or objects with value and optional icon.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { East } from "@elaraai/east";
|
|
27
|
+
* import { List, UIComponentType } from "@elaraai/east-ui";
|
|
28
|
+
*
|
|
29
|
+
* const example = East.function([], UIComponentType, $ => {
|
|
30
|
+
* return List.Root([
|
|
31
|
+
* "First item",
|
|
32
|
+
* "Second item",
|
|
33
|
+
* { value: "Third item", icon: "check" },
|
|
34
|
+
* ], {
|
|
35
|
+
* variant: "unordered",
|
|
36
|
+
* gap: "2",
|
|
37
|
+
* });
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const List: {
|
|
42
|
+
readonly Root: typeof createList;
|
|
43
|
+
readonly Types: {
|
|
44
|
+
readonly List: import("@elaraai/east").StructType<{
|
|
45
|
+
items: ArrayType<StringType>;
|
|
46
|
+
variant: import("@elaraai/east").OptionType<import("@elaraai/east").VariantType<{
|
|
47
|
+
ordered: import("@elaraai/east").NullType;
|
|
48
|
+
unordered: import("@elaraai/east").NullType;
|
|
49
|
+
}>>;
|
|
50
|
+
gap: import("@elaraai/east").OptionType<StringType>;
|
|
51
|
+
colorPalette: import("@elaraai/east").OptionType<StringType>;
|
|
52
|
+
}>;
|
|
53
|
+
readonly Variant: import("@elaraai/east").VariantType<{
|
|
54
|
+
ordered: import("@elaraai/east").NullType;
|
|
55
|
+
unordered: import("@elaraai/east").NullType;
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/list/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAEb,UAAU,EAEV,SAAS,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;GAMG;AACH,iBAAS,UAAU,CACf,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,EAChD,KAAK,CAAC,EAAE,SAAS,GAClB,QAAQ,CAAC,eAAe,CAAC,CAa3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAMP,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { East, StringType, variant, ArrayType, } from "@elaraai/east";
|
|
6
|
+
import { UIComponentType } from "../../component.js";
|
|
7
|
+
import { ListType, ListVariantType } from "./types.js";
|
|
8
|
+
// Re-export types
|
|
9
|
+
export { ListType, ListVariantType } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Creates a List component.
|
|
12
|
+
*
|
|
13
|
+
* @param items - Array of list items (strings or config objects)
|
|
14
|
+
* @param style - Optional styling configuration
|
|
15
|
+
* @returns An East expression representing the list component
|
|
16
|
+
*/
|
|
17
|
+
function createList(items, style) {
|
|
18
|
+
const variantValue = style?.variant
|
|
19
|
+
? (typeof style.variant === "string"
|
|
20
|
+
? East.value(variant(style.variant, null), ListVariantType)
|
|
21
|
+
: style.variant)
|
|
22
|
+
: undefined;
|
|
23
|
+
return East.value(variant("List", {
|
|
24
|
+
items,
|
|
25
|
+
variant: variantValue ? variant("some", variantValue) : variant("none", null),
|
|
26
|
+
gap: style?.gap ? variant("some", style.gap) : variant("none", null),
|
|
27
|
+
colorPalette: style?.colorPalette ? variant("some", style.colorPalette) : variant("none", null),
|
|
28
|
+
}), UIComponentType);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List component for ordered and unordered lists.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Use `List.Root(items, style)` to create lists. Items can be simple strings
|
|
35
|
+
* or objects with value and optional icon.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { East } from "@elaraai/east";
|
|
40
|
+
* import { List, UIComponentType } from "@elaraai/east-ui";
|
|
41
|
+
*
|
|
42
|
+
* const example = East.function([], UIComponentType, $ => {
|
|
43
|
+
* return List.Root([
|
|
44
|
+
* "First item",
|
|
45
|
+
* "Second item",
|
|
46
|
+
* { value: "Third item", icon: "check" },
|
|
47
|
+
* ], {
|
|
48
|
+
* variant: "unordered",
|
|
49
|
+
* gap: "2",
|
|
50
|
+
* });
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export const List = {
|
|
55
|
+
Root: createList,
|
|
56
|
+
Types: {
|
|
57
|
+
List: ListType,
|
|
58
|
+
Variant: ListVariantType,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/typography/list/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGH,IAAI,EACJ,UAAU,EACV,OAAO,EACP,SAAS,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AAEvE,kBAAkB;AAClB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AAEvE;;;;;;GAMG;AACH,SAAS,UAAU,CACf,KAAgD,EAChD,KAAiB;IAEjB,MAAM,YAAY,GAAG,KAAK,EAAE,OAAO;QAC/B,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;YAChC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,eAAe,CAAC;YAC3D,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QAC9B,KAAK;QACL,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;QAC7E,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;QACpE,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;KAClG,CAAC,EAAE,eAAe,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;KAC3B;CACK,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type SubtypeExprOrValue, OptionType, StringType, StructType, VariantType, NullType, ArrayType } from "@elaraai/east";
|
|
6
|
+
/**
|
|
7
|
+
* List variant type for ordered vs unordered lists.
|
|
8
|
+
*
|
|
9
|
+
* @property ordered - Numbered list (ol)
|
|
10
|
+
* @property unordered - Bulleted list (ul)
|
|
11
|
+
*/
|
|
12
|
+
export declare const ListVariantType: VariantType<{
|
|
13
|
+
ordered: NullType;
|
|
14
|
+
unordered: NullType;
|
|
15
|
+
}>;
|
|
16
|
+
export type ListVariantType = typeof ListVariantType;
|
|
17
|
+
export type ListVariantLiteral = "ordered" | "unordered";
|
|
18
|
+
/**
|
|
19
|
+
* The concrete East type for List component data.
|
|
20
|
+
*
|
|
21
|
+
* @property items - Array of list items
|
|
22
|
+
* @property variant - Ordered or unordered list
|
|
23
|
+
* @property gap - Spacing between items
|
|
24
|
+
* @property colorPalette - Color scheme for list markers
|
|
25
|
+
*/
|
|
26
|
+
export declare const ListType: StructType<{
|
|
27
|
+
items: ArrayType<StringType>;
|
|
28
|
+
variant: OptionType<VariantType<{
|
|
29
|
+
ordered: NullType;
|
|
30
|
+
unordered: NullType;
|
|
31
|
+
}>>;
|
|
32
|
+
gap: OptionType<StringType>;
|
|
33
|
+
colorPalette: OptionType<StringType>;
|
|
34
|
+
}>;
|
|
35
|
+
export type ListType = typeof ListType;
|
|
36
|
+
/**
|
|
37
|
+
* Style configuration for List components.
|
|
38
|
+
*/
|
|
39
|
+
export type ListStyle = {
|
|
40
|
+
/** Ordered or unordered list */
|
|
41
|
+
variant?: SubtypeExprOrValue<ListVariantType> | ListVariantLiteral;
|
|
42
|
+
/** Spacing between items */
|
|
43
|
+
gap?: SubtypeExprOrValue<StringType>;
|
|
44
|
+
/** Color palette for list markers */
|
|
45
|
+
colorPalette?: SubtypeExprOrValue<StringType>;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/typography/list/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,KAAK,kBAAkB,EACvB,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACZ,MAAM,eAAe,CAAC;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;EAG1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,CAAC;AAMzD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;;;;;;EAKnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AAMvC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,gCAAgC;IAChC,OAAO,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,kBAAkB,CAAC;IACnE,4BAA4B;IAC5B,GAAG,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACrC,qCAAqC;IACrC,YAAY,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;CACjD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { OptionType, StringType, StructType, VariantType, NullType, ArrayType, } from "@elaraai/east";
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// List Variant Type
|
|
8
|
+
// ============================================================================
|
|
9
|
+
/**
|
|
10
|
+
* List variant type for ordered vs unordered lists.
|
|
11
|
+
*
|
|
12
|
+
* @property ordered - Numbered list (ol)
|
|
13
|
+
* @property unordered - Bulleted list (ul)
|
|
14
|
+
*/
|
|
15
|
+
export const ListVariantType = VariantType({
|
|
16
|
+
ordered: NullType,
|
|
17
|
+
unordered: NullType,
|
|
18
|
+
});
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// List Type
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* The concrete East type for List component data.
|
|
24
|
+
*
|
|
25
|
+
* @property items - Array of list items
|
|
26
|
+
* @property variant - Ordered or unordered list
|
|
27
|
+
* @property gap - Spacing between items
|
|
28
|
+
* @property colorPalette - Color scheme for list markers
|
|
29
|
+
*/
|
|
30
|
+
export const ListType = StructType({
|
|
31
|
+
items: ArrayType(StringType),
|
|
32
|
+
variant: OptionType(ListVariantType),
|
|
33
|
+
gap: OptionType(StringType),
|
|
34
|
+
colorPalette: OptionType(StringType),
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/typography/list/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEH,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACZ,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACvC,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,QAAQ;CACtB,CAAC,CAAC;AAKH,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC,UAAU,CAAC;IAC5B,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC;IACpC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3B,YAAY,EAAE,UAAU,CAAC,UAAU,CAAC;CACvC,CAAC,CAAC"}
|