@salmonui/layout 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +46 -2
- package/dist/avatar/Avatar.d.ts +57 -0
- package/dist/avatar/Avatar.d.ts.map +1 -0
- package/dist/avatar/Avatar.js +42 -0
- package/dist/avatar/Avatar.js.map +1 -0
- package/dist/avatar/image.d.ts +6 -0
- package/dist/avatar/image.d.ts.map +1 -0
- package/dist/avatar/image.js +24 -0
- package/dist/avatar/image.js.map +1 -0
- package/dist/avatar.css +82 -0
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +8 -0
- package/dist/avatar.js.map +1 -0
- package/dist/card/Card.d.ts +53 -0
- package/dist/card/Card.d.ts.map +1 -0
- package/dist/card/Card.js +52 -0
- package/dist/card/Card.js.map +1 -0
- package/dist/card.css +125 -0
- package/dist/card.d.ts +3 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +8 -0
- package/dist/card.js.map +1 -0
- package/dist/dashboard-layout/DashboardLayout.d.ts +75 -0
- package/dist/dashboard-layout/DashboardLayout.d.ts.map +1 -0
- package/dist/dashboard-layout/DashboardLayout.js +257 -0
- package/dist/dashboard-layout/DashboardLayout.js.map +1 -0
- package/dist/dashboard-layout.css +215 -0
- package/dist/dashboard-layout.d.ts +3 -0
- package/dist/dashboard-layout.d.ts.map +1 -0
- package/dist/dashboard-layout.js +10 -0
- package/dist/dashboard-layout.js.map +1 -0
- package/dist/internal/grid-layout.d.ts +43 -0
- package/dist/internal/grid-layout.d.ts.map +1 -0
- package/dist/internal/grid-layout.js +104 -0
- package/dist/internal/grid-layout.js.map +1 -0
- package/dist/list/List.d.ts +14 -0
- package/dist/list/List.d.ts.map +1 -0
- package/dist/list/List.js +12 -0
- package/dist/list/List.js.map +1 -0
- package/dist/list.css +43 -0
- package/dist/list.d.ts +3 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +6 -0
- package/dist/list.js.map +1 -0
- package/dist/splitter/Splitter.d.ts +63 -0
- package/dist/splitter/Splitter.d.ts.map +1 -0
- package/dist/splitter/Splitter.js +235 -0
- package/dist/splitter/Splitter.js.map +1 -0
- package/dist/splitter.css +71 -0
- package/dist/splitter.d.ts +3 -0
- package/dist/splitter.d.ts.map +1 -0
- package/dist/splitter.js +8 -0
- package/dist/splitter.js.map +1 -0
- package/dist/styles.css +681 -0
- package/dist/timeline/Timeline.d.ts +50 -0
- package/dist/timeline/Timeline.d.ts.map +1 -0
- package/dist/timeline/Timeline.js +28 -0
- package/dist/timeline/Timeline.js.map +1 -0
- package/dist/timeline.css +150 -0
- package/dist/timeline.d.ts +3 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +6 -0
- package/dist/timeline.js.map +1 -0
- package/package.json +66 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type HTMLAttributes, type LiHTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export type TimelineTone = 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
/** One entry of the `items` array. */
|
|
4
|
+
export interface TimelineItemData {
|
|
5
|
+
readonly content?: ReactNode;
|
|
6
|
+
/** Content on the other side of the marker. */
|
|
7
|
+
readonly opposite?: ReactNode;
|
|
8
|
+
/** Replaces the default dot (an icon, an avatar). */
|
|
9
|
+
readonly marker?: ReactNode;
|
|
10
|
+
readonly tone?: TimelineTone | undefined;
|
|
11
|
+
readonly disabled?: boolean | undefined;
|
|
12
|
+
readonly className?: string | undefined;
|
|
13
|
+
/** React key; default the index. */
|
|
14
|
+
readonly key?: string | number | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface TimelineItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'content'> {
|
|
17
|
+
readonly children?: ReactNode;
|
|
18
|
+
readonly opposite?: ReactNode;
|
|
19
|
+
readonly marker?: ReactNode;
|
|
20
|
+
/** Default `'neutral'`. */
|
|
21
|
+
readonly tone?: TimelineTone | undefined;
|
|
22
|
+
/** Muted style and `aria-disabled`. */
|
|
23
|
+
readonly disabled?: boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** One item (`.salmon-timeline-item`): opposite content, the marker with its connector, the content. */
|
|
26
|
+
export declare function TimelineItem(props: TimelineItemProps): ReactElement;
|
|
27
|
+
export interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
|
|
28
|
+
/** Data form of the items; wins over `children`. */
|
|
29
|
+
readonly items?: readonly TimelineItemData[] | undefined;
|
|
30
|
+
/** Renders each `items` entry; default its `content`. */
|
|
31
|
+
readonly renderItem?: ((item: TimelineItemData, state: {
|
|
32
|
+
index: number;
|
|
33
|
+
first: boolean;
|
|
34
|
+
last: boolean;
|
|
35
|
+
}) => ReactNode) | undefined;
|
|
36
|
+
/** `Timeline.Item` children. */
|
|
37
|
+
readonly children?: ReactNode;
|
|
38
|
+
/** Default `'vertical'`. */
|
|
39
|
+
readonly orientation?: 'vertical' | 'horizontal' | undefined;
|
|
40
|
+
/** Side of the content relative to the line: `'end'` (default), `'start'`, `'alternate'`, `'alternateReverse'`; logical, follows `dir`. */
|
|
41
|
+
readonly align?: 'start' | 'end' | 'alternate' | 'alternateReverse' | undefined;
|
|
42
|
+
/** Reverses the DOM order, so reading order matches the visual order. */
|
|
43
|
+
readonly reverse?: boolean | undefined;
|
|
44
|
+
}
|
|
45
|
+
/** Timeline (`.salmon-timeline`, `data-orientation`, `data-align`). */
|
|
46
|
+
export declare function Timeline(props: TimelineProps): ReactElement;
|
|
47
|
+
export declare namespace Timeline {
|
|
48
|
+
export { TimelineItem as Item };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/timeline/Timeline.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,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AgB,CAAC;IACrE,oDAAoD;IACpD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,CAAC;IACzD,yDAAyD;IACzD,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IACnI,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,4BAA4B;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;IAC7D,2IAA2I;IAC3I,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAAC;IAChF,yEAAyE;IACzE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACxC;AAED,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAiB3D;yBAjBe,QAAQ;aAmBR,YAAY"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Timeline: an `<ol>` of `<li>` items,
|
|
3
|
+
// list semantics, no APG pattern. No hooks or context, so it renders in
|
|
4
|
+
// React Server Components. `items` and `Timeline.Item` children produce the
|
|
5
|
+
// same markup.
|
|
6
|
+
import { Children } from 'react';
|
|
7
|
+
const cx = (base, extra) => (extra ? `${base} ${extra}` : base);
|
|
8
|
+
/** One item (`.salmon-timeline-item`): opposite content, the marker with its connector, the content. */
|
|
9
|
+
export function TimelineItem(props) {
|
|
10
|
+
const { children, opposite, marker, tone = 'neutral', disabled, className, ...rest } = props;
|
|
11
|
+
return (_jsxs("li", { ...rest, className: cx('salmon-timeline-item', className), "data-tone": tone, "aria-disabled": disabled || undefined, children: [_jsx("div", { className: "salmon-timeline-opposite", children: opposite }), _jsx("div", { className: "salmon-timeline-marker", "aria-hidden": "true", children: marker ?? _jsx("span", { className: "salmon-timeline-dot" }) }), _jsx("div", { className: "salmon-timeline-content", children: children })] }));
|
|
12
|
+
}
|
|
13
|
+
/** Timeline (`.salmon-timeline`, `data-orientation`, `data-align`). */
|
|
14
|
+
export function Timeline(props) {
|
|
15
|
+
const { items, renderItem, children, orientation = 'vertical', align = 'end', reverse, className, ...rest } = props;
|
|
16
|
+
let list;
|
|
17
|
+
if (items) {
|
|
18
|
+
const n = items.length;
|
|
19
|
+
list = items.map((item, index) => (_jsx(TimelineItem, { opposite: item.opposite, marker: item.marker, tone: item.tone, disabled: item.disabled, className: item.className, children: renderItem ? renderItem(item, { index, first: index === 0, last: index === n - 1 }) : item.content }, item.key ?? index)));
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
list = Children.toArray(children);
|
|
23
|
+
if (reverse)
|
|
24
|
+
list.reverse();
|
|
25
|
+
return (_jsx("ol", { ...rest, className: cx('salmon-timeline', className), "data-orientation": orientation, "data-align": align, children: list }));
|
|
26
|
+
}
|
|
27
|
+
Timeline.Item = TimelineItem;
|
|
28
|
+
//# sourceMappingURL=Timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../src/timeline/Timeline.tsx"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,wEAAwE;AACxE,4EAA4E;AAC5E,eAAe;AAEf,OAAO,EAAE,QAAQ,EAAiF,MAAM,OAAO,CAAC;AAIhH,MAAM,EAAE,GAAG,CAAC,IAAY,EAAE,KAAyB,EAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CA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AE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IADlF,IAAI,CAAC,GAAG,IAAI,KAAK,CAErB,CAChB,CAAC,CAAC;IACL,CAAC;;QAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,OAAO;QAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAC5B,OAAO,CACL,gBAAQ,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,sBAAoB,WAAW,gBAAc,KAAK,YACxG,IAAI,GACF,CACN,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
@layer salmon.a;
|
|
2
|
+
@layer salmon.a {
|
|
3
|
+
/* @salmonui/react/timeline: Timeline and its items. Self-contained; logical properties only.
|
|
4
|
+
The list is a three-column grid (opposite | marker | content) and each
|
|
5
|
+
item a subgrid row of it, so the opposite column is as wide as its widest
|
|
6
|
+
text and the markers line up; the connector is the marker's ::after line
|
|
7
|
+
toward the next item. */
|
|
8
|
+
|
|
9
|
+
.salmon-timeline {
|
|
10
|
+
--salmon-timeline-dot: 12px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: max-content auto minmax(0, 1fr);
|
|
14
|
+
column-gap: var(--salmon-space-3);
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
list-style: none;
|
|
18
|
+
font-family: var(--salmon-font-sans);
|
|
19
|
+
font-size: var(--salmon-font-size-md);
|
|
20
|
+
line-height: var(--salmon-line-height-normal);
|
|
21
|
+
color: var(--salmon-text-primary);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.salmon-timeline-item {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-column: 1 / -1;
|
|
27
|
+
grid-template-columns: subgrid;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.salmon-timeline-opposite,
|
|
31
|
+
.salmon-timeline-content {
|
|
32
|
+
padding-block-end: var(--salmon-space-4);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.salmon-timeline-opposite {
|
|
36
|
+
color: var(--salmon-text-secondary);
|
|
37
|
+
text-align: end;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.salmon-timeline-marker {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
min-inline-size: var(--salmon-timeline-dot);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.salmon-timeline-item:not(:last-child) > .salmon-timeline-marker::after {
|
|
49
|
+
content: '';
|
|
50
|
+
flex: 1 1 auto;
|
|
51
|
+
inline-size: 2px;
|
|
52
|
+
margin-block: var(--salmon-space-1);
|
|
53
|
+
background: var(--salmon-border-default);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.salmon-timeline-dot {
|
|
57
|
+
display: block;
|
|
58
|
+
flex: 0 0 auto;
|
|
59
|
+
inline-size: var(--salmon-timeline-dot);
|
|
60
|
+
block-size: var(--salmon-timeline-dot);
|
|
61
|
+
margin-block-start: 0.35em;
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
background: var(--salmon-text-secondary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.salmon-timeline-item[data-tone='primary'] .salmon-timeline-dot { background: var(--salmon-color-primary); }
|
|
67
|
+
.salmon-timeline-item[data-tone='info'] .salmon-timeline-dot { background: var(--salmon-color-info); }
|
|
68
|
+
.salmon-timeline-item[data-tone='success'] .salmon-timeline-dot { background: var(--salmon-color-success); }
|
|
69
|
+
.salmon-timeline-item[data-tone='warning'] .salmon-timeline-dot { background: var(--salmon-color-warning); }
|
|
70
|
+
.salmon-timeline-item[data-tone='danger'] .salmon-timeline-dot { background: var(--salmon-color-danger); }
|
|
71
|
+
|
|
72
|
+
/* A custom marker (an icon drawn in currentColor) takes the item's tone too. */
|
|
73
|
+
.salmon-timeline-item[data-tone='primary'] > .salmon-timeline-marker { color: var(--salmon-color-primary); }
|
|
74
|
+
.salmon-timeline-item[data-tone='info'] > .salmon-timeline-marker { color: var(--salmon-color-info); }
|
|
75
|
+
.salmon-timeline-item[data-tone='success'] > .salmon-timeline-marker { color: var(--salmon-color-success); }
|
|
76
|
+
.salmon-timeline-item[data-tone='warning'] > .salmon-timeline-marker { color: var(--salmon-color-warning); }
|
|
77
|
+
.salmon-timeline-item[data-tone='danger'] > .salmon-timeline-marker { color: var(--salmon-color-danger); }
|
|
78
|
+
|
|
79
|
+
.salmon-timeline-item[aria-disabled='true'] {
|
|
80
|
+
color: var(--salmon-text-disabled);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.salmon-timeline-item[aria-disabled='true'] .salmon-timeline-dot {
|
|
84
|
+
background: var(--salmon-border-default);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* align: 'end' (default) puts content at the inline end; 'start' mirrors;
|
|
88
|
+
alternate / alternateReverse switch per item and give both sides room. */
|
|
89
|
+
.salmon-timeline[data-align='start'] {
|
|
90
|
+
grid-template-columns: minmax(0, 1fr) auto max-content;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.salmon-timeline[data-align='start'] .salmon-timeline-opposite { order: 3; text-align: start; }
|
|
94
|
+
.salmon-timeline[data-align='start'] .salmon-timeline-content { order: -1; text-align: end; }
|
|
95
|
+
|
|
96
|
+
.salmon-timeline[data-align^='alternate'] {
|
|
97
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.salmon-timeline[data-align='alternate'] > .salmon-timeline-item:nth-child(even) .salmon-timeline-opposite,
|
|
101
|
+
.salmon-timeline[data-align='alternateReverse'] > .salmon-timeline-item:nth-child(odd) .salmon-timeline-opposite {
|
|
102
|
+
order: 3;
|
|
103
|
+
text-align: start;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.salmon-timeline[data-align='alternate'] > .salmon-timeline-item:nth-child(even) .salmon-timeline-content,
|
|
107
|
+
.salmon-timeline[data-align='alternateReverse'] > .salmon-timeline-item:nth-child(odd) .salmon-timeline-content {
|
|
108
|
+
order: -1;
|
|
109
|
+
text-align: end;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Horizontal: items in a row (scrolls inline on narrow screens); opposite above, content below. */
|
|
113
|
+
.salmon-timeline[data-orientation='horizontal'] {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: row;
|
|
116
|
+
column-gap: 0;
|
|
117
|
+
overflow-x: auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.salmon-timeline[data-orientation='horizontal'] > .salmon-timeline-item {
|
|
121
|
+
flex: 1 0 140px;
|
|
122
|
+
grid-template-columns: none;
|
|
123
|
+
grid-template-rows: minmax(1.5em, auto) auto auto;
|
|
124
|
+
row-gap: var(--salmon-space-2);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.salmon-timeline[data-orientation='horizontal'] .salmon-timeline-opposite,
|
|
128
|
+
.salmon-timeline[data-orientation='horizontal'] .salmon-timeline-content {
|
|
129
|
+
order: 0;
|
|
130
|
+
padding-block-end: 0;
|
|
131
|
+
padding-inline-end: var(--salmon-space-3);
|
|
132
|
+
text-align: start;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.salmon-timeline[data-orientation='horizontal'] .salmon-timeline-marker {
|
|
136
|
+
flex-direction: row;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.salmon-timeline[data-orientation='horizontal'] .salmon-timeline-dot {
|
|
140
|
+
margin-block-start: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.salmon-timeline[data-orientation='horizontal'] > .salmon-timeline-item:not(:last-child) > .salmon-timeline-marker::after {
|
|
144
|
+
inline-size: auto;
|
|
145
|
+
block-size: 2px;
|
|
146
|
+
margin-block: 0;
|
|
147
|
+
margin-inline: var(--salmon-space-1);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { expectStylesheet } from '@salmonui/core/internal/dev';
|
|
2
|
+
// `@salmonui/layout/timeline`: Timeline and TimelineItem. Server-safe: no 'use client' and no hooks in the graph.
|
|
3
|
+
export { Timeline, TimelineItem } from './timeline/Timeline.js';
|
|
4
|
+
if (process.env.NODE_ENV !== 'production')
|
|
5
|
+
expectStylesheet('@salmonui/layout/timeline', 'salmon-timeline');
|
|
6
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,kHAAkH;AAClH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAMhE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IAAE,gBAAgB,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salmonui/layout",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Splitter, Card, Avatar, Timeline, List and DashboardLayout for Salmon UI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hy-ong/salmonui.git",
|
|
9
|
+
"directory": "packages/layout"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://salmonui.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/hy-ong/salmonui/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
"./splitter": {
|
|
21
|
+
"types": "./dist/splitter.d.ts",
|
|
22
|
+
"import": "./dist/splitter.js"
|
|
23
|
+
},
|
|
24
|
+
"./card": {
|
|
25
|
+
"types": "./dist/card.d.ts",
|
|
26
|
+
"import": "./dist/card.js"
|
|
27
|
+
},
|
|
28
|
+
"./avatar": {
|
|
29
|
+
"types": "./dist/avatar.d.ts",
|
|
30
|
+
"import": "./dist/avatar.js"
|
|
31
|
+
},
|
|
32
|
+
"./timeline": {
|
|
33
|
+
"types": "./dist/timeline.d.ts",
|
|
34
|
+
"import": "./dist/timeline.js"
|
|
35
|
+
},
|
|
36
|
+
"./list": {
|
|
37
|
+
"types": "./dist/list.d.ts",
|
|
38
|
+
"import": "./dist/list.js"
|
|
39
|
+
},
|
|
40
|
+
"./dashboard-layout": {
|
|
41
|
+
"types": "./dist/dashboard-layout.d.ts",
|
|
42
|
+
"import": "./dist/dashboard-layout.js"
|
|
43
|
+
},
|
|
44
|
+
"./splitter/styles.css": "./dist/splitter.css",
|
|
45
|
+
"./card/styles.css": "./dist/card.css",
|
|
46
|
+
"./avatar/styles.css": "./dist/avatar.css",
|
|
47
|
+
"./timeline/styles.css": "./dist/timeline.css",
|
|
48
|
+
"./list/styles.css": "./dist/list.css",
|
|
49
|
+
"./dashboard-layout/styles.css": "./dist/dashboard-layout.css",
|
|
50
|
+
"./styles.css": "./dist/styles.css",
|
|
51
|
+
"./package.json": "./package.json"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist",
|
|
55
|
+
"README.md",
|
|
56
|
+
"LICENSE"
|
|
57
|
+
],
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@salmonui/core": "0.2.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": ">=19",
|
|
63
|
+
"react-dom": ">=19"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=22"
|
|
67
|
+
}
|
|
68
|
+
}
|