@krizaka/ui 4.4.1 → 4.6.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 +1 -0
- package/dist/account-settings.js +56 -43
- package/dist/account-settings.js.map +1 -1
- package/dist/{chunk-CZHPWLNW.js → chunk-WKQ5CB3I.js} +18 -5
- package/dist/chunk-WKQ5CB3I.js.map +1 -0
- package/dist/columns.d.ts +132 -0
- package/dist/columns.js +91 -0
- package/dist/columns.js.map +1 -0
- package/dist/comparison-table.js +3 -3
- package/dist/comparison-table.js.map +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/kind-config-editor.js +1 -1
- package/dist/nav-bar.d.ts +1 -1
- package/dist/notification-preferences.js +1 -1
- package/dist/router.js +2 -2
- package/dist/router.js.map +1 -1
- package/dist/schema-form.js +1 -1
- package/dist/site-cahier.d.ts +2 -0
- package/dist/site-cahier.js +2 -1
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.d.ts +52 -6
- package/dist/site-footer.js +98 -60
- package/dist/site-footer.js.map +1 -1
- package/dist/{sites-iJkCPeiH.d.ts → sites-BPshUouf.d.ts} +2 -2
- package/dist/switch.d.ts +25 -3
- package/dist/switch.js +1 -1
- package/package.json +24 -10
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +2 -2
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/collection-switcher.json +1 -1
- package/registry/columns.json +319 -0
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +2 -2
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/columns/columns.d.ts +4 -0
- package/registry/examples/columns/columns.js +21 -0
- package/registry/examples/columns/columns.tsx +18 -0
- package/registry/examples/columns/photos.d.ts +4 -0
- package/registry/examples/columns/photos.js +12 -0
- package/registry/examples/columns/photos.tsx +16 -0
- package/registry/examples/columns/stats.d.ts +4 -0
- package/registry/examples/columns/stats.js +20 -0
- package/registry/examples/columns/stats.tsx +22 -0
- package/registry/examples/site-footer/family.d.ts +4 -0
- package/registry/examples/site-footer/family.js +25 -0
- package/registry/examples/site-footer/family.tsx +28 -0
- package/registry/examples/switch/row.d.ts +4 -0
- package/registry/examples/switch/row.js +14 -0
- package/registry/examples/switch/row.tsx +13 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/grid.json +4 -3
- package/registry/identity-card.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +42 -11
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/proposal.json +1 -1
- package/registry/qr-code.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +2 -2
- package/registry/schema-form.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +1 -1
- package/registry/shop-gallery.json +1 -1
- package/registry/shop.json +2 -2
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +307 -6
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +44 -7
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
- package/dist/chunk-CZHPWLNW.js.map +0 -1
package/README.md
CHANGED
|
@@ -154,6 +154,7 @@ light or a product's — is a set of tokens.
|
|
|
154
154
|
| `@krizaka/ui/chip` | `Chip` (`selected`/`defaultSelected` + `onSelectedChange`, `size` sm·md; `removable` + `removeLabel` + `onRemove`), `Chip.Group` (`type` single·multiple, `label`, `required` for single), `chip` (the slots) | client |
|
|
155
155
|
| `@krizaka/ui/chip-link` | `ChipLink` (a filter that is a link: `selected`, `current`, `size`, `asChild`), `chipVariants` (`size`, `selected`) | server |
|
|
156
156
|
| `@krizaka/ui/chip-row` | `ChipRow`, `ChipRow.Item` (a scroll-snap row of chip links, wraps from `md`: `selected`, `badge`, `asChild`) | client (arrow keys) |
|
|
157
|
+
| `@krizaka/ui/columns` | `Grid`, `Columns` (the width of the container decides: size-class columns, weighted columns that stack; the web twins of the native ones) | server-safe |
|
|
157
158
|
| `@krizaka/ui/switch` | `Switch` (`checked`/`defaultChecked` + `onCheckedChange`, `label` unless a visible label names it, `size` sm·md, `invalid`), `switchVariants` | client |
|
|
158
159
|
| `@krizaka/ui/slider` | `Slider` (`value`: a number or a `[min, max]` range, `onValueChange`, `onValueCommit`, `label`, `thumbLabels`, `formatValue` → aria-valuetext, `showLabel`, `origin`), `slider` (the slots) | client |
|
|
159
160
|
| `@krizaka/ui/checkbox` | `Checkbox` (`checked` true·false·"indeterminate" + `onCheckedChange`, `invalid`, its words as children) — sits in a `Field` | client |
|
package/dist/account-settings.js
CHANGED
|
@@ -68,7 +68,7 @@ function AccountProfileCard({ name, email, verified, verifiedLabel, unverifiedLa
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// src/account-settings/appearance-settings.tsx
|
|
71
|
-
import * as
|
|
71
|
+
import * as React4 from "react";
|
|
72
72
|
|
|
73
73
|
// src/field/field.tsx
|
|
74
74
|
import { tv as tv2 } from "tailwind-variants";
|
|
@@ -229,10 +229,12 @@ var RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupC
|
|
|
229
229
|
|
|
230
230
|
// src/switch/switch.tsx
|
|
231
231
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
232
|
+
import * as React2 from "react";
|
|
232
233
|
import { tv as tv4 } from "tailwind-variants";
|
|
233
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
234
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
234
235
|
var switchVariants = tv4({
|
|
235
236
|
slots: {
|
|
237
|
+
row: "flex min-h-11 w-full items-center justify-between gap-4",
|
|
236
238
|
root: "peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-fg-muted transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:bg-accent aria-invalid:border-danger",
|
|
237
239
|
thumb: "pointer-events-none block rounded-full bg-fg-on-media shadow-sm transition-transform data-[state=unchecked]:translate-x-0.5 motion-reduce:transition-none"
|
|
238
240
|
},
|
|
@@ -244,45 +246,56 @@ var switchVariants = tv4({
|
|
|
244
246
|
},
|
|
245
247
|
defaultVariants: { size: "md" }
|
|
246
248
|
});
|
|
247
|
-
function Switch({ label, size, invalid, className, ...props }) {
|
|
249
|
+
function Switch({ label, size, invalid, className, children, description, ...props }) {
|
|
248
250
|
const s3 = switchVariants({ size });
|
|
249
|
-
|
|
251
|
+
const id = React2.useId();
|
|
252
|
+
const row = children !== void 0;
|
|
253
|
+
const control = /* @__PURE__ */ jsx5(
|
|
250
254
|
SwitchPrimitive.Root,
|
|
251
255
|
{
|
|
252
256
|
"aria-label": label,
|
|
253
257
|
"aria-invalid": invalid || void 0,
|
|
254
258
|
"data-invalid": invalid ? "" : void 0,
|
|
255
|
-
|
|
259
|
+
"aria-labelledby": row ? `${id}t` : void 0,
|
|
260
|
+
"aria-describedby": row && description ? `${id}h` : void 0,
|
|
261
|
+
className: s3.root({ className: row ? void 0 : className }),
|
|
256
262
|
...props,
|
|
257
263
|
children: /* @__PURE__ */ jsx5(SwitchPrimitive.Thumb, { className: s3.thumb() })
|
|
258
264
|
}
|
|
259
265
|
);
|
|
266
|
+
return row ? /* @__PURE__ */ jsxs5("label", { className: s3.row({ className }), children: [
|
|
267
|
+
/* @__PURE__ */ jsxs5("span", { className: "grid min-w-0", children: [
|
|
268
|
+
/* @__PURE__ */ jsx5("span", { id: `${id}t`, className: "text-sm text-fg", children }),
|
|
269
|
+
description ? /* @__PURE__ */ jsx5("span", { id: `${id}h`, className: "text-xs text-fg-muted", children: description }) : null
|
|
270
|
+
] }),
|
|
271
|
+
control
|
|
272
|
+
] }) : control;
|
|
260
273
|
}
|
|
261
274
|
|
|
262
275
|
// src/account-settings/language-picker.tsx
|
|
263
|
-
import * as
|
|
276
|
+
import * as React3 from "react";
|
|
264
277
|
|
|
265
278
|
// src/account-settings/group-head.tsx
|
|
266
|
-
import { jsx as jsx6, jsxs as
|
|
279
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
267
280
|
function GroupHead({ id, label, description }) {
|
|
268
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-0.5", children: [
|
|
269
282
|
/* @__PURE__ */ jsx6("span", { id, className: "text-sm font-medium text-fg", children: label }),
|
|
270
283
|
description ? /* @__PURE__ */ jsx6("span", { className: "text-sm text-fg-secondary", children: description }) : null
|
|
271
284
|
] });
|
|
272
285
|
}
|
|
273
286
|
|
|
274
287
|
// src/account-settings/language-picker.tsx
|
|
275
|
-
import { jsx as jsx7, jsxs as
|
|
288
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
276
289
|
function LanguagePicker({ label, showLabel = true, description, languages, className, ...props }) {
|
|
277
|
-
const id =
|
|
278
|
-
return /* @__PURE__ */
|
|
290
|
+
const id = React3.useId();
|
|
291
|
+
return /* @__PURE__ */ jsxs7("div", { className: ["flex flex-col gap-2", className].filter(Boolean).join(" "), children: [
|
|
279
292
|
showLabel ? /* @__PURE__ */ jsx7(GroupHead, { id: `${id}-label`, label, description }) : null,
|
|
280
293
|
/* @__PURE__ */ jsx7(RadioGroup.Root, { variant: "segmented", "aria-label": showLabel ? void 0 : String(label), "aria-labelledby": showLabel ? `${id}-label` : void 0, ...props, children: languages.map((language) => /* @__PURE__ */ jsx7(RadioGroup.Segment, { value: language.code, lang: language.code, children: language.name }, language.code)) })
|
|
281
294
|
] });
|
|
282
295
|
}
|
|
283
296
|
|
|
284
297
|
// src/account-settings/appearance-settings.tsx
|
|
285
|
-
import { jsx as jsx8, jsxs as
|
|
298
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
286
299
|
var appearanceLabels = {
|
|
287
300
|
theme: "Theme",
|
|
288
301
|
themeHint: "The look of the workspace. System follows your device.",
|
|
@@ -296,18 +309,18 @@ var appearanceLabels = {
|
|
|
296
309
|
soundHint: "Small sounds when something is done. Off unless you turn it on, and never with reduced motion."
|
|
297
310
|
};
|
|
298
311
|
function Miniature({ preview }) {
|
|
299
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ jsxs8(
|
|
300
313
|
"span",
|
|
301
314
|
{
|
|
302
315
|
"aria-hidden": true,
|
|
303
316
|
className: "flex h-16 w-full overflow-hidden rounded-md border border-border-default",
|
|
304
317
|
style: { background: preview.surface0 },
|
|
305
318
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ jsxs8("span", { className: "m-1.5 flex w-1/3 flex-col gap-1 rounded-sm p-1", style: { background: preview.surface1 }, children: [
|
|
307
320
|
/* @__PURE__ */ jsx8("span", { className: "h-1 w-3/4 rounded-full", style: { background: preview.text } }),
|
|
308
321
|
/* @__PURE__ */ jsx8("span", { className: "h-1 w-1/2 rounded-full", style: { background: preview.muted } })
|
|
309
322
|
] }),
|
|
310
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ jsxs8("span", { className: "my-1.5 mr-1.5 flex flex-1 flex-col gap-1 rounded-sm p-1.5", style: { background: preview.surface2 }, children: [
|
|
311
324
|
/* @__PURE__ */ jsx8("span", { className: "h-1.5 w-2/3 rounded-full", style: { background: preview.text } }),
|
|
312
325
|
/* @__PURE__ */ jsx8("span", { className: "h-1 w-full rounded-full", style: { background: preview.muted } }),
|
|
313
326
|
/* @__PURE__ */ jsx8("span", { className: "h-1 w-5/6 rounded-full", style: { background: preview.muted } }),
|
|
@@ -320,7 +333,7 @@ function Miniature({ preview }) {
|
|
|
320
333
|
function themeArt(option) {
|
|
321
334
|
if (option.preview) return /* @__PURE__ */ jsx8(Miniature, { preview: option.preview });
|
|
322
335
|
if (option.halves) {
|
|
323
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ jsxs8("span", { "aria-hidden": true, className: "grid h-16 w-full grid-cols-2 overflow-hidden rounded-md border border-border-default", children: [
|
|
324
337
|
/* @__PURE__ */ jsx8(Miniature, { preview: option.halves[0] }),
|
|
325
338
|
/* @__PURE__ */ jsx8(Miniature, { preview: option.halves[1] })
|
|
326
339
|
] });
|
|
@@ -346,14 +359,14 @@ function AppearanceSettings({
|
|
|
346
359
|
className
|
|
347
360
|
}) {
|
|
348
361
|
const labels = { ...appearanceLabels, ...given };
|
|
349
|
-
const id =
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */ jsx8(SettingsRow, { label: labels.theme, description: labels.themeHint, children: /* @__PURE__ */ jsx8(RadioGroup.Root, { variant: "cards", label: labels.theme, value: theme, onValueChange: onThemeChange, className: "grid w-full grid-cols-2 gap-3 sm:grid-cols-3", children: themes.map((option) => /* @__PURE__ */
|
|
362
|
+
const id = React4.useId();
|
|
363
|
+
return /* @__PURE__ */ jsxs8("div", { className, children: [
|
|
364
|
+
/* @__PURE__ */ jsx8(SettingsRow, { label: labels.theme, description: labels.themeHint, children: /* @__PURE__ */ jsx8(RadioGroup.Root, { variant: "cards", label: labels.theme, value: theme, onValueChange: onThemeChange, className: "grid w-full grid-cols-2 gap-3 sm:grid-cols-3", children: themes.map((option) => /* @__PURE__ */ jsxs8(RadioGroup.Card, { value: option.id, "aria-describedby": option.description ? `${id}-${option.id}` : void 0, children: [
|
|
352
365
|
themeArt(option),
|
|
353
366
|
/* @__PURE__ */ jsx8("span", { className: "font-semibold text-fg", children: option.label }),
|
|
354
367
|
option.description ? /* @__PURE__ */ jsx8("span", { id: `${id}-${option.id}`, className: "text-xs font-normal text-fg-secondary", children: option.description }) : null
|
|
355
368
|
] }, option.id)) }) }),
|
|
356
|
-
accents && accents.length > 0 && onAccentChange ? /* @__PURE__ */ jsx8(SettingsRow, { label: labels.accent, description: labels.accentHint, htmlFor: `${id}-accent`, children: /* @__PURE__ */
|
|
369
|
+
accents && accents.length > 0 && onAccentChange ? /* @__PURE__ */ jsx8(SettingsRow, { label: labels.accent, description: labels.accentHint, htmlFor: `${id}-accent`, children: /* @__PURE__ */ jsxs8("span", { className: "flex items-center gap-2", children: [
|
|
357
370
|
/* @__PURE__ */ jsx8("span", { "aria-hidden": true, className: "h-4 w-4 rounded-full border border-border-default", style: { background: accents.find((a) => a.id === accent)?.color ?? accents[0]?.color } }),
|
|
358
371
|
/* @__PURE__ */ jsx8(Field.Root, { children: /* @__PURE__ */ jsx8(
|
|
359
372
|
"select",
|
|
@@ -374,14 +387,14 @@ function AppearanceSettings({
|
|
|
374
387
|
|
|
375
388
|
// src/account-settings/avatar-picker.tsx
|
|
376
389
|
import { RadioGroup as RadioGroupPrimitive2 } from "radix-ui";
|
|
377
|
-
import * as
|
|
390
|
+
import * as React6 from "react";
|
|
378
391
|
|
|
379
392
|
// src/file-upload/file-upload.tsx
|
|
380
393
|
import { getNumberFormat } from "@krizaka/intl";
|
|
381
394
|
import { useQueue, useQueueSnapshot } from "@krizaka/pacer/react";
|
|
382
|
-
import * as
|
|
395
|
+
import * as React5 from "react";
|
|
383
396
|
import { tv as tv5 } from "tailwind-variants";
|
|
384
|
-
import { jsx as jsx9, jsxs as
|
|
397
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
385
398
|
var fileUpload = tv5({
|
|
386
399
|
slots: {
|
|
387
400
|
zone: "relative flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border-default bg-surface-1 px-6 py-10 text-center transition-colors data-[dragging]:border-accent data-[dragging]:bg-accent-soft data-[disabled]:opacity-50 has-[:focus-visible]:border-accent",
|
|
@@ -425,11 +438,11 @@ function Dropzone({
|
|
|
425
438
|
className
|
|
426
439
|
}) {
|
|
427
440
|
const s3 = fileUpload();
|
|
428
|
-
const input =
|
|
429
|
-
const [dragging, setDragging] =
|
|
430
|
-
const [refused, setRefused] =
|
|
431
|
-
const depth =
|
|
432
|
-
const id =
|
|
441
|
+
const input = React5.useRef(null);
|
|
442
|
+
const [dragging, setDragging] = React5.useState(false);
|
|
443
|
+
const [refused, setRefused] = React5.useState([]);
|
|
444
|
+
const depth = React5.useRef(0);
|
|
445
|
+
const id = React5.useId();
|
|
433
446
|
const limit = maxFiles ?? (multiple ? Infinity : 1);
|
|
434
447
|
const take = (list) => {
|
|
435
448
|
const files = [...list];
|
|
@@ -445,7 +458,7 @@ function Dropzone({
|
|
|
445
458
|
if (accepted.length) onFiles(accepted);
|
|
446
459
|
if (rejections.length) onReject?.(rejections);
|
|
447
460
|
};
|
|
448
|
-
return /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ jsxs9(
|
|
449
462
|
"div",
|
|
450
463
|
{
|
|
451
464
|
className: s3.zone({ className }),
|
|
@@ -514,7 +527,7 @@ function Dropzone({
|
|
|
514
527
|
}
|
|
515
528
|
|
|
516
529
|
// src/account-settings/avatar-picker.tsx
|
|
517
|
-
import { jsx as jsx10, jsxs as
|
|
530
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
518
531
|
var AVATAR_NONE = "none";
|
|
519
532
|
function avatarOptionKind(option) {
|
|
520
533
|
const kind = option.kind ?? option.defaultAvatar?.kind;
|
|
@@ -531,7 +544,7 @@ function builtInAvatarOptions(kind, brand, label) {
|
|
|
531
544
|
}
|
|
532
545
|
var pictureOf = (option) => option.src ?? (option.defaultAvatar ? defaultAvatarUrl(option.defaultAvatar, { size: 256 }) : void 0);
|
|
533
546
|
function AvatarPicker({ label, showLabel, description, dense, kind = "person", options, noneLabel, uploadFile, upload, className, ...props }) {
|
|
534
|
-
const id =
|
|
547
|
+
const id = React6.useId();
|
|
535
548
|
const listed = optionsOfKind(options, kind);
|
|
536
549
|
const tile = cn(
|
|
537
550
|
"group/avatar relative shrink-0 rounded-full",
|
|
@@ -547,40 +560,40 @@ function AvatarPicker({ label, showLabel, description, dense, kind = "person", o
|
|
|
547
560
|
children: /* @__PURE__ */ jsx10(CheckGlyph, { className: "h-3 w-3" })
|
|
548
561
|
}
|
|
549
562
|
);
|
|
550
|
-
const group = /* @__PURE__ */
|
|
551
|
-
noneLabel ? /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */ jsx10("span", { "aria-hidden": true, className: "flex h-full w-full items-center justify-center rounded-full bg-surface-3 text-fg-secondary", children: /* @__PURE__ */
|
|
563
|
+
const group = /* @__PURE__ */ jsxs10(RadioGroupPrimitive2.Root, { "aria-label": label, "aria-labelledby": showLabel ? id : void 0, className: cn(dense ? "flex flex-wrap gap-2.5" : "grid grid-cols-[repeat(auto-fill,minmax(4.25rem,1fr))] gap-3", !showLabel && !uploadFile && className), ...props, children: [
|
|
564
|
+
noneLabel ? /* @__PURE__ */ jsxs10(RadioGroupPrimitive2.Item, { value: AVATAR_NONE, "aria-label": noneLabel, className: tile, children: [
|
|
565
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": true, className: "flex h-full w-full items-center justify-center rounded-full bg-surface-3 text-fg-secondary", children: /* @__PURE__ */ jsxs10("svg", { viewBox: "0 0 24 24", className: "h-1/2 w-1/2", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", children: [
|
|
553
566
|
/* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "8" }),
|
|
554
567
|
/* @__PURE__ */ jsx10("path", { d: "M6.5 17.5l11-11" })
|
|
555
568
|
] }) }),
|
|
556
569
|
check
|
|
557
570
|
] }) : null,
|
|
558
|
-
listed.map((option) => /* @__PURE__ */
|
|
571
|
+
listed.map((option) => /* @__PURE__ */ jsxs10(RadioGroupPrimitive2.Item, { value: option.id, "aria-label": option.label, className: tile, children: [
|
|
559
572
|
/* @__PURE__ */ jsx10("img", { src: pictureOf(option), alt: "", draggable: false, className: "h-full w-full rounded-full bg-surface-3 object-cover" }),
|
|
560
573
|
check
|
|
561
574
|
] }, option.id)),
|
|
562
575
|
upload ? /* @__PURE__ */ jsx10("div", { className: "flex aspect-square w-full items-center justify-center", children: upload }) : null
|
|
563
576
|
] });
|
|
564
|
-
const withUpload = uploadFile ? /* @__PURE__ */
|
|
577
|
+
const withUpload = uploadFile ? /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col gap-3", !showLabel && className), children: [
|
|
565
578
|
group,
|
|
566
579
|
/* @__PURE__ */ jsx10(Dropzone, { ...uploadFile, onFiles: (files) => files[0] && uploadFile.onFile(files[0]) })
|
|
567
580
|
] }) : group;
|
|
568
581
|
if (!showLabel) return withUpload;
|
|
569
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
570
583
|
/* @__PURE__ */ jsx10(GroupHead, { id, label, description }),
|
|
571
584
|
withUpload
|
|
572
585
|
] });
|
|
573
586
|
}
|
|
574
587
|
|
|
575
588
|
// src/account-settings/choice-cards.tsx
|
|
576
|
-
import * as
|
|
577
|
-
import { jsx as jsx11, jsxs as
|
|
589
|
+
import * as React7 from "react";
|
|
590
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
578
591
|
function ChoiceCards({ label, showLabel, description, options, className, ...props }) {
|
|
579
|
-
const base =
|
|
592
|
+
const base = React7.useId();
|
|
580
593
|
const group = /* @__PURE__ */ jsx11(RadioGroup.Root, { variant: "cards", label, "aria-labelledby": showLabel ? `${base}-label` : void 0, className: ["grid grid-cols-1 gap-3 sm:grid-cols-2", !showLabel && className].filter(Boolean).join(" "), ...props, children: options.map((option) => {
|
|
581
594
|
const describedBy = option.description ? `${base}-${option.id}` : void 0;
|
|
582
|
-
return /* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ jsxs11(RadioGroup.Card, { value: option.id, disabled: option.disabled, "aria-describedby": describedBy, children: [
|
|
596
|
+
/* @__PURE__ */ jsxs11("span", { className: "flex items-center gap-2.5 font-semibold text-fg [&>svg]:h-5 [&>svg]:w-5 [&>svg]:text-accent", children: [
|
|
584
597
|
option.icon,
|
|
585
598
|
option.title
|
|
586
599
|
] }),
|
|
@@ -588,7 +601,7 @@ function ChoiceCards({ label, showLabel, description, options, className, ...pro
|
|
|
588
601
|
] }, option.id);
|
|
589
602
|
}) });
|
|
590
603
|
if (!showLabel) return group;
|
|
591
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ jsxs11("div", { className: ["flex flex-col gap-3", className].filter(Boolean).join(" "), children: [
|
|
592
605
|
/* @__PURE__ */ jsx11(GroupHead, { id: `${base}-label`, label, description }),
|
|
593
606
|
group
|
|
594
607
|
] });
|