jaci-ui 0.7.0 → 0.9.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/CHANGELOG.md +12 -0
- package/README.md +75 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/components/alert-dialog/alert-dialog.cjs +4 -1
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.d.cts +2 -2
- package/dist/components/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog/alert-dialog.js +4 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/carousel/carousel.cjs +342 -0
- package/dist/components/carousel/carousel.cjs.map +1 -0
- package/dist/components/carousel/carousel.d.cts +44 -0
- package/dist/components/carousel/carousel.d.ts +44 -0
- package/dist/components/carousel/carousel.js +330 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/index.d.cts +2 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/code/code.cjs +32 -5
- package/dist/components/code/code.cjs.map +1 -1
- package/dist/components/code/code.d.cts +1 -0
- package/dist/components/code/code.d.ts +1 -0
- package/dist/components/code/code.js +34 -7
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/color-picker/color-picker.cjs +4 -1
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.d.cts +2 -2
- package/dist/components/color-picker/color-picker.d.ts +2 -2
- package/dist/components/color-picker/color-picker.js +4 -1
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.cjs +33 -0
- package/dist/components/color-swatch/color-swatch.cjs.map +1 -0
- package/dist/components/color-swatch/color-swatch.d.cts +13 -0
- package/dist/components/color-swatch/color-swatch.d.ts +13 -0
- package/dist/components/color-swatch/color-swatch.js +33 -0
- package/dist/components/color-swatch/color-swatch.js.map +1 -0
- package/dist/components/color-swatch/index.d.cts +2 -0
- package/dist/components/color-swatch/index.d.ts +2 -0
- package/dist/components/combobox/combobox.cjs +4 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.d.cts +2 -2
- package/dist/components/combobox/combobox.d.ts +2 -2
- package/dist/components/combobox/combobox.js +4 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/command/command.cjs +76 -13
- package/dist/components/command/command.cjs.map +1 -1
- package/dist/components/command/command.d.cts +7 -1
- package/dist/components/command/command.d.ts +7 -1
- package/dist/components/command/command.js +76 -13
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/command/index.d.cts +2 -2
- package/dist/components/command/index.d.ts +2 -2
- package/dist/components/context-menu/context-menu.cjs +4 -1
- package/dist/components/context-menu/context-menu.cjs.map +1 -1
- package/dist/components/context-menu/context-menu.d.cts +2 -2
- package/dist/components/context-menu/context-menu.d.ts +2 -2
- package/dist/components/context-menu/context-menu.js +4 -1
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +4 -1
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.d.cts +2 -2
- package/dist/components/date-picker/date-picker.d.ts +2 -2
- package/dist/components/date-picker/date-picker.js +4 -1
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +4 -1
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.cts +2 -2
- package/dist/components/date-range-picker/date-range-picker.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.js +4 -1
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/dialog/dialog.cjs +4 -1
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.d.cts +2 -2
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.js +4 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.cjs +25 -0
- package/dist/components/download-trigger/download-trigger.cjs.map +1 -0
- package/dist/components/download-trigger/download-trigger.d.cts +12 -0
- package/dist/components/download-trigger/download-trigger.d.ts +12 -0
- package/dist/components/download-trigger/download-trigger.js +25 -0
- package/dist/components/download-trigger/download-trigger.js.map +1 -0
- package/dist/components/download-trigger/index.d.cts +2 -0
- package/dist/components/download-trigger/index.d.ts +2 -0
- package/dist/components/drawer/drawer.cjs +4 -1
- package/dist/components/drawer/drawer.cjs.map +1 -1
- package/dist/components/drawer/drawer.d.cts +2 -2
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.js +4 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/figure/figure.cjs +45 -36
- package/dist/components/figure/figure.cjs.map +1 -1
- package/dist/components/figure/figure.js +45 -36
- package/dist/components/figure/figure.js.map +1 -1
- package/dist/components/image/image.cjs +41 -32
- package/dist/components/image/image.cjs.map +1 -1
- package/dist/components/image/image.js +41 -32
- package/dist/components/image/image.js.map +1 -1
- package/dist/components/menu/menu.cjs +4 -1
- package/dist/components/menu/menu.cjs.map +1 -1
- package/dist/components/menu/menu.d.cts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menu/menu.js +4 -1
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menubar/menubar.cjs +4 -1
- package/dist/components/menubar/menubar.cjs.map +1 -1
- package/dist/components/menubar/menubar.d.cts +2 -2
- package/dist/components/menubar/menubar.d.ts +2 -2
- package/dist/components/menubar/menubar.js +4 -1
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/navigation/navigation.cjs +3 -1
- package/dist/components/navigation/navigation.cjs.map +1 -1
- package/dist/components/navigation/navigation.js +3 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs +4 -1
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.cts +2 -2
- package/dist/components/navigation-menu/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu/navigation-menu.js +4 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/popover/popover.cjs +4 -1
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.d.cts +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/popover.js +4 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/qr-code/index.d.cts +2 -0
- package/dist/components/qr-code/index.d.ts +2 -0
- package/dist/components/qr-code/qr-code.cjs +118 -0
- package/dist/components/qr-code/qr-code.cjs.map +1 -0
- package/dist/components/qr-code/qr-code.d.cts +17 -0
- package/dist/components/qr-code/qr-code.d.ts +17 -0
- package/dist/components/qr-code/qr-code.js +116 -0
- package/dist/components/qr-code/qr-code.js.map +1 -0
- package/dist/components/select/select.cjs +4 -1
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.d.cts +2 -2
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +4 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs +24 -17
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.d.cts +4 -2
- package/dist/components/sidebar/sidebar.d.ts +4 -2
- package/dist/components/sidebar/sidebar.js +24 -17
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/spacer/index.d.cts +2 -0
- package/dist/components/spacer/index.d.ts +2 -0
- package/dist/components/spacer/spacer.cjs +24 -0
- package/dist/components/spacer/spacer.cjs.map +1 -0
- package/dist/components/spacer/spacer.d.cts +10 -0
- package/dist/components/spacer/spacer.d.ts +10 -0
- package/dist/components/spacer/spacer.js +24 -0
- package/dist/components/spacer/spacer.js.map +1 -0
- package/dist/components/toast/toast.cjs +4 -1
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.d.cts +1 -1
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/components/toast/toast.js +4 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/tooltip/tooltip.cjs +4 -1
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.d.cts +2 -2
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +4 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -0
- package/dist/styled-system/recipes/carousel.cjs +48 -0
- package/dist/styled-system/recipes/carousel.cjs.map +1 -0
- package/dist/styled-system/recipes/carousel.js +48 -0
- package/dist/styled-system/recipes/carousel.js.map +1 -0
- package/dist/styled-system/recipes/code.cjs +4 -2
- package/dist/styled-system/recipes/code.cjs.map +1 -1
- package/dist/styled-system/recipes/code.js +4 -2
- package/dist/styled-system/recipes/code.js.map +1 -1
- package/dist/styled-system/recipes/color-swatch.cjs +37 -0
- package/dist/styled-system/recipes/color-swatch.cjs.map +1 -0
- package/dist/styled-system/recipes/color-swatch.js +37 -0
- package/dist/styled-system/recipes/color-swatch.js.map +1 -0
- package/dist/styled-system/recipes/command.cjs +3 -3
- package/dist/styled-system/recipes/command.cjs.map +1 -1
- package/dist/styled-system/recipes/command.js +3 -3
- package/dist/styled-system/recipes/command.js.map +1 -1
- package/dist/styled-system/recipes/download-trigger.cjs +39 -0
- package/dist/styled-system/recipes/download-trigger.cjs.map +1 -0
- package/dist/styled-system/recipes/download-trigger.js +39 -0
- package/dist/styled-system/recipes/download-trigger.js.map +1 -0
- package/dist/styled-system/recipes/figure.cjs +1 -0
- package/dist/styled-system/recipes/figure.cjs.map +1 -1
- package/dist/styled-system/recipes/figure.js +1 -0
- package/dist/styled-system/recipes/figure.js.map +1 -1
- package/dist/styled-system/recipes/image.cjs +1 -0
- package/dist/styled-system/recipes/image.cjs.map +1 -1
- package/dist/styled-system/recipes/image.js +1 -0
- package/dist/styled-system/recipes/image.js.map +1 -1
- package/dist/styled-system/recipes/layout-spacer.cjs +88 -0
- package/dist/styled-system/recipes/layout-spacer.cjs.map +1 -0
- package/dist/styled-system/recipes/layout-spacer.js +88 -0
- package/dist/styled-system/recipes/layout-spacer.js.map +1 -0
- package/dist/styled-system/recipes/qr-code.cjs +25 -0
- package/dist/styled-system/recipes/qr-code.cjs.map +1 -0
- package/dist/styled-system/recipes/qr-code.js +25 -0
- package/dist/styled-system/recipes/qr-code.js.map +1 -0
- package/dist/styles.css +662 -106
- package/dist/theme/theme-provider.cjs +46 -8
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.js +46 -8
- package/dist/theme/theme-provider.js.map +1 -1
- package/dist/theme/theme-scope.cjs +21 -0
- package/dist/theme/theme-scope.cjs.map +1 -0
- package/dist/theme/theme-scope.js +19 -0
- package/dist/theme/theme-scope.js.map +1 -0
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d06e214: Add Carousel, ColorSwatch, DownloadTrigger, QRCode and Spacer components, and consolidate the Separator utilities.
|
|
8
|
+
|
|
9
|
+
## 0.8.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- cd7966c: Harden package compatibility, tarball validation, tree-shaking and CI coverage for React and framework consumers.
|
|
14
|
+
|
|
3
15
|
## 0.7.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Accessible, themeable React components for React 18.2 and React 19 applications.
|
|
4
4
|
|
|
5
|
+
The published package supports Node 18.18 or newer. Node 22.18 or newer is required only for
|
|
6
|
+
working on the repository because it is used by the build toolchain.
|
|
7
|
+
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
7
10
|
```sh
|
|
@@ -18,6 +21,11 @@ import "jaci-ui/styles.css";
|
|
|
18
21
|
The package declares `react` and `react-dom` as peer dependencies. `@base-ui/react` is installed
|
|
19
22
|
as a runtime dependency for accessible interactive primitives.
|
|
20
23
|
|
|
24
|
+
The package publishes ESM and CommonJS entry points, TypeScript declarations and sourcemaps.
|
|
25
|
+
`jaci-ui/styles.css` is the only declared side effect, so bundlers can tree-shake unused
|
|
26
|
+
component modules. Import `jaci-ui/panda-preset` only when an application also uses Panda CSS;
|
|
27
|
+
the regular package does not require Panda at runtime.
|
|
28
|
+
|
|
21
29
|
## Usage
|
|
22
30
|
|
|
23
31
|
Components use named exports and compound APIs where several accessible parts work together:
|
|
@@ -76,6 +84,64 @@ import { AspectRatio, Code, Figure, Image, Kbd, Quote, Stat, StatGroup } from "j
|
|
|
76
84
|
</StatGroup.Root>;
|
|
77
85
|
```
|
|
78
86
|
|
|
87
|
+
### Mídia e utilitários visuais
|
|
88
|
+
|
|
89
|
+
`Carousel` oferece slides acessíveis com navegação por teclado, indicadores, swipe e autoplay
|
|
90
|
+
opcional. Sempre forneça um `aria-label` no root e texto alternativo nas imagens:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<Carousel.Root aria-label="Featured projects" loop>
|
|
94
|
+
<Carousel.Viewport>
|
|
95
|
+
<Carousel.Track>
|
|
96
|
+
<Carousel.Item index={0}>
|
|
97
|
+
<Carousel.Media><Image src="/project.jpg" alt="Project preview" /></Carousel.Media>
|
|
98
|
+
<Carousel.Caption>
|
|
99
|
+
<Carousel.Title>Project title</Carousel.Title>
|
|
100
|
+
<Carousel.Description>Project description</Carousel.Description>
|
|
101
|
+
</Carousel.Caption>
|
|
102
|
+
</Carousel.Item>
|
|
103
|
+
</Carousel.Track>
|
|
104
|
+
</Carousel.Viewport>
|
|
105
|
+
<Carousel.Previous />
|
|
106
|
+
<Carousel.Next />
|
|
107
|
+
<Carousel.Indicators />
|
|
108
|
+
</Carousel.Root>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`QRCode` gera SVG no servidor e no cliente, com módulos circulares e olhos quadrados
|
|
112
|
+
arredondados. O valor pode ser controlado diretamente pela aplicação:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<QRCode
|
|
116
|
+
value="https://jaci-ui.dev"
|
|
117
|
+
size={240}
|
|
118
|
+
errorCorrectionLevel="Q"
|
|
119
|
+
label="Jaci UI website"
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Para downloads, `DownloadTrigger` é um link HTML comum e não faz fetch nem cria `Blob`:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<DownloadTrigger href="/files/report.pdf" download="report.pdf">
|
|
127
|
+
Download report
|
|
128
|
+
</DownloadTrigger>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Em URLs cross-origin, o nome e a própria autorização do download continuam sujeitos às regras
|
|
132
|
+
do navegador e aos headers do servidor.
|
|
133
|
+
|
|
134
|
+
Use `Separator` para uma linha semântica ou decorativa entre seções e `Spacer` quando precisar
|
|
135
|
+
apenas de espaço, sem linha:
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<Separator orientation="horizontal" />
|
|
139
|
+
<Spacer axis="vertical" size="lg" />
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Todos esses componentes continuam compatíveis com SSR e React 18/19. `Carousel` é o único novo
|
|
143
|
+
módulo interativo; os demais não acessam APIs do navegador durante importação ou renderização.
|
|
144
|
+
|
|
79
145
|
`AspectRatio` fills the available inline size of its parent. In shrink-to-fit or flex
|
|
80
146
|
layouts, give the parent an explicit `width`/`max-width` so the ratio has a measurable
|
|
81
147
|
size.
|
|
@@ -338,6 +404,15 @@ export function App() {
|
|
|
338
404
|
mounting. The provider is a client module, so Next.js App Router applications should place it
|
|
339
405
|
inside a client boundary. Direct `data-jaci-theme` and `--jaci-*` variables remain supported.
|
|
340
406
|
|
|
407
|
+
Popups rendered through Jaci portal slots inherit the nearest `ThemeProvider` scope, including
|
|
408
|
+
local accent tokens. An explicit `container` prop on a portal still takes precedence. Without a
|
|
409
|
+
provider, portals keep Base UI's default document-level behavior.
|
|
410
|
+
|
|
411
|
+
When combining responsive utility classes with `Sidebar` or `BottomNavigation`, import
|
|
412
|
+
`jaci-ui/styles.css` before the application's utility stylesheet. Their structural display rule
|
|
413
|
+
uses a low-specificity selector, so classes such as `hidden md:flex` and `md:hidden` can control
|
|
414
|
+
visibility without inline styles.
|
|
415
|
+
|
|
341
416
|
The package exposes semantic surface, foreground, border, status, spacing, radius, shadow and
|
|
342
417
|
transition tokens. See the Theming guide in Storybook for the complete token vocabulary.
|
|
343
418
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
3
3
|
const require_base_ui = require("../base-ui.cjs");
|
|
4
4
|
const require_dialog = require("../../styled-system/recipes/dialog.cjs");
|
|
5
|
+
const require_theme_scope = require("../../theme/theme-scope.cjs");
|
|
5
6
|
let react = require("react");
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
let _base_ui_react_alert_dialog = require("@base-ui/react/alert-dialog");
|
|
@@ -17,7 +18,9 @@ const AlertDialogTrigger = (0, react.forwardRef)(function AlertDialogTrigger({ c
|
|
|
17
18
|
"data-slot": "alert-dialog-trigger"
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
function AlertDialogPortal(props) {
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_alert_dialog.AlertDialog.Portal, { ...require_theme_scope.useThemePortalProps(props) });
|
|
23
|
+
}
|
|
21
24
|
const AlertDialogBackdrop = (0, react.forwardRef)(function AlertDialogBackdrop({ className, ...props }, ref) {
|
|
22
25
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_alert_dialog.AlertDialog.Backdrop, {
|
|
23
26
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","withRecipeClassName","dialog","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport const AlertDialogPortal: typeof BaseAlertDialog.Portal = BaseAlertDialog.Portal;\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;AAkBA,SAAgB,gBAAmC,OAAsC;CACvF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAmDF,4BAAAA,YAAgB;AAIhF,MAAa,uBAAA,GAAA,MAAA,WAAA,CACX,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,uBAAA,GAAA,MAAA,WAAA,CACX,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAAA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,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cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcF,4BAAAA,YAAgB;AAChC"}
|
|
1
|
+
{"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,gBAAmC,OAAsC;CACvF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,iBAAA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AAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAWC,gBAAAA,oBACT,kBAAkBC,eAAAA,OAAO,CAAC,CAAC,SAASA,eAAAA,OAAO,CAAC,CAAC,OAC7C,SACF;EACA,aAAW,YAAY;YAEtB,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcF,4BAAAA,YAAgB;AAChC"}
|
|
@@ -12,7 +12,7 @@ declare function AlertDialogRoot$1<Payload = unknown>(props: AlertDialogRootProp
|
|
|
12
12
|
type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof AlertDialog.Trigger>;
|
|
13
13
|
declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof AlertDialog.Portal>;
|
|
15
|
-
declare
|
|
15
|
+
declare function AlertDialogPortal(props: AlertDialogPortalProps): import("react").JSX.Element;
|
|
16
16
|
type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof AlertDialog.Backdrop>;
|
|
17
17
|
declare const AlertDialogBackdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
18
|
type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof AlertDialog.Viewport>;
|
|
@@ -48,7 +48,7 @@ declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<
|
|
|
48
48
|
declare const AlertDialog$1: {
|
|
49
49
|
Root: typeof AlertDialogRoot$1;
|
|
50
50
|
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
51
|
-
Portal:
|
|
51
|
+
Portal: typeof AlertDialogPortal;
|
|
52
52
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
53
|
Viewport: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
54
|
Popup: import("react").ForwardRefExoticComponent<AlertDialogPopupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -12,7 +12,7 @@ declare function AlertDialogRoot$1<Payload = unknown>(props: AlertDialogRootProp
|
|
|
12
12
|
type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof AlertDialog.Trigger>;
|
|
13
13
|
declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof AlertDialog.Portal>;
|
|
15
|
-
declare
|
|
15
|
+
declare function AlertDialogPortal(props: AlertDialogPortalProps): import("react").JSX.Element;
|
|
16
16
|
type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof AlertDialog.Backdrop>;
|
|
17
17
|
declare const AlertDialogBackdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
18
|
type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof AlertDialog.Viewport>;
|
|
@@ -48,7 +48,7 @@ declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<
|
|
|
48
48
|
declare const AlertDialog$1: {
|
|
49
49
|
Root: typeof AlertDialogRoot$1;
|
|
50
50
|
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
51
|
-
Portal:
|
|
51
|
+
Portal: typeof AlertDialogPortal;
|
|
52
52
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
53
|
Viewport: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
54
|
Popup: import("react").ForwardRefExoticComponent<AlertDialogPopupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { cx } from "../../styled-system/css/cx.js";
|
|
3
3
|
import { withRecipeClassName } from "../base-ui.js";
|
|
4
4
|
import { dialog } from "../../styled-system/recipes/dialog.js";
|
|
5
|
+
import { useThemePortalProps } from "../../theme/theme-scope.js";
|
|
5
6
|
import { forwardRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
@@ -17,7 +18,9 @@ const AlertDialogTrigger = forwardRef(function AlertDialogTrigger({ className, .
|
|
|
17
18
|
"data-slot": "alert-dialog-trigger"
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
function AlertDialogPortal(props) {
|
|
22
|
+
return /* @__PURE__ */ jsx(AlertDialog.Portal, { ...useThemePortalProps(props) });
|
|
23
|
+
}
|
|
21
24
|
const AlertDialogBackdrop = forwardRef(function AlertDialogBackdrop({ className, ...props }, ref) {
|
|
22
25
|
return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
|
|
23
26
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport const AlertDialogPortal: typeof BaseAlertDialog.Portal = BaseAlertDialog.Portal;\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;AAkBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA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;AAEA,MAAaC,gBAAc;CACzB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcC,YAAgB;AAChC"}
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,oBAACA,YAAgB,QAAjB,EAAwB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,E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