@webority/ui-react 0.8.2 → 0.8.4

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.
@@ -7,19 +7,25 @@
7
7
  * @param {"info"|"success"|"warning"|"danger"} [props.variant="info"]
8
8
  * @param {import('react').ReactNode} props.children The alert body.
9
9
  * @param {import('react').ReactNode} [props.title] A bold heading line above the body (`.alert-heading`).
10
- * @param {string|import('react').ReactNode} [props.icon] A leading glyph — a Bootstrap Icons name or a node.
10
+ * @param {string|import('react').ReactNode} [props.icon] A leading glyph — a semantic icon name or a node. Defaults to the variant's badge glyph; pass `null` for none.
11
+ * @param {string} [props.image] A custom image URL shown in the badge instead of the icon glyph (fills the circle).
12
+ * @param {string} [props.imageAlt] Alt text for the custom image.
11
13
  * @param {string} [props.className]
12
14
  * @param {() => void} [props.onClose] Called when dismissed
13
15
  * @param {boolean} [props.dismissible] Show the close button (defaults to true when onClose is set)
16
+ * @param {boolean} [props.bordered=true] Draw the soft variant border. `false` keeps only the tint fill.
14
17
  * @param {"alert"|"status"} [props.role="alert"] Use "status" for non-assertive notices
15
18
  */
