@puzzle-ui/ui 0.2.0 → 0.4.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 +71 -70
- package/dist/components/data-display/empty-state/empty-state.css +128 -0
- package/dist/components/data-display/empty-state/empty-state.utils.cjs +6 -0
- package/dist/components/data-display/empty-state/empty-state.utils.cjs.map +1 -0
- package/dist/components/data-display/empty-state/empty-state.utils.js +6 -0
- package/dist/components/data-display/empty-state/empty-state.utils.js.map +1 -0
- package/dist/components/data-display/empty-state/index.cjs +49 -0
- package/dist/components/data-display/empty-state/index.cjs.map +1 -0
- package/dist/components/data-display/empty-state/index.d.cts +19 -0
- package/dist/components/data-display/empty-state/index.d.ts +19 -0
- package/dist/components/data-display/empty-state/index.js +44 -0
- package/dist/components/data-display/empty-state/index.js.map +1 -0
- package/dist/components/editors/text-editor/editor.cjs.map +1 -1
- package/dist/components/editors/text-editor/editor.js.map +1 -1
- package/dist/components/editors/text-editor/text-document.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-document.js.map +1 -1
- package/dist/components/editors/text-editor/text-parser.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-parser.js.map +1 -1
- package/dist/components/editors/text-editor/text-renderer.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-renderer.js.map +1 -1
- package/dist/components/forms/autocomplete/index.cjs.map +1 -1
- package/dist/components/forms/autocomplete/index.js.map +1 -1
- package/dist/components/forms/color-picker/color-picker.css +351 -0
- package/dist/components/forms/color-picker/color-picker.types.d.cts +25 -0
- package/dist/components/forms/color-picker/color-picker.types.d.ts +25 -0
- package/dist/components/forms/color-picker/color-picker.utils.cjs +116 -0
- package/dist/components/forms/color-picker/color-picker.utils.cjs.map +1 -0
- package/dist/components/forms/color-picker/color-picker.utils.js +109 -0
- package/dist/components/forms/color-picker/color-picker.utils.js.map +1 -0
- package/dist/components/forms/color-picker/index.cjs +340 -0
- package/dist/components/forms/color-picker/index.cjs.map +1 -0
- package/dist/components/forms/color-picker/index.d.cts +3 -0
- package/dist/components/forms/color-picker/index.d.ts +3 -0
- package/dist/components/forms/color-picker/index.js +340 -0
- package/dist/components/forms/color-picker/index.js.map +1 -0
- package/dist/components/forms/file-upload/file-upload.utils.cjs.map +1 -1
- package/dist/components/forms/file-upload/file-upload.utils.js.map +1 -1
- package/dist/components/forms/input/number-input.js +5 -5
- package/dist/components/forms/input/number-input.js.map +1 -1
- package/dist/components/forms/input-group/index.d.cts +3 -0
- package/dist/components/forms/input-group/index.d.ts +3 -0
- package/dist/components/forms/input-group/input-group.cjs +18 -0
- package/dist/components/forms/input-group/input-group.cjs.map +1 -0
- package/dist/components/forms/input-group/input-group.css +62 -0
- package/dist/components/forms/input-group/input-group.d.cts +5 -0
- package/dist/components/forms/input-group/input-group.d.ts +5 -0
- package/dist/components/forms/input-group/input-group.js +18 -0
- package/dist/components/forms/input-group/input-group.js.map +1 -0
- package/dist/components/forms/input-group/input-group.types.d.cts +7 -0
- package/dist/components/forms/input-group/input-group.types.d.ts +7 -0
- package/dist/components/forms/input-group/input-group.utils.cjs +5 -0
- package/dist/components/forms/input-group/input-group.utils.cjs.map +1 -0
- package/dist/components/forms/input-group/input-group.utils.js +5 -0
- package/dist/components/forms/input-group/input-group.utils.js.map +1 -0
- package/dist/components/forms/select/index.cjs.map +1 -1
- package/dist/components/forms/select/index.js.map +1 -1
- package/dist/components/forms/slider/index.cjs +1 -1
- package/dist/components/forms/slider/index.cjs.map +1 -1
- package/dist/components/forms/slider/index.js +1 -1
- package/dist/components/forms/slider/index.js.map +1 -1
- package/dist/components/layout/resizable-panels/index.cjs +1 -1
- package/dist/components/layout/resizable-panels/index.cjs.map +1 -1
- package/dist/components/layout/resizable-panels/index.js +1 -1
- package/dist/components/layout/resizable-panels/index.js.map +1 -1
- package/dist/components/layout/resizable-panels/resizable-panels.utils.cjs.map +1 -1
- package/dist/components/layout/resizable-panels/resizable-panels.utils.js.map +1 -1
- package/dist/components/navigation/accordion/index.cjs.map +1 -1
- package/dist/components/navigation/accordion/index.js.map +1 -1
- package/dist/components/navigation/carousel/index.cjs +1 -1
- package/dist/components/navigation/carousel/index.cjs.map +1 -1
- package/dist/components/navigation/carousel/index.js +1 -1
- package/dist/components/navigation/carousel/index.js.map +1 -1
- package/dist/components/navigation/pagination/index.cjs +146 -0
- package/dist/components/navigation/pagination/index.cjs.map +1 -0
- package/dist/components/navigation/pagination/index.d.cts +3 -0
- package/dist/components/navigation/pagination/index.d.ts +3 -0
- package/dist/components/navigation/pagination/index.js +146 -0
- package/dist/components/navigation/pagination/index.js.map +1 -0
- package/dist/components/navigation/pagination/pagination.css +134 -0
- package/dist/components/navigation/pagination/pagination.types.d.cts +38 -0
- package/dist/components/navigation/pagination/pagination.types.d.ts +38 -0
- package/dist/components/navigation/pagination/pagination.utils.cjs +54 -0
- package/dist/components/navigation/pagination/pagination.utils.cjs.map +1 -0
- package/dist/components/navigation/pagination/pagination.utils.js +53 -0
- package/dist/components/navigation/pagination/pagination.utils.js.map +1 -0
- package/dist/components/navigation/tree-view/index.cjs.map +1 -1
- package/dist/components/navigation/tree-view/index.js.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu-content.cjs.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu-content.js.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.utils.cjs.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.utils.js.map +1 -1
- package/dist/components/utilities/preview/index.cjs +1 -1
- package/dist/components/utilities/preview/index.cjs.map +1 -1
- package/dist/components/utilities/preview/index.js +1 -1
- package/dist/components/utilities/preview/index.js.map +1 -1
- package/dist/index.cjs +110 -97
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +5 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,98 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
description: Install Puzzle in your React app, build your first interface, and customize the theme.
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
> \[!WARNING\] **Puzzle is not ready for production use.**
|
|
7
|
+
>
|
|
8
|
+
> This project is under active development. APIs, component props,
|
|
9
|
+
> package exports, styling, and internal implementation may change
|
|
10
|
+
> without notice. Components may be incomplete, and testing,
|
|
11
|
+
> accessibility, documentation, and framework compatibility are not yet
|
|
12
|
+
> guaranteed. Use it for experimentation and evaluation only---not for
|
|
13
|
+
> production applications.
|
|
5
14
|
|
|
6
|
-
|
|
7
|
-
> APIs, styling, accessibility coverage, and framework compatibility may
|
|
8
|
-
> change. Use it for experimentation and evaluation.
|
|
15
|
+
Puzzle is a TypeScript and React UI component library built around reusable components and shared design tokens. Its components are composable and router-independent, with styling supplied by `"@puzzle-ui/theme`. The framework is setup to be compatible with `Next.js`, `Tanstack Start` and `react-router`.
|
|
9
16
|
|
|
10
|
-
|
|
17
|
+
**Puzzle is under active development and is not ready for production use.** APIs, props, exports, and styling may change without notice. Accessibility and framework compatibility are still being tested. Use the project for experimentation and evaluation.
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
## Prerequisites
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
bun add @puzzle-ui/ui @puzzle-ui/theme
|
|
18
|
-
# or
|
|
19
|
-
pnpm add @puzzle-ui/ui @puzzle-ui/theme
|
|
20
|
-
# or
|
|
21
|
-
yarn add @puzzle-ui/ui @puzzle-ui/theme
|
|
22
|
-
```
|
|
21
|
+
- A package manager: npm, Bun, pnpm, or Yarn.
|
|
22
|
+
- An existing React application with a bundler that supports CSS imports, such as Vite.
|
|
23
|
+
- Familiarity with React and TypeScript. The UI and theme packages require React and React DOM 19 or later within the supported React 19 range.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
imports, such as Vite. Consumers do not need Bun.
|
|
25
|
+
## Set up a new project
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Simple run our @puzzle-ui/create project template to get started.
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
import { Theme } from "@puzzle-ui/theme";
|
|
31
|
-
import { Button } from "@puzzle-ui/ui";
|
|
29
|
+
npm:
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<main>
|
|
36
|
-
<h1>Hello, Puzzle</h1>
|
|
37
|
-
<Button onClick={() => window.alert("Hello!")}>
|
|
38
|
-
Get started
|
|
39
|
-
</Button>
|
|
40
|
-
</main>
|
|
41
|
-
</Theme>
|
|
42
|
-
);
|
|
31
|
+
```bash
|
|
32
|
+
npx @puzzle-ui/create
|
|
43
33
|
```
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
imported automatically; no separate Puzzle stylesheet or Tailwind setup is
|
|
47
|
-
required. Customize colors, fonts, spacing, and other tokens through
|
|
48
|
-
[`@puzzle-ui/theme`](../theme/README.md).
|
|
35
|
+
bun:
|
|
49
36
|
|
|
50
|
-
|
|
37
|
+
```bash
|
|
38
|
+
bunx @puzzle-ui/create
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Puzzle can set up a new project for you with the following framework options:
|
|
51
42
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
- Basic React app
|
|
44
|
+
- Tanstack start
|
|
45
|
+
- Next.js
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
examples, props, and accessibility guidance. Interactive components need a
|
|
59
|
-
client boundary in React Server Component applications.
|
|
47
|
+
Furthermore you can choose to install tailwindcss or not.
|
|
48
|
+
It directly installs all dependencies and sets up the project for you.
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
declarations. Its CSS requires a CSS-aware bundler rather than bare Node.js.
|
|
63
|
-
Test your chosen components in your framework; compatibility is still being
|
|
64
|
-
evaluated.
|
|
50
|
+
## Set up in an existing project:
|
|
65
51
|
|
|
66
|
-
|
|
52
|
+
Install the UI library and theme package in your application's directory. Choose your package manager below:
|
|
67
53
|
|
|
68
|
-
|
|
54
|
+
npm:
|
|
69
55
|
|
|
70
|
-
```
|
|
71
|
-
npm
|
|
56
|
+
```bash
|
|
57
|
+
npm install @puzzle-ui/ui --save
|
|
72
58
|
```
|
|
73
59
|
|
|
74
|
-
|
|
75
|
-
[publishing guide](../../README.md#publishing-packages).
|
|
60
|
+
bun:
|
|
76
61
|
|
|
77
|
-
|
|
62
|
+
```bash
|
|
63
|
+
bun add @puzzle-ui/create
|
|
64
|
+
```
|
|
78
65
|
|
|
79
|
-
|
|
66
|
+
pnpm:
|
|
80
67
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
| Component | `*.test.tsx` / `.ts` | jsdom | `bun run test:component` |
|
|
85
|
-
| Browser | `*.browser.test.tsx` | Chromium (Playwright) | `bun run test:browser` |
|
|
68
|
+
```bash
|
|
69
|
+
pnpm add @puzzle-ui/ui
|
|
70
|
+
```
|
|
86
71
|
|
|
87
|
-
|
|
88
|
-
- **Component**: rendering, ARIA and interaction with Testing Library.
|
|
89
|
-
- **Browser**: behavior that needs real layout, computed styles, focus or pointer input.
|
|
72
|
+
yarn:
|
|
90
73
|
|
|
91
|
-
|
|
74
|
+
```bash
|
|
75
|
+
yarn add @puzzle-ui/ui
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
These commands install published packages; they do not clone the repository or build its workspaces. Puzzle does not require Bun in your application. React and React DOM are peer dependencies and should already be installed in your app.
|
|
92
79
|
|
|
93
|
-
|
|
94
|
-
checkout, after installing workspace dependencies.
|
|
80
|
+
## Your first interface
|
|
95
81
|
|
|
96
|
-
|
|
82
|
+
Import components from `"@puzzle-ui/ui` and wrap your application in `Theme` from `"@puzzle-ui/theme`:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { Theme } from "@puzzle-ui/theme";
|
|
86
|
+
import { Button } from "@puzzle-ui/ui";
|
|
97
87
|
|
|
98
|
-
|
|
88
|
+
export const App = () => (
|
|
89
|
+
<Theme>
|
|
90
|
+
<main>
|
|
91
|
+
<h1>Hello, Puzzle</h1>
|
|
92
|
+
<p>Build your interface with reusable components and shared tokens.</p>
|
|
93
|
+
<Button onClick={() => window.alert("Welcome to Puzzle!")}>
|
|
94
|
+
Get started
|
|
95
|
+
</Button>
|
|
96
|
+
</main>
|
|
97
|
+
</Theme>
|
|
98
|
+
);
|
|
99
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
.puzzle-empty-state {
|
|
2
|
+
--empty-state-padding: var(--puzzle-space-6, 1.5rem);
|
|
3
|
+
--empty-state-gap: var(--puzzle-space-3, .75rem);
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--empty-state-gap);
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
padding: var(--empty-state-padding);
|
|
11
|
+
color: var(--puzzle-color-text);
|
|
12
|
+
font-family: var(--puzzle-font-family-body, inherit);
|
|
13
|
+
text-align: center;
|
|
14
|
+
border-radius: var(--puzzle-radius-lg, .75rem);
|
|
15
|
+
border: 1px solid #0000;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.puzzle-empty-state--sm {
|
|
21
|
+
--empty-state-padding: var(--puzzle-space-4, 1rem);
|
|
22
|
+
--empty-state-gap: var(--puzzle-space-2, .5rem);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.puzzle-empty-state--md {
|
|
26
|
+
--empty-state-padding: var(--puzzle-space-6, 1.5rem);
|
|
27
|
+
--empty-state-gap: var(--puzzle-space-3, .75rem);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.puzzle-empty-state--lg {
|
|
31
|
+
--empty-state-padding: var(--puzzle-space-8, 2rem);
|
|
32
|
+
--empty-state-gap: var(--puzzle-space-4, 1rem);
|
|
33
|
+
border-radius: var(--puzzle-radius-xl, 1rem);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.puzzle-empty-state--default {
|
|
37
|
+
background: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.puzzle-empty-state--outlined {
|
|
41
|
+
border-style: dashed;
|
|
42
|
+
border-color: var(--puzzle-color-border);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.puzzle-empty-state--filled {
|
|
46
|
+
background: var(--puzzle-color-surface-sunken);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.puzzle-empty-state__header {
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--puzzle-space-2, .5rem);
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
width: 100%;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
display: flex;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.puzzle-empty-state__media {
|
|
59
|
+
color: var(--puzzle-color-text-muted);
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.puzzle-empty-state__media--icon {
|
|
67
|
+
border-radius: var(--puzzle-radius-lg, .75rem);
|
|
68
|
+
background: var(--puzzle-color-surface-sunken);
|
|
69
|
+
width: 3rem;
|
|
70
|
+
height: 3rem;
|
|
71
|
+
color: var(--puzzle-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.puzzle-empty-state--lg .puzzle-empty-state__media--icon {
|
|
75
|
+
width: 3.5rem;
|
|
76
|
+
height: 3.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.puzzle-empty-state__media > svg {
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
width: 1.5rem;
|
|
82
|
+
height: 1.5rem;
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.puzzle-empty-state__title {
|
|
87
|
+
color: var(--puzzle-color-text);
|
|
88
|
+
font-size: var(--puzzle-font-size-lg, 1.125rem);
|
|
89
|
+
font-weight: var(--puzzle-font-weight-semibold, 600);
|
|
90
|
+
line-height: var(--puzzle-font-line-height-tight, 1.25);
|
|
91
|
+
margin: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.puzzle-empty-state--sm .puzzle-empty-state__title {
|
|
95
|
+
font-size: var(--puzzle-font-size-base, 1rem);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.puzzle-empty-state--lg .puzzle-empty-state__title {
|
|
99
|
+
font-size: var(--puzzle-font-size-lg, 1.125rem);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.puzzle-empty-state__description {
|
|
103
|
+
max-width: 36rem;
|
|
104
|
+
color: var(--puzzle-color-text-muted);
|
|
105
|
+
font-size: var(--puzzle-font-size-sm, .875rem);
|
|
106
|
+
line-height: var(--puzzle-font-line-height-normal, 1.5);
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.puzzle-empty-state__content {
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: var(--puzzle-space-2, .5rem);
|
|
114
|
+
flex-wrap: wrap;
|
|
115
|
+
width: 100%;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
display: flex;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (width <= 30rem) {
|
|
121
|
+
.puzzle-empty-state__content {
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.puzzle-empty-state__content > * {
|
|
126
|
+
max-width: 100%;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
let _puzzle_ui_core = require("@puzzle-ui/core");
|
|
2
|
+
// src/components/data-display/empty-state/empty-state.utils.ts
|
|
3
|
+
const getEmptyStateClasses = (size, variant, className) => (0, _puzzle_ui_core.cn)("puzzle-empty-state", `puzzle-empty-state--${size}`, `puzzle-empty-state--${variant}`, className);
|
|
4
|
+
exports.getEmptyStateClasses = getEmptyStateClasses;
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=empty-state.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.utils.cjs","names":["cn"],"sources":["../../../../src/components/data-display/empty-state/empty-state.utils.ts"],"sourcesContent":["import { cn } from \"@puzzle-ui/core\";\n\ntype EmptyStateSize = \"sm\" | \"md\" | \"lg\";\ntype EmptyStateVariant = \"default\" | \"outlined\" | \"filled\";\n\nconst getEmptyStateClasses = (\n size: EmptyStateSize,\n variant: EmptyStateVariant,\n className?: string,\n) =>\n cn(\n \"puzzle-empty-state\",\n `puzzle-empty-state--${size}`,\n `puzzle-empty-state--${variant}`,\n className,\n );\n\nexport { getEmptyStateClasses };\n"],"mappings":";;AAKA,MAAM,wBACJ,MACA,SACA,eAAA,GAEAA,gBAAAA,GAAAA,CACE,sBACA,uBAAuB,QACvB,uBAAuB,WACvB,SACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { cn } from "@puzzle-ui/core";
|
|
2
|
+
// src/components/data-display/empty-state/empty-state.utils.ts
|
|
3
|
+
const getEmptyStateClasses = (size, variant, className) => cn("puzzle-empty-state", `puzzle-empty-state--${size}`, `puzzle-empty-state--${variant}`, className);
|
|
4
|
+
export { getEmptyStateClasses };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=empty-state.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.utils.js","names":[],"sources":["../../../../src/components/data-display/empty-state/empty-state.utils.ts"],"sourcesContent":["import { cn } from \"@puzzle-ui/core\";\n\ntype EmptyStateSize = \"sm\" | \"md\" | \"lg\";\ntype EmptyStateVariant = \"default\" | \"outlined\" | \"filled\";\n\nconst getEmptyStateClasses = (\n size: EmptyStateSize,\n variant: EmptyStateVariant,\n className?: string,\n) =>\n cn(\n \"puzzle-empty-state\",\n `puzzle-empty-state--${size}`,\n `puzzle-empty-state--${variant}`,\n className,\n );\n\nexport { getEmptyStateClasses };\n"],"mappings":";;AAKA,MAAM,wBACJ,MACA,SACA,cAEA,GACE,sBACA,uBAAuB,QACvB,uBAAuB,WACvB,SACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_empty_state_utils = require("./empty-state.utils.cjs");
|
|
2
|
+
;/* empty css */
|
|
3
|
+
let _puzzle_ui_core = require("@puzzle-ui/core");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
// src/components/data-display/empty-state/index.tsx
|
|
6
|
+
const EmptyState = ({ size = "md", variant = "default", className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7
|
+
...props,
|
|
8
|
+
className: require_empty_state_utils.getEmptyStateClasses(size, variant, className),
|
|
9
|
+
"data-size": size,
|
|
10
|
+
"data-variant": variant,
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
const EmptyStateHeader = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
14
|
+
...props,
|
|
15
|
+
className: (0, _puzzle_ui_core.cn)("puzzle-empty-state__header", className),
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
const EmptyStateMedia = ({ variant = "default", className, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden, role, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
19
|
+
...props,
|
|
20
|
+
className: (0, _puzzle_ui_core.cn)("puzzle-empty-state__media", `puzzle-empty-state__media--${variant}`, className),
|
|
21
|
+
"data-variant": variant,
|
|
22
|
+
role: ariaLabel ? role ?? "img" : role,
|
|
23
|
+
"aria-label": ariaLabel,
|
|
24
|
+
"aria-hidden": ariaLabel ? void 0 : ariaHidden ?? true,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
const EmptyStateTitle = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
28
|
+
...props,
|
|
29
|
+
className: (0, _puzzle_ui_core.cn)("puzzle-empty-state__title", className),
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
const EmptyStateDescription = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
33
|
+
...props,
|
|
34
|
+
className: (0, _puzzle_ui_core.cn)("puzzle-empty-state__description", className),
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
const EmptyStateContent = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
38
|
+
...props,
|
|
39
|
+
className: (0, _puzzle_ui_core.cn)("puzzle-empty-state__content", className),
|
|
40
|
+
children
|
|
41
|
+
});
|
|
42
|
+
exports.EmptyState = EmptyState;
|
|
43
|
+
exports.EmptyStateContent = EmptyStateContent;
|
|
44
|
+
exports.EmptyStateDescription = EmptyStateDescription;
|
|
45
|
+
exports.EmptyStateHeader = EmptyStateHeader;
|
|
46
|
+
exports.EmptyStateMedia = EmptyStateMedia;
|
|
47
|
+
exports.EmptyStateTitle = EmptyStateTitle;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["getEmptyStateClasses","cn"],"sources":["../../../../src/components/data-display/empty-state/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport { cn } from \"@puzzle-ui/core\";\nimport { getEmptyStateClasses } from \"./empty-state.utils\";\n\nimport \"./empty-state.css\";\n\ntype EmptyStateSize = \"sm\" | \"md\" | \"lg\";\ntype EmptyStateVariant = \"default\" | \"outlined\" | \"filled\";\ntype EmptyStateMediaVariant = \"default\" | \"icon\";\n\ntype EmptyStateProps = HTMLAttributes<HTMLDivElement> & {\n size?: EmptyStateSize;\n variant?: EmptyStateVariant;\n};\n\ntype EmptyStatePartProps = HTMLAttributes<HTMLDivElement>;\n\ntype EmptyStateMediaProps = EmptyStatePartProps & {\n variant?: EmptyStateMediaVariant;\n};\n\nconst EmptyState = ({\n size = \"md\",\n variant = \"default\",\n className,\n children,\n ...props\n}: EmptyStateProps) => (\n <div\n {...props}\n className={getEmptyStateClasses(size, variant, className)}\n data-size={size}\n data-variant={variant}\n >\n {children}\n </div>\n);\n\nconst EmptyStateHeader = ({\n className,\n children,\n ...props\n}: EmptyStatePartProps) => (\n <div {...props} className={cn(\"puzzle-empty-state__header\", className)}>\n {children}\n </div>\n);\n\nconst EmptyStateMedia = ({\n variant = \"default\",\n className,\n children,\n \"aria-label\": ariaLabel,\n \"aria-hidden\": ariaHidden,\n role,\n ...props\n}: EmptyStateMediaProps) => (\n <div\n {...props}\n className={cn(\n \"puzzle-empty-state__media\",\n `puzzle-empty-state__media--${variant}`,\n className,\n )}\n data-variant={variant}\n role={ariaLabel ? (role ?? \"img\") : role}\n aria-label={ariaLabel}\n aria-hidden={ariaLabel ? undefined : (ariaHidden ?? true)}\n >\n {children}\n </div>\n);\n\nconst EmptyStateTitle = ({\n className,\n children,\n ...props\n}: HTMLAttributes<HTMLHeadingElement>) => (\n <h3 {...props} className={cn(\"puzzle-empty-state__title\", className)}>\n {children}\n </h3>\n);\n\nconst EmptyStateDescription = ({\n className,\n children,\n ...props\n}: HTMLAttributes<HTMLParagraphElement>) => (\n <p {...props} className={cn(\"puzzle-empty-state__description\", className)}>\n {children}\n </p>\n);\n\nconst EmptyStateContent = ({\n className,\n children,\n ...props\n}: EmptyStatePartProps) => (\n <div {...props} className={cn(\"puzzle-empty-state__content\", className)}>\n {children}\n </div>\n);\n\nexport {\n EmptyState,\n EmptyStateHeader,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateContent,\n type EmptyStateProps,\n type EmptyStateSize,\n type EmptyStateVariant,\n type EmptyStateMediaProps,\n type EmptyStateMediaVariant,\n};\n"],"mappings":";;;;;AAqBA,MAAM,cAAc,EAClB,OAAO,MACP,UAAU,WACV,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;CACE,GAAI;CACJ,WAAWA,0BAAAA,qBAAqB,MAAM,SAAS,SAAS;CACxD,aAAW;CACX,gBAAc;CAEb;AACE,CAAA;AAGP,MAAM,oBAAoB,EACxB,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;CAAK,GAAI;CAAO,YAAA,GAAWC,gBAAAA,GAAAA,CAAG,8BAA8B,SAAS;CAClE;AACE,CAAA;AAGP,MAAM,mBAAmB,EACvB,UAAU,WACV,WACA,UACA,cAAc,WACd,eAAe,YACf,MACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;CACE,GAAI;CACJ,YAAA,GAAWA,gBAAAA,GAAAA,CACT,6BACA,8BAA8B,WAC9B,SACF;CACA,gBAAc;CACd,MAAM,YAAa,QAAQ,QAAS;CACpC,cAAY;CACZ,eAAa,YAAY,KAAA,IAAa,cAAc;CAEnD;AACE,CAAA;AAGP,MAAM,mBAAmB,EACvB,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;CAAI,GAAI;CAAO,YAAA,GAAWA,gBAAAA,GAAAA,CAAG,6BAA6B,SAAS;CAChE;AACC,CAAA;AAGN,MAAM,yBAAyB,EAC7B,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;CAAG,GAAI;CAAO,YAAA,GAAWA,gBAAAA,GAAAA,CAAG,mCAAmC,SAAS;CACrE;AACA,CAAA;AAGL,MAAM,qBAAqB,EACzB,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;CAAK,GAAI;CAAO,YAAA,GAAWA,gBAAAA,GAAAA,CAAG,+BAA+B,SAAS;CACnE;AACE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
type EmptyStateSize = "sm" | "md" | "lg";
|
|
3
|
+
type EmptyStateVariant = "default" | "outlined" | "filled";
|
|
4
|
+
type EmptyStateMediaVariant = "default" | "icon";
|
|
5
|
+
type EmptyStateProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
size?: EmptyStateSize;
|
|
7
|
+
variant?: EmptyStateVariant;
|
|
8
|
+
};
|
|
9
|
+
type EmptyStatePartProps = HTMLAttributes<HTMLDivElement>;
|
|
10
|
+
type EmptyStateMediaProps = EmptyStatePartProps & {
|
|
11
|
+
variant?: EmptyStateMediaVariant;
|
|
12
|
+
};
|
|
13
|
+
declare const EmptyState: ({ size, variant, className, children, ...props }: EmptyStateProps) => import("react").JSX.Element;
|
|
14
|
+
declare const EmptyStateHeader: ({ className, children, ...props }: EmptyStatePartProps) => import("react").JSX.Element;
|
|
15
|
+
declare const EmptyStateMedia: ({ variant, className, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden, role, ...props }: EmptyStateMediaProps) => import("react").JSX.Element;
|
|
16
|
+
declare const EmptyStateTitle: ({ className, children, ...props }: HTMLAttributes<HTMLHeadingElement>) => import("react").JSX.Element;
|
|
17
|
+
declare const EmptyStateDescription: ({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>) => import("react").JSX.Element;
|
|
18
|
+
declare const EmptyStateContent: ({ className, children, ...props }: EmptyStatePartProps) => import("react").JSX.Element;
|
|
19
|
+
export { EmptyState, EmptyStateContent, EmptyStateDescription, EmptyStateHeader, EmptyStateMedia, type EmptyStateMediaProps, type EmptyStateMediaVariant, type EmptyStateProps, type EmptyStateSize, EmptyStateTitle, type EmptyStateVariant };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
type EmptyStateSize = "sm" | "md" | "lg";
|
|
3
|
+
type EmptyStateVariant = "default" | "outlined" | "filled";
|
|
4
|
+
type EmptyStateMediaVariant = "default" | "icon";
|
|
5
|
+
type EmptyStateProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
size?: EmptyStateSize;
|
|
7
|
+
variant?: EmptyStateVariant;
|
|
8
|
+
};
|
|
9
|
+
type EmptyStatePartProps = HTMLAttributes<HTMLDivElement>;
|
|
10
|
+
type EmptyStateMediaProps = EmptyStatePartProps & {
|
|
11
|
+
variant?: EmptyStateMediaVariant;
|
|
12
|
+
};
|
|
13
|
+
declare const EmptyState: ({ size, variant, className, children, ...props }: EmptyStateProps) => import("react").JSX.Element;
|
|
14
|
+
declare const EmptyStateHeader: ({ className, children, ...props }: EmptyStatePartProps) => import("react").JSX.Element;
|
|
15
|
+
declare const EmptyStateMedia: ({ variant, className, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden, role, ...props }: EmptyStateMediaProps) => import("react").JSX.Element;
|
|
16
|
+
declare const EmptyStateTitle: ({ className, children, ...props }: HTMLAttributes<HTMLHeadingElement>) => import("react").JSX.Element;
|
|
17
|
+
declare const EmptyStateDescription: ({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>) => import("react").JSX.Element;
|
|
18
|
+
declare const EmptyStateContent: ({ className, children, ...props }: EmptyStatePartProps) => import("react").JSX.Element;
|
|
19
|
+
export { EmptyState, EmptyStateContent, EmptyStateDescription, EmptyStateHeader, EmptyStateMedia, type EmptyStateMediaProps, type EmptyStateMediaVariant, type EmptyStateProps, type EmptyStateSize, EmptyStateTitle, type EmptyStateVariant };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getEmptyStateClasses } from "./empty-state.utils.js";
|
|
2
|
+
import "./empty-state.css";
|
|
3
|
+
import { cn } from "@puzzle-ui/core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/data-display/empty-state/index.tsx
|
|
6
|
+
const EmptyState = ({ size = "md", variant = "default", className, children, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
7
|
+
...props,
|
|
8
|
+
className: getEmptyStateClasses(size, variant, className),
|
|
9
|
+
"data-size": size,
|
|
10
|
+
"data-variant": variant,
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
const EmptyStateHeader = ({ className, children, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
14
|
+
...props,
|
|
15
|
+
className: cn("puzzle-empty-state__header", className),
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
const EmptyStateMedia = ({ variant = "default", className, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden, role, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
19
|
+
...props,
|
|
20
|
+
className: cn("puzzle-empty-state__media", `puzzle-empty-state__media--${variant}`, className),
|
|
21
|
+
"data-variant": variant,
|
|
22
|
+
role: ariaLabel ? role ?? "img" : role,
|
|
23
|
+
"aria-label": ariaLabel,
|
|
24
|
+
"aria-hidden": ariaLabel ? void 0 : ariaHidden ?? true,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
const EmptyStateTitle = ({ className, children, ...props }) => /* @__PURE__ */ jsx("h3", {
|
|
28
|
+
...props,
|
|
29
|
+
className: cn("puzzle-empty-state__title", className),
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
const EmptyStateDescription = ({ className, children, ...props }) => /* @__PURE__ */ jsx("p", {
|
|
33
|
+
...props,
|
|
34
|
+
className: cn("puzzle-empty-state__description", className),
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
const EmptyStateContent = ({ className, children, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
38
|
+
...props,
|
|
39
|
+
className: cn("puzzle-empty-state__content", className),
|
|
40
|
+
children
|
|
41
|
+
});
|
|
42
|
+
export { EmptyState, EmptyStateContent, EmptyStateDescription, EmptyStateHeader, EmptyStateMedia, EmptyStateTitle };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/data-display/empty-state/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport { cn } from \"@puzzle-ui/core\";\nimport { getEmptyStateClasses } from \"./empty-state.utils\";\n\nimport \"./empty-state.css\";\n\ntype EmptyStateSize = \"sm\" | \"md\" | \"lg\";\ntype EmptyStateVariant = \"default\" | \"outlined\" | \"filled\";\ntype EmptyStateMediaVariant = \"default\" | \"icon\";\n\ntype EmptyStateProps = HTMLAttributes<HTMLDivElement> & {\n size?: EmptyStateSize;\n variant?: EmptyStateVariant;\n};\n\ntype EmptyStatePartProps = HTMLAttributes<HTMLDivElement>;\n\ntype EmptyStateMediaProps = EmptyStatePartProps & {\n variant?: EmptyStateMediaVariant;\n};\n\nconst EmptyState = ({\n size = \"md\",\n variant = \"default\",\n className,\n children,\n ...props\n}: EmptyStateProps) => (\n <div\n {...props}\n className={getEmptyStateClasses(size, variant, className)}\n data-size={size}\n data-variant={variant}\n >\n {children}\n </div>\n);\n\nconst EmptyStateHeader = ({\n className,\n children,\n ...props\n}: EmptyStatePartProps) => (\n <div {...props} className={cn(\"puzzle-empty-state__header\", className)}>\n {children}\n </div>\n);\n\nconst EmptyStateMedia = ({\n variant = \"default\",\n className,\n children,\n \"aria-label\": ariaLabel,\n \"aria-hidden\": ariaHidden,\n role,\n ...props\n}: EmptyStateMediaProps) => (\n <div\n {...props}\n className={cn(\n \"puzzle-empty-state__media\",\n `puzzle-empty-state__media--${variant}`,\n className,\n )}\n data-variant={variant}\n role={ariaLabel ? (role ?? \"img\") : role}\n aria-label={ariaLabel}\n aria-hidden={ariaLabel ? undefined : (ariaHidden ?? true)}\n >\n {children}\n </div>\n);\n\nconst EmptyStateTitle = ({\n className,\n children,\n ...props\n}: HTMLAttributes<HTMLHeadingElement>) => (\n <h3 {...props} className={cn(\"puzzle-empty-state__title\", className)}>\n {children}\n </h3>\n);\n\nconst EmptyStateDescription = ({\n className,\n children,\n ...props\n}: HTMLAttributes<HTMLParagraphElement>) => (\n <p {...props} className={cn(\"puzzle-empty-state__description\", className)}>\n {children}\n </p>\n);\n\nconst EmptyStateContent = ({\n className,\n children,\n ...props\n}: EmptyStatePartProps) => (\n <div {...props} className={cn(\"puzzle-empty-state__content\", className)}>\n {children}\n </div>\n);\n\nexport {\n EmptyState,\n EmptyStateHeader,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateContent,\n type EmptyStateProps,\n type EmptyStateSize,\n type EmptyStateVariant,\n type EmptyStateMediaProps,\n type EmptyStateMediaVariant,\n};\n"],"mappings":";;;;;AAqBA,MAAM,cAAc,EAClB,OAAO,MACP,UAAU,WACV,WACA,UACA,GAAG,YAEH,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,qBAAqB,MAAM,SAAS,SAAS;CACxD,aAAW;CACX,gBAAc;CAEb;AACE,CAAA;AAGP,MAAM,oBAAoB,EACxB,WACA,UACA,GAAG,YAEH,oBAAC,OAAD;CAAK,GAAI;CAAO,WAAW,GAAG,8BAA8B,SAAS;CAClE;AACE,CAAA;AAGP,MAAM,mBAAmB,EACvB,UAAU,WACV,WACA,UACA,cAAc,WACd,eAAe,YACf,MACA,GAAG,YAEH,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,GACT,6BACA,8BAA8B,WAC9B,SACF;CACA,gBAAc;CACd,MAAM,YAAa,QAAQ,QAAS;CACpC,cAAY;CACZ,eAAa,YAAY,KAAA,IAAa,cAAc;CAEnD;AACE,CAAA;AAGP,MAAM,mBAAmB,EACvB,WACA,UACA,GAAG,YAEH,oBAAC,MAAD;CAAI,GAAI;CAAO,WAAW,GAAG,6BAA6B,SAAS;CAChE;AACC,CAAA;AAGN,MAAM,yBAAyB,EAC7B,WACA,UACA,GAAG,YAEH,oBAAC,KAAD;CAAG,GAAI;CAAO,WAAW,GAAG,mCAAmC,SAAS;CACrE;AACA,CAAA;AAGL,MAAM,qBAAqB,EACzB,WACA,UACA,GAAG,YAEH,oBAAC,OAAD;CAAK,GAAI;CAAO,WAAW,GAAG,+BAA+B,SAAS;CACnE;AACE,CAAA"}
|