@jirawatpyk/aura-react 4.13.0 → 4.15.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 +45 -16
- package/dist/aura.bundle.js +116 -16
- package/dist/cjs/index.cjs +116 -16
- package/dist/esm/AppShell.js +4 -1
- package/dist/esm/Command.js +3 -1
- package/dist/esm/DataTable.js +11 -1
- package/dist/esm/Dialog.js +5 -3
- package/dist/esm/Icon.js +1 -1
- package/dist/esm/Popover.js +3 -1
- package/dist/esm/SideNav.js +72 -4
- package/dist/esm/index.js +2 -1
- package/dist/esm/locale.js +17 -3
- package/dist/index.d.ts +20 -1
- package/dist/styles.css +48 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ AURA Design System components as a real React package — ES modules, TypeScript
|
|
|
9
9
|
One HTML file, no install — the packages are on npmjs, so jsDelivr serves them:
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jirawatpyk/aura-tokens@4/aura.css"
|
|
13
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jirawatpyk/aura-react@4/dist/styles.css"
|
|
12
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jirawatpyk/aura-tokens@4/aura.css" />
|
|
13
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jirawatpyk/aura-react@4/dist/styles.css" />
|
|
14
14
|
<script src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
|
|
15
15
|
<script src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
|
|
16
16
|
<script src="https://cdn.jsdelivr.net/npm/@jirawatpyk/aura-react@4/dist/aura.bundle.js"></script>
|
|
@@ -19,10 +19,17 @@ One HTML file, no install — the packages are on npmjs, so jsDelivr serves them
|
|
|
19
19
|
<script>
|
|
20
20
|
const h = React.createElement;
|
|
21
21
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
22
|
-
h(
|
|
23
|
-
|
|
22
|
+
h(
|
|
23
|
+
Aura.AuraProvider,
|
|
24
|
+
{ locale: 'th' },
|
|
25
|
+
h(
|
|
26
|
+
Aura.Stack,
|
|
27
|
+
{ gap: 4 },
|
|
24
28
|
h(Aura.Button, { icon: 'plus' }, 'New order'),
|
|
25
|
-
h(Aura.DatePicker, { label: 'Delivery date' })
|
|
29
|
+
h(Aura.DatePicker, { label: 'Delivery date' }),
|
|
30
|
+
),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
26
33
|
</script>
|
|
27
34
|
```
|
|
28
35
|
|
|
@@ -38,15 +45,17 @@ Public on npmjs; internal projects can use GitHub Packages instead ([repository
|
|
|
38
45
|
|
|
39
46
|
```tsx
|
|
40
47
|
// app root (once)
|
|
41
|
-
import '@aura/tokens/aura.css';
|
|
42
|
-
import '@aura/react/styles.css';
|
|
48
|
+
import '@aura/tokens/aura.css'; // tokens (light + dark)
|
|
49
|
+
import '@aura/react/styles.css'; // component styles
|
|
43
50
|
// fonts: Google Fonts <link> tags in <head>, or '@aura/tokens/aura-fonts.css'
|
|
44
51
|
|
|
45
52
|
import { AuraProvider, AppShell, SideNav, DataTable, DatePicker } from '@aura/react';
|
|
46
53
|
|
|
47
54
|
export default function Root() {
|
|
48
55
|
return (
|
|
49
|
-
<AuraProvider locale="th">
|
|
56
|
+
<AuraProvider locale="th">
|
|
57
|
+
{' '}
|
|
58
|
+
{/* Thai built-in labels; dates are พ.ศ. by default */}
|
|
50
59
|
<App />
|
|
51
60
|
</AuraProvider>
|
|
52
61
|
);
|
|
@@ -55,17 +64,17 @@ export default function Root() {
|
|
|
55
64
|
|
|
56
65
|
## What's inside
|
|
57
66
|
|
|
58
|
-
| Output
|
|
59
|
-
|
|
60
|
-
| `dist/esm/*.js`
|
|
61
|
-
| `dist/cjs/index.cjs`
|
|
62
|
-
| `dist/aura.bundle.js` | A classic `<script>` that sets `window.Aura` (needs `window.React` / `window.ReactDOM`). The design-system artifact uses this file.
|
|
63
|
-
| `dist/styles.css`
|
|
64
|
-
| `dist/index.d.ts`
|
|
67
|
+
| Output | For |
|
|
68
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| `dist/esm/*.js` | Bundlers (Vite, Next.js, webpack). One file per module with `'use client'`, so Next.js App Router can import it from Server Components. `sideEffects` is limited to CSS, so unused components are dropped. |
|
|
70
|
+
| `dist/cjs/index.cjs` | `require()` / Jest. |
|
|
71
|
+
| `dist/aura.bundle.js` | A classic `<script>` that sets `window.Aura` (needs `window.React` / `window.ReactDOM`). The design-system artifact uses this file. |
|
|
72
|
+
| `dist/styles.css` | Component CSS (no font import). |
|
|
73
|
+
| `dist/index.d.ts` | Types for every component and helper, generated from the TypeScript sources (one file). |
|
|
65
74
|
|
|
66
75
|
## Components (49)
|
|
67
76
|
|
|
68
|
-
Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, PasswordField, Textarea, NumberField, Select, RadioGroup, Checkbox, Switch, SegmentedControl, Combobox (one value, or `multiple`), FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `useFormatDate`, `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, FormErrorSummary, Toaster/`toast()` (+ `.success/.error/.warning/.info/.loading`), Tooltip, StatusPill, Badge, Progress, Skeleton, EmptyState · Overlays: Dialog, Drawer, Popover · Data: DataTable, FilterBar, Stat · Navigation: Command (⌘K palette) · Layout: AppShell, Container, Stack, Grid, Accordion, Pagination, Card, Tabs, Stepper, SideNav, Breadcrumb, Avatar, Surface, Icon · Theme: ColorSchemeToggle, ColorSchemeScript, `useColorScheme`, ThemeStyle/`createTheme` · Hooks: `useBreakpoint`, `useResponsive`, `breakpoints`, `useAuraLocale`.
|
|
77
|
+
Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, PasswordField, Textarea, NumberField, Select, RadioGroup, Checkbox, Switch, SegmentedControl, Combobox (one value, or `multiple`), FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `useFormatDate`, `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, FormErrorSummary, Toaster/`toast()` (+ `.success/.error/.warning/.info/.loading`), Tooltip, StatusPill, Badge, Progress, Skeleton, EmptyState · Overlays: Dialog, Drawer, Popover · Data: DataTable, FilterBar, Stat · Navigation: Command (⌘K palette) · Layout: AppShell, Container, Stack, Grid, Accordion, Pagination, Card, Tabs, Stepper, SideNav, Breadcrumb, Avatar, Surface, Icon · Theme: ColorSchemeToggle, ColorSchemeScript, `useColorScheme`, ThemeStyle/`createTheme` · Hooks: `useBreakpoint`, `useResponsive`, `breakpoints`, `useAuraLocale`, `useDensity`.
|
|
69
78
|
|
|
70
79
|
## Router links, Swedish, motion
|
|
71
80
|
|
|
@@ -76,8 +85,28 @@ import Link from 'next/link';
|
|
|
76
85
|
|
|
77
86
|
`linkComponent` is used by Button `href`, Breadcrumb, Pagination `getHref`, Stat `href`, SideNav and DataTable row/pager links. Only `th` shows Buddhist-era years; `en` and `sv` are Gregorian (`sv` weeks start Monday). **Without a provider, components are English with Gregorian dates** — wrap Thai apps in `<AuraProvider locale="th">`. For dates in your own components use `useFormatDate()` — it follows the provider (`const fmt = useFormatDate(); fmt(iso, { format: 'long' })`). Plain `formatDate()` has no provider to read and stays Thai unless you pass `locale`. Values are always Gregorian ISO dates.
|
|
78
87
|
|
|
88
|
+
## Compact density
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<AuraProvider density="compact">…</AuraProvider> {/* whole app or one section */}
|
|
92
|
+
<DataTable density="compact" … /> {/* just one table */}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Compact makes fields and buttons 36px (from 44px), table rows 40px (from 48px) and tightens button padding. Dialogs, drawers, popovers and the ⌘K palette opened inside the provider follow it. On touch screens (`pointer: coarse`) compact keeps 44px targets and 48px rows. Read it with `useDensity()`. Without CSS-in-JS you can set `data-density="compact"` on any element — the CSS variables `--aura-input-height`, `--aura-button-height`, `--aura-table-row-height` and `--aura-button-padding-x` do the rest; virtual DataTables read the row height from CSS.
|
|
96
|
+
|
|
79
97
|
Motion: skeleton pulses and indeterminate bars honour `prefers-reduced-motion: reduce` — skeletons stop (a static bar), spinners and progress bars slow to a third.
|
|
80
98
|
|
|
99
|
+
## Collapsible sidebar
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
const [collapsed, setCollapsed] = useState(initialFromCookie); // keep the choice across reloads
|
|
103
|
+
<AppShell nav={<SideNav collapsible collapsed={collapsed} onCollapsedChange={setCollapsed} items={items} />}>
|
|
104
|
+
…
|
|
105
|
+
</AppShell>;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`collapsed` turns SideNav into a 64px icon-only rail (`--aura-sidenav-rail-width`). Labels become tooltips and stay the accessible names; counts and badges show as a dot; items without an icon show their first letter; clicking a group widens the rail and opens it. `collapsible` adds the collapse / expand button at the bottom. Uncontrolled: `defaultCollapsed`. Pass a short header while collapsed (a logo mark instead of the name). In AppShell's phone drawer the nav is always full width with no toggle.
|
|
109
|
+
|
|
81
110
|
## Toasts, forms, filters, rich text, ⌘K
|
|
82
111
|
|
|
83
112
|
```tsx
|
package/dist/aura.bundle.js
CHANGED
|
@@ -123,6 +123,7 @@ window.Aura = (() => {
|
|
|
123
123
|
useAuraLocale: () => useAuraLocale,
|
|
124
124
|
useBreakpoint: () => useBreakpoint,
|
|
125
125
|
useColorScheme: () => useColorScheme,
|
|
126
|
+
useDensity: () => useDensity,
|
|
126
127
|
useFormatDate: () => useFormatDate,
|
|
127
128
|
useResponsive: () => useResponsive
|
|
128
129
|
});
|
|
@@ -218,7 +219,7 @@ window.Aura = (() => {
|
|
|
218
219
|
|
|
219
220
|
// src/Icon.tsx
|
|
220
221
|
var h = React2.createElement;
|
|
221
|
-
var ICONS = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]] };
|
|
222
|
+
var ICONS = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]], "panel-left-close": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m16 15-3-3 3-3" }]], "panel-left-open": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m14 9 3 3-3 3" }]] };
|
|
222
223
|
var SIZES = { sm: 16, md: 20, lg: 24 };
|
|
223
224
|
var Icon = React2.forwardRef(function Icon2(props, ref) {
|
|
224
225
|
const size = SIZES[props.size] || props.size || 16;
|
|
@@ -295,6 +296,8 @@ window.Aura = (() => {
|
|
|
295
296
|
breadcrumb: "Breadcrumb",
|
|
296
297
|
navigation: "Navigation",
|
|
297
298
|
openNav: "Open navigation",
|
|
299
|
+
collapseNav: "Collapse sidebar",
|
|
300
|
+
expandNav: "Expand sidebar",
|
|
298
301
|
searching: "Searching\u2026",
|
|
299
302
|
noMatches: "No matches",
|
|
300
303
|
clear: function(what) {
|
|
@@ -406,6 +409,8 @@ window.Aura = (() => {
|
|
|
406
409
|
breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
|
|
407
410
|
navigation: "\u0E40\u0E21\u0E19\u0E39",
|
|
408
411
|
openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
|
|
412
|
+
collapseNav: "\u0E22\u0E48\u0E2D\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
|
|
413
|
+
expandNav: "\u0E02\u0E22\u0E32\u0E22\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
|
|
409
414
|
searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
|
|
410
415
|
noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
|
|
411
416
|
clear: function(what) {
|
|
@@ -517,6 +522,8 @@ window.Aura = (() => {
|
|
|
517
522
|
breadcrumb: "Br\xF6dsmulor",
|
|
518
523
|
navigation: "Navigering",
|
|
519
524
|
openNav: "\xD6ppna menyn",
|
|
525
|
+
collapseNav: "F\xE4ll ihop sidof\xE4ltet",
|
|
526
|
+
expandNav: "F\xE4ll ut sidof\xE4ltet",
|
|
520
527
|
searching: "S\xF6ker\u2026",
|
|
521
528
|
noMatches: "Inga tr\xE4ffar",
|
|
522
529
|
clear: function(what) {
|
|
@@ -609,6 +616,8 @@ window.Aura = (() => {
|
|
|
609
616
|
};
|
|
610
617
|
var LocaleContext = React3.createContext(null);
|
|
611
618
|
function AuraProvider(props) {
|
|
619
|
+
const outer = React3.useContext(LocaleContext);
|
|
620
|
+
const density = props.density || outer && outer.density || null;
|
|
612
621
|
const value = React3.useMemo(
|
|
613
622
|
function() {
|
|
614
623
|
const base = props.locale && STRINGS[props.locale] || STRINGS.en;
|
|
@@ -616,12 +625,13 @@ window.Aura = (() => {
|
|
|
616
625
|
locale: props.locale || "en",
|
|
617
626
|
calendar: props.calendar || null,
|
|
618
627
|
strings: props.strings ? Object.assign({}, base, props.strings) : base,
|
|
619
|
-
linkComponent: props.linkComponent || null
|
|
628
|
+
linkComponent: props.linkComponent || null,
|
|
629
|
+
density
|
|
620
630
|
};
|
|
621
631
|
},
|
|
622
|
-
[props.locale, props.calendar, props.strings, props.linkComponent]
|
|
632
|
+
[props.locale, props.calendar, props.strings, props.linkComponent, density]
|
|
623
633
|
);
|
|
624
|
-
return /* @__PURE__ */ React3.createElement(LocaleContext.Provider, { value }, props.children);
|
|
634
|
+
return /* @__PURE__ */ React3.createElement(LocaleContext.Provider, { value }, props.density ? /* @__PURE__ */ React3.createElement("div", { className: "aura-density", "data-density": props.density }, props.children) : props.children);
|
|
625
635
|
}
|
|
626
636
|
function useAuraLocale() {
|
|
627
637
|
return React3.useContext(LocaleContext) || { locale: null, calendar: null, strings: STRINGS.en };
|
|
@@ -630,6 +640,10 @@ window.Aura = (() => {
|
|
|
630
640
|
const ctx = React3.useContext(LocaleContext);
|
|
631
641
|
return own || ctx && ctx.linkComponent || "a";
|
|
632
642
|
}
|
|
643
|
+
function useDensity() {
|
|
644
|
+
const ctx = React3.useContext(LocaleContext);
|
|
645
|
+
return ctx && ctx.density || void 0;
|
|
646
|
+
}
|
|
633
647
|
function useStrings() {
|
|
634
648
|
return useAuraLocale().strings;
|
|
635
649
|
}
|
|
@@ -2722,6 +2736,7 @@ window.Aura = (() => {
|
|
|
2722
2736
|
}
|
|
2723
2737
|
function Command(props) {
|
|
2724
2738
|
const t = useStrings();
|
|
2739
|
+
const density = useDensity();
|
|
2725
2740
|
const id = uid(), listId = id + "-list";
|
|
2726
2741
|
const box = React25.useRef(null);
|
|
2727
2742
|
const input = React25.useRef(null);
|
|
@@ -2833,6 +2848,7 @@ window.Aura = (() => {
|
|
|
2833
2848
|
"div",
|
|
2834
2849
|
{
|
|
2835
2850
|
className: "aura-dialog-layer aura-command-layer",
|
|
2851
|
+
"data-density": density,
|
|
2836
2852
|
onKeyDown: function(e) {
|
|
2837
2853
|
modal.onKeyDown(e);
|
|
2838
2854
|
e.stopPropagation();
|
|
@@ -3002,6 +3018,7 @@ window.Aura = (() => {
|
|
|
3002
3018
|
var import_react_dom7 = __toESM(require_react_dom(), 1);
|
|
3003
3019
|
var Dialog = React27.forwardRef(function Dialog2(props, ref) {
|
|
3004
3020
|
const t = useStrings();
|
|
3021
|
+
const density = useDensity();
|
|
3005
3022
|
const own = React27.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
3006
3023
|
function close() {
|
|
3007
3024
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
@@ -3014,7 +3031,7 @@ window.Aura = (() => {
|
|
|
3014
3031
|
});
|
|
3015
3032
|
if (!modal.ready) return null;
|
|
3016
3033
|
return (0, import_react_dom7.createPortal)(
|
|
3017
|
-
/* @__PURE__ */ React27.createElement("div", { className: "aura-dialog-layer", onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React27.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }), /* @__PURE__ */ React27.createElement(
|
|
3034
|
+
/* @__PURE__ */ React27.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React27.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }), /* @__PURE__ */ React27.createElement(
|
|
3018
3035
|
"div",
|
|
3019
3036
|
{
|
|
3020
3037
|
ref: merged,
|
|
@@ -3035,6 +3052,7 @@ window.Aura = (() => {
|
|
|
3035
3052
|
});
|
|
3036
3053
|
var Drawer = React27.forwardRef(function Drawer2(props, ref) {
|
|
3037
3054
|
const t = useStrings();
|
|
3055
|
+
const density = useDensity();
|
|
3038
3056
|
const own = React27.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
3039
3057
|
function close() {
|
|
3040
3058
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
@@ -3048,7 +3066,7 @@ window.Aura = (() => {
|
|
|
3048
3066
|
if (!modal.ready) return null;
|
|
3049
3067
|
const side = props.side === "left" ? "left" : "right";
|
|
3050
3068
|
return (0, import_react_dom7.createPortal)(
|
|
3051
|
-
/* @__PURE__ */ React27.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React27.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }), /* @__PURE__ */ React27.createElement(
|
|
3069
|
+
/* @__PURE__ */ React27.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React27.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }), /* @__PURE__ */ React27.createElement(
|
|
3052
3070
|
"div",
|
|
3053
3071
|
{
|
|
3054
3072
|
ref: merged,
|
|
@@ -3079,7 +3097,7 @@ window.Aura = (() => {
|
|
|
3079
3097
|
{ key: "owner", label: "OWNER" }
|
|
3080
3098
|
];
|
|
3081
3099
|
var SKELETON_WIDTHS = ["72%", "56%", "84%", "44%", "64%"];
|
|
3082
|
-
var
|
|
3100
|
+
var ROW_H_DEFAULT = 48;
|
|
3083
3101
|
var OVERSCAN = 8;
|
|
3084
3102
|
var FLEX_MIN = 160;
|
|
3085
3103
|
var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
@@ -3165,6 +3183,14 @@ window.Aura = (() => {
|
|
|
3165
3183
|
return px != null && boxWidth[0] < px;
|
|
3166
3184
|
}
|
|
3167
3185
|
const scrollRef = React28.useRef(null);
|
|
3186
|
+
const rowH = React28.useState(ROW_H_DEFAULT);
|
|
3187
|
+
const ROW_H = rowH[0];
|
|
3188
|
+
useIsoLayoutEffect(function() {
|
|
3189
|
+
const el = wrapRef.current;
|
|
3190
|
+
if (!el || typeof getComputedStyle === "undefined") return;
|
|
3191
|
+
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
3192
|
+
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
3193
|
+
});
|
|
3168
3194
|
const pending = React28.useRef(null);
|
|
3169
3195
|
const resizing = React28.useRef(false);
|
|
3170
3196
|
useIsoLayoutEffect(function() {
|
|
@@ -4027,6 +4053,7 @@ window.Aura = (() => {
|
|
|
4027
4053
|
"div",
|
|
4028
4054
|
{
|
|
4029
4055
|
ref: wrapMerged,
|
|
4056
|
+
"data-density": props.density,
|
|
4030
4057
|
className: cx("aura-table aura-table--stacked", refreshing && "is-refreshing", props.className),
|
|
4031
4058
|
role: "region",
|
|
4032
4059
|
"aria-label": props.label,
|
|
@@ -4055,6 +4082,7 @@ window.Aura = (() => {
|
|
|
4055
4082
|
"div",
|
|
4056
4083
|
{
|
|
4057
4084
|
ref: wrapMerged,
|
|
4085
|
+
"data-density": props.density,
|
|
4058
4086
|
className: cx("aura-table", scrolledX[0] && "is-scrolled-x", refreshing && "is-refreshing", props.className)
|
|
4059
4087
|
},
|
|
4060
4088
|
refreshing ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
@@ -4221,6 +4249,7 @@ window.Aura = (() => {
|
|
|
4221
4249
|
|
|
4222
4250
|
// src/SideNav.tsx
|
|
4223
4251
|
var React31 = __toESM(require_react(), 1);
|
|
4252
|
+
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
4224
4253
|
function contains(it, id) {
|
|
4225
4254
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
4226
4255
|
return c.id === id || contains(c, id);
|
|
@@ -4236,6 +4265,39 @@ window.Aura = (() => {
|
|
|
4236
4265
|
props.onChange
|
|
4237
4266
|
);
|
|
4238
4267
|
const active = st[0];
|
|
4268
|
+
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
4269
|
+
const collapsed = col[0];
|
|
4270
|
+
const tipState = React31.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4271
|
+
React31.useEffect(
|
|
4272
|
+
function() {
|
|
4273
|
+
if (!collapsed) setTip(null);
|
|
4274
|
+
},
|
|
4275
|
+
[collapsed]
|
|
4276
|
+
);
|
|
4277
|
+
React31.useEffect(
|
|
4278
|
+
function() {
|
|
4279
|
+
if (!tip) return;
|
|
4280
|
+
function esc(e) {
|
|
4281
|
+
if (e.key === "Escape") setTip(null);
|
|
4282
|
+
}
|
|
4283
|
+
document.addEventListener("keydown", esc);
|
|
4284
|
+
return function() {
|
|
4285
|
+
document.removeEventListener("keydown", esc);
|
|
4286
|
+
};
|
|
4287
|
+
},
|
|
4288
|
+
[tip]
|
|
4289
|
+
);
|
|
4290
|
+
function tipHandlers(label) {
|
|
4291
|
+
if (!collapsed) return {};
|
|
4292
|
+
function show2(e) {
|
|
4293
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
4294
|
+
setTip({ text: label, top: r.top + r.height / 2, left: r.right + 8 });
|
|
4295
|
+
}
|
|
4296
|
+
function hide() {
|
|
4297
|
+
setTip(null);
|
|
4298
|
+
}
|
|
4299
|
+
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
4300
|
+
}
|
|
4239
4301
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
4240
4302
|
const openState = React31.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
4241
4303
|
function isOpen(it) {
|
|
@@ -4281,8 +4343,10 @@ window.Aura = (() => {
|
|
|
4281
4343
|
visible[j].focus();
|
|
4282
4344
|
}
|
|
4283
4345
|
function inner(it, group, open) {
|
|
4346
|
+
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
4284
4347
|
return [
|
|
4285
|
-
it.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: it.icon }) : null,
|
|
4348
|
+
it.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: it.icon }) : collapsed ? /* @__PURE__ */ React31.createElement("span", { key: "i", className: "aura-nav__initial", "aria-hidden": "true" }, it.label.charAt(0)) : null,
|
|
4349
|
+
collapsed && marked ? /* @__PURE__ */ React31.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
4286
4350
|
/* @__PURE__ */ React31.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
4287
4351
|
it.badge != null ? /* @__PURE__ */ React31.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
4288
4352
|
it.count != null ? /* @__PURE__ */ React31.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
@@ -4291,7 +4355,7 @@ window.Aura = (() => {
|
|
|
4291
4355
|
}
|
|
4292
4356
|
function item(it, depth) {
|
|
4293
4357
|
if (it.children) {
|
|
4294
|
-
const open = isOpen(it);
|
|
4358
|
+
const open = !collapsed && isOpen(it);
|
|
4295
4359
|
const listId = base + "-" + it.id;
|
|
4296
4360
|
const holdsActive = contains(it, active);
|
|
4297
4361
|
return /* @__PURE__ */ React31.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React31.createElement(
|
|
@@ -4302,10 +4366,15 @@ window.Aura = (() => {
|
|
|
4302
4366
|
"aria-expanded": open,
|
|
4303
4367
|
"aria-controls": listId,
|
|
4304
4368
|
style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
|
|
4369
|
+
...tipHandlers(it.label),
|
|
4305
4370
|
onClick: function() {
|
|
4306
4371
|
const next = Object.assign({}, toggled);
|
|
4307
4372
|
next[it.id] = !open;
|
|
4308
4373
|
setToggled(next);
|
|
4374
|
+
if (collapsed) {
|
|
4375
|
+
setTip(null);
|
|
4376
|
+
col[1](false);
|
|
4377
|
+
}
|
|
4309
4378
|
},
|
|
4310
4379
|
onKeyDown: function(e) {
|
|
4311
4380
|
if (e.key === "ArrowRight" && !open) {
|
|
@@ -4324,6 +4393,7 @@ window.Aura = (() => {
|
|
|
4324
4393
|
}
|
|
4325
4394
|
const on = active === it.id;
|
|
4326
4395
|
const common = {
|
|
4396
|
+
...tipHandlers(it.label),
|
|
4327
4397
|
className: cx("aura-nav__item", on && "is-active"),
|
|
4328
4398
|
"aria-current": on ? "page" : void 0,
|
|
4329
4399
|
style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
|
|
@@ -4342,7 +4412,8 @@ window.Aura = (() => {
|
|
|
4342
4412
|
if (typeof ref === "function") ref(el);
|
|
4343
4413
|
else if (ref) ref.current = el;
|
|
4344
4414
|
},
|
|
4345
|
-
className: cx("aura-nav", props.className),
|
|
4415
|
+
className: cx("aura-nav", collapsed && "aura-nav--collapsed", props.className),
|
|
4416
|
+
"data-collapsed": collapsed ? "" : void 0,
|
|
4346
4417
|
"aria-label": props.label || t.mainNav,
|
|
4347
4418
|
onKeyDown
|
|
4348
4419
|
},
|
|
@@ -4352,7 +4423,31 @@ window.Aura = (() => {
|
|
|
4352
4423
|
return item(it, 0);
|
|
4353
4424
|
})));
|
|
4354
4425
|
})),
|
|
4355
|
-
props.footer ? /* @__PURE__ */ React31.createElement("div", { className: "aura-nav__footer" }, props.footer) : null
|
|
4426
|
+
props.footer ? /* @__PURE__ */ React31.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
4427
|
+
props.collapsible ? /* @__PURE__ */ React31.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React31.createElement(
|
|
4428
|
+
IconButton,
|
|
4429
|
+
{
|
|
4430
|
+
icon: collapsed ? "panel-left-open" : "panel-left-close",
|
|
4431
|
+
label: collapsed ? t.expandNav : t.collapseNav,
|
|
4432
|
+
size: "md",
|
|
4433
|
+
onClick: function() {
|
|
4434
|
+
setTip(null);
|
|
4435
|
+
col[1](!collapsed);
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
)) : null,
|
|
4439
|
+
tip && typeof document !== "undefined" ? (0, import_react_dom8.createPortal)(
|
|
4440
|
+
/* @__PURE__ */ React31.createElement(
|
|
4441
|
+
"div",
|
|
4442
|
+
{
|
|
4443
|
+
className: "aura-tooltip aura-tooltip--right",
|
|
4444
|
+
"aria-hidden": "true",
|
|
4445
|
+
style: { top: tip.top, left: tip.left }
|
|
4446
|
+
},
|
|
4447
|
+
tip.text
|
|
4448
|
+
),
|
|
4449
|
+
document.body
|
|
4450
|
+
) : null
|
|
4356
4451
|
);
|
|
4357
4452
|
});
|
|
4358
4453
|
|
|
@@ -4517,7 +4612,10 @@ window.Aura = (() => {
|
|
|
4517
4612
|
if (navEl.props.onChange) navEl.props.onChange(id);
|
|
4518
4613
|
setOpen(false);
|
|
4519
4614
|
},
|
|
4520
|
-
className: cx(navEl.props.className, "is-in-drawer")
|
|
4615
|
+
className: cx(navEl.props.className, "is-in-drawer"),
|
|
4616
|
+
/* The drawer is already full-size: never a rail, no collapse button. */
|
|
4617
|
+
collapsed: false,
|
|
4618
|
+
collapsible: false
|
|
4521
4619
|
}) : props.nav;
|
|
4522
4620
|
return /* @__PURE__ */ React38.createElement("div", { ref, className: cx("aura-shell", compact && "is-compact", props.className) }, !compact ? /* @__PURE__ */ React38.createElement("div", { className: "aura-shell__nav" }, nav) : null, compact ? /* @__PURE__ */ React38.createElement(
|
|
4523
4621
|
Drawer,
|
|
@@ -4598,7 +4696,7 @@ window.Aura = (() => {
|
|
|
4598
4696
|
|
|
4599
4697
|
// src/TimePicker.tsx
|
|
4600
4698
|
var React41 = __toESM(require_react(), 1);
|
|
4601
|
-
var
|
|
4699
|
+
var import_react_dom9 = __toESM(require_react_dom(), 1);
|
|
4602
4700
|
function pad2(n2) {
|
|
4603
4701
|
return (n2 < 10 ? "0" : "") + n2;
|
|
4604
4702
|
}
|
|
@@ -4795,7 +4893,7 @@ window.Aura = (() => {
|
|
|
4795
4893
|
}
|
|
4796
4894
|
}
|
|
4797
4895
|
const error = errState[0] || props.error;
|
|
4798
|
-
const list = open && mounted && pos[0] ? (0,
|
|
4896
|
+
const list = open && mounted && pos[0] ? (0, import_react_dom9.createPortal)(
|
|
4799
4897
|
/* @__PURE__ */ React41.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React41.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
4800
4898
|
const dis = blocked(s), sel = s === value;
|
|
4801
4899
|
return /* @__PURE__ */ React41.createElement(
|
|
@@ -5747,7 +5845,7 @@ window.Aura = (() => {
|
|
|
5747
5845
|
|
|
5748
5846
|
// src/Popover.tsx
|
|
5749
5847
|
var React51 = __toESM(require_react(), 1);
|
|
5750
|
-
var
|
|
5848
|
+
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
5751
5849
|
function position(anchor, pop, placement) {
|
|
5752
5850
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.offsetHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
5753
5851
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
@@ -5759,6 +5857,7 @@ window.Aura = (() => {
|
|
|
5759
5857
|
}
|
|
5760
5858
|
var Popover = React51.forwardRef(function Popover2(props, ref) {
|
|
5761
5859
|
const t = useStrings();
|
|
5860
|
+
const density = useDensity();
|
|
5762
5861
|
const auto = uid(), id = props.id || auto;
|
|
5763
5862
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
5764
5863
|
const open = !!st[0];
|
|
@@ -5810,12 +5909,13 @@ window.Aura = (() => {
|
|
|
5810
5909
|
[open, mounted]
|
|
5811
5910
|
);
|
|
5812
5911
|
const child = React51.Children.only(props.trigger);
|
|
5813
|
-
const panel = open && mounted ? (0,
|
|
5912
|
+
const panel = open && mounted ? (0, import_react_dom10.createPortal)(
|
|
5814
5913
|
/* @__PURE__ */ React51.createElement(
|
|
5815
5914
|
"div",
|
|
5816
5915
|
{
|
|
5817
5916
|
ref: popMerged,
|
|
5818
5917
|
id,
|
|
5918
|
+
"data-density": density,
|
|
5819
5919
|
role: "dialog",
|
|
5820
5920
|
"aria-modal": false,
|
|
5821
5921
|
"aria-label": props.title ? void 0 : props.label,
|