@krizaka/ui 2.5.0 → 2.8.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 +49 -5
- package/dist/action-bar.d.ts +38 -0
- package/dist/action-bar.js +52 -0
- package/dist/action-bar.js.map +1 -0
- package/dist/argument-card.d.ts +67 -0
- package/dist/argument-card.js +69 -0
- package/dist/argument-card.js.map +1 -0
- package/dist/audio-player.js +1 -1
- package/dist/block-link-BAg4eoZk.d.ts +12 -0
- package/dist/blocks.css +529 -0
- package/dist/button.js +5 -94
- package/dist/button.js.map +1 -1
- package/dist/card-grid.d.ts +42 -0
- package/dist/card-grid.js +47 -0
- package/dist/card-grid.js.map +1 -0
- package/dist/chunk-2AGSO3WH.js +20 -0
- package/dist/chunk-2AGSO3WH.js.map +1 -0
- package/dist/chunk-AB5D3KBG.js +37 -0
- package/dist/chunk-AB5D3KBG.js.map +1 -0
- package/dist/{chunk-YX6CNVJA.js → chunk-CPA5CF35.js} +1 -1
- package/dist/chunk-CPA5CF35.js.map +1 -0
- package/dist/chunk-K3SWZXYT.js +92 -0
- package/dist/chunk-K3SWZXYT.js.map +1 -0
- package/dist/chunk-NOVUREEC.js +274 -0
- package/dist/chunk-NOVUREEC.js.map +1 -0
- package/dist/{chunk-XUMJA5ZI.js → chunk-X6TW3X6Y.js} +2 -2
- package/dist/chunk-XCBVFMNV.js +41 -0
- package/dist/{chunk-YX6CNVJA.js.map → chunk-XCBVFMNV.js.map} +1 -1
- package/dist/chunk-XVLWVTQA.js +28 -0
- package/dist/chunk-XVLWVTQA.js.map +1 -0
- package/dist/chunk-Z6FUPB3Q.js +102 -0
- package/dist/chunk-Z6FUPB3Q.js.map +1 -0
- package/dist/code-block.d.ts +42 -0
- package/dist/code-block.js +202 -0
- package/dist/code-block.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cta-panel.d.ts +23 -0
- package/dist/cta-panel.js +20 -0
- package/dist/cta-panel.js.map +1 -0
- package/dist/data-table.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.d.ts +34 -0
- package/dist/decision-list.js +67 -0
- package/dist/decision-list.js.map +1 -0
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/geometry-CXrAW34x.d.ts +19 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +86 -4
- package/dist/index.js.map +1 -1
- package/dist/link-card.d.ts +35 -0
- package/dist/link-card.js +46 -0
- package/dist/link-card.js.map +1 -0
- package/dist/mascot-quote.d.ts +43 -0
- package/dist/mascot-quote.js +287 -0
- package/dist/mascot-quote.js.map +1 -0
- package/dist/mascot-state.d.ts +128 -0
- package/dist/mascot-state.js +95 -0
- package/dist/mascot-state.js.map +1 -0
- package/dist/mascots.d.ts +5 -20
- package/dist/mascots.js +5 -246
- package/dist/mascots.js.map +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/motion.css +25 -1
- package/dist/native.d.ts +54 -7
- package/dist/native.js +334 -166
- package/dist/native.js.map +1 -1
- package/dist/page-hero.d.ts +44 -0
- package/dist/page-hero.js +41 -0
- package/dist/page-hero.js.map +1 -0
- package/dist/page.d.ts +116 -0
- package/dist/page.js +17 -0
- package/dist/page.js.map +1 -0
- package/dist/pagination.js +25 -44
- package/dist/pagination.js.map +1 -1
- package/dist/pointer-light.d.ts +20 -0
- package/dist/pointer-light.js +12 -0
- package/dist/pointer-light.js.map +1 -0
- package/dist/search-field.js +1 -1
- package/dist/section-backdrop.js +4 -22
- package/dist/section-backdrop.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/terminal-replay.d.ts +68 -0
- package/dist/terminal-replay.js +231 -0
- package/dist/terminal-replay.js.map +1 -0
- package/dist/toc.d.ts +23 -0
- package/dist/toc.js +39 -0
- package/dist/toc.js.map +1 -0
- package/dist/video-player.js +1 -1
- package/package.json +208 -8
- package/registry/action-bar.json +205 -0
- package/registry/alert.json +1 -1
- package/registry/argument-card.json +327 -0
- package/registry/audio-player.json +2 -2
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +221 -0
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/code-block.json +262 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +154 -0
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +144 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/action-bar/buttons.d.ts +4 -0
- package/registry/examples/action-bar/buttons.js +22 -0
- package/registry/examples/action-bar/buttons.tsx +17 -0
- package/registry/examples/action-bar/icons.d.ts +4 -0
- package/registry/examples/action-bar/icons.js +24 -0
- package/registry/examples/action-bar/icons.tsx +23 -0
- package/registry/examples/argument-card/building-block.d.ts +4 -0
- package/registry/examples/argument-card/building-block.js +29 -0
- package/registry/examples/argument-card/building-block.tsx +29 -0
- package/registry/examples/argument-card/grid.d.ts +4 -0
- package/registry/examples/argument-card/grid.js +17 -0
- package/registry/examples/argument-card/grid.tsx +19 -0
- package/registry/examples/argument-card/unfold.d.ts +4 -0
- package/registry/examples/argument-card/unfold.js +26 -0
- package/registry/examples/argument-card/unfold.tsx +21 -0
- package/registry/examples/card-grid/products.d.ts +4 -0
- package/registry/examples/card-grid/products.js +16 -0
- package/registry/examples/card-grid/products.tsx +13 -0
- package/registry/examples/card-grid/reveal.d.ts +4 -0
- package/registry/examples/card-grid/reveal.js +13 -0
- package/registry/examples/card-grid/reveal.tsx +16 -0
- package/registry/examples/code-block/build-tools.d.ts +4 -0
- package/registry/examples/code-block/build-tools.js +30 -0
- package/registry/examples/code-block/build-tools.tsx +25 -0
- package/registry/examples/code-block/file.d.ts +4 -0
- package/registry/examples/code-block/file.js +17 -0
- package/registry/examples/code-block/file.tsx +13 -0
- package/registry/examples/cta-panel/discuss.d.ts +4 -0
- package/registry/examples/cta-panel/discuss.js +31 -0
- package/registry/examples/cta-panel/discuss.tsx +23 -0
- package/registry/examples/decision-list/product.d.ts +4 -0
- package/registry/examples/decision-list/product.js +35 -0
- package/registry/examples/decision-list/product.tsx +30 -0
- package/registry/examples/link-card/docs-hub.d.ts +4 -0
- package/registry/examples/link-card/docs-hub.js +18 -0
- package/registry/examples/link-card/docs-hub.tsx +20 -0
- package/registry/examples/link-card/external.d.ts +4 -0
- package/registry/examples/link-card/external.js +22 -0
- package/registry/examples/link-card/external.tsx +16 -0
- package/registry/examples/link-card/stack.d.ts +4 -0
- package/registry/examples/link-card/stack.js +26 -0
- package/registry/examples/link-card/stack.tsx +21 -0
- package/registry/examples/mascot-quote/callout.d.ts +4 -0
- package/registry/examples/mascot-quote/callout.js +11 -0
- package/registry/examples/mascot-quote/callout.tsx +10 -0
- package/registry/examples/mascot-quote/inline.d.ts +4 -0
- package/registry/examples/mascot-quote/inline.js +11 -0
- package/registry/examples/mascot-quote/inline.tsx +10 -0
- package/registry/examples/mascot-state/empty.d.ts +4 -0
- package/registry/examples/mascot-state/empty.js +22 -0
- package/registry/examples/mascot-state/empty.tsx +20 -0
- package/registry/examples/mascot-state/error.d.ts +4 -0
- package/registry/examples/mascot-state/error.js +23 -0
- package/registry/examples/mascot-state/error.tsx +21 -0
- package/registry/examples/mascot-state/loading.d.ts +4 -0
- package/registry/examples/mascot-state/loading.js +22 -0
- package/registry/examples/mascot-state/loading.tsx +16 -0
- package/registry/examples/mascot-state/native/default.d.ts +4 -0
- package/registry/examples/mascot-state/native/default.dark.png +0 -0
- package/registry/examples/mascot-state/native/default.js +25 -0
- package/registry/examples/mascot-state/native/default.light.png +0 -0
- package/registry/examples/mascot-state/native/default.tsx +19 -0
- package/registry/examples/mascot-state/success.d.ts +4 -0
- package/registry/examples/mascot-state/success.js +21 -0
- package/registry/examples/mascot-state/success.tsx +19 -0
- package/registry/examples/mascot-state/welcome.d.ts +4 -0
- package/registry/examples/mascot-state/welcome.js +21 -0
- package/registry/examples/mascot-state/welcome.tsx +19 -0
- package/registry/examples/mascots/flock.tsx +1 -1
- package/registry/examples/mascots/lovebird.d.ts +4 -0
- package/registry/examples/mascots/lovebird.js +19 -0
- package/registry/examples/mascots/lovebird.tsx +18 -0
- package/registry/examples/mascots/native/lovebird.d.ts +4 -0
- package/registry/examples/mascots/native/lovebird.dark.png +0 -0
- package/registry/examples/mascots/native/lovebird.js +21 -0
- package/registry/examples/mascots/native/lovebird.light.png +0 -0
- package/registry/examples/mascots/native/lovebird.tsx +18 -0
- package/registry/examples/page/backdrop.d.ts +4 -0
- package/registry/examples/page/backdrop.js +23 -0
- package/registry/examples/page/backdrop.tsx +18 -0
- package/registry/examples/page/facts.d.ts +4 -0
- package/registry/examples/page/facts.js +24 -0
- package/registry/examples/page/facts.tsx +21 -0
- package/registry/examples/page/frame.d.ts +4 -0
- package/registry/examples/page/frame.js +15 -0
- package/registry/examples/page/frame.tsx +17 -0
- package/registry/examples/page/sections.d.ts +4 -0
- package/registry/examples/page/sections.js +14 -0
- package/registry/examples/page/sections.tsx +15 -0
- package/registry/examples/page-hero/building-block.d.ts +4 -0
- package/registry/examples/page-hero/building-block.js +24 -0
- package/registry/examples/page-hero/building-block.tsx +20 -0
- package/registry/examples/page-hero/hub.d.ts +4 -0
- package/registry/examples/page-hero/hub.js +21 -0
- package/registry/examples/page-hero/hub.tsx +15 -0
- package/registry/examples/pointer-light/list.d.ts +4 -0
- package/registry/examples/pointer-light/list.js +16 -0
- package/registry/examples/pointer-light/list.tsx +14 -0
- package/registry/examples/terminal-replay/at-rest.d.ts +4 -0
- package/registry/examples/terminal-replay/at-rest.js +32 -0
- package/registry/examples/terminal-replay/at-rest.tsx +26 -0
- package/registry/examples/terminal-replay/session.d.ts +4 -0
- package/registry/examples/terminal-replay/session.js +34 -0
- package/registry/examples/terminal-replay/session.tsx +28 -0
- package/registry/examples/toc/reading-page.d.ts +4 -0
- package/registry/examples/toc/reading-page.js +21 -0
- package/registry/examples/toc/reading-page.tsx +21 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +2 -2
- package/registry/glow-card.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +265 -5
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/link-card.json +279 -0
- package/registry/loader.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +191 -0
- package/registry/mascot-state.json +1249 -0
- package/registry/mascots.json +41 -21
- package/registry/media-capture.json +4 -4
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +254 -0
- package/registry/page.json +497 -0
- package/registry/pagination.json +2 -2
- package/registry/pointer-light.json +119 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +3 -3
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +317 -0
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +157 -0
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +4 -4
- package/registry/video-trimmer.json +3 -3
- /package/dist/{chunk-XUMJA5ZI.js.map → chunk-X6TW3X6Y.js.map} +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
**The Krizaka front-end platform's components, shared by every product.**
|
|
11
11
|
The primitives (button, badge, avatar, field, theme, countdown…) on the semantic `--kz-*` tokens, the animated marks
|
|
12
|
-
of Krizaka, Orazaka and
|
|
12
|
+
of Krizaka, Orazaka, Orochia and Yazakia, and the Krizaka motion signature — one easing, one way to enter, reveal, roll, shine
|
|
13
13
|
and open.
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/@krizaka/ui)
|
|
@@ -159,10 +159,11 @@ light or a product's — is a set of tokens.
|
|
|
159
159
|
| `@krizaka/ui/meter` | `Meter` (`label`, `value`/`min`/`max`, `valueText`, `thresholds`, `optimum` low·high, `parts` with their legend, `variant` bar·ring, `size`, `showLabel`), `MeterValue` | server |
|
|
160
160
|
| `@krizaka/ui/stepper` | `Stepper` (`steps`: `title`, `description`, `status`, `value`, `content`; `current`, `labels` of the states, `orientation`) | server |
|
|
161
161
|
| `@krizaka/ui/number-ticker` | `NumberTicker` (`value`, `locale`, `format`, `trigger` view·change, `duration`, `announce`, `align`) | client |
|
|
162
|
+
| `@krizaka/ui/terminal-replay` | `TerminalReplay` (`steps` command + output lines with a tone, `label`, `title`, `prompt`, `playLabel`/`pauseLabel`/`replayLabel`, `copyLabel`/`copiedLabel`, `typingSpeed`, `lineDelay`, `stepDelay`, `rows`, `autoPlay`) | client |
|
|
162
163
|
| `@krizaka/ui/glow-card` | `GlowCard` (`glow` border·spotlight·both, `alive`, `asChild`) | client |
|
|
163
164
|
| `@krizaka/ui/marquee` | `Marquee` (`label`, `pauseLabel`, `playLabel`, `speed` px/s, `direction`, `fade`, `defaultPaused`) | client |
|
|
164
165
|
| `@krizaka/ui/section-backdrop` | `SectionBackdrop` (`as`, `direction` down·up, `dome`, `grid`, `media` blurred for depth of field, `animated`): a page section on the brand's section gradient — see `@krizaka/tokens` BRAND.md, "Visual language" | server |
|
|
165
|
-
| `@krizaka/ui/mascots` | `Mascot` (`bird` falcon·owl·duck·flamingo·pigeon, `mood` welcome·thinking·success·empty·error, `tone` brand·own, `size`, `animated`, `title`), `MASCOT_BIRDS`, `MASCOT_MOODS`: the Krizaka flock, in the host brand's accent — one bird at a moment that matters (onboarding, a long wait, a success, an empty list, an error); native `Mascot` in `/native` | client |
|
|
166
|
+
| `@krizaka/ui/mascots` | `Mascot` (`bird` falcon·owl·duck·flamingo·pigeon·lovebird, `mood` welcome·thinking·success·empty·error, `tone` brand·own, `size`, `animated`, `title`), `MASCOT_BIRDS`, `MASCOT_MOODS`: the Krizaka flock, in the host brand's accent — one bird at a moment that matters (onboarding, a long wait, a success, an empty list, an error); native `Mascot` in `/native` | client |
|
|
166
167
|
| `@krizaka/ui/iso` | the isometric kit: `IsoHub` (a hero driven by data: `layers`, `dome`, `satellites`, `highlight`), `IsoScene`, `IsoPrism`, `IsoStack`, `IsoDome`, `IsoTile`, `IsoLink`, `IsoNode`, `IsoLabel`, the projection helpers — static SVG animated by motion.css | server |
|
|
167
168
|
| `@krizaka/ui/motion` | `MotionObserver` (reveal, off-screen pause, settle, spotlight, magnetism) and `RotatingWord` (no layout shift) | client |
|
|
168
169
|
| `@krizaka/ui/pagination` | `Pagination` (pages: `page`, `pageCount`, `onPageChange` or `getHref` for links; cursor: `hasPrevious`/`hasNext`, `onPrevious`/`onNext`; `status`, `pageSize` + `pageSizeOptions`, `siblings`, `boundaries`, `labels`; folds into "Page 3 of 12" in a narrow container), `pageRange` | server |
|
|
@@ -178,11 +179,23 @@ light or a product's — is a set of tokens.
|
|
|
178
179
|
| `@krizaka/ui/video-trimmer` | `VideoTrimmer` (`duration`, `value` [start, end], `minLength`, `step`/`largeStep`, `frames` or children, `time` + `onSeek`, `classNames` per part, `renderHandle`) | client |
|
|
179
180
|
| `@krizaka/ui/audio-player` | `AudioPlayer` (a seekable waveform: `peaks` or `computePeaks`, `bars`, `playbackRates`, `duration`), `resamplePeaks`, `computeAudioPeaks` | client |
|
|
180
181
|
| `@krizaka/ui/image-cropper` | `ImageCropper` (`aspect`, `round`, an image or a `<video>`, a focus point + zoom out, keyboard and zoom slider), `cropRect` | client |
|
|
182
|
+
| `@krizaka/ui/page` | the page frame: `Page` (`size` narrow·default·wide·full, `as`), `Section` (`id`, `eyebrow`, `title`, `lead`, `actions`, `divider`, `spacing` sm·md·lg, `backdrop`, `size`, `reveal`), `SectionHeading`, `Facts` (`items`: `label`, `tone` ok·wip·neutral, `href`), `Ticks` (backticks read as code) — see [Page blocks](#page-blocks) | server |
|
|
183
|
+
| `@krizaka/ui/page-hero` | `PageHero` (`title` → the h1, `eyebrow`, `lead`, `back`, `aside`, `backdrop` grid·plain·none, `align`, `size`, `linkAs`; facts or actions as children) | server |
|
|
184
|
+
| `@krizaka/ui/card-grid` | `CardGrid` (`min`, `fit` fill·fit, `align`, `reveal` staggered by `columns`, `light`, `as` div·ul·ol) | client |
|
|
185
|
+
| `@krizaka/ui/pointer-light` | `PointerLight` (`target`), `usePointerLight(ref, target)`: the light that follows the pointer over `[data-kz-light]` cards | client |
|
|
186
|
+
| `@krizaka/ui/link-card` | `LinkCard` (the whole card one link: `href`, `icon`, `meta`, `title`, `titleAs`, `description`, `extra`, `cta`, `layout` row·stack, `linkAs`) | server |
|
|
187
|
+
| `@krizaka/ui/argument-card` | `ArgumentCard` (compact: `icon`, `title`, `meta`, `facts`, `hook` — the trap in one line —, `more`, `actions`; in a panel: `points`, `rule`, `details`, `panelLabel`) | server |
|
|
188
|
+
| `@krizaka/ui/mascot-quote` | `MascotQuote` (`bird`, `mood`, `label`, the sentence as children, `variant` inline·callout, `animated`) | client |
|
|
189
|
+
| `@krizaka/ui/decision-list` | `DecisionList` (`decisions`: `chose`, `refused`, `because`, `cost`; `labels`, `reveal`) | server |
|
|
190
|
+
| `@krizaka/ui/code-block` | `CodeBlock` (`code`, `language`, `file`, `copyLabel`, `copiedLabel`, `highlight`), `CodeTabs` (`label`, `tabs`), `highlight` | client |
|
|
191
|
+
| `@krizaka/ui/action-bar` | `ActionBar` (`actions`: `href`, `label`, `icon`; `variant` buttons·icons — the words in a CSS tooltip —, `primaryFirst`, `size`, `label`, `linkAs`) | server |
|
|
192
|
+
| `@krizaka/ui/cta-panel` | `CtaPanel` (`id`, `title`, `body`, the actions as children, `level`, `reveal`) | server |
|
|
193
|
+
| `@krizaka/ui/toc` | `Toc` (`label`, `items`; the section being read marked), `TocLayout` (`toc`, the sections as children) | client |
|
|
181
194
|
| `@krizaka/ui/native/video-player` | React Native `VideoPlayer` on expo-video (optional peer) | native |
|
|
182
195
|
| `@krizaka/ui/native/media-capture` | React Native `MediaCapture` on expo-camera (optional peer) | native |
|
|
183
196
|
| `@krizaka/ui` | the marks, `MotionObserver`, `RotatingWord`, `cx` (unchanged) | client |
|
|
184
197
|
| `@krizaka/ui/native` | React Native: `ThemeProvider`/`useTheme`, `Txt`, `Button`, `IconButton`, `Card.*`, `Badge`, `Chip` (+ `Group`), `Avatar` (+ `Group`), `Skeleton`, `EmptyState`, `Spinner`, `Countdown`, `Segmented`, `Progress`, `Toaster`/`toast`, `Pagination`, `SearchField`, the marks — see [React Native](#react-native) | native |
|
|
185
|
-
| `@krizaka/ui/motion.css`, `@krizaka/ui/tailwind.css` | the motion signature; the `@source` of the primitives' classes | CSS |
|
|
198
|
+
| `@krizaka/ui/motion.css`, `@krizaka/ui/blocks.css`, `@krizaka/ui/tailwind.css` | the motion signature; the page blocks' styles (imported once by the app); the `@source` of the primitives' classes | CSS |
|
|
186
199
|
| `@krizaka/ui/registry/<name>`, `@krizaka/ui/registry/examples/<name>/<example>` | the registry (JSON) and the examples — see [Registry](#registry--the-code-drives-the-documentation) | data · client |
|
|
187
200
|
|
|
188
201
|
The theme is one mechanism for every product: dark by default, `html.light` for light, `html.theme-<name>` for a named
|
|
@@ -200,6 +213,36 @@ applies it before the first paint (no flash), the provider reports it. A persist
|
|
|
200
213
|
<ThemeToggle label={(mode) => t(`theme.${mode}`)} />
|
|
201
214
|
```
|
|
202
215
|
|
|
216
|
+
## Page blocks
|
|
217
|
+
|
|
218
|
+
> Category **blocks** of krizaka.com/docs/ui. The pieces every page of a Krizaka site is made of — one frame, one hero,
|
|
219
|
+
> sections on one rhythm, cards that lead or argue, decisions, code, calls to act — so every page reads the same.
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { Page, Section, Facts, Ticks } from "@krizaka/ui/page";
|
|
223
|
+
import { PageHero } from "@krizaka/ui/page-hero";
|
|
224
|
+
import { CardGrid } from "@krizaka/ui/card-grid";
|
|
225
|
+
import { LinkCard } from "@krizaka/ui/link-card";
|
|
226
|
+
|
|
227
|
+
<PageHero eyebrow={t("docs.kicker")} title={t("docs.title")} lead={t("docs.lead")} linkAs={Link} />
|
|
228
|
+
<Section id="start" eyebrow={t("docs.start")} title={t("docs.startTitle")}>
|
|
229
|
+
<CardGrid min={280}>
|
|
230
|
+
{entries.map((e) => <LinkCard key={e.id} href={e.href} linkAs={Link} icon={e.icon} title={e.title} description={e.text} cta={t("open")} />)}
|
|
231
|
+
</CardGrid>
|
|
232
|
+
</Section>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
- **One frame.** `Page` (and every `Section`, every `PageHero`) is at most `--kz-page-max` wide (72rem; `narrow` 48rem,
|
|
236
|
+
`wide` 88rem) with the gutters of `--kz-page-gutter` (16 → 32 px). Give the site's navigation the same width: the bar,
|
|
237
|
+
the hero and the sections share their edges at every width.
|
|
238
|
+
- **Styles.** `@krizaka/ui/blocks.css` (plain CSS on the `--kz-*` tokens, `kz-*` classes), imported once by the app —
|
|
239
|
+
`import "@krizaka/ui/blocks.css"` in its root layout (or `@import` by package path in its global stylesheet). `--kz-hero-top` clears a fixed bar; `--kz-anchor-offset` places anchors.
|
|
240
|
+
- **A subject's colour.** Blocks read `--kz-hue` (rails, tiles, lights), `--kz-hue-2` and `--kz-hue-text` (small text,
|
|
241
|
+
≥ 4.5:1), falling back to the brand's accent: set them on a card or a wrapper; `.brand-<id>` sets the accent.
|
|
242
|
+
- **Links.** Blocks that link take `linkAs` (Next's `Link`) for internal addresses; an absolute URL opens in a new tab.
|
|
243
|
+
- **Motion.** `reveal` uses `[data-reveal]` (MotionObserver): never on the first screen. The pointer's light, the lifts
|
|
244
|
+
and the hops stop under `prefers-reduced-motion`; nothing loops.
|
|
245
|
+
|
|
203
246
|
## Registry — the code drives the documentation
|
|
204
247
|
|
|
205
248
|
Every component is also published as data: **[krizaka.com/docs/ui](https://www.krizaka.com/docs/ui)** is generated
|
|
@@ -292,7 +335,7 @@ const { theme, scheme, mode, setMode, radius } = useTheme(); // theme.surface1,
|
|
|
292
335
|
| `Segmented` | `options` (`value`, `label`, `disabled`), `value`, `onValueChange`, `size` | The web `Tabs variant="segmented"` (a tab list). To filter, `Chip.Group`. |
|
|
293
336
|
| `Progress` | `variant` bar·ring, `size`, `value`/`max`, `label`, `valueText`, a ring's centre as children | The fill is the `accent` → `accent2` gradient (react-native-svg); it animates to each new value. |
|
|
294
337
|
| `Toaster`, `toast` | `toast(title, { description, tone, icon, action, onPress, id, duration, onDismiss })`, `toast.success/warning/error/info`, `toast.dismiss(id?)`; `Toaster closeLabel position offset duration max` | No sonner: a light queue of its own. `offset` takes the safe-area inset (no safe-area dependency). |
|
|
295
|
-
| `KrizakaMark`, `OrazakaMark`, `OrochiaMark`, `ProductMark` (`id`) | `size`, `animated`, `title`, `neutral` (default `theme.textMuted`) | The brand marks, drawn with react-native-svg from the web marks' geometry. |
|
|
338
|
+
| `KrizakaMark`, `OrazakaMark`, `OrochiaMark`, `YazakiaMark`, `ProductMark` (`id`) | `size`, `animated`, `title`, `neutral` (default `theme.textMuted`) | The brand marks, drawn with react-native-svg from the web marks' geometry. |
|
|
296
339
|
|
|
297
340
|
Every animation (skeleton, badge dot, urgent countdown, progress, toast entrance, the marks) stops when the system
|
|
298
341
|
asks to reduce motion (`useReducedMotion()`). Accessibility goes through `role` and `aria-*` (RN ≥ 0.71): headings,
|
|
@@ -322,11 +365,12 @@ Testing Library (`src/native/*.test.tsx`); `scripts/native-dist.mjs` checks that
|
|
|
322
365
|
## The marks
|
|
323
366
|
|
|
324
367
|
```tsx
|
|
325
|
-
import { KrizakaLogo, OrazakaLogo, OrochiaLogo, ProductLogo } from "@krizaka/ui";
|
|
368
|
+
import { KrizakaLogo, OrazakaLogo, OrochiaLogo, ProductLogo, YazakiaLogo } from "@krizaka/ui";
|
|
326
369
|
|
|
327
370
|
<OrochiaLogo size={36} /> // decorative (aria-hidden)
|
|
328
371
|
<KrizakaLogo size={48} title="Krizaka" /> // an image with an accessible name
|
|
329
372
|
<ProductLogo id="orazaka" animated={false} /> // by id, still
|
|
373
|
+
<YazakiaLogo size={32} /> // Yazakia: emerald → turquoise, two who meet
|
|
330
374
|
```
|
|
331
375
|
|
|
332
376
|
Neutral strokes follow the host's `--kz-*` tokens when they exist (`--kz-border-strong`, `--kz-text-muted`…) and the
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { L as LinkComponent } from './block-link-BAg4eoZk.js';
|
|
3
|
+
|
|
4
|
+
interface Action {
|
|
5
|
+
/** Where it leads. An absolute URL opens in a new tab, with the external mark. */
|
|
6
|
+
href: string;
|
|
7
|
+
/** Its words (the accessible name, and the tooltip of an icon action). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Its icon (a signature icon): decorative. Required by `variant="icons"`. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
type ActionBarProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
13
|
+
/** The actions, in order of importance. */
|
|
14
|
+
actions: readonly Action[];
|
|
15
|
+
/**
|
|
16
|
+
* `buttons` (with their words) or `icons` (icon buttons, the words in a tooltip).
|
|
17
|
+
* @default "buttons"
|
|
18
|
+
*/
|
|
19
|
+
variant?: "buttons" | "icons";
|
|
20
|
+
/**
|
|
21
|
+
* The first action as the primary button (the one action a block is about); the others stay secondary.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
primaryFirst?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The buttons' size: `sm` in a card, `md` in a section, `lg` on a hero or a closing call.
|
|
27
|
+
* @default "md"
|
|
28
|
+
*/
|
|
29
|
+
size?: "sm" | "md" | "lg";
|
|
30
|
+
/** What the actions are about (`Talk about Krizaka Java`): the list's accessible name. */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** The app's link component for internal addresses (Next's `Link`); an `<a>` otherwise. */
|
|
33
|
+
linkAs?: LinkComponent;
|
|
34
|
+
};
|
|
35
|
+
/** A row of link actions: buttons with their words, or icon buttons with a tooltip. */
|
|
36
|
+
declare function ActionBar({ actions, variant, primaryFirst, size, label, linkAs, className, ...props }: ActionBarProps): React.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { type Action, ActionBar, type ActionBarProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockLink,
|
|
3
|
+
isExternal
|
|
4
|
+
} from "./chunk-2AGSO3WH.js";
|
|
5
|
+
import {
|
|
6
|
+
ExternalGlyph
|
|
7
|
+
} from "./chunk-XCBVFMNV.js";
|
|
8
|
+
import {
|
|
9
|
+
buttonVariants
|
|
10
|
+
} from "./chunk-Z6FUPB3Q.js";
|
|
11
|
+
import {
|
|
12
|
+
cn
|
|
13
|
+
} from "./chunk-FJDSLNXK.js";
|
|
14
|
+
import "./chunk-43PTCDTL.js";
|
|
15
|
+
|
|
16
|
+
// src/action-bar/action-bar.tsx
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function ActionBar({ actions, variant = "buttons", primaryFirst = false, size = "md", label, linkAs, className, ...props }) {
|
|
19
|
+
const icons = variant === "icons";
|
|
20
|
+
return /* @__PURE__ */ jsx("ul", { className: cn("kz-actions", className), "data-variant": icons ? "icons" : void 0, "aria-label": label, ...props, children: actions.map((a, i) => {
|
|
21
|
+
const external = isExternal(a.href);
|
|
22
|
+
return /* @__PURE__ */ jsx("li", { children: icons ? /* @__PURE__ */ jsx(
|
|
23
|
+
BlockLink,
|
|
24
|
+
{
|
|
25
|
+
href: a.href,
|
|
26
|
+
linkAs,
|
|
27
|
+
external,
|
|
28
|
+
"aria-label": a.label,
|
|
29
|
+
"data-tip": a.label,
|
|
30
|
+
className: buttonVariants({ variant: "ghost", size: "icon", shape: "cut", className: size === "sm" ? "h-9 w-9" : void 0 }),
|
|
31
|
+
children: a.icon
|
|
32
|
+
}
|
|
33
|
+
) : /* @__PURE__ */ jsxs(
|
|
34
|
+
BlockLink,
|
|
35
|
+
{
|
|
36
|
+
href: a.href,
|
|
37
|
+
linkAs,
|
|
38
|
+
external,
|
|
39
|
+
className: buttonVariants({ variant: primaryFirst && i === 0 ? "primary" : "secondary", size, shape: "cut", className: "gap-2" }),
|
|
40
|
+
children: [
|
|
41
|
+
a.icon,
|
|
42
|
+
a.label,
|
|
43
|
+
external && /* @__PURE__ */ jsx(ExternalGlyph, { className: "h-3 w-3 opacity-70" })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
) }, a.href);
|
|
47
|
+
}) });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
ActionBar
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=action-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/action-bar/action-bar.tsx"],"sourcesContent":["// Server-safe. A row of actions that leave or move on (blocks.css): discuss · propose · report, read the docs, see the\n// code. `buttons`: buttons with their words — the end of a page or a section. `icons`: icon buttons whose words are the\n// accessible name and a tooltip on hover and focus (CSS only: no script, no portal) — the foot of a card.\nimport type * as React from \"react\";\n\nimport { BlockLink, isExternal, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { ExternalGlyph } from \"../glyphs\";\n\nexport interface Action {\n /** Where it leads. An absolute URL opens in a new tab, with the external mark. */\n href: string;\n /** Its words (the accessible name, and the tooltip of an icon action). */\n label: string;\n /** Its icon (a signature icon): decorative. Required by `variant=\"icons\"`. */\n icon?: React.ReactNode;\n}\n\nexport type ActionBarProps = React.HTMLAttributes<HTMLUListElement> & {\n /** The actions, in order of importance. */\n actions: readonly Action[];\n /**\n * `buttons` (with their words) or `icons` (icon buttons, the words in a tooltip).\n * @default \"buttons\"\n */\n variant?: \"buttons\" | \"icons\";\n /**\n * The first action as the primary button (the one action a block is about); the others stay secondary.\n * @default false\n */\n primaryFirst?: boolean;\n /**\n * The buttons' size: `sm` in a card, `md` in a section, `lg` on a hero or a closing call.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /** What the actions are about (`Talk about Krizaka Java`): the list's accessible name. */\n label?: string;\n /** The app's link component for internal addresses (Next's `Link`); an `<a>` otherwise. */\n linkAs?: LinkComponent;\n};\n\n/** A row of link actions: buttons with their words, or icon buttons with a tooltip. */\nexport function ActionBar({ actions, variant = \"buttons\", primaryFirst = false, size = \"md\", label, linkAs, className, ...props }: ActionBarProps) {\n const icons = variant === \"icons\";\n return (\n <ul className={cn(\"kz-actions\", className)} data-variant={icons ? \"icons\" : undefined} aria-label={label} {...props}>\n {actions.map((a, i) => {\n const external = isExternal(a.href);\n return (\n <li key={a.href}>\n {icons ? (\n <BlockLink\n href={a.href}\n linkAs={linkAs}\n external={external}\n aria-label={a.label}\n data-tip={a.label}\n className={buttonVariants({ variant: \"ghost\", size: \"icon\", shape: \"cut\", className: size === \"sm\" ? \"h-9 w-9\" : undefined })}\n >\n {a.icon}\n </BlockLink>\n ) : (\n <BlockLink\n href={a.href}\n linkAs={linkAs}\n external={external}\n className={buttonVariants({ variant: primaryFirst && i === 0 ? \"primary\" : \"secondary\", size, shape: \"cut\", className: \"gap-2\" })}\n >\n {a.icon}\n {a.label}\n {external && <ExternalGlyph className=\"h-3 w-3 opacity-70\" />}\n </BlockLink>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqDc,cAWA,YAXA;AATP,SAAS,UAAU,EAAE,SAAS,UAAU,WAAW,eAAe,OAAO,OAAO,MAAM,OAAO,QAAQ,WAAW,GAAG,MAAM,GAAmB;AACjJ,QAAM,QAAQ,YAAY;AAC1B,SACE,oBAAC,QAAG,WAAW,GAAG,cAAc,SAAS,GAAG,gBAAc,QAAQ,UAAU,QAAW,cAAY,OAAQ,GAAG,OAC3G,kBAAQ,IAAI,CAAC,GAAG,MAAM;AACrB,UAAM,WAAW,WAAW,EAAE,IAAI;AAClC,WACE,oBAAC,QACE,kBACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,EAAE;AAAA,QACR;AAAA,QACA;AAAA,QACA,cAAY,EAAE;AAAA,QACd,YAAU,EAAE;AAAA,QACZ,WAAW,eAAe,EAAE,SAAS,SAAS,MAAM,QAAQ,OAAO,OAAO,WAAW,SAAS,OAAO,YAAY,OAAU,CAAC;AAAA,QAE3H,YAAE;AAAA;AAAA,IACL,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,EAAE;AAAA,QACR;AAAA,QACA;AAAA,QACA,WAAW,eAAe,EAAE,SAAS,gBAAgB,MAAM,IAAI,YAAY,aAAa,MAAM,OAAO,OAAO,WAAW,QAAQ,CAAC;AAAA,QAE/H;AAAA,YAAE;AAAA,UACF,EAAE;AAAA,UACF,YAAY,oBAAC,iBAAc,WAAU,sBAAqB;AAAA;AAAA;AAAA,IAC7D,KAtBK,EAAE,IAwBX;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Fact } from './page.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { L as LinkComponent } from './block-link-BAg4eoZk.js';
|
|
4
|
+
import './section-backdrop.js';
|
|
5
|
+
import 'tailwind-variants';
|
|
6
|
+
|
|
7
|
+
type ArgumentCardProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
8
|
+
/** The id of the title: the card's accessible name. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** The title: the subject (a building block, a feature, a plan). */
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
/** The icon tile (a signature icon): decorative. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** A mono line under the title (a repository, a package). */
|
|
15
|
+
meta?: React.ReactNode;
|
|
16
|
+
/** Small, in the top corner: the bird whose rule it is (a `Mascot` of 40 px, still). Decorative. */
|
|
17
|
+
mark?: React.ReactNode;
|
|
18
|
+
/** Compact facts under the line: registry and version, a status said honestly. */
|
|
19
|
+
facts?: readonly Fact[];
|
|
20
|
+
/**
|
|
21
|
+
* The problem in ONE line (≤ 90 characters): what a reader keeps if they read nothing else. `label` (`The trap`) is
|
|
22
|
+
* read by assistive technology before it, not shown.
|
|
23
|
+
*/
|
|
24
|
+
hook: {
|
|
25
|
+
label: React.ReactNode;
|
|
26
|
+
text: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/** Unfolded only: what it does, as a few short points, with their label (`What it does`). */
|
|
29
|
+
points?: {
|
|
30
|
+
label: React.ReactNode;
|
|
31
|
+
items: readonly React.ReactNode[];
|
|
32
|
+
};
|
|
33
|
+
/** Unfolded only: the rule told by a bird (a `MascotQuote`, `variant="inline"`). */
|
|
34
|
+
rule?: React.ReactNode;
|
|
35
|
+
/** Unfolded only: the long version, as labelled paragraphs. */
|
|
36
|
+
details?: readonly {
|
|
37
|
+
label: React.ReactNode;
|
|
38
|
+
text: React.ReactNode;
|
|
39
|
+
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Without a detail page: the words that unfold the card in place (`Details`) — a native `<details>` holding the
|
|
42
|
+
* points, the rule and the long version. Ignored with `more`: the detail page holds them.
|
|
43
|
+
*/
|
|
44
|
+
panelLabel?: React.ReactNode;
|
|
45
|
+
/** The way in: a detail page — one short action at the foot (`Details`). With it, the card is only its face. */
|
|
46
|
+
more?: {
|
|
47
|
+
href: string;
|
|
48
|
+
label: React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
/** Discreet secondary actions at the foot, on the right (an `ActionBar` with `variant="icons"`). */
|
|
51
|
+
actions?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* The title's level.
|
|
54
|
+
* @default 3
|
|
55
|
+
*/
|
|
56
|
+
level?: 2 | 3 | 4;
|
|
57
|
+
/** The app's link component for internal addresses (Next's `Link`); an `<a>` otherwise. */
|
|
58
|
+
linkAs?: LinkComponent;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A card that argues, compact (about a third of a full card): who (icon, name, meta; the bird small in the corner) →
|
|
62
|
+
* the problem in one line → compact facts → one short action. What it does, the bird's rule and the long version are
|
|
63
|
+
* never on the face: they live on the detail page (`more`) or in the card unfolded in place (`panelLabel`).
|
|
64
|
+
*/
|
|
65
|
+
declare function ArgumentCard({ id, title, icon, meta, mark, facts, hook, points, rule, details, panelLabel, more, actions, level, linkAs, className, ...props }: ArgumentCardProps): React.JSX.Element;
|
|
66
|
+
|
|
67
|
+
export { ArgumentCard, type ArgumentCardProps, Fact };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Facts
|
|
3
|
+
} from "./chunk-K3SWZXYT.js";
|
|
4
|
+
import {
|
|
5
|
+
BlockLink
|
|
6
|
+
} from "./chunk-2AGSO3WH.js";
|
|
7
|
+
import {
|
|
8
|
+
ArrowGlyph,
|
|
9
|
+
ChevronGlyph
|
|
10
|
+
} from "./chunk-XCBVFMNV.js";
|
|
11
|
+
import "./chunk-XVLWVTQA.js";
|
|
12
|
+
import {
|
|
13
|
+
cn
|
|
14
|
+
} from "./chunk-FJDSLNXK.js";
|
|
15
|
+
|
|
16
|
+
// src/argument-card/argument-card.tsx
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function ArgumentCard({ id, title, icon, meta, mark, facts, hook, points, rule, details, panelLabel, more, actions, level = 3, linkAs, className, ...props }) {
|
|
19
|
+
const H = `h${level}`;
|
|
20
|
+
const fold = !more && panelLabel && (points || rule || details && details.length > 0);
|
|
21
|
+
return /* @__PURE__ */ jsxs("article", { className: cn("kz-block-card kz-arg", className), "data-kz-light": "", "aria-labelledby": id, ...props, children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "kz-arg-head", children: [
|
|
23
|
+
icon && /* @__PURE__ */ jsx("span", { className: "kz-block-icon", "aria-hidden": true, children: icon }),
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "kz-arg-id", children: [
|
|
25
|
+
/* @__PURE__ */ jsx(H, { id, className: "kz-arg-title", children: title }),
|
|
26
|
+
meta && /* @__PURE__ */ jsx("p", { className: "kz-arg-meta", children: meta })
|
|
27
|
+
] }),
|
|
28
|
+
mark && /* @__PURE__ */ jsx("span", { className: "kz-arg-mark", "aria-hidden": true, children: mark })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsxs("p", { className: "kz-arg-line", children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("span", { className: "kz-sr-only", children: [
|
|
32
|
+
hook.label,
|
|
33
|
+
" \u2014 "
|
|
34
|
+
] }),
|
|
35
|
+
hook.text
|
|
36
|
+
] }),
|
|
37
|
+
facts && facts.length > 0 && /* @__PURE__ */ jsx(Facts, { items: facts }),
|
|
38
|
+
fold && /* @__PURE__ */ jsxs("details", { className: "kz-arg-panel", children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("summary", { children: [
|
|
40
|
+
panelLabel,
|
|
41
|
+
" ",
|
|
42
|
+
/* @__PURE__ */ jsx(ChevronGlyph, { className: "h-3.5 w-3.5" })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "kz-arg-panel-body", children: [
|
|
45
|
+
points && /* @__PURE__ */ jsxs("div", { children: [
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "kz-label", children: points.label }),
|
|
47
|
+
/* @__PURE__ */ jsx("ul", { className: "kz-list", children: points.items.map((item, i) => /* @__PURE__ */ jsx("li", { children: item }, i)) })
|
|
48
|
+
] }),
|
|
49
|
+
details && details.length > 0 && /* @__PURE__ */ jsx("dl", { children: details.map((d, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
50
|
+
/* @__PURE__ */ jsx("dt", { className: "kz-label", children: d.label }),
|
|
51
|
+
/* @__PURE__ */ jsx("dd", { children: d.text })
|
|
52
|
+
] }, i)) }),
|
|
53
|
+
rule
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
(more || actions) && /* @__PURE__ */ jsxs("div", { className: "kz-arg-foot", children: [
|
|
57
|
+
more ? /* @__PURE__ */ jsxs(BlockLink, { href: more.href, linkAs, className: "kz-arg-more", "aria-describedby": id, children: [
|
|
58
|
+
more.label,
|
|
59
|
+
" ",
|
|
60
|
+
/* @__PURE__ */ jsx(ArrowGlyph, { className: "h-3.5 w-3.5" })
|
|
61
|
+
] }) : /* @__PURE__ */ jsx("span", {}),
|
|
62
|
+
actions
|
|
63
|
+
] })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
ArgumentCard
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=argument-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/argument-card/argument-card.tsx"],"sourcesContent":["// Server-safe. A card that argues (blocks.css), compact: who (icon, name, facts) → the trap in one line → the way in.\n// The long version — what it does, the rule a bird stands for, the reasons — waits in a panel the reader opens (a\n// native <details>: keyboard, screen readers, no script). Cards of a row share their height; the panel and the foot\n// sit at the bottom, at the same place on every card.\nimport type * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { cn } from \"../cn\";\nimport { ArrowGlyph, ChevronGlyph } from \"../glyphs\";\nimport { type Fact, Facts } from \"../page/page\";\n\nexport type ArgumentCardProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The id of the title: the card's accessible name. */\n id: string;\n /** The title: the subject (a building block, a feature, a plan). */\n title: React.ReactNode;\n /** The icon tile (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A mono line under the title (a repository, a package). */\n meta?: React.ReactNode;\n /** Small, in the top corner: the bird whose rule it is (a `Mascot` of 40 px, still). Decorative. */\n mark?: React.ReactNode;\n /** Compact facts under the line: registry and version, a status said honestly. */\n facts?: readonly Fact[];\n /**\n * The problem in ONE line (≤ 90 characters): what a reader keeps if they read nothing else. `label` (`The trap`) is\n * read by assistive technology before it, not shown.\n */\n hook: { label: React.ReactNode; text: React.ReactNode };\n /** Unfolded only: what it does, as a few short points, with their label (`What it does`). */\n points?: { label: React.ReactNode; items: readonly React.ReactNode[] };\n /** Unfolded only: the rule told by a bird (a `MascotQuote`, `variant=\"inline\"`). */\n rule?: React.ReactNode;\n /** Unfolded only: the long version, as labelled paragraphs. */\n details?: readonly { label: React.ReactNode; text: React.ReactNode }[];\n /**\n * Without a detail page: the words that unfold the card in place (`Details`) — a native `<details>` holding the\n * points, the rule and the long version. Ignored with `more`: the detail page holds them.\n */\n panelLabel?: React.ReactNode;\n /** The way in: a detail page — one short action at the foot (`Details`). With it, the card is only its face. */\n more?: { href: string; label: React.ReactNode };\n /** Discreet secondary actions at the foot, on the right (an `ActionBar` with `variant=\"icons\"`). */\n actions?: React.ReactNode;\n /**\n * The title's level.\n * @default 3\n */\n level?: 2 | 3 | 4;\n /** The app's link component for internal addresses (Next's `Link`); an `<a>` otherwise. */\n linkAs?: LinkComponent;\n};\n\n/**\n * A card that argues, compact (about a third of a full card): who (icon, name, meta; the bird small in the corner) →\n * the problem in one line → compact facts → one short action. What it does, the bird's rule and the long version are\n * never on the face: they live on the detail page (`more`) or in the card unfolded in place (`panelLabel`).\n */\nexport function ArgumentCard({ id, title, icon, meta, mark, facts, hook, points, rule, details, panelLabel, more, actions, level = 3, linkAs, className, ...props }: ArgumentCardProps) {\n const H = `h${level}` as \"h2\" | \"h3\" | \"h4\";\n const fold = !more && panelLabel && (points || rule || (details && details.length > 0));\n return (\n <article className={cn(\"kz-block-card kz-arg\", className)} data-kz-light=\"\" aria-labelledby={id} {...props}>\n <div className=\"kz-arg-head\">\n {icon && (\n <span className=\"kz-block-icon\" aria-hidden>\n {icon}\n </span>\n )}\n <div className=\"kz-arg-id\">\n <H id={id} className=\"kz-arg-title\">\n {title}\n </H>\n {meta && <p className=\"kz-arg-meta\">{meta}</p>}\n </div>\n {mark && (\n <span className=\"kz-arg-mark\" aria-hidden>\n {mark}\n </span>\n )}\n </div>\n <p className=\"kz-arg-line\">\n <span className=\"kz-sr-only\">{hook.label} — </span>\n {hook.text}\n </p>\n {facts && facts.length > 0 && <Facts items={facts} />}\n {fold && (\n <details className=\"kz-arg-panel\">\n <summary>\n {panelLabel} <ChevronGlyph className=\"h-3.5 w-3.5\" />\n </summary>\n <div className=\"kz-arg-panel-body\">\n {points && (\n <div>\n <p className=\"kz-label\">{points.label}</p>\n <ul className=\"kz-list\">\n {points.items.map((item, i) => (\n <li key={i}>{item}</li>\n ))}\n </ul>\n </div>\n )}\n {details && details.length > 0 && (\n <dl>\n {details.map((d, i) => (\n <div key={i}>\n <dt className=\"kz-label\">{d.label}</dt>\n <dd>{d.text}</dd>\n </div>\n ))}\n </dl>\n )}\n {rule}\n </div>\n </details>\n )}\n {(more || actions) && (\n <div className=\"kz-arg-foot\">\n {more ? (\n <BlockLink href={more.href} linkAs={linkAs} className=\"kz-arg-more\" aria-describedby={id}>\n {more.label} <ArrowGlyph className=\"h-3.5 w-3.5\" />\n </BlockLink>\n ) : (\n <span />\n )}\n {actions}\n </div>\n )}\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiEU,cAIF,YAJE;AAPH,SAAS,aAAa,EAAE,IAAI,OAAO,MAAM,MAAM,MAAM,OAAO,MAAM,QAAQ,MAAM,SAAS,YAAY,MAAM,SAAS,QAAQ,GAAG,QAAQ,WAAW,GAAG,MAAM,GAAsB;AACtL,QAAM,IAAI,IAAI,KAAK;AACnB,QAAM,OAAO,CAAC,QAAQ,eAAe,UAAU,QAAS,WAAW,QAAQ,SAAS;AACpF,SACE,qBAAC,aAAQ,WAAW,GAAG,wBAAwB,SAAS,GAAG,iBAAc,IAAG,mBAAiB,IAAK,GAAG,OACnG;AAAA,yBAAC,SAAI,WAAU,eACZ;AAAA,cACC,oBAAC,UAAK,WAAU,iBAAgB,eAAW,MACxC,gBACH;AAAA,MAEF,qBAAC,SAAI,WAAU,aACb;AAAA,4BAAC,KAAE,IAAQ,WAAU,gBAClB,iBACH;AAAA,QACC,QAAQ,oBAAC,OAAE,WAAU,eAAe,gBAAK;AAAA,SAC5C;AAAA,MACC,QACC,oBAAC,UAAK,WAAU,eAAc,eAAW,MACtC,gBACH;AAAA,OAEJ;AAAA,IACA,qBAAC,OAAE,WAAU,eACX;AAAA,2BAAC,UAAK,WAAU,cAAc;AAAA,aAAK;AAAA,QAAM;AAAA,SAAG;AAAA,MAC3C,KAAK;AAAA,OACR;AAAA,IACC,SAAS,MAAM,SAAS,KAAK,oBAAC,SAAM,OAAO,OAAO;AAAA,IAClD,QACC,qBAAC,aAAQ,WAAU,gBACjB;AAAA,2BAAC,aACE;AAAA;AAAA,QAAW;AAAA,QAAC,oBAAC,gBAAa,WAAU,eAAc;AAAA,SACrD;AAAA,MACA,qBAAC,SAAI,WAAU,qBACZ;AAAA,kBACC,qBAAC,SACC;AAAA,8BAAC,OAAE,WAAU,YAAY,iBAAO,OAAM;AAAA,UACtC,oBAAC,QAAG,WAAU,WACX,iBAAO,MAAM,IAAI,CAAC,MAAM,MACvB,oBAAC,QAAY,kBAAJ,CAAS,CACnB,GACH;AAAA,WACF;AAAA,QAED,WAAW,QAAQ,SAAS,KAC3B,oBAAC,QACE,kBAAQ,IAAI,CAAC,GAAG,MACf,qBAAC,SACC;AAAA,8BAAC,QAAG,WAAU,YAAY,YAAE,OAAM;AAAA,UAClC,oBAAC,QAAI,YAAE,MAAK;AAAA,aAFJ,CAGV,CACD,GACH;AAAA,QAED;AAAA,SACH;AAAA,OACF;AAAA,KAEA,QAAQ,YACR,qBAAC,SAAI,WAAU,eACZ;AAAA,aACC,qBAAC,aAAU,MAAM,KAAK,MAAM,QAAgB,WAAU,eAAc,oBAAkB,IACnF;AAAA,aAAK;AAAA,QAAM;AAAA,QAAC,oBAAC,cAAW,WAAU,eAAc;AAAA,SACnD,IAEA,oBAAC,UAAK;AAAA,MAEP;AAAA,OACH;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/audio-player.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** The app's link component (Next's `Link`, React Router's `Link`…): receives `href`, `className` and the children. */
|
|
4
|
+
type LinkComponent = React.ElementType<{
|
|
5
|
+
href: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
"aria-label"?: string;
|
|
9
|
+
"aria-describedby"?: string;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
export type { LinkComponent as L };
|