@manakind/ui-core 0.19.0 → 0.20.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/README.md +26 -0
- package/dist/centered-layout/centered-layout.css +36 -0
- package/dist/centered-layout/centered-layout.css.d.ts +2 -0
- package/dist/centered-layout/centered-layout.d.ts +18 -0
- package/dist/centered-layout/centered-layout.d.ts.map +1 -0
- package/dist/centered-layout/centered-layout.js +16 -0
- package/dist/centered-layout/centered-layout.js.map +1 -0
- package/dist/centered-layout/index.d.ts +3 -0
- package/dist/centered-layout/index.d.ts.map +1 -0
- package/dist/centered-layout/index.js +2 -0
- package/dist/centered-layout/index.js.map +1 -0
- package/dist/divider/divider.css +18 -0
- package/dist/divider/divider.css.d.ts +2 -0
- package/dist/divider/divider.d.ts +26 -0
- package/dist/divider/divider.d.ts.map +1 -0
- package/dist/divider/divider.js +15 -0
- package/dist/divider/divider.js.map +1 -0
- package/dist/divider/index.d.ts +3 -0
- package/dist/divider/index.d.ts.map +1 -0
- package/dist/divider/index.js +2 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/empty-state/empty-state.css +37 -0
- package/dist/empty-state/empty-state.css.d.ts +2 -0
- package/dist/empty-state/empty-state.d.ts +26 -0
- package/dist/empty-state/empty-state.d.ts.map +1 -0
- package/dist/empty-state/empty-state.js +16 -0
- package/dist/empty-state/empty-state.js.map +1 -0
- package/dist/empty-state/index.d.ts +3 -0
- package/dist/empty-state/index.d.ts.map +1 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/empty-state/index.js.map +1 -0
- package/dist/form-layout/form-layout.css +18 -0
- package/dist/form-layout/form-layout.css.d.ts +2 -0
- package/dist/form-layout/form-layout.d.ts +21 -0
- package/dist/form-layout/form-layout.d.ts.map +1 -0
- package/dist/form-layout/form-layout.js +24 -0
- package/dist/form-layout/form-layout.js.map +1 -0
- package/dist/form-layout/index.d.ts +3 -0
- package/dist/form-layout/index.d.ts.map +1 -0
- package/dist/form-layout/index.js +2 -0
- package/dist/form-layout/index.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/layout.css +185 -0
- package/dist/layout/layout.css.d.ts +2 -0
- package/dist/layout/layout.d.ts +105 -0
- package/dist/layout/layout.d.ts.map +1 -0
- package/dist/layout/layout.js +77 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/page-layout/index.d.ts +3 -0
- package/dist/page-layout/index.d.ts.map +1 -0
- package/dist/page-layout/index.js +2 -0
- package/dist/page-layout/index.js.map +1 -0
- package/dist/page-layout/page-layout.css +81 -0
- package/dist/page-layout/page-layout.css.d.ts +2 -0
- package/dist/page-layout/page-layout.d.ts +43 -0
- package/dist/page-layout/page-layout.d.ts.map +1 -0
- package/dist/page-layout/page-layout.js +42 -0
- package/dist/page-layout/page-layout.js.map +1 -0
- package/dist/section/index.d.ts +3 -0
- package/dist/section/index.d.ts.map +1 -0
- package/dist/section/index.js +2 -0
- package/dist/section/index.js.map +1 -0
- package/dist/section/section.css +31 -0
- package/dist/section/section.css.d.ts +2 -0
- package/dist/section/section.d.ts +31 -0
- package/dist/section/section.d.ts.map +1 -0
- package/dist/section/section.js +19 -0
- package/dist/section/section.js.map +1 -0
- package/dist/show/index.d.ts +3 -0
- package/dist/show/index.d.ts.map +1 -0
- package/dist/show/index.js +2 -0
- package/dist/show/index.js.map +1 -0
- package/dist/show/show.css +67 -0
- package/dist/show/show.css.d.ts +2 -0
- package/dist/show/show.d.ts +36 -0
- package/dist/show/show.d.ts.map +1 -0
- package/dist/show/show.js +23 -0
- package/dist/show/show.js.map +1 -0
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.css +36 -0
- package/dist/skeleton/skeleton.css.d.ts +2 -0
- package/dist/skeleton/skeleton.d.ts +26 -0
- package/dist/skeleton/skeleton.d.ts.map +1 -0
- package/dist/skeleton/skeleton.js +21 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/split-layout/index.d.ts +3 -0
- package/dist/split-layout/index.d.ts.map +1 -0
- package/dist/split-layout/index.js +2 -0
- package/dist/split-layout/index.js.map +1 -0
- package/dist/split-layout/split-layout.css +71 -0
- package/dist/split-layout/split-layout.css.d.ts +2 -0
- package/dist/split-layout/split-layout.d.ts +32 -0
- package/dist/split-layout/split-layout.d.ts.map +1 -0
- package/dist/split-layout/split-layout.js +25 -0
- package/dist/split-layout/split-layout.js.map +1 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/text.css +128 -0
- package/dist/text/text.css.d.ts +2 -0
- package/dist/text/text.d.ts +78 -0
- package/dist/text/text.d.ts.map +1 -0
- package/dist/text/text.js +56 -0
- package/dist/text/text.js.map +1 -0
- package/dist/visually-hidden/index.d.ts +3 -0
- package/dist/visually-hidden/index.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/dist/visually-hidden/visually-hidden.css +19 -0
- package/dist/visually-hidden/visually-hidden.css.d.ts +2 -0
- package/dist/visually-hidden/visually-hidden.d.ts +15 -0
- package/dist/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.js +17 -0
- package/dist/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/wizard-layout/index.d.ts +3 -0
- package/dist/wizard-layout/index.d.ts.map +1 -0
- package/dist/wizard-layout/index.js +2 -0
- package/dist/wizard-layout/index.js.map +1 -0
- package/dist/wizard-layout/wizard-layout.css +52 -0
- package/dist/wizard-layout/wizard-layout.css.d.ts +2 -0
- package/dist/wizard-layout/wizard-layout.d.ts +50 -0
- package/dist/wizard-layout/wizard-layout.d.ts.map +1 -0
- package/dist/wizard-layout/wizard-layout.js +38 -0
- package/dist/wizard-layout/wizard-layout.js.map +1 -0
- package/package.json +106 -2
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* The modifiers every layout primitive shares. `min-width: 0` lets a flex
|
|
4
|
+
* or grid child shrink below its content's width, so a long word inside
|
|
5
|
+
* breaks instead of pushing the row past its box.
|
|
6
|
+
*/
|
|
7
|
+
.ds-layout {
|
|
8
|
+
min-width: 0;
|
|
9
|
+
gap: var(--ds-layout-gap);
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
|
|
12
|
+
&.ds-layout--gap-none {
|
|
13
|
+
gap: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.ds-layout--gap-tight {
|
|
17
|
+
gap: var(--ds-layout-gap-tight);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.ds-layout--gap-relaxed {
|
|
21
|
+
gap: var(--ds-layout-gap-relaxed);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.ds-layout--gap-loose {
|
|
25
|
+
gap: var(--ds-layout-gap-loose);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.ds-layout--padding-tight {
|
|
29
|
+
padding: var(--ds-layout-padding-tight);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.ds-layout--padding-normal {
|
|
33
|
+
padding: var(--ds-layout-padding);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.ds-layout--padding-relaxed {
|
|
37
|
+
padding: var(--ds-layout-padding-relaxed);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.ds-layout--align-start {
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ds-layout--align-center {
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.ds-layout--align-end {
|
|
49
|
+
align-items: flex-end;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.ds-layout--align-stretch {
|
|
53
|
+
align-items: stretch;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.ds-layout--align-baseline {
|
|
57
|
+
align-items: baseline;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.ds-layout--justify-start {
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.ds-layout--justify-center {
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.ds-layout--justify-end {
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.ds-layout--justify-between {
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-stack {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-inline {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
align-items: center;
|
|
87
|
+
|
|
88
|
+
&.ds-inline--nowrap {
|
|
89
|
+
flex-wrap: nowrap;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* Self-filling: as many columns of at least the step's width as fit. The
|
|
95
|
+
* `min()` keeps a column from being wider than the grid itself on a
|
|
96
|
+
* viewport narrower than the step, so the grid never overflows a phone.
|
|
97
|
+
*/
|
|
98
|
+
.ds-grid {
|
|
99
|
+
display: grid;
|
|
100
|
+
|
|
101
|
+
&.ds-grid--fill-sm {
|
|
102
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-sm), 100%), 1fr));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.ds-grid--fill-md {
|
|
106
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-md), 100%), 1fr));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.ds-grid--fill-lg {
|
|
110
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-lg), 100%), 1fr));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Fixed columns. The component writes one private property per breakpoint,
|
|
116
|
+
* all five, each already carried forward from the narrower steps, so each
|
|
117
|
+
* media query reads its own step and nothing is inherited from a grid
|
|
118
|
+
* further out. The breakpoints are the viewport tokens, written as
|
|
119
|
+
* literals because `@media` cannot read a custom property
|
|
120
|
+
* (`check:breakpoints`).
|
|
121
|
+
*/
|
|
122
|
+
.ds-grid--columns {
|
|
123
|
+
--_grid-columns: var(--_grid-columns-base);
|
|
124
|
+
|
|
125
|
+
grid-template-columns: repeat(var(--_grid-columns), minmax(0, 1fr));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (width >= 40rem) {
|
|
129
|
+
.ds-grid--columns {
|
|
130
|
+
--_grid-columns: var(--_grid-columns-sm);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (width >= 48rem) {
|
|
135
|
+
.ds-grid--columns {
|
|
136
|
+
--_grid-columns: var(--_grid-columns-md);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media (width >= 64rem) {
|
|
141
|
+
.ds-grid--columns {
|
|
142
|
+
--_grid-columns: var(--_grid-columns-lg);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media (width >= 80rem) {
|
|
147
|
+
.ds-grid--columns {
|
|
148
|
+
--_grid-columns: var(--_grid-columns-xl);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ds-container {
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
width: 100%;
|
|
155
|
+
margin-inline: auto;
|
|
156
|
+
|
|
157
|
+
&.ds-container--sm {
|
|
158
|
+
max-width: var(--ds-layout-content-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.ds-container--md {
|
|
162
|
+
max-width: var(--ds-layout-content-md);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&.ds-container--lg {
|
|
166
|
+
max-width: var(--ds-layout-content-lg);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.ds-container--xl {
|
|
170
|
+
max-width: var(--ds-layout-content-xl);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.ds-container--padding-tight {
|
|
174
|
+
padding-inline: var(--ds-layout-padding-tight);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.ds-container--padding-normal {
|
|
178
|
+
padding-inline: var(--ds-layout-padding);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.ds-container--padding-relaxed {
|
|
182
|
+
padding-inline: var(--ds-layout-padding-relaxed);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './layout.css';
|
|
4
|
+
/**
|
|
5
|
+
* The distance between the children of a layout primitive. The words are the
|
|
6
|
+
* semantic `space.gap-*` steps; `none` removes the gap.
|
|
7
|
+
*/
|
|
8
|
+
export type LayoutGap = 'none' | 'tight' | 'normal' | 'relaxed' | 'loose';
|
|
9
|
+
/** The inset of a layout primitive from its edge: the semantic `space.padding-*` steps. */
|
|
10
|
+
export type LayoutPadding = 'none' | 'tight' | 'normal' | 'relaxed';
|
|
11
|
+
/** Cross-axis placement of the children. */
|
|
12
|
+
export type LayoutAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
13
|
+
/** Main-axis distribution of the children. */
|
|
14
|
+
export type LayoutJustify = 'start' | 'center' | 'end' | 'between';
|
|
15
|
+
/** Where a block of content stops growing: the semantic `size.content.*` steps. */
|
|
16
|
+
export type ContentWidth = 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
/** Where a layout changes shape: the semantic `size.viewport.*` steps. */
|
|
18
|
+
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
19
|
+
/** A value per breakpoint, from the narrowest viewport (`base`) up. */
|
|
20
|
+
export type Responsive<T> = Partial<Record<'base' | Breakpoint, T>>;
|
|
21
|
+
interface LayoutModifiers {
|
|
22
|
+
/** Space between the children. Defaults to `normal`. */
|
|
23
|
+
gap?: LayoutGap;
|
|
24
|
+
/** Inset from the primitive's own edge. Defaults to `none`. */
|
|
25
|
+
padding?: LayoutPadding;
|
|
26
|
+
/** Cross-axis placement of the children. */
|
|
27
|
+
align?: LayoutAlign;
|
|
28
|
+
/** Main-axis distribution of the children. */
|
|
29
|
+
justify?: LayoutJustify;
|
|
30
|
+
}
|
|
31
|
+
export interface StackProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A column of children with one gap between them.
|
|
35
|
+
*
|
|
36
|
+
* The workhorse of page composition: a form's fields, a card's regions, a
|
|
37
|
+
* list of sections. Renders a `div`; pass `asChild` to lay out your own
|
|
38
|
+
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
39
|
+
* step, so a product never writes a number.
|
|
40
|
+
*/
|
|
41
|
+
export declare function Stack({ gap, padding, align, justify, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export interface InlineProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
43
|
+
/**
|
|
44
|
+
* Whether the children wrap onto new lines when the row runs out of room.
|
|
45
|
+
* Defaults to `true`; a row that must stay on one line (a toolbar in a
|
|
46
|
+
* sideways scroller) passes `false`.
|
|
47
|
+
*/
|
|
48
|
+
wrap?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A row of children with one gap between them, centred on the cross axis.
|
|
52
|
+
*
|
|
53
|
+
* A title beside its actions, a group of badges, a footer of buttons. Wraps by
|
|
54
|
+
* default, so a long label takes a line of its own instead of squeezing its
|
|
55
|
+
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
56
|
+
*/
|
|
57
|
+
export declare function Inline({ gap, padding, align, justify, wrap, className, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
/** How many columns a grid has; `Responsive` for a count per breakpoint. */
|
|
59
|
+
export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
|
+
export interface GridProps extends ComponentProps<typeof ark.div>, Omit<LayoutModifiers, 'justify'> {
|
|
61
|
+
/**
|
|
62
|
+
* A fixed number of columns, or a number per breakpoint
|
|
63
|
+
* (`{ base: 1, md: 2, lg: 3 }`). Without it the grid fills itself with as
|
|
64
|
+
* many `minColumnWidth`-wide columns as fit.
|
|
65
|
+
*/
|
|
66
|
+
columns?: GridColumns | Responsive<GridColumns>;
|
|
67
|
+
/**
|
|
68
|
+
* The narrowest a column may be when the grid fills itself: a content
|
|
69
|
+
* width step. Defaults to `sm`. Ignored when `columns` is set.
|
|
70
|
+
*/
|
|
71
|
+
minColumnWidth?: Exclude<ContentWidth, 'xl'>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Children in equal columns.
|
|
75
|
+
*
|
|
76
|
+
* Two modes. Without `columns` the grid is self-filling: as many columns of
|
|
77
|
+
* at least `minColumnWidth` as fit, so a row of cards reflows by itself.
|
|
78
|
+
* With `columns` the count is fixed, or fixed per breakpoint. Rows take the
|
|
79
|
+
* height of their tallest child; pass `align="start"` to stop short cards
|
|
80
|
+
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
81
|
+
*/
|
|
82
|
+
export declare function Grid({ columns, minColumnWidth, gap, padding, align, className, style, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export interface ContainerProps extends ComponentProps<typeof ark.div> {
|
|
84
|
+
/**
|
|
85
|
+
* Where the content stops growing: a content width step. Defaults to `xl`,
|
|
86
|
+
* the width of a page. A dialog or sign-in card is `md`; a form or a
|
|
87
|
+
* reading column is `lg`.
|
|
88
|
+
*/
|
|
89
|
+
size?: ContentWidth;
|
|
90
|
+
/**
|
|
91
|
+
* Inset from the viewport's edge, applied inline only, so a container never
|
|
92
|
+
* adds vertical rhythm of its own. Defaults to `none`.
|
|
93
|
+
*/
|
|
94
|
+
padding?: LayoutPadding;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A centred column no wider than a content width step.
|
|
98
|
+
*
|
|
99
|
+
* Wraps a page, a form or a reading column so it stops growing at the same
|
|
100
|
+
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
101
|
+
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
102
|
+
*/
|
|
103
|
+
export declare function Container({ size, padding, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,cAAc,CAAC;AAGtB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1E,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpE,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QA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AAE,WAAW,2CAcb;AAED,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhD,MAAM,WAAW,SACf,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EACpC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAChD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;CAC9C;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,cAAqB,EACrB,GAAG,EACH,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,2CAeX;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAW,EACX,OAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,2CAchB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './layout.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
function modifierClasses({ gap = 'normal', padding = 'none', align, justify }) {
|
|
6
|
+
return cx('ds-layout', gap !== 'normal' && `ds-layout--gap-${gap}`, padding !== 'none' && `ds-layout--padding-${padding}`, align && `ds-layout--align-${align}`, justify && `ds-layout--justify-${justify}`);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A column of children with one gap between them.
|
|
10
|
+
*
|
|
11
|
+
* The workhorse of page composition: a form's fields, a card's regions, a
|
|
12
|
+
* list of sections. Renders a `div`; pass `asChild` to lay out your own
|
|
13
|
+
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
14
|
+
* step, so a product never writes a number.
|
|
15
|
+
*/
|
|
16
|
+
export function Stack({ gap, padding, align, justify, className, children, ...props }) {
|
|
17
|
+
return (_jsx(ark.div, { className: cx('ds-stack', modifierClasses({ gap, padding, align, justify }), className), ...props, children: children }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A row of children with one gap between them, centred on the cross axis.
|
|
21
|
+
*
|
|
22
|
+
* A title beside its actions, a group of badges, a footer of buttons. Wraps by
|
|
23
|
+
* default, so a long label takes a line of its own instead of squeezing its
|
|
24
|
+
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
25
|
+
*/
|
|
26
|
+
export function Inline({ gap, padding, align = 'center', justify, wrap = true, className, children, ...props }) {
|
|
27
|
+
return (_jsx(ark.div, { className: cx('ds-inline', !wrap && 'ds-inline--nowrap', modifierClasses({ gap, padding, align, justify }), className), ...props, children: children }));
|
|
28
|
+
}
|
|
29
|
+
const COLUMN_VARIABLES = {
|
|
30
|
+
base: '--_grid-columns-base',
|
|
31
|
+
sm: '--_grid-columns-sm',
|
|
32
|
+
md: '--_grid-columns-md',
|
|
33
|
+
lg: '--_grid-columns-lg',
|
|
34
|
+
xl: '--_grid-columns-xl',
|
|
35
|
+
};
|
|
36
|
+
const BREAKPOINTS_ASCENDING = ['base', 'sm', 'md', 'lg', 'xl'];
|
|
37
|
+
/**
|
|
38
|
+
* The column counts as the private custom properties `layout.css` reads, one
|
|
39
|
+
* per breakpoint, every one written: a count carries forward to the wider
|
|
40
|
+
* steps until the map names another, and a map without `base` starts at one
|
|
41
|
+
* column. Writing all five is what keeps a nested grid its own — custom
|
|
42
|
+
* properties inherit, so a step left unset would resolve to the parent
|
|
43
|
+
* grid's count instead of the fallback.
|
|
44
|
+
*/
|
|
45
|
+
function gridColumnStyle(columns) {
|
|
46
|
+
const perBreakpoint = typeof columns === 'number' ? { base: columns } : { base: 1, ...columns };
|
|
47
|
+
const style = {};
|
|
48
|
+
let current = 1;
|
|
49
|
+
for (const breakpoint of BREAKPOINTS_ASCENDING) {
|
|
50
|
+
current = perBreakpoint[breakpoint] ?? current;
|
|
51
|
+
style[COLUMN_VARIABLES[breakpoint]] = current;
|
|
52
|
+
}
|
|
53
|
+
return style;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Children in equal columns.
|
|
57
|
+
*
|
|
58
|
+
* Two modes. Without `columns` the grid is self-filling: as many columns of
|
|
59
|
+
* at least `minColumnWidth` as fit, so a row of cards reflows by itself.
|
|
60
|
+
* With `columns` the count is fixed, or fixed per breakpoint. Rows take the
|
|
61
|
+
* height of their tallest child; pass `align="start"` to stop short cards
|
|
62
|
+
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
63
|
+
*/
|
|
64
|
+
export function Grid({ columns, minColumnWidth = 'sm', gap, padding, align, className, style, children, ...props }) {
|
|
65
|
+
return (_jsx(ark.div, { className: cx('ds-grid', columns ? 'ds-grid--columns' : `ds-grid--fill-${minColumnWidth}`, modifierClasses({ gap, padding, align }), className), style: columns ? { ...gridColumnStyle(columns), ...style } : style, ...props, children: children }));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A centred column no wider than a content width step.
|
|
69
|
+
*
|
|
70
|
+
* Wraps a page, a form or a reading column so it stops growing at the same
|
|
71
|
+
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
72
|
+
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
73
|
+
*/
|
|
74
|
+
export function Container({ size = 'xl', padding = 'none', className, children, ...props }) {
|
|
75
|
+
return (_jsx(ark.div, { className: cx('ds-container', `ds-container--${size}`, padding !== 'none' && `ds-container--padding-${padding}`, className), ...props, children: children }));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAqC3B,SAAS,eAAe,CAAC,EAAE,GAAG,GAAG,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAmB;IAC5F,OAAO,EAAE,CACP,WAAW,EACX,GAAG,KAAK,QAAQ,IAAI,kBAAkB,GAAG,EAAE,EAC3C,OAAO,KAAK,MAAM,IAAI,sBAAsB,OAAO,EAAE,EACrD,KAAK,IAAI,oBAAoB,KAAK,EAAE,EACpC,OAAO,IAAI,sBAAsB,OAAO,EAAE,CAC3C,CAAC;AACJ,CAAC;AAID;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAc;IAC/F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KACnF,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,GAAG,EACH,OAAO,EACP,KAAK,GAAG,QAAQ,EAChB,OAAO,EACP,IAAI,GAAG,IAAI,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,GAAG,CAAC,GA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,SAAS,EAAE,EAAE,CACX,SAAS,EACT,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,cAAc,EAAE,EAChE,eAAe,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EACxC,SAAS,CACV,EACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAC9D,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAgBD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,MAAM,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACO;IACf,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,cAAc,EACd,iBAAiB,IAAI,EAAE,EACvB,OAAO,KAAK,MAAM,IAAI,yBAAyB,OAAO,EAAE,EACxD,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-page {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--ds-page-gap);
|
|
7
|
+
width: 100%;
|
|
8
|
+
margin-inline: auto;
|
|
9
|
+
padding-block: var(--ds-page-padding-block);
|
|
10
|
+
padding-inline: var(--ds-page-padding-inline);
|
|
11
|
+
min-width: 0;
|
|
12
|
+
overflow-wrap: anywhere;
|
|
13
|
+
|
|
14
|
+
&.ds-page--sm {
|
|
15
|
+
max-width: var(--ds-layout-content-sm);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.ds-page--md {
|
|
19
|
+
max-width: var(--ds-layout-content-md);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.ds-page--lg {
|
|
23
|
+
max-width: var(--ds-layout-content-lg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.ds-page--xl {
|
|
27
|
+
max-width: var(--ds-layout-content-xl);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Title over description, actions beneath both on a narrow viewport: a
|
|
33
|
+
* plain column, so a part left out leaves no row and no gap behind. From
|
|
34
|
+
* `md` the header is a grid whose rows are only the parts present: the
|
|
35
|
+
* title in row one, the description in the row after it, the actions in
|
|
36
|
+
* the second column of row one. No template areas, because an explicit
|
|
37
|
+
* empty row keeps its gutter.
|
|
38
|
+
*/
|
|
39
|
+
.ds-page__header {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: var(--ds-page-header-gap);
|
|
43
|
+
min-width: 0;
|
|
44
|
+
|
|
45
|
+
& .ds-page__actions {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--ds-layout-gap);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* `fit-content(50%)`, not `auto`: an auto track grows to its max-content, so
|
|
55
|
+
* one long unbroken label in the actions would take the whole header and
|
|
56
|
+
* squeeze the title to nothing. Capped at half, the label breaks instead.
|
|
57
|
+
*/
|
|
58
|
+
@media (width >= 48rem) {
|
|
59
|
+
.ds-page__header {
|
|
60
|
+
display: grid;
|
|
61
|
+
grid-template-columns: minmax(0, 1fr) fit-content(50%);
|
|
62
|
+
column-gap: var(--ds-layout-gap-relaxed);
|
|
63
|
+
|
|
64
|
+
& .ds-page__title {
|
|
65
|
+
grid-column: 1;
|
|
66
|
+
grid-row: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
& .ds-page__description {
|
|
70
|
+
grid-column: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& .ds-page__actions {
|
|
74
|
+
grid-column: 2;
|
|
75
|
+
grid-row: 1;
|
|
76
|
+
align-self: start;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './page-layout.css';
|
|
4
|
+
import type { ContentWidth } from '../layout/layout';
|
|
5
|
+
import { type HeadingProps, type TextProps } from '../text/text';
|
|
6
|
+
export interface PageLayoutProps extends ComponentProps<typeof ark.div> {
|
|
7
|
+
/**
|
|
8
|
+
* Where the page's content stops growing. Defaults to `xl`, a full page; a
|
|
9
|
+
* settings page or a reading page is `lg`.
|
|
10
|
+
*/
|
|
11
|
+
size?: ContentWidth;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The template every page composes: a centred column with the page's inset
|
|
15
|
+
* and the rhythm between its regions.
|
|
16
|
+
*
|
|
17
|
+
* Children are the page's regions, usually a {@link PageHeader} and then
|
|
18
|
+
* {@link Section}s, separated by `--ds-page-gap`. The inset from the viewport
|
|
19
|
+
* is `--ds-page-padding-inline` and `--ds-page-padding-block`. Renders a
|
|
20
|
+
* `div`; pass `asChild` to make the page a landmark
|
|
21
|
+
* (`<PageLayout asChild><main>…</main></PageLayout>`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function PageLayout({ size, className, children, ...props }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type PageHeaderProps = ComponentProps<typeof ark.header>;
|
|
25
|
+
/**
|
|
26
|
+
* The top of a page: its {@link PageTitle}, an optional {@link PageDescription}
|
|
27
|
+
* and optional {@link PageActions}. The title and description stack; the
|
|
28
|
+
* actions sit beside them from `md` up and under them on a narrower viewport.
|
|
29
|
+
*/
|
|
30
|
+
export declare function PageHeader({ className, children, ...props }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export type PageTitleProps = Omit<HeadingProps, 'level'>;
|
|
32
|
+
/**
|
|
33
|
+
* The page's one `h1`. Takes a `ref` for focus management after a route
|
|
34
|
+
* change or a removal, like any heading.
|
|
35
|
+
*/
|
|
36
|
+
export declare function PageTitle({ className, children, ...props }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export type PageDescriptionProps = TextProps;
|
|
38
|
+
/** Muted supporting copy under the title. */
|
|
39
|
+
export declare function PageDescription({ className, children, ...props }: PageDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export type PageActionsProps = ComponentProps<typeof ark.div>;
|
|
41
|
+
/** The page's primary controls, a wrapping row aligned to the end. */
|
|
42
|
+
export declare function PageActions({ className, children, ...props }: PageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=page-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../../src/page-layout/page-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB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
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './page-layout.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
import { Heading, Text } from '../text/text';
|
|
6
|
+
/**
|
|
7
|
+
* The template every page composes: a centred column with the page's inset
|
|
8
|
+
* and the rhythm between its regions.
|
|
9
|
+
*
|
|
10
|
+
* Children are the page's regions, usually a {@link PageHeader} and then
|
|
11
|
+
* {@link Section}s, separated by `--ds-page-gap`. The inset from the viewport
|
|
12
|
+
* is `--ds-page-padding-inline` and `--ds-page-padding-block`. Renders a
|
|
13
|
+
* `div`; pass `asChild` to make the page a landmark
|
|
14
|
+
* (`<PageLayout asChild><main>…</main></PageLayout>`).
|
|
15
|
+
*/
|
|
16
|
+
export function PageLayout({ size = 'xl', className, children, ...props }) {
|
|
17
|
+
return (_jsx(ark.div, { className: cx('ds-page', `ds-page--${size}`, className), ...props, children: children }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The top of a page: its {@link PageTitle}, an optional {@link PageDescription}
|
|
21
|
+
* and optional {@link PageActions}. The title and description stack; the
|
|
22
|
+
* actions sit beside them from `md` up and under them on a narrower viewport.
|
|
23
|
+
*/
|
|
24
|
+
export function PageHeader({ className, children, ...props }) {
|
|
25
|
+
return (_jsx(ark.header, { className: cx('ds-page__header', className), ...props, children: children }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The page's one `h1`. Takes a `ref` for focus management after a route
|
|
29
|
+
* change or a removal, like any heading.
|
|
30
|
+
*/
|
|
31
|
+
export function PageTitle({ className, children, ...props }) {
|
|
32
|
+
return (_jsx(Heading, { level: 1, className: cx('ds-page__title', className), ...props, children: children }));
|
|
33
|
+
}
|
|
34
|
+
/** Muted supporting copy under the title. */
|
|
35
|
+
export function PageDescription({ className, children, ...props }) {
|
|
36
|
+
return (_jsx(Text, { tone: "muted", className: cx('ds-page__description', className), ...props, children: children }));
|
|
37
|
+
}
|
|
38
|
+
/** The page's primary controls, a wrapping row aligned to the end. */
|
|
39
|
+
export function PageActions({ className, children, ...props }) {
|
|
40
|
+
return (_jsx(ark.div, { className: cx('ds-page__actions', className), ...props, children: children }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=page-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-layout.js","sourceRoot":"","sources":["../../src/page-layout/page-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAUhF;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IACxF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,YAAY,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,YACxE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,MAAM,IAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC/D,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IACzE,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,6CAA6C;AAC7C,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC3E,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAID,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC7D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-section {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--ds-section-gap);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
overflow-wrap: anywhere;
|
|
8
|
+
|
|
9
|
+
& .ds-section__header {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: var(--ds-layout-gap);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& .ds-section__heading {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--ds-section-header-gap);
|
|
21
|
+
min-width: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& .ds-section__actions {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--ds-layout-gap);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|