@the-portland-company/shell 0.88.0 → 0.89.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 +11 -0
- package/README.md +8 -3
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +1 -1
- package/dist/app-chrome.d.ts +1 -1
- package/dist/app-chrome.js +3 -3
- package/dist/chrome.css +20 -0
- package/dist/{chunk-7WSGW5CC.js → chunk-J23MTK56.js} +175 -20
- package/dist/chunk-J23MTK56.js.map +1 -0
- package/dist/{chunk-2ACN7HQC.js → chunk-SJDFAK5R.js} +3 -3
- package/dist/{chunk-2ACN7HQC.js.map → chunk-SJDFAK5R.js.map} +1 -1
- package/dist/{index-tfcLFAni.d.cts → index-CZylXAP4.d.cts} +81 -6
- package/dist/{index-DEiOABW2.d.ts → index-DwkSyAip.d.ts} +81 -6
- package/dist/index.cjs +175 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/native.cjs +175 -18
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.js +2 -2
- package/eslint/index.cjs +15 -2
- package/package.json +1 -1
- package/dist/chunk-7WSGW5CC.js.map +0 -1
|
@@ -3,15 +3,38 @@ import * as react from 'react';
|
|
|
3
3
|
import { ReactNode, CSSProperties, ButtonHTMLAttributes, AnchorHTMLAttributes, ElementType, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, ComponentType } from 'react';
|
|
4
4
|
import { ThemePreference as ThemePreference$1 } from './theme-preference.cjs';
|
|
5
5
|
|
|
6
|
+
type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
6
7
|
type CardProps = {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/** Heading text. With none of the structured props below it renders as a plain `<h3>` inside the padded box. */
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
/** Secondary line under the title. Switches the card to the structured header layout. */
|
|
11
|
+
subtitle?: ReactNode;
|
|
12
|
+
/** Right-aligned header content (a link, chip or count). Same as `actions`; both may be set. */
|
|
13
|
+
aside?: ReactNode;
|
|
14
|
+
/** Right-aligned header buttons. */
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
/** Bottom strip separated by a top border. */
|
|
17
|
+
footer?: ReactNode;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/** Padding of the card (legacy layout) or of the body (structured layout). Default `md` (p-6). */
|
|
20
|
+
padding?: CardPadding;
|
|
21
|
+
/** Replaces the body padding classes in the structured layout (e.g. `px-7 pb-6 pt-6`). */
|
|
22
|
+
bodyClassName?: string;
|
|
9
23
|
minH?: string | number;
|
|
10
24
|
className?: string;
|
|
11
25
|
style?: CSSProperties;
|
|
12
26
|
[key: string]: unknown;
|
|
13
27
|
};
|
|
14
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Shared Card. Surface, border and text come from the `--app-card-*` tokens, which
|
|
30
|
+
* have light values on `:root` and dark values under `.dark`
|
|
31
|
+
* (chrome.css), so a card is correct in both themes.
|
|
32
|
+
*
|
|
33
|
+
* Plain `<Card title>` keeps the original layout (padding on the card, h3 above the
|
|
34
|
+
* content). Passing `subtitle`, `aside`, `actions`, `footer` or `bodyClassName` switches to
|
|
35
|
+
* the structured layout: bordered header, body, bordered footer.
|
|
36
|
+
*/
|
|
37
|
+
declare function Card({ title, subtitle, aside, actions, footer, children, padding, bodyClassName, minH, className, style, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
15
38
|
|
|
16
39
|
type FormColumnProps = {
|
|
17
40
|
children: ReactNode;
|
|
@@ -114,8 +137,9 @@ type FieldChromeProps = {
|
|
|
114
137
|
};
|
|
115
138
|
|
|
116
139
|
/**
|
|
117
|
-
* Text-like input types the field styling supports. Checkbox
|
|
118
|
-
* file and color need their own native layout and are
|
|
140
|
+
* Text-like input types the field styling supports. Checkbox has `Checkbox` and
|
|
141
|
+
* file has `FileInput`; radio, range and color need their own native layout and are
|
|
142
|
+
* not supported here.
|
|
119
143
|
*/
|
|
120
144
|
type InputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number' | 'date' | 'time' | 'datetime-local' | 'month' | 'week';
|
|
121
145
|
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & FieldChromeProps & {
|
|
@@ -179,6 +203,57 @@ declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<H
|
|
|
179
203
|
invalid?: boolean;
|
|
180
204
|
} & react.RefAttributes<HTMLTextAreaElement>>;
|
|
181
205
|
|
|
206
|
+
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {
|
|
207
|
+
/** Visible label, clickable. */
|
|
208
|
+
label?: ReactNode;
|
|
209
|
+
/** Secondary text under the label. */
|
|
210
|
+
description?: ReactNode;
|
|
211
|
+
/** Mixed state (set on the DOM node; `checked` still controls the underlying value). */
|
|
212
|
+
indeterminate?: boolean;
|
|
213
|
+
/** Marks the checkbox invalid (red outline, aria-invalid). */
|
|
214
|
+
invalid?: boolean;
|
|
215
|
+
/** Class for the `<input>`; the row takes `wrapperClassName`. */
|
|
216
|
+
className?: string;
|
|
217
|
+
wrapperClassName?: string;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Shared Checkbox. The whole row is a 44px-tall touch target (label wraps the
|
|
221
|
+
* control); colors come from the shell tokens, with the accent as the fill.
|
|
222
|
+
*/
|
|
223
|
+
declare const Checkbox: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
224
|
+
/** Visible label, clickable. */
|
|
225
|
+
label?: ReactNode;
|
|
226
|
+
/** Secondary text under the label. */
|
|
227
|
+
description?: ReactNode;
|
|
228
|
+
/** Mixed state (set on the DOM node; `checked` still controls the underlying value). */
|
|
229
|
+
indeterminate?: boolean;
|
|
230
|
+
/** Marks the checkbox invalid (red outline, aria-invalid). */
|
|
231
|
+
invalid?: boolean;
|
|
232
|
+
/** Class for the `<input>`; the row takes `wrapperClassName`. */
|
|
233
|
+
className?: string;
|
|
234
|
+
wrapperClassName?: string;
|
|
235
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
236
|
+
|
|
237
|
+
type FileInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue'> & FieldChromeProps & {
|
|
238
|
+
/** Class for the control itself; the wrapper takes `wrapperClassName`. */
|
|
239
|
+
className?: string;
|
|
240
|
+
wrapperClassName?: string;
|
|
241
|
+
/** Marks the control invalid without an error message. */
|
|
242
|
+
invalid?: boolean;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Shared file picker (`<input type="file">`). Same label/helper/error chrome and
|
|
246
|
+
* field tokens as `Input`; the native "Choose file" button is styled with the
|
|
247
|
+
* secondary-button tokens. Use `accept` / `multiple` as usual.
|
|
248
|
+
*/
|
|
249
|
+
declare const FileInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "defaultValue"> & FieldChromeProps & {
|
|
250
|
+
/** Class for the control itself; the wrapper takes `wrapperClassName`. */
|
|
251
|
+
className?: string;
|
|
252
|
+
wrapperClassName?: string;
|
|
253
|
+
/** Marks the control invalid without an error message. */
|
|
254
|
+
invalid?: boolean;
|
|
255
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
256
|
+
|
|
182
257
|
type BreadcrumbItem = {
|
|
183
258
|
label: string;
|
|
184
259
|
href?: string;
|
|
@@ -1260,4 +1335,4 @@ type NavAppShellProps = {
|
|
|
1260
1335
|
};
|
|
1261
1336
|
declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
|
|
1262
1337
|
|
|
1263
|
-
export { type
|
|
1338
|
+
export { type ChromeNotificationQuarantine as $, type NavChromeFetcher as A, type BreadcrumbBarProps as B, Card as C, type NavMode as D, type NavUserMenu as E, FileInput as F, type NavOrgOption as G, HeaderTabBar as H, Input as I, type NavFooterLink as J, type NavFooter as K, type NavDisplayMode as L, BETA_BANNER_DISMISS_KEY as M, type NavItem as N, BreadcrumbBar as O, type PageHeaderProps as P, CAMPAIGN_FEATURE_AVAILABILITY as Q, CORE_APP_ORIGIN as R, Select as S, Textarea as T, CORE_BILLING_PATH as U, CREDIT_TYPE_LABELS as V, CREDIT_TYPE_ORDER as W, type CampaignFeatureAvailability as X, type ChromeMe as Y, type ChromeNotificationAlert as Z, type ChromeNotificationImport as _, Button as a, useNavChromeFetcher as a$, type ChromeNotificationReply as a0, type ChromeNotificationsPayload as a1, type ChromeOrgSummary as a2, type CommunicationsFuelStatus as a3, type CreditHealthState as a4, type CreditTypeKey as a5, CreditsAction as a6, type CreditsIconState as a7, FuelAction as a8, type FuelChannelStatus as a9, SpecOverlayAction as aA, type StandardNavOptions as aB, SupportAction as aC, type ThemePreference as aD, TopBarCountBadge as aE, type TopBarIconTone as aF, TopBarPanelArrow as aG, TopBarPopover as aH, TopBarTooltip as aI, TopBarWidgetSlot as aJ, clearBetaBannerDismissal as aK, creditGaugeRatio as aL, creditStateWord as aM, creditTooltipLine as aN, creditsAriaLabel as aO, creditsIconState as aP, envChipClasses as aQ, isNavItemActive as aR, modeIdFromLabel as aS, resolveOrgLogoUrl as aT, shortEnvLabel as aU, shortUserName as aV, standardPolitogyNav as aW, topBarIconButtonClass as aX, useChromeMe as aY, useChromeOrgs as aZ, useNavChromeDedupedFetch as a_, NavAppShell as aa, type NavAppShellProps as ab, NavBetaBanner as ac, type NavBetaBannerProps as ad, type NavBrand as ae, NavChromeProvider as af, NavDisplayAction as ag, type NavLinkProps as ah, type NavLinkedAccount as ai, type NavModeOption as aj, type NavOrg as ak, type NavRoleBadge as al, NavSidebar as am, type NavSidebarProps as an, type NavTab as ao, NavTabStrip as ap, type NavTabStripProps as aq, NavThemeControl as ar, NavTopBar as as, type NavTopBarAction as at, type NavTopBarProps as au, type NavUser as av, NotificationsAction as aw, PageHeader as ax, type PageHeaderMode as ay, SPECS_ORIGIN as az, type ButtonProps as b, useThemePreference as b0, type ButtonSize as c, type ButtonVariant as d, type CardPadding as e, type CardProps as f, Checkbox as g, type CheckboxProps as h, type CommsNotification as i, type CommsNotificationKind as j, type FileInputProps as k, FormColumn as l, type HeaderTabBarItem as m, type InputProps as n, type NotificationsAdapter as o, type NotificationsFeed as p, type SelectProps as q, type TextareaProps as r, createCommsNotificationsAdapter as s, emptyNotificationsFeed as t, normalizeNotificationsFeed as u, type StandardNavIconKey as v, type NavIcon as w, type NavBreadcrumb as x, type StandardNavMode as y, type NavLinkComponent as z };
|
|
@@ -3,15 +3,38 @@ import * as react from 'react';
|
|
|
3
3
|
import { ReactNode, CSSProperties, ButtonHTMLAttributes, AnchorHTMLAttributes, ElementType, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, ComponentType } from 'react';
|
|
4
4
|
import { ThemePreference as ThemePreference$1 } from './theme-preference.js';
|
|
5
5
|
|
|
6
|
+
type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
6
7
|
type CardProps = {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/** Heading text. With none of the structured props below it renders as a plain `<h3>` inside the padded box. */
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
/** Secondary line under the title. Switches the card to the structured header layout. */
|
|
11
|
+
subtitle?: ReactNode;
|
|
12
|
+
/** Right-aligned header content (a link, chip or count). Same as `actions`; both may be set. */
|
|
13
|
+
aside?: ReactNode;
|
|
14
|
+
/** Right-aligned header buttons. */
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
/** Bottom strip separated by a top border. */
|
|
17
|
+
footer?: ReactNode;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/** Padding of the card (legacy layout) or of the body (structured layout). Default `md` (p-6). */
|
|
20
|
+
padding?: CardPadding;
|
|
21
|
+
/** Replaces the body padding classes in the structured layout (e.g. `px-7 pb-6 pt-6`). */
|
|
22
|
+
bodyClassName?: string;
|
|
9
23
|
minH?: string | number;
|
|
10
24
|
className?: string;
|
|
11
25
|
style?: CSSProperties;
|
|
12
26
|
[key: string]: unknown;
|
|
13
27
|
};
|
|
14
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Shared Card. Surface, border and text come from the `--app-card-*` tokens, which
|
|
30
|
+
* have light values on `:root` and dark values under `.dark`
|
|
31
|
+
* (chrome.css), so a card is correct in both themes.
|
|
32
|
+
*
|
|
33
|
+
* Plain `<Card title>` keeps the original layout (padding on the card, h3 above the
|
|
34
|
+
* content). Passing `subtitle`, `aside`, `actions`, `footer` or `bodyClassName` switches to
|
|
35
|
+
* the structured layout: bordered header, body, bordered footer.
|
|
36
|
+
*/
|
|
37
|
+
declare function Card({ title, subtitle, aside, actions, footer, children, padding, bodyClassName, minH, className, style, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
15
38
|
|
|
16
39
|
type FormColumnProps = {
|
|
17
40
|
children: ReactNode;
|
|
@@ -114,8 +137,9 @@ type FieldChromeProps = {
|
|
|
114
137
|
};
|
|
115
138
|
|
|
116
139
|
/**
|
|
117
|
-
* Text-like input types the field styling supports. Checkbox
|
|
118
|
-
* file and color need their own native layout and are
|
|
140
|
+
* Text-like input types the field styling supports. Checkbox has `Checkbox` and
|
|
141
|
+
* file has `FileInput`; radio, range and color need their own native layout and are
|
|
142
|
+
* not supported here.
|
|
119
143
|
*/
|
|
120
144
|
type InputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number' | 'date' | 'time' | 'datetime-local' | 'month' | 'week';
|
|
121
145
|
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & FieldChromeProps & {
|
|
@@ -179,6 +203,57 @@ declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<H
|
|
|
179
203
|
invalid?: boolean;
|
|
180
204
|
} & react.RefAttributes<HTMLTextAreaElement>>;
|
|
181
205
|
|
|
206
|
+
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {
|
|
207
|
+
/** Visible label, clickable. */
|
|
208
|
+
label?: ReactNode;
|
|
209
|
+
/** Secondary text under the label. */
|
|
210
|
+
description?: ReactNode;
|
|
211
|
+
/** Mixed state (set on the DOM node; `checked` still controls the underlying value). */
|
|
212
|
+
indeterminate?: boolean;
|
|
213
|
+
/** Marks the checkbox invalid (red outline, aria-invalid). */
|
|
214
|
+
invalid?: boolean;
|
|
215
|
+
/** Class for the `<input>`; the row takes `wrapperClassName`. */
|
|
216
|
+
className?: string;
|
|
217
|
+
wrapperClassName?: string;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Shared Checkbox. The whole row is a 44px-tall touch target (label wraps the
|
|
221
|
+
* control); colors come from the shell tokens, with the accent as the fill.
|
|
222
|
+
*/
|
|
223
|
+
declare const Checkbox: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
224
|
+
/** Visible label, clickable. */
|
|
225
|
+
label?: ReactNode;
|
|
226
|
+
/** Secondary text under the label. */
|
|
227
|
+
description?: ReactNode;
|
|
228
|
+
/** Mixed state (set on the DOM node; `checked` still controls the underlying value). */
|
|
229
|
+
indeterminate?: boolean;
|
|
230
|
+
/** Marks the checkbox invalid (red outline, aria-invalid). */
|
|
231
|
+
invalid?: boolean;
|
|
232
|
+
/** Class for the `<input>`; the row takes `wrapperClassName`. */
|
|
233
|
+
className?: string;
|
|
234
|
+
wrapperClassName?: string;
|
|
235
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
236
|
+
|
|
237
|
+
type FileInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue'> & FieldChromeProps & {
|
|
238
|
+
/** Class for the control itself; the wrapper takes `wrapperClassName`. */
|
|
239
|
+
className?: string;
|
|
240
|
+
wrapperClassName?: string;
|
|
241
|
+
/** Marks the control invalid without an error message. */
|
|
242
|
+
invalid?: boolean;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Shared file picker (`<input type="file">`). Same label/helper/error chrome and
|
|
246
|
+
* field tokens as `Input`; the native "Choose file" button is styled with the
|
|
247
|
+
* secondary-button tokens. Use `accept` / `multiple` as usual.
|
|
248
|
+
*/
|
|
249
|
+
declare const FileInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "defaultValue"> & FieldChromeProps & {
|
|
250
|
+
/** Class for the control itself; the wrapper takes `wrapperClassName`. */
|
|
251
|
+
className?: string;
|
|
252
|
+
wrapperClassName?: string;
|
|
253
|
+
/** Marks the control invalid without an error message. */
|
|
254
|
+
invalid?: boolean;
|
|
255
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
256
|
+
|
|
182
257
|
type BreadcrumbItem = {
|
|
183
258
|
label: string;
|
|
184
259
|
href?: string;
|
|
@@ -1260,4 +1335,4 @@ type NavAppShellProps = {
|
|
|
1260
1335
|
};
|
|
1261
1336
|
declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
|
|
1262
1337
|
|
|
1263
|
-
export { type
|
|
1338
|
+
export { type ChromeNotificationQuarantine as $, type NavChromeFetcher as A, type BreadcrumbBarProps as B, Card as C, type NavMode as D, type NavUserMenu as E, FileInput as F, type NavOrgOption as G, HeaderTabBar as H, Input as I, type NavFooterLink as J, type NavFooter as K, type NavDisplayMode as L, BETA_BANNER_DISMISS_KEY as M, type NavItem as N, BreadcrumbBar as O, type PageHeaderProps as P, CAMPAIGN_FEATURE_AVAILABILITY as Q, CORE_APP_ORIGIN as R, Select as S, Textarea as T, CORE_BILLING_PATH as U, CREDIT_TYPE_LABELS as V, CREDIT_TYPE_ORDER as W, type CampaignFeatureAvailability as X, type ChromeMe as Y, type ChromeNotificationAlert as Z, type ChromeNotificationImport as _, Button as a, useNavChromeFetcher as a$, type ChromeNotificationReply as a0, type ChromeNotificationsPayload as a1, type ChromeOrgSummary as a2, type CommunicationsFuelStatus as a3, type CreditHealthState as a4, type CreditTypeKey as a5, CreditsAction as a6, type CreditsIconState as a7, FuelAction as a8, type FuelChannelStatus as a9, SpecOverlayAction as aA, type StandardNavOptions as aB, SupportAction as aC, type ThemePreference as aD, TopBarCountBadge as aE, type TopBarIconTone as aF, TopBarPanelArrow as aG, TopBarPopover as aH, TopBarTooltip as aI, TopBarWidgetSlot as aJ, clearBetaBannerDismissal as aK, creditGaugeRatio as aL, creditStateWord as aM, creditTooltipLine as aN, creditsAriaLabel as aO, creditsIconState as aP, envChipClasses as aQ, isNavItemActive as aR, modeIdFromLabel as aS, resolveOrgLogoUrl as aT, shortEnvLabel as aU, shortUserName as aV, standardPolitogyNav as aW, topBarIconButtonClass as aX, useChromeMe as aY, useChromeOrgs as aZ, useNavChromeDedupedFetch as a_, NavAppShell as aa, type NavAppShellProps as ab, NavBetaBanner as ac, type NavBetaBannerProps as ad, type NavBrand as ae, NavChromeProvider as af, NavDisplayAction as ag, type NavLinkProps as ah, type NavLinkedAccount as ai, type NavModeOption as aj, type NavOrg as ak, type NavRoleBadge as al, NavSidebar as am, type NavSidebarProps as an, type NavTab as ao, NavTabStrip as ap, type NavTabStripProps as aq, NavThemeControl as ar, NavTopBar as as, type NavTopBarAction as at, type NavTopBarProps as au, type NavUser as av, NotificationsAction as aw, PageHeader as ax, type PageHeaderMode as ay, SPECS_ORIGIN as az, type ButtonProps as b, useThemePreference as b0, type ButtonSize as c, type ButtonVariant as d, type CardPadding as e, type CardProps as f, Checkbox as g, type CheckboxProps as h, type CommsNotification as i, type CommsNotificationKind as j, type FileInputProps as k, FormColumn as l, type HeaderTabBarItem as m, type InputProps as n, type NotificationsAdapter as o, type NotificationsFeed as p, type SelectProps as q, type TextareaProps as r, createCommsNotificationsAdapter as s, emptyNotificationsFeed as t, normalizeNotificationsFeed as u, type StandardNavIconKey as v, type NavIcon as w, type NavBreadcrumb as x, type StandardNavMode as y, type NavLinkComponent as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@chakra-ui/react');
|
|
4
|
+
var clsx = require('clsx');
|
|
4
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var clsx2 = require('clsx');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
7
|
var react$1 = require('react');
|
|
8
8
|
require('react-dom');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
13
13
|
|
|
14
14
|
// src/theme/index.ts
|
|
15
15
|
|
|
@@ -839,29 +839,72 @@ var politogyTheme = react.extendTheme({
|
|
|
839
839
|
full: "9999px"
|
|
840
840
|
}
|
|
841
841
|
});
|
|
842
|
+
var PADDING = {
|
|
843
|
+
none: "p-0",
|
|
844
|
+
sm: "p-4",
|
|
845
|
+
md: "p-6",
|
|
846
|
+
lg: "p-8"
|
|
847
|
+
};
|
|
842
848
|
function Card({
|
|
843
849
|
title,
|
|
850
|
+
subtitle,
|
|
851
|
+
aside,
|
|
852
|
+
actions,
|
|
853
|
+
footer,
|
|
844
854
|
children,
|
|
855
|
+
padding = "md",
|
|
856
|
+
bodyClassName,
|
|
845
857
|
minH,
|
|
846
858
|
className,
|
|
847
859
|
style,
|
|
848
860
|
...props
|
|
849
861
|
}) {
|
|
862
|
+
const structured = Boolean(subtitle || aside || actions || footer || bodyClassName);
|
|
863
|
+
const surface = "rounded-lg border border-[color:var(--app-card-border,var(--color-border))] bg-[color:var(--app-card-bg,var(--color-panel))] text-[color:var(--app-card-fg,var(--color-text))] shadow-sm";
|
|
864
|
+
if (!structured) {
|
|
865
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
866
|
+
"div",
|
|
867
|
+
{
|
|
868
|
+
"data-shell-card": "",
|
|
869
|
+
className: clsx__default.default(surface, PADDING[padding], className),
|
|
870
|
+
style: { minHeight: minH, ...style },
|
|
871
|
+
...props,
|
|
872
|
+
children: [
|
|
873
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }) : null,
|
|
874
|
+
children
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
const hasHeader = Boolean(title || subtitle || aside || actions);
|
|
880
|
+
const divider = "border-[color:var(--app-card-border,var(--color-border))]";
|
|
850
881
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
851
882
|
"div",
|
|
852
883
|
{
|
|
853
|
-
|
|
884
|
+
"data-shell-card": "",
|
|
885
|
+
"data-shell-card-structured": "",
|
|
886
|
+
className: clsx__default.default(surface, "overflow-hidden", className),
|
|
854
887
|
style: { minHeight: minH, ...style },
|
|
855
888
|
...props,
|
|
856
889
|
children: [
|
|
857
|
-
|
|
858
|
-
|
|
890
|
+
hasHeader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx__default.default("flex flex-wrap items-start justify-between gap-3 border-b px-5 py-4", divider), children: [
|
|
891
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
892
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold", children: title }) : null,
|
|
893
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-[color:var(--app-card-fg-muted,var(--color-text-muted))]", children: subtitle }) : null
|
|
894
|
+
] }),
|
|
895
|
+
aside || actions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
896
|
+
aside,
|
|
897
|
+
actions
|
|
898
|
+
] }) : null
|
|
899
|
+
] }) : null,
|
|
900
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: bodyClassName ?? PADDING[padding], children }),
|
|
901
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx__default.default("border-t px-5 py-3", divider), children: footer }) : null
|
|
859
902
|
]
|
|
860
903
|
}
|
|
861
904
|
);
|
|
862
905
|
}
|
|
863
906
|
function FormColumn({ children, className }) {
|
|
864
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className:
|
|
907
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className: clsx__default.default("w-full max-w-[960px]", className), children });
|
|
865
908
|
}
|
|
866
909
|
var MODE_EYEBROW_LABEL = {
|
|
867
910
|
relationship: "Relationship mode",
|
|
@@ -903,11 +946,11 @@ function PageHeaderView({
|
|
|
903
946
|
"div",
|
|
904
947
|
{
|
|
905
948
|
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
906
|
-
className:
|
|
949
|
+
className: clsx__default.default("text-slate-100", tabBar ? "pt-3 pb-0" : "py-3 border-b border-gray-200", {
|
|
907
950
|
"md:ml-60": !hideSidebar
|
|
908
951
|
}),
|
|
909
952
|
children: [
|
|
910
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
953
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx__default.default("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
911
954
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
912
955
|
eyebrowText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
913
956
|
"div",
|
|
@@ -934,7 +977,7 @@ function PageHeaderView({
|
|
|
934
977
|
"nav",
|
|
935
978
|
{
|
|
936
979
|
"aria-label": "Breadcrumb",
|
|
937
|
-
className:
|
|
980
|
+
className: clsx__default.default("min-w-0 text-slate-100", title ? "mt-1" : ""),
|
|
938
981
|
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
939
982
|
"li",
|
|
940
983
|
{
|
|
@@ -1003,7 +1046,7 @@ var Button = react$1.forwardRef(function Button2({
|
|
|
1003
1046
|
"data-shell-button": "",
|
|
1004
1047
|
"data-variant": variant,
|
|
1005
1048
|
"aria-busy": loading || void 0,
|
|
1006
|
-
className:
|
|
1049
|
+
className: clsx__default.default(
|
|
1007
1050
|
"inline-flex items-center justify-center gap-2 rounded-[5px] px-3 text-sm font-semibold no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))] focus-visible:ring-offset-2",
|
|
1008
1051
|
SIZE_CLASS[size],
|
|
1009
1052
|
VARIANT_CLASS[variant],
|
|
@@ -1040,7 +1083,7 @@ function FormField({
|
|
|
1040
1083
|
className,
|
|
1041
1084
|
children
|
|
1042
1085
|
}) {
|
|
1043
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1086
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx__default.default("flex w-full flex-col gap-1", className), children: [
|
|
1044
1087
|
label ? /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: "text-sm font-semibold text-[color:var(--color-text)]", children: [
|
|
1045
1088
|
label,
|
|
1046
1089
|
required ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
@@ -1089,7 +1132,7 @@ var Input = react$1.forwardRef(function Input2({ label, helperText, error, inval
|
|
|
1089
1132
|
"data-shell-field": "",
|
|
1090
1133
|
"aria-invalid": isInvalid || void 0,
|
|
1091
1134
|
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1092
|
-
className:
|
|
1135
|
+
className: clsx__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1093
1136
|
...props
|
|
1094
1137
|
}
|
|
1095
1138
|
)
|
|
@@ -1119,7 +1162,7 @@ var Select = react$1.forwardRef(function Select2({ label, helperText, error, inv
|
|
|
1119
1162
|
"data-shell-field": "",
|
|
1120
1163
|
"aria-invalid": isInvalid || void 0,
|
|
1121
1164
|
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1122
|
-
className:
|
|
1165
|
+
className: clsx__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1123
1166
|
...props,
|
|
1124
1167
|
children
|
|
1125
1168
|
}
|
|
@@ -1150,7 +1193,7 @@ var Textarea = react$1.forwardRef(function Textarea2({ label, helperText, error,
|
|
|
1150
1193
|
"data-shell-field": "",
|
|
1151
1194
|
"aria-invalid": isInvalid || void 0,
|
|
1152
1195
|
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1153
|
-
className:
|
|
1196
|
+
className: clsx__default.default(FIELD_BASE, "min-h-[88px] py-3", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1154
1197
|
...props
|
|
1155
1198
|
}
|
|
1156
1199
|
)
|
|
@@ -1158,6 +1201,118 @@ var Textarea = react$1.forwardRef(function Textarea2({ label, helperText, error,
|
|
|
1158
1201
|
);
|
|
1159
1202
|
});
|
|
1160
1203
|
var Textarea_default = Textarea;
|
|
1204
|
+
var Checkbox = react$1.forwardRef(function Checkbox2({
|
|
1205
|
+
label,
|
|
1206
|
+
description,
|
|
1207
|
+
indeterminate,
|
|
1208
|
+
invalid,
|
|
1209
|
+
className,
|
|
1210
|
+
wrapperClassName,
|
|
1211
|
+
id,
|
|
1212
|
+
disabled,
|
|
1213
|
+
"aria-describedby": ariaDescribedBy,
|
|
1214
|
+
...props
|
|
1215
|
+
}, ref) {
|
|
1216
|
+
const autoId = react$1.useId();
|
|
1217
|
+
const fieldId = id ?? autoId;
|
|
1218
|
+
const descId = description ? `${fieldId}-description` : void 0;
|
|
1219
|
+
const inner = react$1.useRef(null);
|
|
1220
|
+
const setRef = react$1.useCallback(
|
|
1221
|
+
(node) => {
|
|
1222
|
+
inner.current = node;
|
|
1223
|
+
if (typeof ref === "function") ref(node);
|
|
1224
|
+
else if (ref) ref.current = node;
|
|
1225
|
+
},
|
|
1226
|
+
[ref]
|
|
1227
|
+
);
|
|
1228
|
+
react$1.useEffect(() => {
|
|
1229
|
+
if (inner.current) inner.current.indeterminate = Boolean(indeterminate);
|
|
1230
|
+
}, [indeterminate]);
|
|
1231
|
+
const describedBy2 = [descId, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
1232
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1233
|
+
"label",
|
|
1234
|
+
{
|
|
1235
|
+
htmlFor: fieldId,
|
|
1236
|
+
"data-shell-checkbox": "",
|
|
1237
|
+
className: clsx__default.default(
|
|
1238
|
+
"flex min-h-[44px] items-start gap-3 py-[10px] text-sm text-[color:var(--app-card-fg,var(--color-text))]",
|
|
1239
|
+
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
1240
|
+
wrapperClassName
|
|
1241
|
+
),
|
|
1242
|
+
children: [
|
|
1243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1244
|
+
"input",
|
|
1245
|
+
{
|
|
1246
|
+
...props,
|
|
1247
|
+
ref: setRef,
|
|
1248
|
+
id: fieldId,
|
|
1249
|
+
type: "checkbox",
|
|
1250
|
+
disabled,
|
|
1251
|
+
"data-shell-field": "",
|
|
1252
|
+
"aria-invalid": invalid || void 0,
|
|
1253
|
+
"aria-describedby": describedBy2,
|
|
1254
|
+
className: clsx__default.default(
|
|
1255
|
+
"mt-[2px] h-5 w-5 shrink-0 rounded-[5px] border focus:outline-none focus-visible:ring-2",
|
|
1256
|
+
"accent-[color:var(--color-accent-bg-safe,var(--color-accent))]",
|
|
1257
|
+
"focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))]",
|
|
1258
|
+
invalid ? "border-[color:var(--chrome-danger,var(--color-race-red))] outline outline-2 outline-[color:var(--chrome-danger,var(--color-race-red))]" : "border-[color:var(--app-field-border,var(--color-border))]",
|
|
1259
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
1260
|
+
className
|
|
1261
|
+
)
|
|
1262
|
+
}
|
|
1263
|
+
),
|
|
1264
|
+
label || description ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
|
|
1265
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block font-medium", children: label }) : null,
|
|
1266
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
|
+
"span",
|
|
1268
|
+
{
|
|
1269
|
+
id: descId,
|
|
1270
|
+
className: "block text-xs text-[color:var(--app-card-fg-muted,var(--color-text-muted))]",
|
|
1271
|
+
children: description
|
|
1272
|
+
}
|
|
1273
|
+
) : null
|
|
1274
|
+
] }) : null
|
|
1275
|
+
]
|
|
1276
|
+
}
|
|
1277
|
+
);
|
|
1278
|
+
});
|
|
1279
|
+
var Checkbox_default = Checkbox;
|
|
1280
|
+
var FileInput = react$1.forwardRef(function FileInput2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
1281
|
+
const autoId = react$1.useId();
|
|
1282
|
+
const fieldId = id ?? autoId;
|
|
1283
|
+
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
1284
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1285
|
+
FormField,
|
|
1286
|
+
{
|
|
1287
|
+
id: fieldId,
|
|
1288
|
+
label,
|
|
1289
|
+
helperText,
|
|
1290
|
+
error,
|
|
1291
|
+
required,
|
|
1292
|
+
className: wrapperClassName,
|
|
1293
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1294
|
+
"input",
|
|
1295
|
+
{
|
|
1296
|
+
...props,
|
|
1297
|
+
ref,
|
|
1298
|
+
id: fieldId,
|
|
1299
|
+
type: "file",
|
|
1300
|
+
required,
|
|
1301
|
+
"data-shell-field": "",
|
|
1302
|
+
"aria-invalid": isInvalid || void 0,
|
|
1303
|
+
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1304
|
+
className: clsx__default.default(
|
|
1305
|
+
FIELD_BASE,
|
|
1306
|
+
"h-[44px] cursor-pointer py-[5px] file:mr-3 file:h-[32px] file:cursor-pointer file:rounded-[5px] file:border file:border-[color:var(--app-btn-secondary-border,var(--color-border))] file:bg-[color:var(--app-btn-secondary-bg,var(--color-white))] file:px-3 file:text-sm file:font-medium file:text-[color:var(--app-btn-secondary-fg,var(--color-text))]",
|
|
1307
|
+
isInvalid ? FIELD_INVALID : FIELD_VALID,
|
|
1308
|
+
className
|
|
1309
|
+
)
|
|
1310
|
+
}
|
|
1311
|
+
)
|
|
1312
|
+
}
|
|
1313
|
+
);
|
|
1314
|
+
});
|
|
1315
|
+
var FileInput_default = FileInput;
|
|
1161
1316
|
|
|
1162
1317
|
// src/lib/deprecation.ts
|
|
1163
1318
|
var warned = /* @__PURE__ */ new Set();
|
|
@@ -1201,7 +1356,7 @@ function PageContainer({
|
|
|
1201
1356
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1202
1357
|
"div",
|
|
1203
1358
|
{
|
|
1204
|
-
className:
|
|
1359
|
+
className: clsx__default.default(
|
|
1205
1360
|
"mx-auto w-full",
|
|
1206
1361
|
maxWClass,
|
|
1207
1362
|
pxClass,
|
|
@@ -1234,7 +1389,7 @@ function BreadcrumbBarView({
|
|
|
1234
1389
|
{
|
|
1235
1390
|
className: "ml-0 border-b border-gray-200 px-4 py-3 md:ml-60",
|
|
1236
1391
|
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
1237
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1392
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx__default.default("mx-auto w-full px-0", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
1238
1393
|
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex items-center gap-2 text-sm text-slate-100", children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2", children: [
|
|
1239
1394
|
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
1240
1395
|
item.href ? renderCrumbLink(item.href, item.label, "text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-100", children: item.label })
|
|
@@ -1401,7 +1556,7 @@ function HeaderTabBar({
|
|
|
1401
1556
|
{
|
|
1402
1557
|
role: "tablist",
|
|
1403
1558
|
"aria-label": ariaLabel,
|
|
1404
|
-
className:
|
|
1559
|
+
className: clsx__default.default(
|
|
1405
1560
|
// Header-wide tab strip: background + bottom border only (no outer box).
|
|
1406
1561
|
// Left-aligned and fluid: the container spans the full content width,
|
|
1407
1562
|
// the tabs keep their natural width packed from the left (Global-Rules
|
|
@@ -1425,7 +1580,7 @@ function HeaderTabBar({
|
|
|
1425
1580
|
"aria-label": item.label,
|
|
1426
1581
|
disabled: isDisabled,
|
|
1427
1582
|
onClick: () => onChange(item.id),
|
|
1428
|
-
className:
|
|
1583
|
+
className: clsx__default.default(
|
|
1429
1584
|
// `group/tbtip relative` powers the shared <TopBarTooltip>.
|
|
1430
1585
|
// Natural width (no flex-1 stretch); 40px square hit area for the
|
|
1431
1586
|
// icon-only tab so the strip stays tappable.
|
|
@@ -1989,6 +2144,8 @@ exports.BrandLogo = BrandLogo;
|
|
|
1989
2144
|
exports.BreadcrumbBar = BreadcrumbBar;
|
|
1990
2145
|
exports.Button = Button_default;
|
|
1991
2146
|
exports.Card = Card;
|
|
2147
|
+
exports.Checkbox = Checkbox_default;
|
|
2148
|
+
exports.FileInput = FileInput_default;
|
|
1992
2149
|
exports.FormColumn = FormColumn;
|
|
1993
2150
|
exports.GlobalUiIdProvider = GlobalUiIdProvider;
|
|
1994
2151
|
exports.HeaderTabBar = HeaderTabBar;
|