@ngrok/mantle 0.89.0 → 0.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.json +1529 -1
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/{alert-CZYYlx9q.js → alert-ZaUBtgno.js} +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/app-layout.d.ts +68 -13
- package/dist/app-layout.js +1 -1
- package/dist/card.d.ts +7 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-BDzapPLR.js → dialog-CaGJD02w.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpRsyt_F.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +1 -1
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/empty.d.ts +7 -0
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/{icons-BMZnm4hM.js → icons-CAtjMNti.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +117 -2
- package/dist/mantle.css +9 -0
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/{primitive-B-6XILB2.js → primitive-AGoxSJBI.js} +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/{select-CxXb3aiC.d.ts → select-DlohFa54.d.ts} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{separator-HzGvuD0B.d.ts → separator-BWGjCIl7.d.ts} +7 -0
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-DND_KjmS.js → sheet-H8zvhSuA.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +17 -10
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/strata.d.ts +548 -0
- package/dist/strata.js +1 -0
- package/dist/tabs.d.ts +12 -2
- package/dist/tabs.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/well.d.ts +7 -0
- package/package.json +4 -3
- package/dist/alert-vfeV_hso.js +0 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +0 -1
- package/dist/theme-BlCZHClJ.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
package/dist/strata.d.ts
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
//#region src/components/strata/strata.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The stack of sections. Renders a `<div>` with `divide-card-muted divide-y`, so
|
|
7
|
+
* a hairline falls between adjacent `Strata.Section` children and never above
|
|
8
|
+
* the first or below the last. Vertical rhythm belongs to `Section`
|
|
9
|
+
* (`py-8 first:pt-0`) rather than here, which keeps a lone `Section` usable
|
|
10
|
+
* without a `Root` around it. Set `--strata-columns` on `Root` to re-split
|
|
11
|
+
* every section at once — custom properties inherit, so one declaration reaches
|
|
12
|
+
* all of them.
|
|
13
|
+
*
|
|
14
|
+
* | Data Attribute | Value | Description |
|
|
15
|
+
* | -------------- | ----------- | ------------------------------------------------------------------ |
|
|
16
|
+
* | `data-slot` | `"strata"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
17
|
+
*
|
|
18
|
+
* @see https://mantle.ngrok.com/components/structure/strata#strataroot
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Strata.Root>
|
|
23
|
+
* <Strata.Section>
|
|
24
|
+
* <Strata.Header>
|
|
25
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
26
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
27
|
+
* </Strata.Header>
|
|
28
|
+
* <Strata.Body>
|
|
29
|
+
* <ProviderScopePicker />
|
|
30
|
+
* </Strata.Body>
|
|
31
|
+
* </Strata.Section>
|
|
32
|
+
* <Strata.Section>
|
|
33
|
+
* <Strata.Header>
|
|
34
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
35
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
36
|
+
* </Strata.Header>
|
|
37
|
+
* <Strata.Body>
|
|
38
|
+
* <RoutingRuleList />
|
|
39
|
+
* </Strata.Body>
|
|
40
|
+
* </Strata.Section>
|
|
41
|
+
* </Strata.Root>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* One titled band of the page. Renders a `<section>` that stacks
|
|
47
|
+
* `Strata.Header` above `Strata.Body` below the `md` breakpoint, then splits
|
|
48
|
+
* the two into a one-to-two grid at `md` and up. It carries its own vertical
|
|
49
|
+
* rhythm (`py-8 first:pt-0`), so it reads correctly as the only child of a
|
|
50
|
+
* `Root` and as one of many. Both layouts size their tracks `minmax(0, …)`,
|
|
51
|
+
* so a nowrap value in `Strata.Body` clips or wraps instead of widening the
|
|
52
|
+
* section.
|
|
53
|
+
*
|
|
54
|
+
* The `<section>` takes no accessible name, which keeps it generic in the
|
|
55
|
+
* accessibility tree instead of adding one `region` landmark per band — the
|
|
56
|
+
* `Strata.Title` headings already carry the page outline, and a landmark list
|
|
57
|
+
* only stays useful while `main` and `nav` are easy to find in it. Set
|
|
58
|
+
* `aria-labelledby` to the `Title`'s `id` only when the section is a
|
|
59
|
+
* destination a reader jumps back to, not merely a division of the page. To
|
|
60
|
+
* tell apart controls that read alike across two sections, reach for
|
|
61
|
+
* `Field.Set` and `Field.Legend` instead — assistive technology announces a
|
|
62
|
+
* landmark on entry, never per control.
|
|
63
|
+
*
|
|
64
|
+
* | CSS Variable | Default | Description |
|
|
65
|
+
* | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
* | `--strata-columns` | `minmax(0, 1fr) minmax(0, 2fr)` | The `grid-template-columns` value at `md` and up. Set it on `Strata.Root` to re-split every section, or here for this section alone. |
|
|
67
|
+
*
|
|
68
|
+
* | Data Attribute | Value | Description |
|
|
69
|
+
* | -------------- | ------------------- | ------------------------------------------------------------------ |
|
|
70
|
+
* | `data-slot` | `"strata-section"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
71
|
+
*
|
|
72
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratasection
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Strata.Root>
|
|
77
|
+
* <Strata.Section>
|
|
78
|
+
* <Strata.Header>
|
|
79
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
80
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
81
|
+
* </Strata.Header>
|
|
82
|
+
* <Strata.Body>
|
|
83
|
+
* <ProviderScopePicker />
|
|
84
|
+
* </Strata.Body>
|
|
85
|
+
* </Strata.Section>
|
|
86
|
+
* <Strata.Section>
|
|
87
|
+
* <Strata.Header>
|
|
88
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
89
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
90
|
+
* </Strata.Header>
|
|
91
|
+
* <Strata.Body>
|
|
92
|
+
* <RoutingRuleList />
|
|
93
|
+
* </Strata.Body>
|
|
94
|
+
* </Strata.Section>
|
|
95
|
+
* </Strata.Root>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare const Section: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"section"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
99
|
+
/**
|
|
100
|
+
* A section's introductory column — its `Strata.Title` and
|
|
101
|
+
* `Strata.Description`. Renders a `<header>` with `flex flex-col gap-2`, so
|
|
102
|
+
* anything else composed in (a `Badge`, a count) picks up the same spacing. At
|
|
103
|
+
* `md` and up it takes the grid's first column; below the breakpoint it stacks
|
|
104
|
+
* above `Strata.Body`.
|
|
105
|
+
*
|
|
106
|
+
* Why `<header>`: it groups the introductory content of its nearest sectioning
|
|
107
|
+
* ancestor, which is `Strata.Section`'s `<section>`. Nested inside sectioning
|
|
108
|
+
* content, a `<header>` is not the `banner` landmark, so a page carries as many
|
|
109
|
+
* as it has sections.
|
|
110
|
+
*
|
|
111
|
+
* | Data Attribute | Value | Description |
|
|
112
|
+
* | -------------- | ------------------ | ------------------------------------------------------------------ |
|
|
113
|
+
* | `data-slot` | `"strata-header"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
114
|
+
*
|
|
115
|
+
* @see https://mantle.ngrok.com/components/structure/strata#strataheader
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* <Strata.Root>
|
|
120
|
+
* <Strata.Section>
|
|
121
|
+
* <Strata.Header>
|
|
122
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
123
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
124
|
+
* </Strata.Header>
|
|
125
|
+
* <Strata.Body>
|
|
126
|
+
* <ProviderScopePicker />
|
|
127
|
+
* </Strata.Body>
|
|
128
|
+
* </Strata.Section>
|
|
129
|
+
* <Strata.Section>
|
|
130
|
+
* <Strata.Header>
|
|
131
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
132
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
133
|
+
* </Strata.Header>
|
|
134
|
+
* <Strata.Body>
|
|
135
|
+
* <RoutingRuleList />
|
|
136
|
+
* </Strata.Body>
|
|
137
|
+
* </Strata.Section>
|
|
138
|
+
* </Strata.Root>
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"header"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
142
|
+
/**
|
|
143
|
+
* The section's heading. Renders an `<h2>`, one level below the page's `<h1>`,
|
|
144
|
+
* because a `Strata.Section` is a top-level division of its page. Compose
|
|
145
|
+
* `asChild` with the right element when a page nests its sections deeper —
|
|
146
|
+
* heading level is document structure, so mantle does not guess it.
|
|
147
|
+
*
|
|
148
|
+
* | Data Attribute | Value | Description |
|
|
149
|
+
* | -------------- | ----------------- | ------------------------------------------------------------------ |
|
|
150
|
+
* | `data-slot` | `"strata-title"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
151
|
+
*
|
|
152
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratatitle
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```tsx
|
|
156
|
+
* <Strata.Root>
|
|
157
|
+
* <Strata.Section>
|
|
158
|
+
* <Strata.Header>
|
|
159
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
160
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
161
|
+
* </Strata.Header>
|
|
162
|
+
* <Strata.Body>
|
|
163
|
+
* <ProviderScopePicker />
|
|
164
|
+
* </Strata.Body>
|
|
165
|
+
* </Strata.Section>
|
|
166
|
+
* <Strata.Section>
|
|
167
|
+
* <Strata.Header>
|
|
168
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
169
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
170
|
+
* </Strata.Header>
|
|
171
|
+
* <Strata.Body>
|
|
172
|
+
* <RoutingRuleList />
|
|
173
|
+
* </Strata.Body>
|
|
174
|
+
* </Strata.Section>
|
|
175
|
+
* </Strata.Root>
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
declare const Title: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"h2"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
179
|
+
/**
|
|
180
|
+
* The sentence that says what the section's controls do, and what changing them
|
|
181
|
+
* costs. Renders a `<p>` in muted body text beneath `Strata.Title`. Optional —
|
|
182
|
+
* a section whose title says everything may omit it.
|
|
183
|
+
*
|
|
184
|
+
* | Data Attribute | Value | Description |
|
|
185
|
+
* | -------------- | ----------------------- | ------------------------------------------------------------------ |
|
|
186
|
+
* | `data-slot` | `"strata-description"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
187
|
+
*
|
|
188
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratadescription
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```tsx
|
|
192
|
+
* <Strata.Root>
|
|
193
|
+
* <Strata.Section>
|
|
194
|
+
* <Strata.Header>
|
|
195
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
196
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
197
|
+
* </Strata.Header>
|
|
198
|
+
* <Strata.Body>
|
|
199
|
+
* <ProviderScopePicker />
|
|
200
|
+
* </Strata.Body>
|
|
201
|
+
* </Strata.Section>
|
|
202
|
+
* <Strata.Section>
|
|
203
|
+
* <Strata.Header>
|
|
204
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
205
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
206
|
+
* </Strata.Header>
|
|
207
|
+
* <Strata.Body>
|
|
208
|
+
* <RoutingRuleList />
|
|
209
|
+
* </Strata.Body>
|
|
210
|
+
* </Strata.Section>
|
|
211
|
+
* </Strata.Root>
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare const Description: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"p"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
215
|
+
/**
|
|
216
|
+
* The section's content column — the controls, cards, or table that
|
|
217
|
+
* `Strata.Header` describes. Renders a `<div>` with `flex flex-col gap-4`, so
|
|
218
|
+
* stacked controls space themselves and a consumer's own `gap-*` replaces the
|
|
219
|
+
* default cleanly. At `md` and up it takes the grid's second column; below the
|
|
220
|
+
* breakpoint it stacks under the header.
|
|
221
|
+
*
|
|
222
|
+
* | Data Attribute | Value | Description |
|
|
223
|
+
* | -------------- | ---------------- | ------------------------------------------------------------------ |
|
|
224
|
+
* | `data-slot` | `"strata-body"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
225
|
+
*
|
|
226
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratabody
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```tsx
|
|
230
|
+
* <Strata.Root>
|
|
231
|
+
* <Strata.Section>
|
|
232
|
+
* <Strata.Header>
|
|
233
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
234
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
235
|
+
* </Strata.Header>
|
|
236
|
+
* <Strata.Body>
|
|
237
|
+
* <ProviderScopePicker />
|
|
238
|
+
* </Strata.Body>
|
|
239
|
+
* </Strata.Section>
|
|
240
|
+
* <Strata.Section>
|
|
241
|
+
* <Strata.Header>
|
|
242
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
243
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
244
|
+
* </Strata.Header>
|
|
245
|
+
* <Strata.Body>
|
|
246
|
+
* <RoutingRuleList />
|
|
247
|
+
* </Strata.Body>
|
|
248
|
+
* </Strata.Section>
|
|
249
|
+
* </Strata.Root>
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
253
|
+
/**
|
|
254
|
+
* A page of titled sections, each one explained beside its content. Every
|
|
255
|
+
* section pairs a `Strata.Header` — its `Title` and `Description` — with a
|
|
256
|
+
* `Strata.Body` of controls. `Strata.Root` stacks the sections with a
|
|
257
|
+
* hairline between them. Below the `md` breakpoint the header stacks above its
|
|
258
|
+
* own content, so the pairing survives a narrow viewport. It is the shape of a
|
|
259
|
+
* settings page, a resource configuration editor, and any form long enough that
|
|
260
|
+
* each group needs its own explanation.
|
|
261
|
+
*
|
|
262
|
+
* It owns structure only — the grid, the rhythm, and the rules between sections.
|
|
263
|
+
* Reach for [Card](https://mantle.ngrok.com/components/structure/card) when a
|
|
264
|
+
* group needs a raised surface of its own, for
|
|
265
|
+
* [MediaObject](https://mantle.ngrok.com/components/structure/media-object)
|
|
266
|
+
* when the thing beside the text is an image or an icon, and for
|
|
267
|
+
* [DescriptionList](https://mantle.ngrok.com/components/data-display/description-list)
|
|
268
|
+
* when the pairs are read-only term/value data rather than headed sections.
|
|
269
|
+
*
|
|
270
|
+
* @see https://mantle.ngrok.com/components/structure/strata
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* Composition:
|
|
274
|
+
* ```
|
|
275
|
+
* Strata.Root
|
|
276
|
+
* └── Strata.Section
|
|
277
|
+
* ├── Strata.Header
|
|
278
|
+
* │ ├── Strata.Title
|
|
279
|
+
* │ └── Strata.Description
|
|
280
|
+
* └── Strata.Body
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```tsx
|
|
285
|
+
* <Strata.Root>
|
|
286
|
+
* <Strata.Section>
|
|
287
|
+
* <Strata.Header>
|
|
288
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
289
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
290
|
+
* </Strata.Header>
|
|
291
|
+
* <Strata.Body>
|
|
292
|
+
* <ProviderScopePicker />
|
|
293
|
+
* </Strata.Body>
|
|
294
|
+
* </Strata.Section>
|
|
295
|
+
* <Strata.Section>
|
|
296
|
+
* <Strata.Header>
|
|
297
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
298
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
299
|
+
* </Strata.Header>
|
|
300
|
+
* <Strata.Body>
|
|
301
|
+
* <RoutingRuleList />
|
|
302
|
+
* </Strata.Body>
|
|
303
|
+
* </Strata.Section>
|
|
304
|
+
* </Strata.Root>
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
declare const Strata: {
|
|
308
|
+
/**
|
|
309
|
+
* The stack of sections. Renders a `<div>` with `divide-card-muted divide-y`,
|
|
310
|
+
* so a hairline falls between adjacent `Section` children and never above the
|
|
311
|
+
* first or below the last. Vertical rhythm belongs to `Section`
|
|
312
|
+
* (`py-8 first:pt-0`) rather than here, which keeps a lone `Section` usable
|
|
313
|
+
* without a `Root` around it. Set `--strata-columns` on `Root` to re-split
|
|
314
|
+
* every section at once.
|
|
315
|
+
*
|
|
316
|
+
* | Data Attribute | Value | Description |
|
|
317
|
+
* | -------------- | ----------- | ------------------------------------------------------------------ |
|
|
318
|
+
* | `data-slot` | `"strata"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
319
|
+
*
|
|
320
|
+
* @see https://mantle.ngrok.com/components/structure/strata#strataroot
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```tsx
|
|
324
|
+
* <Strata.Root>
|
|
325
|
+
* <Strata.Section>
|
|
326
|
+
* <Strata.Header>
|
|
327
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
328
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
329
|
+
* </Strata.Header>
|
|
330
|
+
* <Strata.Body>
|
|
331
|
+
* <ProviderScopePicker />
|
|
332
|
+
* </Strata.Body>
|
|
333
|
+
* </Strata.Section>
|
|
334
|
+
* <Strata.Section>
|
|
335
|
+
* <Strata.Header>
|
|
336
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
337
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
338
|
+
* </Strata.Header>
|
|
339
|
+
* <Strata.Body>
|
|
340
|
+
* <RoutingRuleList />
|
|
341
|
+
* </Strata.Body>
|
|
342
|
+
* </Strata.Section>
|
|
343
|
+
* </Strata.Root>
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
readonly Root: typeof Root;
|
|
347
|
+
/**
|
|
348
|
+
* One titled band of the page. Renders a `<section>` that stacks `Header`
|
|
349
|
+
* above `Body` below the `md` breakpoint, then splits the two into a
|
|
350
|
+
* one-to-two grid at `md` and up, and carries its own vertical rhythm
|
|
351
|
+
* (`py-8 first:pt-0`). Both layouts size their tracks `minmax(0, …)`, so a
|
|
352
|
+
* nowrap value in `Body` clips or wraps instead of widening the section. It
|
|
353
|
+
* takes no accessible name, which keeps it generic in the accessibility tree
|
|
354
|
+
* instead of adding one `region` landmark per band —
|
|
355
|
+
* the `Title` headings already carry the page outline. Set `aria-labelledby`
|
|
356
|
+
* to the `Title`'s `id` only when the section is a destination a reader jumps
|
|
357
|
+
* back to, not merely a division of the page. To tell apart controls that read
|
|
358
|
+
* alike across two sections, reach for `Field.Set` and `Field.Legend` instead
|
|
359
|
+
* — assistive technology announces a landmark on entry, never per control.
|
|
360
|
+
*
|
|
361
|
+
* | CSS Variable | Default | Description |
|
|
362
|
+
* | ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
363
|
+
* | `--strata-columns` | `minmax(0, 1fr) minmax(0, 2fr)` | The `grid-template-columns` value at `md` and up. Set it on `Root` to re-split every section, or here for this section alone. |
|
|
364
|
+
*
|
|
365
|
+
* | Data Attribute | Value | Description |
|
|
366
|
+
* | -------------- | ------------------- | ------------------------------------------------------------------ |
|
|
367
|
+
* | `data-slot` | `"strata-section"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
368
|
+
*
|
|
369
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratasection
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```tsx
|
|
373
|
+
* <Strata.Root>
|
|
374
|
+
* <Strata.Section>
|
|
375
|
+
* <Strata.Header>
|
|
376
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
377
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
378
|
+
* </Strata.Header>
|
|
379
|
+
* <Strata.Body>
|
|
380
|
+
* <ProviderScopePicker />
|
|
381
|
+
* </Strata.Body>
|
|
382
|
+
* </Strata.Section>
|
|
383
|
+
* <Strata.Section>
|
|
384
|
+
* <Strata.Header>
|
|
385
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
386
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
387
|
+
* </Strata.Header>
|
|
388
|
+
* <Strata.Body>
|
|
389
|
+
* <RoutingRuleList />
|
|
390
|
+
* </Strata.Body>
|
|
391
|
+
* </Strata.Section>
|
|
392
|
+
* </Strata.Root>
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
readonly Section: typeof Section;
|
|
396
|
+
/**
|
|
397
|
+
* A section's introductory column — its `Title` and `Description`. Renders a
|
|
398
|
+
* `<header>` with `flex flex-col gap-2`, so anything else composed in picks
|
|
399
|
+
* up the same spacing. At `md` and up it takes the grid's first column; below
|
|
400
|
+
* the breakpoint it stacks above `Body`. Nested inside `Section`'s
|
|
401
|
+
* `<section>`, a `<header>` is not the `banner` landmark, so a page carries
|
|
402
|
+
* as many as it has sections.
|
|
403
|
+
*
|
|
404
|
+
* | Data Attribute | Value | Description |
|
|
405
|
+
* | -------------- | ------------------ | ------------------------------------------------------------------ |
|
|
406
|
+
* | `data-slot` | `"strata-header"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
407
|
+
*
|
|
408
|
+
* @see https://mantle.ngrok.com/components/structure/strata#strataheader
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```tsx
|
|
412
|
+
* <Strata.Root>
|
|
413
|
+
* <Strata.Section>
|
|
414
|
+
* <Strata.Header>
|
|
415
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
416
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
417
|
+
* </Strata.Header>
|
|
418
|
+
* <Strata.Body>
|
|
419
|
+
* <ProviderScopePicker />
|
|
420
|
+
* </Strata.Body>
|
|
421
|
+
* </Strata.Section>
|
|
422
|
+
* <Strata.Section>
|
|
423
|
+
* <Strata.Header>
|
|
424
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
425
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
426
|
+
* </Strata.Header>
|
|
427
|
+
* <Strata.Body>
|
|
428
|
+
* <RoutingRuleList />
|
|
429
|
+
* </Strata.Body>
|
|
430
|
+
* </Strata.Section>
|
|
431
|
+
* </Strata.Root>
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
readonly Header: typeof Header;
|
|
435
|
+
/**
|
|
436
|
+
* The section's heading. Renders an `<h2>`, one level below the page's
|
|
437
|
+
* `<h1>`, because a `Section` is a top-level division of its page. Compose
|
|
438
|
+
* `asChild` with the right element when a page nests its sections deeper —
|
|
439
|
+
* heading level is document structure, so mantle does not guess it.
|
|
440
|
+
*
|
|
441
|
+
* | Data Attribute | Value | Description |
|
|
442
|
+
* | -------------- | ----------------- | ------------------------------------------------------------------ |
|
|
443
|
+
* | `data-slot` | `"strata-title"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
444
|
+
*
|
|
445
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratatitle
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```tsx
|
|
449
|
+
* <Strata.Root>
|
|
450
|
+
* <Strata.Section>
|
|
451
|
+
* <Strata.Header>
|
|
452
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
453
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
454
|
+
* </Strata.Header>
|
|
455
|
+
* <Strata.Body>
|
|
456
|
+
* <ProviderScopePicker />
|
|
457
|
+
* </Strata.Body>
|
|
458
|
+
* </Strata.Section>
|
|
459
|
+
* <Strata.Section>
|
|
460
|
+
* <Strata.Header>
|
|
461
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
462
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
463
|
+
* </Strata.Header>
|
|
464
|
+
* <Strata.Body>
|
|
465
|
+
* <RoutingRuleList />
|
|
466
|
+
* </Strata.Body>
|
|
467
|
+
* </Strata.Section>
|
|
468
|
+
* </Strata.Root>
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
readonly Title: typeof Title;
|
|
472
|
+
/**
|
|
473
|
+
* The sentence that says what the section's controls do, and what changing
|
|
474
|
+
* them costs. Renders a `<p>` in muted body text beneath `Title`. Optional —
|
|
475
|
+
* a section whose title says everything may omit it.
|
|
476
|
+
*
|
|
477
|
+
* | Data Attribute | Value | Description |
|
|
478
|
+
* | -------------- | ----------------------- | ------------------------------------------------------------------ |
|
|
479
|
+
* | `data-slot` | `"strata-description"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
480
|
+
*
|
|
481
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratadescription
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```tsx
|
|
485
|
+
* <Strata.Root>
|
|
486
|
+
* <Strata.Section>
|
|
487
|
+
* <Strata.Header>
|
|
488
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
489
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
490
|
+
* </Strata.Header>
|
|
491
|
+
* <Strata.Body>
|
|
492
|
+
* <ProviderScopePicker />
|
|
493
|
+
* </Strata.Body>
|
|
494
|
+
* </Strata.Section>
|
|
495
|
+
* <Strata.Section>
|
|
496
|
+
* <Strata.Header>
|
|
497
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
498
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
499
|
+
* </Strata.Header>
|
|
500
|
+
* <Strata.Body>
|
|
501
|
+
* <RoutingRuleList />
|
|
502
|
+
* </Strata.Body>
|
|
503
|
+
* </Strata.Section>
|
|
504
|
+
* </Strata.Root>
|
|
505
|
+
* ```
|
|
506
|
+
*/
|
|
507
|
+
readonly Description: typeof Description;
|
|
508
|
+
/**
|
|
509
|
+
* The section's content column — the controls, cards, or table that `Header`
|
|
510
|
+
* describes. Renders a `<div>` with `flex flex-col gap-4`, so stacked
|
|
511
|
+
* controls space themselves and a consumer's own `gap-*` replaces the default
|
|
512
|
+
* cleanly. At `md` and up it takes the grid's second column; below the
|
|
513
|
+
* breakpoint it stacks under the header.
|
|
514
|
+
*
|
|
515
|
+
* | Data Attribute | Value | Description |
|
|
516
|
+
* | -------------- | ---------------- | ------------------------------------------------------------------ |
|
|
517
|
+
* | `data-slot` | `"strata-body"` | Stable styling hook. Survives `className` overrides and `asChild`. |
|
|
518
|
+
*
|
|
519
|
+
* @see https://mantle.ngrok.com/components/structure/strata#stratabody
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```tsx
|
|
523
|
+
* <Strata.Root>
|
|
524
|
+
* <Strata.Section>
|
|
525
|
+
* <Strata.Header>
|
|
526
|
+
* <Strata.Title>Providers</Strata.Title>
|
|
527
|
+
* <Strata.Description>What providers keys may call.</Strata.Description>
|
|
528
|
+
* </Strata.Header>
|
|
529
|
+
* <Strata.Body>
|
|
530
|
+
* <ProviderScopePicker />
|
|
531
|
+
* </Strata.Body>
|
|
532
|
+
* </Strata.Section>
|
|
533
|
+
* <Strata.Section>
|
|
534
|
+
* <Strata.Header>
|
|
535
|
+
* <Strata.Title>Routing rules</Strata.Title>
|
|
536
|
+
* <Strata.Description>Define how requests are authenticated.</Strata.Description>
|
|
537
|
+
* </Strata.Header>
|
|
538
|
+
* <Strata.Body>
|
|
539
|
+
* <RoutingRuleList />
|
|
540
|
+
* </Strata.Body>
|
|
541
|
+
* </Strata.Section>
|
|
542
|
+
* </Strata.Root>
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
readonly Body: typeof Body;
|
|
546
|
+
};
|
|
547
|
+
//#endregion
|
|
548
|
+
export { Strata };
|
package/dist/strata.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`divide-card-muted divide-y`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Section:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`section`,p;o[6]===u?p=o[7]:(p=t(u,`strata-section`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`grid grid-cols-1 gap-6 py-8 first:pt-0`,`md:grid-cols-(--strata-columns,minmax(0,1fr)_minmax(0,2fr)) md:gap-12`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`strata-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h2`,p;o[6]===u?p=o[7]:(p=t(u,`strata-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-base font-medium`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`p`,p;o[6]===u?p=o[7]:(p=t(u,`strata-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-body text-sm`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Strata};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as SelfClosingWithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
-
import { n as Separator } from "./separator-
|
|
3
|
+
import { n as Separator } from "./separator-BWGjCIl7.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
6
6
|
//#region src/components/tabs/tabs.d.ts
|
|
@@ -9,6 +9,11 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
9
9
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
10
10
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
11
11
|
*
|
|
12
|
+
* `onValueChange` fires once per activation. Radix activates a trigger on
|
|
13
|
+
* mousedown and again on the focus it moves there, before a controlled root
|
|
14
|
+
* re-renders, so the root passes the second call through only when its value
|
|
15
|
+
* differs from the first.
|
|
16
|
+
*
|
|
12
17
|
* **Data attributes:**
|
|
13
18
|
*
|
|
14
19
|
* | Data Attribute | Value | Description |
|
|
@@ -42,7 +47,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
42
47
|
* </Tabs.Root>
|
|
43
48
|
* ```
|
|
44
49
|
*/
|
|
45
|
-
declare const Root$1: ({ className, children, "data-slot": dataSlot, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
|
|
50
|
+
declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
|
|
46
51
|
/**
|
|
47
52
|
* The appearance of the tabs. Classic appearance shows the tab
|
|
48
53
|
* list with an underline; pill appearance shows each tab as a pill.
|
|
@@ -264,6 +269,11 @@ declare const Tabs: {
|
|
|
264
269
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
265
270
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
266
271
|
*
|
|
272
|
+
* `onValueChange` fires once per activation. Radix activates a trigger on
|
|
273
|
+
* mousedown and again on the focus it moves there, before a controlled root
|
|
274
|
+
* re-renders, so the root passes the second call through only when its value
|
|
275
|
+
* differs from the first.
|
|
276
|
+
*
|
|
267
277
|
* **Data attributes:**
|
|
268
278
|
*
|
|
269
279
|
* | Data Attribute | Value | Description |
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./use-prefers-reduced-motion-
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./use-prefers-reduced-motion-DimzRx-M.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let r=s(29),i,a,o,c,l,u,d;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6],d=r[7]):({className:a,children:i,"data-slot":o,onValueChange:c,orientation:u,appearance:d,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u,r[7]=d);let f=u===void 0?`horizontal`:u,p=d===void 0?`classic`:d,h;r[8]!==p||r[9]!==f?(h={orientation:f,appearance:p},r[8]=p,r[9]=f,r[10]=h):h=r[10];let g=h,v=m(null),y;r[11]===c?y=r[12]:(y=e=>{e!==v.current&&(v.current=e,queueMicrotask(()=>{v.current=null}),c?.(e))},r[11]=c,r[12]=y);let b=y,x;r[13]===o?x=r[14]:(x=n(o,`tabs`),r[13]=o,r[14]=x);let C=f===`horizontal`?`flex-col`:`flex-row`,T;r[15]!==a||r[16]!==C?(T=t(`flex [--tabs-gap:--spacing(4)] gap-(--tabs-gap)`,C,a),r[15]=a,r[16]=C,r[17]=T):T=r[17];let E;r[18]!==p||r[19]!==i||r[20]!==b||r[21]!==f||r[22]!==l||r[23]!==x||r[24]!==T?(E=/* @__PURE__ */ _(S,{"data-slot":x,"data-appearance":p,className:T,orientation:f,onValueChange:b,...l,children:i}),r[18]=p,r[19]=i,r[20]=b,r[21]=f,r[22]=l,r[23]=x,r[24]=T,r[25]=E):E=r[25];let D;return r[26]!==g||r[27]!==E?(D=/* @__PURE__ */ _(w.Provider,{value:g,children:E}),r[26]=g,r[27]=E,r[28]=D):D=r[28],D},D=y(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none self-stretch min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`}]}),O=r=>{let i=s(20),a,c,l,u;i[0]===r?(a=i[1],c=i[2],l=i[3],u=i[4]):({className:a,"data-slot":c,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=c,i[3]=l,i[4]=u);let{orientation:d,appearance:f}=T(`Tabs.List`),h=m(null),g=e(h,u),v,y;i[5]===d?(v=i[6],y=i[7]):(v=()=>{let e=h.current;if(!e||d!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let i=()=>{r=!1};return e.addEventListener(`pointerup`,i,{signal:n}),e.addEventListener(`pointercancel`,i,{signal:n}),e.addEventListener(`keydown`,i,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=o()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},y=[d],i[5]=d,i[6]=v,i[7]=y),p(v,y);let b;i[8]===c?b=i[9]:(b=n(c,`tabs-list`),i[8]=c,i[9]=b);let S;i[10]!==f||i[11]!==a||i[12]!==d?(S=t(D({orientation:d,appearance:f}),a),i[10]=f,i[11]=a,i[12]=d,i[13]=S):S=i[13];let C;return i[14]!==g||i[15]!==d||i[16]!==l||i[17]!==b||i[18]!==S?(C=/* @__PURE__ */ _(x,{"aria-orientation":d,"data-slot":b,className:S,ref:g,...l}),i[14]=g,i[15]=d,i[16]=l,i[17]=b,i[18]=S,i[19]=C):C=i[19],C},k=e=>{let r=s(14),i,o,c;r[0]===e?(i=r[1],o=r[2],c=r[3]):({className:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=c);let{orientation:l}=T(`Tabs.Separator`),u=l===`horizontal`?`[[data-slot~=tabs]>&]:-mt-(--tabs-gap)`:`h-auto self-stretch [[data-slot~=tabs]>&]:-ml-(--tabs-gap)`,d;r[4]===o?d=r[5]:(d=n(o,`tabs-separator`),r[4]=o,r[5]=d);let f;r[6]!==i||r[7]!==u?(f=t(u,i),r[6]=i,r[7]=u,r[8]=f):f=r[8];let p;return r[9]!==l||r[10]!==c||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ _(a,{"data-slot":d,orientation:l,className:f,...c}),r[9]=l,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},A=y(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),j=()=>{let e=s(5),{orientation:t,appearance:n}=T(`Tabs.Trigger`),r;e[0]!==n||e[1]!==t?(r=i(A({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=r):r=e[2];let a;return e[3]===r?a=e[4]:(a=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:r}),e[3]=r,e[4]=a),a},M=y(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),N={Root:E,Content:e=>{let r=s(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,"data-slot":a,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let c;r[4]===a?c=r[5]:(c=n(a,`tabs-content`),r[4]=a,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,i),r[6]=i,r[7]=l);let u;return r[8]!==o||r[9]!==c||r[10]!==l?(u=/* @__PURE__ */ _(b,{"data-slot":c,className:l,...o}),r[8]=o,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},List:O,Separator:k,Trigger:e=>{let i=s(44),a,o,u,f,p,m,y,b;i[0]===e?(a=i[1],o=i[2],u=i[3],f=i[4],p=i[5],m=i[6],y=i[7],b=i[8]):({"aria-disabled":a,asChild:b,children:u,className:f,"data-slot":p,disabled:o,ref:y,...m}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=u,i[4]=f,i[5]=p,i[6]=m,i[7]=y,i[8]=b);let x=b!==void 0&&b,{orientation:S,appearance:w}=T(`Tabs.Trigger`),E=a??o,D;i[9]===E?D=i[10]:(D=r(E),i[9]=E,i[10]=D);let O=D,k=a??o,A;i[11]!==w||i[12]!==f||i[13]!==S?(A=t(M({orientation:S,appearance:w}),f),i[11]=w,i[12]=f,i[13]=S,i[14]=A):A=i[14];let N;i[15]===p?N=i[16]:(N=n(p,`tabs-trigger`),i[15]=p,i[16]=N);let P;i[17]!==O||i[18]!==m||i[19]!==k||i[20]!==A||i[21]!==N?(P={"aria-disabled":k,className:A,"data-slot":N,disabled:O,...m},i[17]=O,i[18]=m,i[19]=k,i[20]=A,i[21]=N,i[22]=P):P=i[22];let F=P;if(x){let e;i[23]===u?e=i[24]:(e=c.only(u),h(d(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),i[23]=u,i[24]=e);let t=e.props?.children,n;if(i[25]!==O||i[26]!==t||i[27]!==y||i[28]!==e||i[29]!==F){let r=O?{href:void 0,to:void 0}:{},a;i[31]!==O||i[32]!==e?(a=O?/* @__PURE__ */ _(`button`,{type:`button`}):e,i[31]=O,i[32]=e,i[33]=a):a=i[33];let o;i[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ _(j,{}),i[34]=o):o=i[34];let s;i[35]===t?s=i[36]:(s=/* @__PURE__ */ v(g,{children:[o,/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),i[35]=t,i[36]=s),n=/* @__PURE__ */ _(C,{asChild:!0,...F,ref:y,children:l(a,r,s)}),i[25]=O,i[26]=t,i[27]=y,i[28]=e,i[29]=F,i[30]=n}else n=i[30];return n}let I;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(I=/* @__PURE__ */ _(j,{}),i[37]=I):I=i[37];let L;i[38]===u?L=i[39]:(L=/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:u}),i[38]=u,i[39]=L);let R;return i[40]!==y||i[41]!==L||i[42]!==F?(R=/* @__PURE__ */ v(C,{ref:y,...F,children:[I,L]}),i[40]=y,i[41]=L,i[42]=F,i[43]=R):R=i[43],R},Badge:e=>{let r=s(14),i,a,o,c;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4]):({className:a,children:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c);let l;r[5]===o?l=r[6]:(l=n(o,`tabs-badge`),r[5]=o,r[6]=l);let u;r[7]===a?u=r[8]:(u=t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,a),r[7]=a,r[8]=u);let d;return r[9]!==i||r[10]!==c||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ _(`span`,{"data-slot":l,className:u,...c,children:i}),r[9]=i,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d}};export{N as Tabs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./use-matches-media-query-m860lols.js";import{n,t as r}from"./cookie-ca4g5CKp.js";import{n as i}from"./browser-only-Crr3sgA0.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s,useEffect as c,useRef as l,useState as u}from"react";import d from"tiny-invariant";import{jsx as f}from"react/jsx-runtime";const p=[`light`,`dark`,`light-high-contrast`,`dark-high-contrast`],m=[`system`,...p],h=e=>e;function g(e){return typeof e==`string`&&m.includes(e)}const _=e=>e;function v(e){return typeof e==`string`&&p.includes(e)}const y=`(prefers-color-scheme: dark)`,b=`(prefers-contrast: more)`,x=`mantle-ui-theme`,S=`system`,C=o(null);function w(e){let t=a(14),{children:n,forceTheme:r,ssrCookie:o}=e,s;t[0]!==r||t[1]!==o?(s=()=>{let e=F({cookie:i()?document.cookie:o});return E(e,{forceTheme:r}),e},t[0]=r,t[1]=o,t[2]=s):s=t[2];let[d,p]=u(s),m=l(null),h,_;t[3]===r?(h=t[4],_=t[5]):(h=()=>{let e=function(e){let t=e??F({cookie:document.cookie});p(t),E(t,{forceTheme:r})};e();try{`BroadcastChannel`in window&&(m.current=new BroadcastChannel(x),m.current.addEventListener(`message`,t=>{let n=t?.data?.theme;g(n)&&e(n)}))}catch{}let t=function(t){t.key===`${x}__ping`&&e()};window.addEventListener(`storage`,t);let n=window.matchMedia(y),i=window.matchMedia(b),a=function(){e()},o=function(){document.visibilityState===`visible`&&e()};return n.addEventListener(`change`,a),i.addEventListener(`change`,a),window.addEventListener(`pageshow`,a),document.addEventListener(`visibilitychange`,o),()=>{window.removeEventListener(`storage`,t),n.removeEventListener(`change`,a),i.removeEventListener(`change`,a),window.removeEventListener(`pageshow`,a),document.removeEventListener(`visibilitychange`,o),B(m.current),m.current=null}},_=[r],t[3]=r,t[4]=h,t[5]=_),c(h,_);let v;t[6]===r?v=t[7]:(v=e=>{z(e),p(e),E(e,{forceTheme:r}),L(e,{broadcastChannel:m.current,pingKey:`${x}__ping`})},t[6]=r,t[7]=v);let S;t[8]!==v||t[9]!==d?(S=[d,v],t[8]=v,t[9]=d,t[10]=S):S=t[10];let w=S,T;return t[11]!==n||t[12]!==w?(T=/* @__PURE__ */ f(C.Provider,{value:w,children:n}),t[11]=n,t[12]=w,t[13]=T):T=t[13],T}function T(){let e=s(C);return d(e,`useTheme must be used within a ThemeProvider`),e}function E(e,{forceTheme:t}={}){if(!i())return;let n=window.document.documentElement,r=window.matchMedia(y).matches,a=window.matchMedia(b).matches,o=t??O(e,{prefersDarkMode:r,prefersHighContrast:a}),s=n.dataset.theme,c=n.dataset.appliedTheme,l=g(s)?s:void 0,u=v(c)?c:void 0;(l!==e||u!==o)&&(n.classList.remove(...p),n.classList.add(o),n.dataset.theme=e,n.dataset.appliedTheme=o)}function D(){if(!i())return{appliedTheme:void 0,theme:void 0};let e=window.document.documentElement,t=g(e.dataset.theme)?e.dataset.theme:void 0;return{appliedTheme:v(e.dataset.appliedTheme)?e.dataset.appliedTheme:void 0,theme:t}}function O(e,{prefersDarkMode:t,prefersHighContrast:n}){return e===`system`?A({prefersDarkMode:t,prefersHighContrast:n}):e}function k(){let e=a(4),n=s(C),r=n==null?`system`:n[0],i=t(y),o=t(b),c;return e[0]!==i||e[1]!==o||e[2]!==r?(c=O(r,{prefersDarkMode:i,prefersHighContrast:o}),e[0]=i,e[1]=o,e[2]=r,e[3]=c):c=e[3],c}function A({prefersDarkMode:e,prefersHighContrast:t}){return t?e?`dark-high-contrast`:`light-high-contrast`:e?`dark`:`light`}function j(e){let{storageKey:t,defaultTheme:n,themes:r,resolvedThemes:i,prefersDarkModeMediaQuery:a,prefersHighContrastMediaQuery:o,forceTheme:s}=e;function c(e){return typeof e==`string`&&r.includes(e)}function l(e){let t=document.cookie;if(!t)return null;try{let n=t.split(`;`).find(t=>t.trim().startsWith(`${e}=`))?.trim().slice(e.length+1);return n?decodeURIComponent(n):null}catch{return null}}function u(e,t){let n=/* @__PURE__ */ new Date;n.setFullYear(n.getFullYear()+1);let r=window.location.hostname,i=window.location.protocol,a=r===`ngrok.com`||r.endsWith(`.ngrok.com`)?`; domain=.ngrok.com`:``,o=i===`https:`?`; Secure`:``;return`${e}=${encodeURIComponent(t)}; expires=${n.toUTCString()}; path=/${a}; SameSite=Lax${o}`}function d(e,t){try{document.cookie=u(e,t)}catch{}}function f(e,t,n){return e===`system`?n?t?`dark-high-contrast`:`light-high-contrast`:t?`dark`:`light`:e}let p=null,m=null,h=null;try{p=l(t)}catch{}if(c(p))h=p;else{try{m=window.localStorage?.getItem(t)??null}catch{}c(m)&&(h=m)}let g=c(h)?h:n,_=matchMedia(a).matches,v=matchMedia(o).matches,y=s??f(g,_,v),b=document.documentElement;if(b.dataset.appliedTheme!==y||b.dataset.theme!==g){for(let e of i)b.classList.remove(e);b.classList.add(y),b.dataset.theme=g,b.dataset.appliedTheme=y}let x=c(p);try{if(c(m)&&!x){d(t,m);try{window.localStorage.removeItem(t)}catch{}}else x||d(t,g)}catch{}}function M(e){let t={storageKey:x,defaultTheme:S,themes:m,resolvedThemes:p,prefersDarkModeMediaQuery:y,prefersHighContrastMediaQuery:b,forceTheme:e};return`(${j.toString()})(${JSON.stringify(t)})`}const N=e=>{let t=a(7),{forceTheme:n,nonce:r}=e,i;t[0]===n?i=t[1]:(i=M(n),t[0]=n,t[1]=i);let o;t[2]===i?o=t[3]:(o={__html:i},t[2]=i,t[3]=o);let s;return t[4]!==r||t[5]!==o?(s=/* @__PURE__ */ f(`script`,{dangerouslySetInnerHTML:o,nonce:r,suppressHydrationWarning:!0}),t[4]=r,t[5]=o,t[6]=s):s=t[6],s};function P(t){let n=a(16),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let o=r,s;n[2]===o?s=n[3]:(s=o??{},n[2]=o,n[3]=s);let{className:c,forceTheme:l,ssrCookie:u}=s,d=c===void 0?``:c,f,p;if(i()){let e;if(n[7]===Symbol.for(`react.memo_cache_sentinel`)){let t=window.matchMedia(y).matches,r=window.matchMedia(b).matches;f=F({cookie:document.cookie}),e=O(f,{prefersDarkMode:t,prefersHighContrast:r}),n[7]=e,n[8]=f}else e=n[7],f=n[8];p=e}else{let e;n[4]===u?(e=n[5],f=n[6]):(f=F({cookie:u}),e=O(f,{prefersDarkMode:!1,prefersHighContrast:!1}),n[4]=u,n[5]=e,n[6]=f),p=e}let m=l??p,h;n[9]!==m||n[10]!==d?(h=e(d,m),n[9]=m,n[10]=d,n[11]=h):h=n[11];let g;return n[12]!==m||n[13]!==f||n[14]!==h?(g={className:h,"data-applied-theme":m,"data-theme":f},n[12]=m,n[13]=f,n[14]=h,n[15]=g):g=n[15],g}function F({cookie:e}){if(!e)return S;let t=n(e,x);return g(t)?t:S}function I(e){return r(e,x)}function L(e,t){let{broadcastChannel:n,pingKey:r}=t;try{if(n){n.postMessage({theme:e,timestamp:Date.now()});return}}catch{}try{localStorage.setItem(r,JSON.stringify({theme:e,timestamp:Date.now()}))}catch{}}function R(e){let t=/* @__PURE__ */ new Date;t.setFullYear(t.getFullYear()+1);let{hostname:n,protocol:r}=window.location,i=n===`ngrok.com`||n.endsWith(`.ngrok.com`)?`; domain=.ngrok.com`:``,a=r===`https:`?`; Secure`:``;return`${x}=${encodeURIComponent(e)}; expires=${t.toUTCString()}; path=/${i}; SameSite=Lax${a}`}function z(e){if(i())try{document.cookie=R(e)}catch{}}function B(e){if(e!=null)try{e.close()}catch{}}export{M as a,P as c,h as d,v as f,m as h,F as i,T as l,p as m,w as n,D as o,g as p,I as r,k as s,N as t,_ as u};
|