16
- export default function AppAlert({ variant, children, title, icon, className, onClose, dismissible, role, ...rest }: {
19
+ export default function AppAlert({ variant, children, title, icon, image, imageAlt, className, onClose, dismissible, bordered, role, ...rest }: {
17
20
  variant?: "info" | "success" | "warning" | "danger";
18
21
  children: import('react').ReactNode;
19
22
  title?: import('react').ReactNode;
20
23
  icon?: string | import('react').ReactNode;
24
+ image?: string;
25
+ imageAlt?: string;
21
26
  className?: string;
22
27
  onClose?: () => void;
23
28
  dismissible?: boolean;
29
+ bordered?: boolean;
24
30
  role?: "alert" | "status";
25
31
  }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A soft branded aside that EXPLAINS something — how a calculation works, what a
3
- * setting affects, what happens next in a flow.
3
+ * setting affects, what happens next in a flow. A thick coloured left edge marks it
4
+ * as an aside.
4
5
  *
5
6
  * Distinct from `AppAlert`, and the difference is not cosmetic: an alert reports a
6
7
  * *state* ("we couldn't save", "your trial ends in 3 days") and goes away when that
@@ -9,11 +10,25 @@
9
10
  *
10
11
  * @param {object} props
11
12
  * @param {import('react').ReactNode} props.children The explanation. `<strong>` is styled.
12
- * @param {string} [props.icon='info'] Leading glyph. Pass `null` for none.
13
+ * @param {"info"|"success"|"warning"|"danger"} [props.tone="info"] The colour, mapped to intent.
14
+ * @param {import('react').ReactNode} [props.title] A bold heading line above the body.
15
+ * @param {string|import('react').ReactNode} [props.icon] Leading glyph — a semantic icon name or a node. Defaults to the tone's badge glyph; pass `null` for none.
16
+ * @param {string} [props.image] A custom image URL shown in the badge instead of the icon glyph (fills the circle).
17
+ * @param {string} [props.imageAlt] Alt text for the custom image.
18
+ * @param {"md"|"sm"} [props.size="md"] `sm` is a compact single line with tone-coloured text.
19
+ * @param {boolean} [props.dismissible=false] Show a × on the right that removes the callout.
20
+ * @param {() => void} [props.onDismiss] Called after the callout is dismissed.
13
21
  * @param {string} [props.className]
14
22
  */
15
- export default function AppCallout({ children, icon, className, ...rest }: {
23
+ export default function AppCallout({ children, tone, title, icon, image, imageAlt, size, dismissible, onDismiss, className, ...rest }: {
16
24
  children: import('react').ReactNode;
17
- icon?: string;
25
+ tone?: "info" | "success" | "warning" | "danger";
26
+ title?: import('react').ReactNode;
27
+ icon?: string | import('react').ReactNode;
28
+ image?: string;
29
+ imageAlt?: string;
30
+ size?: "md" | "sm";
31
+ dismissible?: boolean;
32
+ onDismiss?: () => void;
18
33
  className?: string;
19
34
  }): import("react").JSX.Element;
@@ -14,7 +14,7 @@
14
14
  * @param {import('react').ReactNode} [props.children]
15
15
  * @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone="neutral"]
16
16
  * @param {"sm"|"md"} [props.size="md"]
17
- * @param {string} [props.leadingIcon] Bootstrap Icons name for a leading glyph.
17
+ * @param {string} [props.leadingIcon] Semantic icon name for a leading glyph.
18
18
  * @param {string|import('react').ReactNode} [props.avatar] Leading avatar — an image URL or a node.
19
19
  * @param {() => void} [props.onRemove] Present → shows the dismiss ✕.
20
20
  * @param {() => void} [props.onClick] Present → the chip body is clickable.
@@ -10,7 +10,7 @@
10
10
  * the tighter widget/tile variant (smaller title + text).
11
11
  *
12
12
  * @param {object} props
13
- * @param {string|import('react').ReactNode} props.icon Bootstrap Icons name for the bubble, or a custom node
13
+ * @param {string|import('react').ReactNode} props.icon Semantic icon name for the bubble, or a custom node
14
14
  * @param {number} [props.iconSize=24]
15
15
  * @param {"md"|"sm"} [props.size="md"]
16
16
  * @param {import('react').ReactNode} props.title
@@ -1,9 +1,19 @@
1
+ /**
2
+ * The library's icon component — iconsax (Linear) glyphs, keyed by the semantic
3
+ * kebab-case names in scripts/icon-map.json: <Icon name="file-text" />. Renders inline
4
+ * SVG (24x24 viewBox, currentColor) with data-icon={name} so CSS can target a specific
5
+ * glyph. `size` maps to width/height; `color` to the icon colour.
6
+ *
7
+ * The glyph bodies are GENERATED (iconGlyphs.g.js) from one source shared with the Razor
8
+ * RCL and the wui elements, so every surface draws the identical icon. Add or change an
9
+ * icon in scripts/icon-map.json and run `node scripts/gen-icons.mjs`.
10
+ */
1
11
  export declare const iconNames: string[];
2
12
  /**
3
13
  * Register product-specific glyphs — call once at app init, before first render. Each value is a
4
14
  * render function `({ size, color, className, style }) => ReactNode` that returns your own glyph
5
- * (e.g. an iconsax Bulk component) applied to those props. A registered name wins over the
6
- * built-in Bootstrap-Icon map; every unregistered name still resolves to Bootstrap Icons.
15
+ * applied to those props. A registered name wins over the built-in iconsax resolution; every
16
+ * unregistered name still resolves to the generated iconsax glyph.
7
17
  *
8
18
  * @param {Record<string, (props: { size: number, color?: string, className?: string, style?: object }) => import('react').ReactNode>} map
9
19
  */
@@ -13,11 +23,12 @@ export declare function registerIcons(map: Record<string, (props: {
13
23
  className?: string;
14
24
  style?: object;
15
25
  }) => import('react').ReactNode>): void;
16
- export default function Icon({ name, size, className, color, style, ...rest }: {
26
+ export default function Icon({ name, size, variant, className, color, style, ...rest }: {
17
27
  [x: string]: any;
18
28
  className: any;
19
29
  color: any;
20
30
  name: any;
21
31
  size?: number;
22
32
  style: any;
33
+ variant: any;
23
34
  }): any;
@@ -0,0 +1,148 @@
1
+ export declare const GLYPHS: {
2
+ activity: string;
3
+ alarm: string;
4
+ 'alert-circle': string;
5
+ 'alert-triangle': string;
6
+ 'arrow-down': string;
7
+ 'arrow-down-up': string;
8
+ 'arrow-left': string;
9
+ 'arrow-right': string;
10
+ 'arrow-up': string;
11
+ 'arrow-up-right': string;
12
+ 'badge-check': string;
13
+ bell: string;
14
+ book: string;
15
+ 'box-seam': string;
16
+ briefcase: string;
17
+ bug: string;
18
+ building: string;
19
+ 'building-2': string;
20
+ bullseye: string;
21
+ calculator: string;
22
+ calendar: string;
23
+ 'calendar-check': string;
24
+ 'calendar-dots': string;
25
+ camera: string;
26
+ 'cash-stack': string;
27
+ chart: string;
28
+ 'chart-column': string;
29
+ chat: string;
30
+ 'chat-dots': string;
31
+ check: string;
32
+ 'check-check': string;
33
+ 'check-circle': string;
34
+ 'chevron-down': string;
35
+ 'chevron-left': string;
36
+ 'chevron-right': string;
37
+ 'chevron-up': string;
38
+ 'chevrons-up-down': string;
39
+ circle: string;
40
+ 'circle-help': string;
41
+ 'clipboard-check': string;
42
+ clock: string;
43
+ cloud: string;
44
+ coins: string;
45
+ contact: string;
46
+ copy: string;
47
+ 'credit-card': string;
48
+ cursor: string;
49
+ 'diagram-3': string;
50
+ display: string;
51
+ download: string;
52
+ edit: string;
53
+ 'emoji-smile': string;
54
+ 'external-link': string;
55
+ eye: string;
56
+ 'eye-off': string;
57
+ factory: string;
58
+ 'file-plus-2': string;
59
+ 'file-text': string;
60
+ files: string;
61
+ filter: string;
62
+ flag: string;
63
+ folder: string;
64
+ 'folder-kanban': string;
65
+ 'folder-open': string;
66
+ 'folder-plus': string;
67
+ gauge: string;
68
+ gift: string;
69
+ globe: string;
70
+ globe2: string;
71
+ grid: string;
72
+ heart: string;
73
+ history: string;
74
+ house: string;
75
+ image: string;
76
+ inbox: string;
77
+ info: string;
78
+ key: string;
79
+ 'layout-dashboard': string;
80
+ 'layout-grid': string;
81
+ lightbulb: string;
82
+ list: string;
83
+ lock: string;
84
+ 'log-out': string;
85
+ mail: string;
86
+ 'map-pin': string;
87
+ menu: string;
88
+ 'message-square': string;
89
+ minus: string;
90
+ moon: string;
91
+ 'more-horizontal': string;
92
+ palette: string;
93
+ 'panel-left-close': string;
94
+ 'panel-left-open': string;
95
+ 'pen-tool': string;
96
+ pencil: string;
97
+ phone: string;
98
+ plug: string;
99
+ plus: string;
100
+ 'plus-circle': string;
101
+ receipt: string;
102
+ 'refresh-cw': string;
103
+ repeat: string;
104
+ 'rotate-ccw': string;
105
+ search: string;
106
+ send: string;
107
+ server: string;
108
+ settings: string;
109
+ 'share-2': string;
110
+ shield: string;
111
+ 'shield-check': string;
112
+ 'shield-lock': string;
113
+ 'shield-plus': string;
114
+ shop: string;
115
+ sort: string;
116
+ sparkles: string;
117
+ star: string;
118
+ stars: string;
119
+ sun: string;
120
+ tag: string;
121
+ telephone: string;
122
+ text: string;
123
+ 'trash-2': string;
124
+ 'trending-up': string;
125
+ triangle: string;
126
+ 'two-page': string;
127
+ upload: string;
128
+ user: string;
129
+ 'user-check': string;
130
+ 'user-minus': string;
131
+ 'user-plus': string;
132
+ users: string;
133
+ wallet2: string;
134
+ 'wand-sparkles': string;
135
+ whatsapp: string;
136
+ x: string;
137
+ 'x-circle': string;
138
+ zap: string;
139
+ 'zoom-in': string;
140
+ 'zoom-out': string;
141
+ };
142
+ export declare const iconNames: string[];
143
+ /** The library's single icon SVG emitter — identical markup to Razor's IconMarkup.Render. */
144
+ export declare function glyphSvg(name: any, { size, className, style }?: {
145
+ className?: string;
146
+ size?: number;
147
+ style?: string;
148
+ }): string;