@ecopages/radiant-ui 0.1.0-beta.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 +70 -0
- package/dist/components/ui/alert/alert.css +27 -0
- package/dist/components/ui/alert/alert.d.ts +4 -0
- package/dist/components/ui/alert/alert.script.d.ts +25 -0
- package/dist/components/ui/alert/index.d.ts +2 -0
- package/dist/components/ui/alert/index.js +2 -0
- package/dist/components/ui/alert/index.js.map +7 -0
- package/dist/components/ui/breadcrumb/breadcrumb.css +41 -0
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +59 -0
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +40 -0
- package/dist/components/ui/breadcrumb/index.d.ts +2 -0
- package/dist/components/ui/breadcrumb/index.js +2 -0
- package/dist/components/ui/breadcrumb/index.js.map +7 -0
- package/dist/components/ui/button/button.d.ts +37 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button/index.js +2 -0
- package/dist/components/ui/button/index.js.map +7 -0
- package/dist/components/ui/carousel/carousel.css +170 -0
- package/dist/components/ui/carousel/carousel.d.ts +39 -0
- package/dist/components/ui/carousel/carousel.script.d.ts +113 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/carousel/index.js +2 -0
- package/dist/components/ui/carousel/index.js.map +7 -0
- package/dist/components/ui/checkbox/checkbox.css +55 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.script.d.ts +58 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.js +2 -0
- package/dist/components/ui/checkbox/index.js.map +7 -0
- package/dist/components/ui/combobox/combobox.css +65 -0
- package/dist/components/ui/combobox/combobox.d.ts +53 -0
- package/dist/components/ui/combobox/combobox.script.d.ts +89 -0
- package/dist/components/ui/combobox/index.d.ts +2 -0
- package/dist/components/ui/combobox/index.js +2 -0
- package/dist/components/ui/combobox/index.js.map +7 -0
- package/dist/components/ui/dialog/dialog-registry.d.ts +34 -0
- package/dist/components/ui/dialog/dialog-registry.test.d.ts +1 -0
- package/dist/components/ui/dialog/dialog-types.d.ts +55 -0
- package/dist/components/ui/dialog/dialog.css +53 -0
- package/dist/components/ui/dialog/dialog.d.ts +36 -0
- package/dist/components/ui/dialog/dialog.script.d.ts +61 -0
- package/dist/components/ui/dialog/index.d.ts +4 -0
- package/dist/components/ui/dialog/index.js +2 -0
- package/dist/components/ui/dialog/index.js.map +7 -0
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +31 -0
- package/dist/components/ui/disclosure/disclosure.css +105 -0
- package/dist/components/ui/disclosure/disclosure.d.ts +35 -0
- package/dist/components/ui/disclosure/disclosure.script.d.ts +38 -0
- package/dist/components/ui/disclosure/index.d.ts +3 -0
- package/dist/components/ui/disclosure/index.js +2 -0
- package/dist/components/ui/disclosure/index.js.map +7 -0
- package/dist/components/ui/feed/feed.css +14 -0
- package/dist/components/ui/feed/feed.d.ts +12 -0
- package/dist/components/ui/feed/feed.script.d.ts +22 -0
- package/dist/components/ui/feed/index.d.ts +2 -0
- package/dist/components/ui/feed/index.js +2 -0
- package/dist/components/ui/feed/index.js.map +7 -0
- package/dist/components/ui/field/field-context.d.ts +20 -0
- package/dist/components/ui/field/field-description.d.ts +8 -0
- package/dist/components/ui/field/field-error.d.ts +9 -0
- package/dist/components/ui/field/field-ssr-hydration.test.d.ts +1 -0
- package/dist/components/ui/field/field.css +26 -0
- package/dist/components/ui/field/field.d.ts +4 -0
- package/dist/components/ui/field/field.script.d.ts +68 -0
- package/dist/components/ui/field/index.d.ts +5 -0
- package/dist/components/ui/field/index.js +2 -0
- package/dist/components/ui/field/index.js.map +7 -0
- package/dist/components/ui/form/control-protocol.d.ts +19 -0
- package/dist/components/ui/form/form-context.d.ts +27 -0
- package/dist/components/ui/form/form-field.test.d.ts +3 -0
- package/dist/components/ui/form/form-store.d.ts +53 -0
- package/dist/components/ui/form/form-store.test.d.ts +1 -0
- package/dist/components/ui/form/form.css +12 -0
- package/dist/components/ui/form/form.d.ts +5 -0
- package/dist/components/ui/form/form.script.d.ts +67 -0
- package/dist/components/ui/form/index.d.ts +7 -0
- package/dist/components/ui/form/index.js +2 -0
- package/dist/components/ui/form/index.js.map +7 -0
- package/dist/components/ui/form/resolvers.d.ts +3 -0
- package/dist/components/ui/form/types.d.ts +72 -0
- package/dist/components/ui/grid/grid.css +47 -0
- package/dist/components/ui/grid/grid.d.ts +7 -0
- package/dist/components/ui/grid/grid.script.d.ts +26 -0
- package/dist/components/ui/grid/index.d.ts +2 -0
- package/dist/components/ui/grid/index.js +2 -0
- package/dist/components/ui/grid/index.js.map +7 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/index.js +2 -0
- package/dist/components/ui/input/index.js.map +7 -0
- package/dist/components/ui/input/input.css +32 -0
- package/dist/components/ui/input/input.d.ts +23 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/index.js +2 -0
- package/dist/components/ui/label/index.js.map +7 -0
- package/dist/components/ui/label/label.css +8 -0
- package/dist/components/ui/label/label.d.ts +9 -0
- package/dist/components/ui/listbox/index.d.ts +2 -0
- package/dist/components/ui/listbox/index.js +2 -0
- package/dist/components/ui/listbox/index.js.map +7 -0
- package/dist/components/ui/listbox/listbox.css +23 -0
- package/dist/components/ui/listbox/listbox.d.ts +12 -0
- package/dist/components/ui/listbox/listbox.script.d.ts +40 -0
- package/dist/components/ui/menu-button/index.d.ts +2 -0
- package/dist/components/ui/menu-button/index.js +2 -0
- package/dist/components/ui/menu-button/index.js.map +7 -0
- package/dist/components/ui/menu-button/menu-button.css +43 -0
- package/dist/components/ui/menu-button/menu-button.d.ts +13 -0
- package/dist/components/ui/menu-button/menu-button.script.d.ts +64 -0
- package/dist/components/ui/menubar/index.d.ts +2 -0
- package/dist/components/ui/menubar/index.js +2 -0
- package/dist/components/ui/menubar/index.js.map +7 -0
- package/dist/components/ui/menubar/menubar.css +45 -0
- package/dist/components/ui/menubar/menubar.d.ts +16 -0
- package/dist/components/ui/menubar/menubar.script.d.ts +52 -0
- package/dist/components/ui/meter/index.d.ts +2 -0
- package/dist/components/ui/meter/index.js +2 -0
- package/dist/components/ui/meter/index.js.map +7 -0
- package/dist/components/ui/meter/meter.css +17 -0
- package/dist/components/ui/meter/meter.d.ts +4 -0
- package/dist/components/ui/meter/meter.script.d.ts +33 -0
- package/dist/components/ui/navigation-menu/index.d.ts +2 -0
- package/dist/components/ui/navigation-menu/index.js +2 -0
- package/dist/components/ui/navigation-menu/index.js.map +7 -0
- package/dist/components/ui/navigation-menu/navigation-menu.css +90 -0
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +28 -0
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +49 -0
- package/dist/components/ui/radio-group/index.d.ts +2 -0
- package/dist/components/ui/radio-group/index.js +2 -0
- package/dist/components/ui/radio-group/index.js.map +7 -0
- package/dist/components/ui/radio-group/radio-group.css +44 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +12 -0
- package/dist/components/ui/radio-group/radio-group.script.d.ts +52 -0
- package/dist/components/ui/sidebar/index.d.ts +3 -0
- package/dist/components/ui/sidebar/index.js +2 -0
- package/dist/components/ui/sidebar/index.js.map +7 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +53 -0
- package/dist/components/ui/sidebar/sidebar.css +362 -0
- package/dist/components/ui/sidebar/sidebar.d.ts +141 -0
- package/dist/components/ui/sidebar/sidebar.script.d.ts +140 -0
- package/dist/components/ui/sidebar/sidebar.test.d.ts +1 -0
- package/dist/components/ui/slider/index.d.ts +2 -0
- package/dist/components/ui/slider/index.js +2 -0
- package/dist/components/ui/slider/index.js.map +7 -0
- package/dist/components/ui/slider/slider.css +51 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.script.d.ts +102 -0
- package/dist/components/ui/spinbutton/index.d.ts +2 -0
- package/dist/components/ui/spinbutton/index.js +2 -0
- package/dist/components/ui/spinbutton/index.js.map +7 -0
- package/dist/components/ui/spinbutton/spinbutton.css +19 -0
- package/dist/components/ui/spinbutton/spinbutton.d.ts +4 -0
- package/dist/components/ui/spinbutton/spinbutton.script.d.ts +64 -0
- package/dist/components/ui/switch/index.d.ts +2 -0
- package/dist/components/ui/switch/index.js +2 -0
- package/dist/components/ui/switch/index.js.map +7 -0
- package/dist/components/ui/switch/switch.css +47 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.script.d.ts +51 -0
- package/dist/components/ui/tabs/index.d.ts +2 -0
- package/dist/components/ui/tabs/index.js +2 -0
- package/dist/components/ui/tabs/index.js.map +7 -0
- package/dist/components/ui/tabs/tabs.css +28 -0
- package/dist/components/ui/tabs/tabs.d.ts +12 -0
- package/dist/components/ui/tabs/tabs.script.d.ts +54 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/index.js +2 -0
- package/dist/components/ui/textarea/index.js.map +7 -0
- package/dist/components/ui/textarea/textarea.css +33 -0
- package/dist/components/ui/textarea/textarea.d.ts +23 -0
- package/dist/components/ui/toast/index.d.ts +5 -0
- package/dist/components/ui/toast/index.js +2 -0
- package/dist/components/ui/toast/index.js.map +7 -0
- package/dist/components/ui/toast/toast-api.d.ts +29 -0
- package/dist/components/ui/toast/toast-context.d.ts +59 -0
- package/dist/components/ui/toast/toast-state.d.ts +25 -0
- package/dist/components/ui/toast/toast.css +315 -0
- package/dist/components/ui/toast/toast.d.ts +8 -0
- package/dist/components/ui/toast/toast.script.d.ts +91 -0
- package/dist/components/ui/toast/toast.test.d.ts +2 -0
- package/dist/components/ui/toast/toaster.script.d.ts +79 -0
- package/dist/components/ui/toolbar/index.d.ts +2 -0
- package/dist/components/ui/toolbar/index.js +2 -0
- package/dist/components/ui/toolbar/index.js.map +7 -0
- package/dist/components/ui/toolbar/toolbar.css +16 -0
- package/dist/components/ui/toolbar/toolbar.d.ts +4 -0
- package/dist/components/ui/toolbar/toolbar.script.d.ts +30 -0
- package/dist/components/ui/tooltip/index.d.ts +2 -0
- package/dist/components/ui/tooltip/index.js +2 -0
- package/dist/components/ui/tooltip/index.js.map +7 -0
- package/dist/components/ui/tooltip/tooltip.css +25 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +4 -0
- package/dist/components/ui/tooltip/tooltip.script.d.ts +70 -0
- package/dist/components/ui/tree/index.d.ts +2 -0
- package/dist/components/ui/tree/index.js +2 -0
- package/dist/components/ui/tree/index.js.map +7 -0
- package/dist/components/ui/tree/tree.css +54 -0
- package/dist/components/ui/tree/tree.d.ts +13 -0
- package/dist/components/ui/tree/tree.script.d.ts +45 -0
- package/dist/components/ui/treegrid/index.d.ts +2 -0
- package/dist/components/ui/treegrid/index.js +2 -0
- package/dist/components/ui/treegrid/index.js.map +7 -0
- package/dist/components/ui/treegrid/treegrid.css +77 -0
- package/dist/components/ui/treegrid/treegrid.d.ts +14 -0
- package/dist/components/ui/treegrid/treegrid.script.d.ts +49 -0
- package/dist/components/ui/window-splitter/index.d.ts +2 -0
- package/dist/components/ui/window-splitter/index.js +2 -0
- package/dist/components/ui/window-splitter/index.js.map +7 -0
- package/dist/components/ui/window-splitter/window-splitter.css +35 -0
- package/dist/components/ui/window-splitter/window-splitter.d.ts +8 -0
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +49 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/focusable-elements.d.ts +2 -0
- package/dist/lib/radiant-view.d.ts +17 -0
- package/dist/lib/roving-tabindex.d.ts +27 -0
- package/dist/styles/components/button.css +115 -0
- package/dist/styles/radiant-ui-core.css +7 -0
- package/dist/styles/radiant-ui.css +10 -0
- package/dist/styles/styles.css +36 -0
- package/dist/styles/tailwind.css +41 -0
- package/dist/styles/themes/aurora.css +19 -0
- package/dist/styles/themes/default-compact-soft.css +19 -0
- package/dist/styles/themes/default.css +2 -0
- package/dist/styles/themes/glacier.css +19 -0
- package/dist/styles/tokens/colors/aurora.css +73 -0
- package/dist/styles/tokens/colors/basalt.css +36 -0
- package/dist/styles/tokens/colors/glacier.css +45 -0
- package/dist/styles/tokens/colors/palettes.css +3 -0
- package/dist/styles/tokens/elevation/default.css +22 -0
- package/dist/styles/tokens/elevation/flat.css +22 -0
- package/dist/styles/tokens/motion/default.css +19 -0
- package/dist/styles/tokens/motion/snappy.css +19 -0
- package/dist/styles/tokens/presets/colors/aurora.css +126 -0
- package/dist/styles/tokens/presets/colors/basalt.css +126 -0
- package/dist/styles/tokens/presets/colors/ember.css +134 -0
- package/dist/styles/tokens/presets/colors/glacier.css +130 -0
- package/dist/styles/tokens/presets/colors/index.css +4 -0
- package/dist/styles/tokens/presets/radius.css +45 -0
- package/dist/styles/tokens/presets/spacing.css +57 -0
- package/dist/styles/tokens/radius/default.css +34 -0
- package/dist/styles/tokens/radius/edgy.css +35 -0
- package/dist/styles/tokens/radius/sharp.css +2 -0
- package/dist/styles/tokens/radius/soft.css +34 -0
- package/dist/styles/tokens/semantic.css +80 -0
- package/dist/styles/tokens/spacing/compact.css +23 -0
- package/dist/styles/tokens/spacing/default.css +23 -0
- package/dist/styles/tokens/spacing/scale-bridge.css +17 -0
- package/dist/styles/tokens/spacing/wide.css +23 -0
- package/dist/styles/tokens/system.css +36 -0
- package/dist/styles/tokens/typography/default.css +37 -0
- package/dist/styles/utilities/sheen.css +7 -0
- package/dist/types.d.ts +14 -0
- package/package.json +371 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @ecopages/radiant-ui
|
|
2
|
+
|
|
3
|
+
Accessible light-DOM UI components built with [`@ecopages/radiant`](https://www.npmjs.com/package/@ecopages/radiant) and `@ecopages/jsx`, documented in Storybook.
|
|
4
|
+
|
|
5
|
+
Custom elements use the **`rui-*`** tag prefix. Public TypeScript / JSX exports use the **`Rui*`** prefix.
|
|
6
|
+
|
|
7
|
+
This project is **not a React app**. JSX compiles through `@ecopages/jsx`.
|
|
8
|
+
|
|
9
|
+
## Packages
|
|
10
|
+
|
|
11
|
+
| Path | Role |
|
|
12
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
13
|
+
| `src/components/ui` | **`@ecopages/radiant-ui`** component library (APG-oriented widgets) |
|
|
14
|
+
| [`@ecopages/storybook-radiant-vite`](../storybook-radiant-vite) | Storybook framework for Radiant (client + SSR → hydrate) |
|
|
15
|
+
| `src/components/client`, `src/components/ssr`, `src/stories` | Framework dogfood demos (not the published UI catalog) |
|
|
16
|
+
|
|
17
|
+
Framework documentation (API, SSR contract, Vitest, limitations):
|
|
18
|
+
**[../storybook-radiant-vite/README.md](../storybook-radiant-vite/README.md)**
|
|
19
|
+
|
|
20
|
+
Library overview and conventions: Storybook **Introduction** (`src/Introduction.mdx`).
|
|
21
|
+
|
|
22
|
+
## Develop
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm install
|
|
26
|
+
pnpm run storybook
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Open the URL Storybook prints (default port `6006`).
|
|
30
|
+
|
|
31
|
+
Useful scripts:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm run test # Vitest browser story tests
|
|
35
|
+
pnpm run typecheck
|
|
36
|
+
pnpm run lint
|
|
37
|
+
pnpm run build:lib # generate exports + build dist
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Using radiant-ui
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import '@ecopages/radiant-ui/themes/default';
|
|
44
|
+
import '@ecopages/radiant-ui/styles.css';
|
|
45
|
+
import '@ecopages/radiant-ui/disclosure';
|
|
46
|
+
import { RuiDisclosure, RuiDisclosureGroup } from '@ecopages/radiant-ui/disclosure';
|
|
47
|
+
import { RuiButton } from '@ecopages/radiant-ui/button';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or register every custom element from the root entry (still load theme + styles separately):
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import '@ecopages/radiant-ui/themes/default';
|
|
54
|
+
import '@ecopages/radiant-ui/styles.css';
|
|
55
|
+
import '@ecopages/radiant-ui';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Convenience bundle (default theme + Tailwind + button primitive):
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import '@ecopages/radiant-ui/radiant-ui.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Design tokens and themes: see [`AGENTS.md`](./AGENTS.md) and [`DESIGN-SYSTEM-PLAN.md`](./DESIGN-SYSTEM-PLAN.md).
|
|
65
|
+
|
|
66
|
+
## Story map
|
|
67
|
+
|
|
68
|
+
- **Components/** — `radiant-ui` catalog (`src/components/ui`)
|
|
69
|
+
- **Client/** — framework demos ported from Radiant `playground/vite`
|
|
70
|
+
- **SSR/** — framework demos ported from Radiant `playground/vite-nitro`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@reference '../../../styles/radiant-ui.css';
|
|
2
|
+
|
|
3
|
+
rui-alert {
|
|
4
|
+
@apply block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@layer components {
|
|
8
|
+
.rui-alert {
|
|
9
|
+
@apply rounded-container border px-control-x py-control-y text-sm;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rui-alert--info {
|
|
13
|
+
@apply border-border bg-surface text-on-surface;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rui-alert--success {
|
|
17
|
+
@apply border-success/40 bg-success/10 text-success;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rui-alert--warning {
|
|
21
|
+
@apply border-border bg-surface text-on-surface;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.rui-alert--error {
|
|
25
|
+
@apply border-error/40 bg-error/10 text-error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WithChildren, RadiantSlotProps } from '../../../types';
|
|
2
|
+
import type { RuiAlertProps } from './alert.script';
|
|
3
|
+
import './alert.css';
|
|
4
|
+
export declare const RuiAlert: import("../../../lib/radiant-view").RadiantViewComponent<WithChildren<RuiAlertProps & RadiantSlotProps>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RadiantElement } from '@ecopages/radiant';
|
|
2
|
+
export type RuiAlertProps = {
|
|
3
|
+
/** Visual tone of the alert. Default: `info`. */
|
|
4
|
+
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* `<rui-alert>` — a brief, important message that attracts attention
|
|
8
|
+
* without interrupting the user's task.
|
|
9
|
+
*
|
|
10
|
+
* Implements the WAI-ARIA APG Alert pattern via `role="alert"`. Dynamically
|
|
11
|
+
* rendered alerts are announced by most screen readers. Do not move focus
|
|
12
|
+
* into the alert; use an Alert Dialog when interrupting workflow is required.
|
|
13
|
+
*
|
|
14
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alert/
|
|
15
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
16
|
+
*
|
|
17
|
+
* Keyboard interaction: not applicable — alerts must not steal focus.
|
|
18
|
+
*
|
|
19
|
+
* @element rui-alert
|
|
20
|
+
* @slot - The alert message content.
|
|
21
|
+
*/
|
|
22
|
+
export declare class RuiAlert extends RadiantElement {
|
|
23
|
+
variant: RuiAlertProps['variant'];
|
|
24
|
+
render(): import("@ecopages/jsx").JsxRenderable;
|
|
25
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RadiantElement as l,customElement as R,prop as p}from"@ecopages/radiant";var o=@R("rui-alert")class extends l{@p({type:String,reflect:!0,defaultValue:"info"})variant;render(){return React.createElement("div",{class:`rui-alert rui-alert--${this.variant??"info"}`,role:"alert"},React.createElement("slot",null))}};var A=Symbol.for("@ecopages/storybook-radiant.viewElement"),i=Symbol.for("@ecopages/storybook-radiant.scriptModule"),n=Symbol.for("@ecopages/storybook-radiant.scriptExport");function m(t,r){t[A]=r;let e=r[i];e&&(t[i]=e,t[n]=r[n]??r.name)}function s(t,r){let e=(a=>r(a));return m(e,t),e}import"./alert.css";var u=s(o,({slot:t,variant:r,children:e})=>React.createElement("rui-alert",{slot:t,variant:r},e));export{u as RuiAlert,o as RuiAlertElement};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/alert/alert.script.tsx", "../../../../src/lib/radiant-view.ts", "../../../../src/components/ui/alert/alert.tsx"],
|
|
4
|
+
"sourcesContent": ["import { RadiantElement, customElement, prop } from '@ecopages/radiant';\n\nexport type RuiAlertProps = {\n\t/** Visual tone of the alert. Default: `info`. */\n\tvariant?: 'info' | 'success' | 'warning' | 'error';\n};\n\n/**\n * `<rui-alert>` \u2014 a brief, important message that attracts attention\n * without interrupting the user's task.\n *\n * Implements the WAI-ARIA APG Alert pattern via `role=\"alert\"`. Dynamically\n * rendered alerts are announced by most screen readers. Do not move focus\n * into the alert; use an Alert Dialog when interrupting workflow is required.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/alert/\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/\n *\n * Keyboard interaction: not applicable \u2014 alerts must not steal focus.\n *\n * @element rui-alert\n * @slot - The alert message content.\n */\n@customElement('rui-alert')\nexport class RuiAlert extends RadiantElement {\n\t@prop({ type: String, reflect: true, defaultValue: 'info' }) variant: RuiAlertProps['variant'];\n\n\toverride render() {\n\t\treturn (\n\t\t\t<div class={`rui-alert rui-alert--${this.variant ?? 'info'}`} role=\"alert\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\n\nconst RADIANT_VIEW_ELEMENT = Symbol.for('@ecopages/storybook-radiant.viewElement');\nconst RADIANT_SCRIPT_MODULE = Symbol.for('@ecopages/storybook-radiant.scriptModule');\nconst RADIANT_SCRIPT_EXPORT = Symbol.for('@ecopages/storybook-radiant.scriptExport');\n\nexport type RadiantViewComponent<TArgs = unknown> = ((args: TArgs) => JsxRenderable) & {\n\t[RADIANT_VIEW_ELEMENT]?: CustomElementConstructor;\n\t[RADIANT_SCRIPT_MODULE]?: string;\n\t[RADIANT_SCRIPT_EXPORT]?: string;\n};\n\nfunction linkViewToElement<TArgs>(\n\tview: RadiantViewComponent<TArgs>,\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n): void {\n\tview[RADIANT_VIEW_ELEMENT] = element;\n\n\tconst ssrModule = element[RADIANT_SCRIPT_MODULE];\n\tif (ssrModule) {\n\t\tview[RADIANT_SCRIPT_MODULE] = ssrModule;\n\t\tview[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n\t}\n}\n\n/** Link a JSX view export to its RadiantElement class (same symbols as the Storybook framework). */\nexport function defineRadiantView<TArgs>(\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n\trender: (args: TArgs) => JsxRenderable,\n): RadiantViewComponent<TArgs> {\n\tconst view = ((args: TArgs) => render(args)) as RadiantViewComponent<TArgs>;\n\tlinkViewToElement(view, element);\n\treturn view;\n}\n\n/** Re-copy SSR metadata from the linked element (e.g. after HMR). */\nexport function syncRadiantViewMetadata(view: RadiantViewComponent): void {\n\tconst element = view[RADIANT_VIEW_ELEMENT];\n\tif (element) {\n\t\tlinkViewToElement(view, element);\n\t}\n}\n", "import type { WithChildren, RadiantSlotProps } from '../../../types';\nimport { defineRadiantView } from '../../../lib/radiant-view';\nimport type { RuiAlertProps } from './alert.script';\nimport { RuiAlert as RuiAlertElement } from './alert.script';\nimport './alert.css';\n\nexport const RuiAlert = defineRadiantView(\n\tRuiAlertElement,\n\t({ slot, variant, children }: WithChildren<RuiAlertProps & RadiantSlotProps>) => (\n\t\t<rui-alert slot={slot} variant={variant}>\n\t\t\t{children}\n\t\t</rui-alert>\n\t),\n);\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,EAAgB,iBAAAC,EAAe,QAAAC,MAAY,oBAwB7C,IAAMC,EADb,CAACF,EAAc,WAAW,CACnB,cAAuBD,CAAe,CAC5C,CAACE,EAAK,CAAE,KAAM,OAAQ,QAAS,GAAM,aAAc,MAAO,CAAC,CAAE,QAEpD,QAAS,CACjB,OACC,oBAAC,OAAI,MAAO,wBAAwB,KAAK,SAAW,MAAM,GAAI,KAAK,SAClE,oBAAC,WAAK,CACP,CAEF,CACD,EChCA,IAAME,EAAuB,OAAO,IAAI,yCAAyC,EAC3EC,EAAwB,OAAO,IAAI,0CAA0C,EAC7EC,EAAwB,OAAO,IAAI,0CAA0C,EAQnF,SAASC,EACRC,EACAC,EAIO,CACPD,EAAKJ,CAAoB,EAAIK,EAE7B,IAAMC,EAAYD,EAAQJ,CAAqB,EAC3CK,IACHF,EAAKH,CAAqB,EAAIK,EAC9BF,EAAKF,CAAqB,EAAIG,EAAQH,CAAqB,GAAKG,EAAQ,KAE1E,CAGO,SAASE,EACfF,EAIAG,EAC8B,CAC9B,IAAMJ,GAASK,GAAgBD,EAAOC,CAAI,GAC1C,OAAAN,EAAkBC,EAAMC,CAAO,EACxBD,CACR,CCnCA,MAAO,cAEA,IAAMM,EAAWC,EACvBD,EACA,CAAC,CAAE,KAAAE,EAAM,QAAAC,EAAS,SAAAC,CAAS,IAC1B,oBAAC,aAAU,KAAMF,EAAM,QAASC,GAC9BC,CACF,CAEF",
|
|
6
|
+
"names": ["RadiantElement", "customElement", "prop", "RuiAlert", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "ssrModule", "defineRadiantView", "render", "args", "RuiAlert", "defineRadiantView", "slot", "variant", "children"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@reference '../../../styles/radiant-ui.css';
|
|
2
|
+
|
|
3
|
+
rui-breadcrumb {
|
|
4
|
+
@apply block;
|
|
5
|
+
--rui-breadcrumb-separator: '/';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@layer components {
|
|
9
|
+
.rui-breadcrumb__list {
|
|
10
|
+
@apply m-0 flex list-none flex-wrap items-center gap-inline p-0 text-sm;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rui-breadcrumb__item {
|
|
14
|
+
@apply inline-flex items-center gap-inline;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rui-breadcrumb__link {
|
|
18
|
+
@apply inline-flex items-center gap-inline text-primary underline-offset-2 hover:underline;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rui-breadcrumb__page,
|
|
22
|
+
.rui-breadcrumb [aria-current='page'] {
|
|
23
|
+
@apply font-medium text-on-background;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rui-breadcrumb__separator {
|
|
27
|
+
@apply inline-flex items-center text-on-surface/60;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rui-breadcrumb__separator:empty::before {
|
|
31
|
+
content: var(--rui-breadcrumb-separator);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rui-breadcrumb__ellipsis {
|
|
35
|
+
@apply inline-flex items-center tracking-widest text-on-surface/60;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rui-breadcrumb__ellipsis-label {
|
|
39
|
+
@apply sr-only;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RadiantSlotProps } from '../../../types';
|
|
3
|
+
import type { RuiBreadcrumbProps } from './breadcrumb.script';
|
|
4
|
+
import './breadcrumb.css';
|
|
5
|
+
export type RuiBreadcrumbViewProps = RuiBreadcrumbProps & RadiantSlotProps & {
|
|
6
|
+
children?: JsxRenderable;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Landmark wrapper for a breadcrumb trail. Set `separator` once here (e.g. `/`
|
|
11
|
+
* or `>`); empty `RuiBreadcrumbSeparator` nodes pick it up via CSS — no context.
|
|
12
|
+
* Pass children into a separator to override for that instance.
|
|
13
|
+
*/
|
|
14
|
+
export declare const RuiBreadcrumb: import("../../../lib/radiant-view").RadiantViewComponent<RuiBreadcrumbViewProps>;
|
|
15
|
+
export type RuiBreadcrumbListProps = {
|
|
16
|
+
children: JsxRenderable;
|
|
17
|
+
class?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Ordered list of breadcrumb items and separators. */
|
|
20
|
+
export declare function RuiBreadcrumbList({ children, class: className }: RuiBreadcrumbListProps): JsxRenderable;
|
|
21
|
+
export type RuiBreadcrumbItemProps = {
|
|
22
|
+
children: JsxRenderable;
|
|
23
|
+
class?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Single crumb (`<li>`). */
|
|
26
|
+
export declare function RuiBreadcrumbItem({ children, class: className }: RuiBreadcrumbItemProps): JsxRenderable;
|
|
27
|
+
export type RuiBreadcrumbLinkProps = {
|
|
28
|
+
href: string;
|
|
29
|
+
children: JsxRenderable;
|
|
30
|
+
class?: string;
|
|
31
|
+
/** Accessible name when the link content is non-text (e.g. an icon). */
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Linked ancestor page. */
|
|
35
|
+
export declare function RuiBreadcrumbLink({ href, children, class: className, 'aria-label': ariaLabel, }: RuiBreadcrumbLinkProps): JsxRenderable;
|
|
36
|
+
export type RuiBreadcrumbPageProps = {
|
|
37
|
+
children: JsxRenderable;
|
|
38
|
+
class?: string;
|
|
39
|
+
};
|
|
40
|
+
/** Current page (non-link). */
|
|
41
|
+
export declare function RuiBreadcrumbPage({ children, class: className }: RuiBreadcrumbPageProps): JsxRenderable;
|
|
42
|
+
export type RuiBreadcrumbSeparatorProps = {
|
|
43
|
+
/** Override the trail separator for this instance only. */
|
|
44
|
+
children?: JsxRenderable;
|
|
45
|
+
class?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Visual separator between crumbs. Renders as a presentational list item.
|
|
49
|
+
* With no children, uses the glyph from `RuiBreadcrumb`’s `separator` prop
|
|
50
|
+
* (CSS custom property). With children, those replace the default glyph.
|
|
51
|
+
*/
|
|
52
|
+
export declare function RuiBreadcrumbSeparator({ children, class: className }: RuiBreadcrumbSeparatorProps): JsxRenderable;
|
|
53
|
+
export type RuiBreadcrumbEllipsisProps = {
|
|
54
|
+
class?: string;
|
|
55
|
+
/** Accessible label announced for the collapsed segment. Default: `More`. */
|
|
56
|
+
label?: string;
|
|
57
|
+
};
|
|
58
|
+
/** Collapsed middle segment indicator. */
|
|
59
|
+
export declare function RuiBreadcrumbEllipsis({ class: className, label }: RuiBreadcrumbEllipsisProps): JsxRenderable;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RadiantElement } from '@ecopages/radiant';
|
|
2
|
+
export type RuiBreadcrumbProps = {
|
|
3
|
+
/** Accessible name for the navigation landmark. Default: `Breadcrumb`. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Glyph used by empty `RuiBreadcrumbSeparator` nodes (via CSS custom
|
|
7
|
+
* property). Default: `/`. Override per-separator with children instead
|
|
8
|
+
* of reaching for context.
|
|
9
|
+
*/
|
|
10
|
+
separator?: string;
|
|
11
|
+
};
|
|
12
|
+
type RuiBreadcrumbBindings = {
|
|
13
|
+
label: string;
|
|
14
|
+
separator: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* `<rui-breadcrumb>` — a trail of links to ancestor pages in hierarchical order.
|
|
18
|
+
*
|
|
19
|
+
* Implements the WAI-ARIA APG Breadcrumb pattern: a `<nav>` landmark containing
|
|
20
|
+
* an ordered list of links, with `aria-current="page"` on the current page item.
|
|
21
|
+
*
|
|
22
|
+
* Compose with the JSX helpers (`RuiBreadcrumbList`, `RuiBreadcrumbItem`,
|
|
23
|
+
* `RuiBreadcrumbLink`, `RuiBreadcrumbPage`, `RuiBreadcrumbSeparator`,
|
|
24
|
+
* `RuiBreadcrumbEllipsis`), or author equivalent light-DOM markup into the slot.
|
|
25
|
+
*
|
|
26
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/
|
|
27
|
+
*
|
|
28
|
+
* Keyboard interaction: standard link navigation (`Tab`, `Enter`).
|
|
29
|
+
*
|
|
30
|
+
* @element rui-breadcrumb
|
|
31
|
+
* @slot - Authored breadcrumb list markup.
|
|
32
|
+
*/
|
|
33
|
+
export declare class RuiBreadcrumb extends RadiantElement<RuiBreadcrumbBindings> {
|
|
34
|
+
label: string;
|
|
35
|
+
separator: string;
|
|
36
|
+
private readonly resolvedAriaLabel;
|
|
37
|
+
private readonly separatorStyle;
|
|
38
|
+
render(): import("@ecopages/jsx").JsxRenderable;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { RuiBreadcrumb as RuiBreadcrumbElement, type RuiBreadcrumbProps } from './breadcrumb.script';
|
|
2
|
+
export { RuiBreadcrumb, RuiBreadcrumbList, RuiBreadcrumbItem, RuiBreadcrumbLink, RuiBreadcrumbPage, RuiBreadcrumbSeparator, RuiBreadcrumbEllipsis, type RuiBreadcrumbViewProps, type RuiBreadcrumbListProps, type RuiBreadcrumbItemProps, type RuiBreadcrumbLinkProps, type RuiBreadcrumbPageProps, type RuiBreadcrumbSeparatorProps, type RuiBreadcrumbEllipsisProps, } from './breadcrumb';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RadiantElement as l,customElement as d,prop as o}from"@ecopages/radiant";var i=@d("rui-breadcrumb")class extends l{@o({type:String,defaultValue:"Breadcrumb"})label;@o({type:String,defaultValue:"/"})separator;resolvedAriaLabel=this.$.label.map(r=>r||"Breadcrumb");separatorStyle=this.$.separator.map(r=>({"--rui-breadcrumb-separator":JSON.stringify(r||"/")}));render(){return React.createElement("nav",{class:"rui-breadcrumb","aria-label":this.resolvedAriaLabel,style:this.separatorStyle},React.createElement("slot",null))}};var m=Symbol.for("@ecopages/storybook-radiant.viewElement"),n=Symbol.for("@ecopages/storybook-radiant.scriptModule"),u=Symbol.for("@ecopages/storybook-radiant.scriptExport");function b(e,r){e[m]=r;let a=r[n];a&&(e[n]=a,e[u]=r[u]??r.name)}function p(e,r){let a=(t=>r(t));return b(a,e),a}import"./breadcrumb.css";function s(...e){return e.filter(Boolean).join(" ")}var R=p(i,({slot:e,label:r,separator:a,class:t,children:c})=>React.createElement("rui-breadcrumb",{slot:e,class:t,label:r,separator:a},c));function g({children:e,class:r}){return React.createElement("ol",{class:s("rui-breadcrumb__list",r)},e)}function B({children:e,class:r}){return React.createElement("li",{class:s("rui-breadcrumb__item",r)},e)}function P({href:e,children:r,class:a,"aria-label":t}){return React.createElement("a",{class:s("rui-breadcrumb__link",a),href:e,"aria-label":t},r)}function y({children:e,class:r}){return React.createElement("span",{class:s("rui-breadcrumb__page",r),"aria-current":"page"},e)}function x({children:e,class:r}){return React.createElement("li",{class:s("rui-breadcrumb__separator",r),role:"presentation","aria-hidden":"true"},e)}function f({class:e,label:r="More"}){return React.createElement("span",{class:s("rui-breadcrumb__ellipsis",e),role:"presentation","aria-hidden":"true"},React.createElement("span",{"aria-hidden":"true"},"\u2026"),React.createElement("span",{class:"rui-breadcrumb__ellipsis-label"},r))}export{R as RuiBreadcrumb,i as RuiBreadcrumbElement,f as RuiBreadcrumbEllipsis,B as RuiBreadcrumbItem,P as RuiBreadcrumbLink,g as RuiBreadcrumbList,y as RuiBreadcrumbPage,x as RuiBreadcrumbSeparator};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/breadcrumb/breadcrumb.script.tsx", "../../../../src/lib/radiant-view.ts", "../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],
|
|
4
|
+
"sourcesContent": ["import { RadiantElement, customElement, prop } from '@ecopages/radiant';\n\nexport type RuiBreadcrumbProps = {\n\t/** Accessible name for the navigation landmark. Default: `Breadcrumb`. */\n\tlabel?: string;\n\t/**\n\t * Glyph used by empty `RuiBreadcrumbSeparator` nodes (via CSS custom\n\t * property). Default: `/`. Override per-separator with children instead\n\t * of reaching for context.\n\t */\n\tseparator?: string;\n};\n\ntype RuiBreadcrumbBindings = {\n\tlabel: string;\n\tseparator: string;\n};\n\n/**\n * `<rui-breadcrumb>` \u2014 a trail of links to ancestor pages in hierarchical order.\n *\n * Implements the WAI-ARIA APG Breadcrumb pattern: a `<nav>` landmark containing\n * an ordered list of links, with `aria-current=\"page\"` on the current page item.\n *\n * Compose with the JSX helpers (`RuiBreadcrumbList`, `RuiBreadcrumbItem`,\n * `RuiBreadcrumbLink`, `RuiBreadcrumbPage`, `RuiBreadcrumbSeparator`,\n * `RuiBreadcrumbEllipsis`), or author equivalent light-DOM markup into the slot.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/\n *\n * Keyboard interaction: standard link navigation (`Tab`, `Enter`).\n *\n * @element rui-breadcrumb\n * @slot - Authored breadcrumb list markup.\n */\n@customElement('rui-breadcrumb')\nexport class RuiBreadcrumb extends RadiantElement<RuiBreadcrumbBindings> {\n\t@prop({ type: String, defaultValue: 'Breadcrumb' }) label: string;\n\t@prop({ type: String, defaultValue: '/' }) separator: string;\n\n\tprivate readonly resolvedAriaLabel = this.$.label.map((label) => label || 'Breadcrumb');\n\tprivate readonly separatorStyle = this.$.separator.map(\n\t\t(separator) =>\n\t\t\t({\n\t\t\t\t'--rui-breadcrumb-separator': JSON.stringify(separator || '/'),\n\t\t\t}) as Record<string, string>,\n\t);\n\n\toverride render() {\n\t\treturn (\n\t\t\t<nav class=\"rui-breadcrumb\" aria-label={this.resolvedAriaLabel} style={this.separatorStyle}>\n\t\t\t\t<slot></slot>\n\t\t\t</nav>\n\t\t);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\n\nconst RADIANT_VIEW_ELEMENT = Symbol.for('@ecopages/storybook-radiant.viewElement');\nconst RADIANT_SCRIPT_MODULE = Symbol.for('@ecopages/storybook-radiant.scriptModule');\nconst RADIANT_SCRIPT_EXPORT = Symbol.for('@ecopages/storybook-radiant.scriptExport');\n\nexport type RadiantViewComponent<TArgs = unknown> = ((args: TArgs) => JsxRenderable) & {\n\t[RADIANT_VIEW_ELEMENT]?: CustomElementConstructor;\n\t[RADIANT_SCRIPT_MODULE]?: string;\n\t[RADIANT_SCRIPT_EXPORT]?: string;\n};\n\nfunction linkViewToElement<TArgs>(\n\tview: RadiantViewComponent<TArgs>,\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n): void {\n\tview[RADIANT_VIEW_ELEMENT] = element;\n\n\tconst ssrModule = element[RADIANT_SCRIPT_MODULE];\n\tif (ssrModule) {\n\t\tview[RADIANT_SCRIPT_MODULE] = ssrModule;\n\t\tview[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n\t}\n}\n\n/** Link a JSX view export to its RadiantElement class (same symbols as the Storybook framework). */\nexport function defineRadiantView<TArgs>(\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n\trender: (args: TArgs) => JsxRenderable,\n): RadiantViewComponent<TArgs> {\n\tconst view = ((args: TArgs) => render(args)) as RadiantViewComponent<TArgs>;\n\tlinkViewToElement(view, element);\n\treturn view;\n}\n\n/** Re-copy SSR metadata from the linked element (e.g. after HMR). */\nexport function syncRadiantViewMetadata(view: RadiantViewComponent): void {\n\tconst element = view[RADIANT_VIEW_ELEMENT];\n\tif (element) {\n\t\tlinkViewToElement(view, element);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantSlotProps } from '../../../types';\nimport { defineRadiantView } from '../../../lib/radiant-view';\nimport type { RuiBreadcrumbProps } from './breadcrumb.script';\nimport { RuiBreadcrumb as RuiBreadcrumbElement } from './breadcrumb.script';\nimport './breadcrumb.css';\n\nfunction cx(...parts: Array<string | false | null | undefined>): string {\n\treturn parts.filter(Boolean).join(' ');\n}\n\nexport type RuiBreadcrumbViewProps = RuiBreadcrumbProps &\n\tRadiantSlotProps & {\n\t\tchildren?: JsxRenderable;\n\t\tclass?: string;\n\t};\n\n/**\n * Landmark wrapper for a breadcrumb trail. Set `separator` once here (e.g. `/`\n * or `>`); empty `RuiBreadcrumbSeparator` nodes pick it up via CSS \u2014 no context.\n * Pass children into a separator to override for that instance.\n */\nexport const RuiBreadcrumb = defineRadiantView(\n\tRuiBreadcrumbElement,\n\t({ slot, label, separator, class: className, children }: RuiBreadcrumbViewProps) => (\n\t\t<rui-breadcrumb slot={slot} class={className} label={label} separator={separator}>\n\t\t\t{children}\n\t\t</rui-breadcrumb>\n\t),\n);\n\nexport type RuiBreadcrumbListProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n};\n\n/** Ordered list of breadcrumb items and separators. */\nexport function RuiBreadcrumbList({ children, class: className }: RuiBreadcrumbListProps) {\n\treturn <ol class={cx('rui-breadcrumb__list', className)}>{children}</ol>;\n}\n\nexport type RuiBreadcrumbItemProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n};\n\n/** Single crumb (`<li>`). */\nexport function RuiBreadcrumbItem({ children, class: className }: RuiBreadcrumbItemProps) {\n\treturn <li class={cx('rui-breadcrumb__item', className)}>{children}</li>;\n}\n\nexport type RuiBreadcrumbLinkProps = {\n\thref: string;\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Accessible name when the link content is non-text (e.g. an icon). */\n\t'aria-label'?: string;\n};\n\n/** Linked ancestor page. */\nexport function RuiBreadcrumbLink({\n\thref,\n\tchildren,\n\tclass: className,\n\t'aria-label': ariaLabel,\n}: RuiBreadcrumbLinkProps) {\n\treturn (\n\t\t<a class={cx('rui-breadcrumb__link', className)} href={href} aria-label={ariaLabel}>\n\t\t\t{children}\n\t\t</a>\n\t);\n}\n\nexport type RuiBreadcrumbPageProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n};\n\n/** Current page (non-link). */\nexport function RuiBreadcrumbPage({ children, class: className }: RuiBreadcrumbPageProps) {\n\treturn (\n\t\t<span class={cx('rui-breadcrumb__page', className)} aria-current=\"page\">\n\t\t\t{children}\n\t\t</span>\n\t);\n}\n\nexport type RuiBreadcrumbSeparatorProps = {\n\t/** Override the trail separator for this instance only. */\n\tchildren?: JsxRenderable;\n\tclass?: string;\n};\n\n/**\n * Visual separator between crumbs. Renders as a presentational list item.\n * With no children, uses the glyph from `RuiBreadcrumb`\u2019s `separator` prop\n * (CSS custom property). With children, those replace the default glyph.\n */\nexport function RuiBreadcrumbSeparator({ children, class: className }: RuiBreadcrumbSeparatorProps) {\n\treturn (\n\t\t<li class={cx('rui-breadcrumb__separator', className)} role=\"presentation\" aria-hidden=\"true\">\n\t\t\t{children}\n\t\t</li>\n\t);\n}\n\nexport type RuiBreadcrumbEllipsisProps = {\n\tclass?: string;\n\t/** Accessible label announced for the collapsed segment. Default: `More`. */\n\tlabel?: string;\n};\n\n/** Collapsed middle segment indicator. */\nexport function RuiBreadcrumbEllipsis({ class: className, label = 'More' }: RuiBreadcrumbEllipsisProps) {\n\treturn (\n\t\t<span class={cx('rui-breadcrumb__ellipsis', className)} role=\"presentation\" aria-hidden=\"true\">\n\t\t\t<span aria-hidden=\"true\">\u2026</span>\n\t\t\t<span class=\"rui-breadcrumb__ellipsis-label\">{label}</span>\n\t\t</span>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,EAAgB,iBAAAC,EAAe,QAAAC,MAAY,oBAoC7C,IAAMC,EADb,CAACF,EAAc,gBAAgB,CACxB,cAA4BD,CAAsC,CACxE,CAACE,EAAK,CAAE,KAAM,OAAQ,aAAc,YAAa,CAAC,CAAE,MACpD,CAACA,EAAK,CAAE,KAAM,OAAQ,aAAc,GAAI,CAAC,CAAE,UAE1B,kBAAoB,KAAK,EAAE,MAAM,IAAKE,GAAUA,GAAS,YAAY,EACrE,eAAiB,KAAK,EAAE,UAAU,IACjDC,IACC,CACA,6BAA8B,KAAK,UAAUA,GAAa,GAAG,CAC9D,EACF,EAES,QAAS,CACjB,OACC,oBAAC,OAAI,MAAM,iBAAiB,aAAY,KAAK,kBAAmB,MAAO,KAAK,gBAC3E,oBAAC,WAAK,CACP,CAEF,CACD,ECrDA,IAAMC,EAAuB,OAAO,IAAI,yCAAyC,EAC3EC,EAAwB,OAAO,IAAI,0CAA0C,EAC7EC,EAAwB,OAAO,IAAI,0CAA0C,EAQnF,SAASC,EACRC,EACAC,EAIO,CACPD,EAAKJ,CAAoB,EAAIK,EAE7B,IAAMC,EAAYD,EAAQJ,CAAqB,EAC3CK,IACHF,EAAKH,CAAqB,EAAIK,EAC9BF,EAAKF,CAAqB,EAAIG,EAAQH,CAAqB,GAAKG,EAAQ,KAE1E,CAGO,SAASE,EACfF,EAIAG,EAC8B,CAC9B,IAAMJ,GAASK,GAAgBD,EAAOC,CAAI,GAC1C,OAAAN,EAAkBC,EAAMC,CAAO,EACxBD,CACR,CClCA,MAAO,mBAEP,SAASM,KAAMC,EAAyD,CACvE,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACtC,CAaO,IAAMC,EAAgBC,EAC5BD,EACA,CAAC,CAAE,KAAAE,EAAM,MAAAC,EAAO,UAAAC,EAAW,MAAOC,EAAW,SAAAC,CAAS,IACrD,oBAAC,kBAAe,KAAMJ,EAAM,MAAOG,EAAW,MAAOF,EAAO,UAAWC,GACrEE,CACF,CAEF,EAQO,SAASC,EAAkB,CAAE,SAAAD,EAAU,MAAOD,CAAU,EAA2B,CACzF,OAAO,oBAAC,MAAG,MAAOP,EAAG,uBAAwBO,CAAS,GAAIC,CAAS,CACpE,CAQO,SAASE,EAAkB,CAAE,SAAAF,EAAU,MAAOD,CAAU,EAA2B,CACzF,OAAO,oBAAC,MAAG,MAAOP,EAAG,uBAAwBO,CAAS,GAAIC,CAAS,CACpE,CAWO,SAASG,EAAkB,CACjC,KAAAC,EACA,SAAAJ,EACA,MAAOD,EACP,aAAcM,CACf,EAA2B,CAC1B,OACC,oBAAC,KAAE,MAAOb,EAAG,uBAAwBO,CAAS,EAAG,KAAMK,EAAM,aAAYC,GACvEL,CACF,CAEF,CAQO,SAASM,EAAkB,CAAE,SAAAN,EAAU,MAAOD,CAAU,EAA2B,CACzF,OACC,oBAAC,QAAK,MAAOP,EAAG,uBAAwBO,CAAS,EAAG,eAAa,QAC/DC,CACF,CAEF,CAaO,SAASO,EAAuB,CAAE,SAAAP,EAAU,MAAOD,CAAU,EAAgC,CACnG,OACC,oBAAC,MAAG,MAAOP,EAAG,4BAA6BO,CAAS,EAAG,KAAK,eAAe,cAAY,QACrFC,CACF,CAEF,CASO,SAASQ,EAAsB,CAAE,MAAOT,EAAW,MAAAF,EAAQ,MAAO,EAA+B,CACvG,OACC,oBAAC,QAAK,MAAOL,EAAG,2BAA4BO,CAAS,EAAG,KAAK,eAAe,cAAY,QACvF,oBAAC,QAAK,cAAY,QAAO,QAAC,EAC1B,oBAAC,QAAK,MAAM,kCAAkCF,CAAM,CACrD,CAEF",
|
|
6
|
+
"names": ["RadiantElement", "customElement", "prop", "RuiBreadcrumb", "label", "separator", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "ssrModule", "defineRadiantView", "render", "args", "cx", "parts", "RuiBreadcrumb", "defineRadiantView", "slot", "label", "separator", "className", "children", "RuiBreadcrumbList", "RuiBreadcrumbItem", "RuiBreadcrumbLink", "href", "ariaLabel", "RuiBreadcrumbPage", "RuiBreadcrumbSeparator", "RuiBreadcrumbEllipsis"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RadiantSlotProps } from '../../../types';
|
|
3
|
+
export type RuiButtonVariant = 'filled' | 'outline' | 'destructive' | 'ghost';
|
|
4
|
+
export type RuiButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type RuiButtonProps = RadiantSlotProps & {
|
|
6
|
+
/** Visual style. Default: `filled`. */
|
|
7
|
+
variant?: RuiButtonVariant;
|
|
8
|
+
/** Control size. Default: `md`. */
|
|
9
|
+
size?: RuiButtonSize;
|
|
10
|
+
/** Native button type. Default: `button`. */
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
/** Disabled state. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Controlled pressed state for toggle buttons (`aria-pressed`). */
|
|
15
|
+
pressed?: boolean;
|
|
16
|
+
/** Initial pressed state when `toggle` is used without a controlled `pressed` value. */
|
|
17
|
+
defaultPressed?: boolean;
|
|
18
|
+
/** Toggle `aria-pressed` on click when `pressed` is not controlled. */
|
|
19
|
+
toggle?: boolean;
|
|
20
|
+
/** Extra class names appended after the variant/size classes. */
|
|
21
|
+
class?: string;
|
|
22
|
+
/** Accessible name when the button has no visible text. */
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
'on:click'?: (event: Event) => void;
|
|
25
|
+
children?: JsxRenderable;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Presentational wrapper around a native `<button>`.
|
|
29
|
+
*
|
|
30
|
+
* No custom element and no controller — only CSS variants/sizes. Follows the
|
|
31
|
+
* APG Button pattern by staying on the native control for activation and focus.
|
|
32
|
+
*
|
|
33
|
+
* Styles ship via the radiant-ui base stylesheet (`rui-button` classes).
|
|
34
|
+
*
|
|
35
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/button/
|
|
36
|
+
*/
|
|
37
|
+
export declare function RuiButton({ variant, size, type, disabled, pressed, defaultPressed, toggle, class: className, slot, children, 'on:click': onClick, ...rest }: RuiButtonProps): JsxRenderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RuiButton, type RuiButtonProps, type RuiButtonSize, type RuiButtonVariant } from './button';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function B(...t){return t.filter(Boolean).join(" ")}function y(t,n,o){if(t!==void 0)return t;if(n)return o}function m({variant:t="filled",size:n="md",type:o="button",disabled:s,pressed:i,defaultPressed:l=!1,toggle:e=!1,class:d,slot:f,children:p,"on:click":r,...b}){let c=u=>{if(e&&i===void 0){let a=u.currentTarget,R=a.getAttribute("aria-pressed")!=="true";a.setAttribute("aria-pressed",String(R))}r?.(u)};return React.createElement("button",{type:o,slot:f,class:B("rui-button",`rui-button--${t}`,`rui-button--${n}`,d),disabled:s,"aria-pressed":y(i,e,l),"data-toggle":e&&i===void 0?"":void 0,"on:click":e||r?c:void 0,...b},p)}export{m as RuiButton};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/button/button.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantSlotProps } from '../../../types';\n\nexport type RuiButtonVariant = 'filled' | 'outline' | 'destructive' | 'ghost';\nexport type RuiButtonSize = 'sm' | 'md' | 'lg';\n\nexport type RuiButtonProps = RadiantSlotProps & {\n\t/** Visual style. Default: `filled`. */\n\tvariant?: RuiButtonVariant;\n\t/** Control size. Default: `md`. */\n\tsize?: RuiButtonSize;\n\t/** Native button type. Default: `button`. */\n\ttype?: 'button' | 'submit' | 'reset';\n\t/** Disabled state. */\n\tdisabled?: boolean;\n\t/** Controlled pressed state for toggle buttons (`aria-pressed`). */\n\tpressed?: boolean;\n\t/** Initial pressed state when `toggle` is used without a controlled `pressed` value. */\n\tdefaultPressed?: boolean;\n\t/** Toggle `aria-pressed` on click when `pressed` is not controlled. */\n\ttoggle?: boolean;\n\t/** Extra class names appended after the variant/size classes. */\n\tclass?: string;\n\t/** Accessible name when the button has no visible text. */\n\t'aria-label'?: string;\n\t'on:click'?: (event: Event) => void;\n\tchildren?: JsxRenderable;\n};\n\nfunction cx(...parts: Array<string | false | null | undefined>): string {\n\treturn parts.filter(Boolean).join(' ');\n}\n\nfunction resolveAriaPressed(\n\tpressed: boolean | undefined,\n\ttoggle: boolean,\n\tdefaultPressed: boolean,\n): boolean | undefined {\n\tif (pressed !== undefined) {\n\t\treturn pressed;\n\t}\n\n\tif (toggle) {\n\t\treturn defaultPressed;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Presentational wrapper around a native `<button>`.\n *\n * No custom element and no controller \u2014 only CSS variants/sizes. Follows the\n * APG Button pattern by staying on the native control for activation and focus.\n *\n * Styles ship via the radiant-ui base stylesheet (`rui-button` classes).\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\nexport function RuiButton({\n\tvariant = 'filled',\n\tsize = 'md',\n\ttype = 'button',\n\tdisabled,\n\tpressed,\n\tdefaultPressed = false,\n\ttoggle = false,\n\tclass: className,\n\tslot,\n\tchildren,\n\t'on:click': onClick,\n\t...rest\n}: RuiButtonProps) {\n\tconst handleClick = (event: Event) => {\n\t\tif (toggle && pressed === undefined) {\n\t\t\tconst button = event.currentTarget as HTMLButtonElement;\n\t\t\tconst next = button.getAttribute('aria-pressed') !== 'true';\n\t\t\tbutton.setAttribute('aria-pressed', String(next));\n\t\t}\n\n\t\tonClick?.(event);\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype={type}\n\t\t\tslot={slot}\n\t\t\tclass={cx('rui-button', `rui-button--${variant}`, `rui-button--${size}`, className)}\n\t\t\tdisabled={disabled}\n\t\t\taria-pressed={resolveAriaPressed(pressed, toggle, defaultPressed)}\n\t\t\tdata-toggle={toggle && pressed === undefined ? '' : undefined}\n\t\t\ton:click={toggle || onClick ? handleClick : undefined}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AA6BA,SAASA,KAAMC,EAAyD,CACvE,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACtC,CAEA,SAASC,EACRC,EACAC,EACAC,EACsB,CACtB,GAAIF,IAAY,OACf,OAAOA,EAGR,GAAIC,EACH,OAAOC,CAIT,CAYO,SAASC,EAAU,CACzB,QAAAC,EAAU,SACV,KAAAC,EAAO,KACP,KAAAC,EAAO,SACP,SAAAC,EACA,QAAAP,EACA,eAAAE,EAAiB,GACjB,OAAAD,EAAS,GACT,MAAOO,EACP,KAAAC,EACA,SAAAC,EACA,WAAYC,EACZ,GAAGC,CACJ,EAAmB,CAClB,IAAMC,EAAeC,GAAiB,CACrC,GAAIb,GAAUD,IAAY,OAAW,CACpC,IAAMe,EAASD,EAAM,cACfE,EAAOD,EAAO,aAAa,cAAc,IAAM,OACrDA,EAAO,aAAa,eAAgB,OAAOC,CAAI,CAAC,CACjD,CAEAL,IAAUG,CAAK,CAChB,EAEA,OACC,oBAAC,UACA,KAAMR,EACN,KAAMG,EACN,MAAOZ,EAAG,aAAc,eAAeO,CAAO,GAAI,eAAeC,CAAI,GAAIG,CAAS,EAClF,SAAUD,EACV,eAAcR,EAAmBC,EAASC,EAAQC,CAAc,EAChE,cAAaD,GAAUD,IAAY,OAAY,GAAK,OACpD,WAAUC,GAAUU,EAAUE,EAAc,OAC3C,GAAGD,GAEHF,CACF,CAEF",
|
|
6
|
+
"names": ["cx", "parts", "resolveAriaPressed", "pressed", "toggle", "defaultPressed", "RuiButton", "variant", "size", "type", "disabled", "className", "slot", "children", "onClick", "rest", "handleClick", "event", "button", "next"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
@reference '../../../styles/radiant-ui.css';
|
|
2
|
+
|
|
3
|
+
rui-carousel {
|
|
4
|
+
@apply block w-full max-w-full min-w-0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@layer components {
|
|
8
|
+
.rui-carousel {
|
|
9
|
+
@apply flex w-full min-w-0 max-w-full flex-col gap-stack;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rui-carousel:focus-visible {
|
|
13
|
+
@apply outline-hidden ring-2 ring-focus-ring rounded-container;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rui-carousel__stage {
|
|
17
|
+
@apply relative w-full min-w-0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rui-carousel__viewport {
|
|
21
|
+
@apply relative w-full min-w-0 overflow-hidden rounded-container border border-border bg-surface text-sm;
|
|
22
|
+
touch-action: pan-y;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rui-carousel--controls-toolbar .rui-carousel__viewport {
|
|
26
|
+
@apply p-inset;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.rui-carousel--controls-overlay .rui-carousel__viewport {
|
|
30
|
+
@apply p-0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rui-carousel__track {
|
|
34
|
+
@apply relative w-full min-h-[clamp(8rem,40vw,16rem)];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.rui-carousel__slide {
|
|
38
|
+
@apply flex w-full min-w-0 min-h-[clamp(8rem,40vw,16rem)] items-center justify-center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.rui-carousel__footer {
|
|
42
|
+
@apply w-full min-w-0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.rui-carousel__toolbar {
|
|
46
|
+
@apply grid w-full items-center gap-inline;
|
|
47
|
+
grid-template-columns: 1fr auto 1fr;
|
|
48
|
+
grid-template-rows: auto auto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.rui-carousel__toolbar-rotation {
|
|
52
|
+
@apply flex justify-center;
|
|
53
|
+
grid-column: 2;
|
|
54
|
+
grid-row: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rui-carousel__toolbar-center {
|
|
58
|
+
@apply flex justify-center px-2;
|
|
59
|
+
grid-column: 2;
|
|
60
|
+
grid-row: 2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.rui-carousel__toolbar-side--start {
|
|
64
|
+
@apply flex min-w-0 items-center justify-start;
|
|
65
|
+
grid-column: 1;
|
|
66
|
+
grid-row: 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rui-carousel__toolbar-side--end {
|
|
70
|
+
@apply flex min-w-0 items-center justify-end;
|
|
71
|
+
grid-column: 3;
|
|
72
|
+
grid-row: 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.rui-carousel__nav-label {
|
|
76
|
+
@apply inline-flex items-center gap-1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.rui-carousel__overlay-chrome {
|
|
80
|
+
@apply pointer-events-none absolute inset-0 z-dropdown;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.rui-carousel__overlay-rotation {
|
|
84
|
+
top: var(--space-inset);
|
|
85
|
+
right: var(--space-inset);
|
|
86
|
+
@apply pointer-events-auto absolute;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.rui-carousel__controls--overlay {
|
|
90
|
+
@apply pointer-events-none absolute inset-0 flex items-center justify-between;
|
|
91
|
+
padding-inline: var(--space-inset);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.rui-carousel__controls--overlay > * {
|
|
95
|
+
@apply pointer-events-auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.rui-carousel__indicators--overlay {
|
|
99
|
+
top: var(--space-inset);
|
|
100
|
+
@apply pointer-events-auto absolute left-1/2 max-w-[calc(100%-5rem)] -translate-x-1/2 rounded-full border border-border/80 bg-surface/80 px-3 py-1.5 shadow-sm backdrop-blur-sm;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.rui-carousel__nav--overlay {
|
|
104
|
+
@apply min-h-11 min-w-11 shrink-0 rounded-full border-border/80 bg-surface/90 shadow-sm backdrop-blur-sm;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.rui-carousel__nav--overlay:focus-visible {
|
|
108
|
+
@apply rounded-full;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.rui-carousel__nav--overlay:active:not(:disabled) {
|
|
112
|
+
@apply rounded-full;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.rui-carousel__nav-icon {
|
|
116
|
+
@apply block text-lg leading-none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rui-carousel__rotation--overlay {
|
|
120
|
+
@apply rounded-full border border-border/80 bg-surface/90 px-3 shadow-sm backdrop-blur-sm;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.rui-carousel__indicators {
|
|
124
|
+
@apply flex items-center justify-center gap-inline;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rui-carousel__indicator {
|
|
128
|
+
@apply h-2.5 w-2.5 shrink-0 rounded-full border border-border bg-background transition-[background-color,border-color] focus:rounded-full;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rui-carousel__indicator[aria-selected='true'] {
|
|
132
|
+
@apply rounded-full bg-primary border-primary;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.rui-carousel__indicator:focus-visible {
|
|
136
|
+
@apply rounded-full outline-hidden ring-2 ring-focus-ring;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.rui-carousel__indicator:active {
|
|
140
|
+
@apply rounded-full;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.rui-carousel--none .rui-carousel__slide[hidden] {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.rui-carousel--slide .rui-carousel__track {
|
|
148
|
+
@apply flex w-full transition-transform duration-slow ease-in-out;
|
|
149
|
+
transform: translateX(calc(var(--rui-carousel-index, 0) * -100%));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.rui-carousel--slide .rui-carousel__slide {
|
|
153
|
+
@apply min-w-full w-full shrink-0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.rui-carousel--fade .rui-carousel__track {
|
|
157
|
+
@apply grid w-full;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.rui-carousel--fade .rui-carousel__slide {
|
|
161
|
+
@apply col-start-1 row-start-1 w-full transition-opacity duration-slow ease-in-out;
|
|
162
|
+
opacity: 0;
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.rui-carousel--fade .rui-carousel__slide[data-active='true'] {
|
|
167
|
+
opacity: 1;
|
|
168
|
+
pointer-events: auto;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RadiantSlotProps } from '../../../types';
|
|
3
|
+
import type { RuiCarouselProps } from './carousel.script';
|
|
4
|
+
import './carousel.css';
|
|
5
|
+
export type RuiCarouselSlideData = {
|
|
6
|
+
id: string;
|
|
7
|
+
children: JsxRenderable;
|
|
8
|
+
};
|
|
9
|
+
export type RuiCarouselSlideProps = {
|
|
10
|
+
id: string;
|
|
11
|
+
index?: number;
|
|
12
|
+
children: JsxRenderable;
|
|
13
|
+
class?: string;
|
|
14
|
+
};
|
|
15
|
+
/** Slide in the default carousel slot (APG `group` / `tabpanel` roles are applied by the host). */
|
|
16
|
+
export declare function RuiCarouselSlide({ id, children, class: className }: RuiCarouselSlideProps): JsxRenderable;
|
|
17
|
+
export type RuiCarouselControlProps = RadiantSlotProps & {
|
|
18
|
+
children?: JsxRenderable;
|
|
19
|
+
class?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Match `controls-variant="overlay"` on the carousel for circular on-slide chrome. */
|
|
22
|
+
overlay?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Previous control slotted into `prev` by default. */
|
|
25
|
+
export declare function RuiCarouselPrev({ slot, children, class: className, disabled, overlay, }: RuiCarouselControlProps): JsxRenderable;
|
|
26
|
+
/** Next control slotted into `next` by default. */
|
|
27
|
+
export declare function RuiCarouselNext({ slot, children, class: className, disabled, overlay, }: RuiCarouselControlProps): JsxRenderable;
|
|
28
|
+
export type RuiCarouselRotationProps = RadiantSlotProps & {
|
|
29
|
+
children?: JsxRenderable;
|
|
30
|
+
class?: string;
|
|
31
|
+
overlay?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/** Play/pause rotation control slotted into `rotation` by default. */
|
|
34
|
+
export declare function RuiCarouselRotation({ slot, children, class: className, overlay, }: RuiCarouselRotationProps): JsxRenderable;
|
|
35
|
+
export declare const RuiCarousel: import("../../../lib/radiant-view").RadiantViewComponent<RuiCarouselProps & RadiantSlotProps & {
|
|
36
|
+
slides?: RuiCarouselSlideData[];
|
|
37
|
+
} & {
|
|
38
|
+
children?: JsxRenderable;
|
|
39
|
+
}>;
|