yukit-web 0.0.13 → 0.0.15
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/.npm/_cacache/content-v2/sha512/{03/98/70979fc359861d63479e1619d042ae426b2765f31a8af329a1f76a60cd26b0159ea29bb70209838d246dd6a0a5bafc6617f597733ccae24b8f25ae597d19 → 4d/45/448d7568a32a10e83c1b42f01a0dfdb37044257acc46d5df8e088fbc4d5cae370823d9414201e9097ab06a0fff272d00d05d8b7567fa35920ba629a745ce} +1 -1
- package/.npm/_cacache/index-v5/64/dc/73c7a26f2e6eb0c711133d96c247da5ecf0eba708cd37c450a7b3c7cb488 +1 -1
- package/.npm/_logs/{2026-09-03T11_06_22_047Z-debug-0.log → 2026-09-08T13_19_17_944Z-debug-0.log} +10 -10
- package/.npm/_logs/{2026-09-03T11_06_22_642Z-debug-0.log → 2026-09-08T13_19_18_482Z-debug-0.log} +2 -2
- package/fesm2022/yukit-web.mjs +160 -122
- package/fesm2022/yukit-web.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/theme/components/button-group.css +36 -0
- package/src/lib/theme/components/button.css +4 -0
- package/src/lib/theme/theme.css +4 -3
- package/src/lib/theme/tokens/color.css +27 -12
- package/src/lib/theme/tokens/component-colors.css +4 -4
- package/types/yukit-web.d.ts +149 -118
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
yuw-button-group > yuw-button > :is(button, a) {
|
|
2
|
+
border-radius: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
yuw-button-group[data-orientation='vertical'] > yuw-button,
|
|
6
|
+
yuw-button-group[data-orientation='vertical'] > yuw-button > :is(button, a) {
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
yuw-button-group[data-orientation='horizontal'] > yuw-button:not(:first-child) > :is(button, a) {
|
|
11
|
+
border-inline-start-width: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
yuw-button-group[data-orientation='vertical'] > yuw-button:not(:first-child) > :is(button, a) {
|
|
15
|
+
border-block-start-width: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
yuw-button-group[data-orientation='horizontal'] > yuw-button:first-child > :is(button, a) {
|
|
19
|
+
border-start-start-radius: var(--radius);
|
|
20
|
+
border-end-start-radius: var(--radius);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
yuw-button-group[data-orientation='horizontal'] > yuw-button:last-child > :is(button, a) {
|
|
24
|
+
border-start-end-radius: var(--radius);
|
|
25
|
+
border-end-end-radius: var(--radius);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
yuw-button-group[data-orientation='vertical'] > yuw-button:first-child > :is(button, a) {
|
|
29
|
+
border-start-start-radius: var(--radius);
|
|
30
|
+
border-start-end-radius: var(--radius);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
yuw-button-group[data-orientation='vertical'] > yuw-button:last-child > :is(button, a) {
|
|
34
|
+
border-end-start-radius: var(--radius);
|
|
35
|
+
border-end-end-radius: var(--radius);
|
|
36
|
+
}
|
package/src/lib/theme/theme.css
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* Spartan css overwrites
|
|
11
11
|
*/
|
|
12
|
+
@import './components/button.css';
|
|
13
|
+
@import './components/button-group.css';
|
|
12
14
|
@import './spartan-overwrites/accordion.css';
|
|
13
15
|
|
|
14
16
|
@layer base {
|
|
15
|
-
|
|
16
17
|
*,
|
|
17
18
|
::after,
|
|
18
19
|
::before {
|
|
@@ -30,12 +31,12 @@
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
button:not(:disabled),
|
|
33
|
-
[role=
|
|
34
|
+
[role='button']:not(:disabled) {
|
|
34
35
|
cursor: pointer;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
button:disabled,
|
|
38
|
-
[role=
|
|
39
|
+
[role='button']:disabled {
|
|
39
40
|
cursor: not-allowed;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
/** || Gradients || */
|
|
5
5
|
--gradient-primary-button: linear-gradient(0deg, var(--accent-primary) 50%, var(--accent-primary-dark) 100%);
|
|
6
|
-
--gradient-primary-button-hover: linear-gradient(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
--gradient-primary-button-hover: linear-gradient(
|
|
7
|
+
0deg,
|
|
8
|
+
var(--accent-primary-dark) 50%,
|
|
9
|
+
var(--accent-primary-darker) 100%
|
|
10
|
+
);
|
|
11
|
+
--neutrals-element-high-gradient: linear-gradient(
|
|
12
|
+
to bottom,
|
|
13
|
+
var(--neutrals-element-high-gradient-start) 50%,
|
|
14
|
+
var(--neutrals-element-high) 100%
|
|
15
|
+
);
|
|
16
|
+
--neutrals-element-high-gradient-hover: linear-gradient(
|
|
17
|
+
to bottom,
|
|
18
|
+
var(--neutrals-element-high-gradient-start-hover) 50%,
|
|
19
|
+
var(--neutrals-black) 100%
|
|
20
|
+
);
|
|
10
21
|
|
|
11
22
|
/** || accent || */
|
|
12
23
|
--accent-primary-darker-ext: oklch(0.27 0.145 281.565);
|
|
@@ -93,7 +104,7 @@
|
|
|
93
104
|
/* #9B191D */
|
|
94
105
|
--feedback-error: oklch(0.528 0.201 26.757);
|
|
95
106
|
/* #C51B20 */
|
|
96
|
-
--feedback-error-light: oklch(0.711 0.
|
|
107
|
+
--feedback-error-light: oklch(0.711 0.17 20.711);
|
|
97
108
|
/* #FA6F73 */
|
|
98
109
|
--feedback-error-lighter-2: oklch(0.972 0.012 23.703);
|
|
99
110
|
/* #FEF3F2 */
|
|
@@ -180,8 +191,8 @@
|
|
|
180
191
|
--sidebar-foreground: var(--neutrals-element-high);
|
|
181
192
|
--sidebar-primary: var(--accent-primary);
|
|
182
193
|
--sidebar-primary-foreground: var(--neutrals-white);
|
|
183
|
-
--sidebar-accent:
|
|
184
|
-
--sidebar-accent-foreground:
|
|
194
|
+
--sidebar-accent: var(--accent-primary-lighter-2);
|
|
195
|
+
--sidebar-accent-foreground: var(--accent-primary);
|
|
185
196
|
--sidebar-border: var(--neutrals-outline);
|
|
186
197
|
--sidebar-ring: var(--accent-primary);
|
|
187
198
|
|
|
@@ -201,11 +212,15 @@
|
|
|
201
212
|
|
|
202
213
|
.dark {
|
|
203
214
|
color-scheme: dark;
|
|
204
|
-
--neutrals-element-high-gradient-hover: linear-gradient(
|
|
205
|
-
|
|
215
|
+
--neutrals-element-high-gradient-hover: linear-gradient(
|
|
216
|
+
to bottom,
|
|
217
|
+
var(--neutrals-element-high-gradient-start-hover) 50%,
|
|
218
|
+
var(--neutrals-white) 100%
|
|
219
|
+
);
|
|
220
|
+
|
|
206
221
|
/** || Sidebar || */
|
|
207
|
-
--sidebar-accent: #
|
|
208
|
-
--sidebar-accent-foreground: #
|
|
222
|
+
--sidebar-accent: #3a1f22;
|
|
223
|
+
--sidebar-accent-foreground: #ff7a7c;
|
|
209
224
|
|
|
210
225
|
/** || Accent || */
|
|
211
226
|
--accent-primary-darker-ext: oklch(0.27 0.145 281.565);
|
|
@@ -291,7 +306,7 @@
|
|
|
291
306
|
/* #9B191D */
|
|
292
307
|
--feedback-error: oklch(0.528 0.201 26.757);
|
|
293
308
|
/* #C51B20 */
|
|
294
|
-
--feedback-error-light: oklch(0.711 0.
|
|
309
|
+
--feedback-error-light: oklch(0.711 0.17 20.711);
|
|
295
310
|
/* #FA6F73 */
|
|
296
311
|
--feedback-error-lighter-2: oklch(0.528 0.201 26.757 / 0.32);
|
|
297
312
|
/* rgba(197,27,32,0.32) */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[data-yuw-color='primary'] {
|
|
2
2
|
--yuw-accent: var(--accent-primary);
|
|
3
3
|
--yuw-accent-foreground: var(--neutrals-white);
|
|
4
|
-
--secondary: var(--accent
|
|
5
|
-
--secondary-foreground: var(--
|
|
4
|
+
--secondary: var(--sidebar-accent);
|
|
5
|
+
--secondary-foreground: var(--sidebar-accent-foreground);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
[data-yuw-color='primary'] button.bg-primary:not(:disabled) {
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
|
|
117
117
|
.dark [data-yuw-color='primary'] {
|
|
118
118
|
--yuw-accent: var(--accent-primary-dark);
|
|
119
|
-
--secondary: var(--accent
|
|
120
|
-
--secondary-foreground: var(--
|
|
119
|
+
--secondary: var(--sidebar-accent);
|
|
120
|
+
--secondary-foreground: var(--sidebar-accent-foreground);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.dark [data-yuw-color='secondary'] {
|
package/types/yukit-web.d.ts
CHANGED
|
@@ -106,63 +106,10 @@ interface YuwTextFieldContract {
|
|
|
106
106
|
type YuwColorDto = 'primary' | 'secondary' | 'destructive' | 'success' | 'warning' | 'info' | 'muted' | 'violet';
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* A single
|
|
109
|
+
* A single action button, rendered as a `<button>` or, when `href` is set, an `<a>`.
|
|
110
110
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* one out carries its own.
|
|
114
|
-
*
|
|
115
|
-
* `label` is data the parent supplies, not a component-owned default — the same i18n rule
|
|
116
|
-
* `YuwBreadcrumbItemDto` and `YuwSelectOptionDto` follow.
|
|
117
|
-
*/
|
|
118
|
-
interface YuwButtonGroupItemDto {
|
|
119
|
-
id: string;
|
|
120
|
-
label: string;
|
|
121
|
-
kind?: 'button';
|
|
122
|
-
variant?: ButtonVariants['variant'];
|
|
123
|
-
size?: ButtonVariants['size'];
|
|
124
|
-
color?: YuwColorDto;
|
|
125
|
-
disabled?: boolean;
|
|
126
|
-
href?: string;
|
|
127
|
-
target?: string;
|
|
128
|
-
type?: 'button' | 'submit' | 'reset';
|
|
129
|
-
ariaLabel?: string;
|
|
130
|
-
yuwDropdownMenuTrigger?: TemplateRef<unknown> | undefined;
|
|
131
|
-
transparent?: boolean;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* A static, non-interactive segment welded into the same row as the buttons — a leading caption, a
|
|
135
|
-
* trailing unit, a checkbox that applies to the whole group.
|
|
136
|
-
*
|
|
137
|
-
* A separate type rather than optional fields on `YuwButtonGroupItemDto`: a text segment honors none
|
|
138
|
-
* of that interface's button surface, and merging them would hand consumers fields that silently do
|
|
139
|
-
* nothing on half the entries.
|
|
140
|
-
*
|
|
141
|
-
* `label` renders as-is. For content a string can't express (a `yuw-checkbox`, custom markup),
|
|
142
|
-
* declare an `<ng-template yuwButtonGroupText="<id>">` whose id matches this entry; the template
|
|
143
|
-
* wins over `label` when both are present.
|
|
144
|
-
*/
|
|
145
|
-
interface YuwButtonGroupTextDto {
|
|
146
|
-
id: string;
|
|
147
|
-
kind: 'text';
|
|
148
|
-
label?: string;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* What `<yuw-button>`'s `buttons` input accepts: buttons, text segments, in whatever order the
|
|
152
|
-
* consumer lists them.
|
|
153
|
-
*
|
|
154
|
-
* `kind` is optional on the button variant, so existing `{id, label}` arrays keep working: an entry
|
|
155
|
-
* without `kind` is a button.
|
|
156
|
-
*/
|
|
157
|
-
type YuwButtonGroupEntryDto = YuwButtonGroupItemDto | YuwButtonGroupTextDto;
|
|
158
|
-
/** What `<yuw-button>` emits from `buttonClicked` in the group form. */
|
|
159
|
-
interface YuwButtonGroupClickDto {
|
|
160
|
-
id: string;
|
|
161
|
-
event: MouseEvent;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Button component supporting single action button or grouped button options.
|
|
111
|
+
* For a welded row of buttons driven by data, use `<yuw-button-group>`, which renders one of these
|
|
112
|
+
* per entry.
|
|
166
113
|
*
|
|
167
114
|
* Inputs:
|
|
168
115
|
* - `variant`: Button style variant (`'default'`, `'secondary'`, `'outline'`, `'destructive'`, `'ghost'`, `'link'`). Default is `'default'`.
|
|
@@ -173,60 +120,34 @@ interface YuwButtonGroupClickDto {
|
|
|
173
120
|
* - `href`: Renders button as an anchor tag navigating to specified URL.
|
|
174
121
|
* - `target`: Target attribute for link button (e.g. `'_blank'`).
|
|
175
122
|
* - `transparent`: Removes background and border styling.
|
|
176
|
-
* - `class`: Extra CSS classes merged onto the inner button/anchor
|
|
123
|
+
* - `class`: Extra CSS classes merged onto the inner button/anchor; merged last, so they win over the component's own classes.
|
|
177
124
|
* - `yuwDropdownMenuTrigger`: Optional dropdown menu template reference to trigger.
|
|
178
125
|
* - `ariaLabel`: Accessible label for screen readers.
|
|
179
|
-
* - `buttons`: Array of group entries (`YuwButtonGroupEntryDto[]`) to render as a welded button group.
|
|
180
|
-
* A `kind: 'text'` entry renders a static, non-interactive segment instead of a button; give it an
|
|
181
|
-
* `<ng-template yuwButtonGroupText="<id>">` to fill it with markup rather than a plain `label`.
|
|
182
|
-
* - `orientation`: Group layout orientation (`'horizontal'` or `'vertical'`). Default is `'horizontal'`.
|
|
183
|
-
* - `groupAriaLabel`: Accessible name for button group container.
|
|
184
126
|
*
|
|
185
127
|
* Outputs:
|
|
186
|
-
* - `clicked`: Emits MouseEvent on
|
|
187
|
-
* - `buttonClicked`: Emits object containing clicked button `id` and `event` in group mode.
|
|
128
|
+
* - `clicked`: Emits MouseEvent on click.
|
|
188
129
|
*
|
|
189
130
|
* `_btnClass` merges our variant layer with the consumer's `class`, which goes last so it wins.
|
|
190
131
|
*
|
|
191
|
-
* `_resolved` gives each group entry everything its branch of the template needs. A text entry has
|
|
192
|
-
* no variant/size/color to fall back to, so it takes its own path rather than being run through the
|
|
193
|
-
* button resolver, which would invent fields its DTO doesn't declare. Its content template is looked
|
|
194
|
-
* up through a `Map` rather than a per-entry `.find()`, which would make an n-entry group cost n².
|
|
195
|
-
*
|
|
196
132
|
* The host carries `inline-flex` so it is a real box rather than an inline one: an overlay trigger
|
|
197
133
|
* directive composed onto `<yuw-button>` (see `YuwPopoverTriggerDirective`) anchors its panel to the
|
|
198
134
|
* host element, and an inline host reports a rect that misses the button's own box. Elements that
|
|
199
135
|
* need to be positioned — an overlay's close button, for instance — get a positioned wrapper around
|
|
200
136
|
* `<yuw-button>` rather than relying on the host's own display.
|
|
201
137
|
*
|
|
202
|
-
*
|
|
138
|
+
* Usage:
|
|
203
139
|
* ```html
|
|
204
140
|
* <yuw-button variant="outline" color="primary" (clicked)="onSave()">Save</yuw-button>
|
|
205
141
|
* <yuw-button href="/dashboard">Navigate</yuw-button>
|
|
206
142
|
* ```
|
|
207
|
-
*
|
|
208
|
-
* Button Group Usage:
|
|
209
|
-
* ```html
|
|
210
|
-
* <yuw-button [buttons]="actionList" (buttonClicked)="onAction($event)" />
|
|
211
|
-
*
|
|
212
|
-
* <yuw-button [buttons]="[{id: 'caption', kind: 'text', label: 'Sort by'}, ...sortActions]">
|
|
213
|
-
* <ng-template yuwButtonGroupText="select-all">
|
|
214
|
-
* <yuw-checkbox [(checked)]="allSelected" />
|
|
215
|
-
* </ng-template>
|
|
216
|
-
* </yuw-button>
|
|
217
|
-
* ```
|
|
218
143
|
*/
|
|
219
144
|
declare class YuwButtonComponent {
|
|
220
145
|
private readonly _host;
|
|
221
|
-
private readonly _texts;
|
|
222
146
|
readonly animationDisabled: _angular_core.InputSignal<boolean>;
|
|
223
147
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
224
|
-
readonly buttons: _angular_core.InputSignal<YuwButtonGroupEntryDto[] | undefined>;
|
|
225
148
|
readonly color: _angular_core.InputSignal<YuwColorDto>;
|
|
226
149
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
227
|
-
readonly groupAriaLabel: _angular_core.InputSignal<string | undefined>;
|
|
228
150
|
readonly href: _angular_core.InputSignal<string | undefined>;
|
|
229
|
-
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
230
151
|
readonly size: _angular_core.InputSignal<"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined>;
|
|
231
152
|
readonly target: _angular_core.InputSignal<string | undefined>;
|
|
232
153
|
readonly transparent: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
@@ -234,63 +155,173 @@ declare class YuwButtonComponent {
|
|
|
234
155
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
235
156
|
readonly variant: _angular_core.InputSignal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
236
157
|
readonly yuwDropdownMenuTrigger: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
237
|
-
readonly buttonClicked: _angular_core.OutputEmitterRef<YuwButtonGroupClickDto>;
|
|
238
158
|
readonly clicked: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
239
|
-
protected readonly _textClass = "bg-transparent text-foreground border-border dark:border-input";
|
|
240
159
|
protected readonly _animationDisabled: _angular_core.Signal<boolean>;
|
|
241
|
-
protected readonly _effectiveVariant: _angular_core.Signal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
242
160
|
protected readonly _btnClass: _angular_core.Signal<string>;
|
|
243
|
-
protected readonly
|
|
244
|
-
protected
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
161
|
+
protected readonly _effectiveVariant: _angular_core.Signal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
162
|
+
protected onClick(event: MouseEvent): void;
|
|
163
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwButtonComponent, never>;
|
|
164
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwButtonComponent, "yuw-button", never, { "animationDisabled": { "alias": "animationDisabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "transparent": { "alias": "transparent"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "yuwDropdownMenuTrigger": { "alias": "yuwDropdownMenuTrigger"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, ["[yuwButtonIcon]", "*", "[yuwButtonIcon]", "*"], true, never>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A single button in `<yuw-button-group>`'s `buttons` input.
|
|
169
|
+
*
|
|
170
|
+
* Every field mirrors the `<yuw-button>` input of the same name. A field declared here wins over the
|
|
171
|
+
* group-level input of the same name — the group sets the row's base, an entry states its specific
|
|
172
|
+
* case — so a uniform row is `{id, label}` entries plus one group-level `variant`, and only the odd
|
|
173
|
+
* one out carries its own.
|
|
174
|
+
*
|
|
175
|
+
* `label` renders as plain text. For markup a string can't express, declare an
|
|
176
|
+
* `<ng-template yuwButtonGroupContent="<id>">` whose id matches this entry; the template wins over
|
|
177
|
+
* `label` when both are present. `label` is data the parent supplies, not a component-owned
|
|
178
|
+
* default, so the consuming app owns translation.
|
|
179
|
+
*
|
|
180
|
+
* `interactive: false` renders the entry as inert chrome — transparent, no hover, no click, not
|
|
181
|
+
* focusable — for a caption or a unit welded into the row.
|
|
182
|
+
*
|
|
183
|
+
* `selected` marks the entry as the active one in a segmented row, so the parent flips one boolean
|
|
184
|
+
* rather than rewriting appearance across the array on every click. It resolves most-specific
|
|
185
|
+
* first: this entry's `selectedColor`, then its `color`, then the group's `selectedColor`, then the
|
|
186
|
+
* group's `color`. An entry declaring `selectedColor` therefore keeps it even in a group that sets
|
|
187
|
+
* its own, which is the point — the entry is the specific case.
|
|
188
|
+
*/
|
|
189
|
+
interface YuwButtonGroupItemDto {
|
|
190
|
+
id: string;
|
|
191
|
+
label?: string;
|
|
192
|
+
variant?: ButtonVariants['variant'];
|
|
193
|
+
size?: ButtonVariants['size'];
|
|
194
|
+
color?: YuwColorDto;
|
|
195
|
+
transparent?: boolean;
|
|
196
|
+
selected?: boolean;
|
|
197
|
+
selectedVariant?: ButtonVariants['variant'];
|
|
198
|
+
selectedColor?: YuwColorDto;
|
|
199
|
+
interactive?: boolean;
|
|
200
|
+
disabled?: boolean;
|
|
201
|
+
href?: string;
|
|
202
|
+
target?: string;
|
|
203
|
+
type?: 'button' | 'submit' | 'reset';
|
|
204
|
+
ariaLabel?: string;
|
|
205
|
+
yuwDropdownMenuTrigger?: TemplateRef<unknown>;
|
|
206
|
+
}
|
|
207
|
+
/** What `<yuw-button-group>` emits from `buttonClicked`. */
|
|
208
|
+
interface YuwButtonGroupClickDto {
|
|
209
|
+
id: string;
|
|
210
|
+
event: MouseEvent;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* A welded row of buttons driven by data.
|
|
215
|
+
*
|
|
216
|
+
* Each entry renders a real `<yuw-button>`, so every button input — `variant`, `color`, `size`,
|
|
217
|
+
* `transparent`, `href`, the dropdown trigger — behaves inside the group exactly as it does on a
|
|
218
|
+
* standalone button, and the theme's `data-yuw-color` layer applies unchanged. The group only owns
|
|
219
|
+
* what a row adds: which corners stay rounded and which side draws each seam.
|
|
220
|
+
*
|
|
221
|
+
* Inputs:
|
|
222
|
+
* - `buttons`: The entries to render (`YuwButtonGroupItemDto[]`), in order.
|
|
223
|
+
* - `variant`, `size`, `color`: The row's base appearance. An entry that declares its own wins,
|
|
224
|
+
* since a per-entry value is by definition the specific case.
|
|
225
|
+
* - `selectedVariant`, `selectedColor`: The row's appearance for an entry marked `selected`,
|
|
226
|
+
* mirroring `variant`/`color`. Unset by default, in which case a selected entry keeps the row's
|
|
227
|
+
* `variant`/`color` unless it states its own.
|
|
228
|
+
* - `orientation`: Layout direction (`'horizontal'`, `'vertical'`). Default is `'horizontal'`.
|
|
229
|
+
* The seams rotate with it: a vertical group's entries own their bottom border and round only
|
|
230
|
+
* their top (first) or bottom (last) corners.
|
|
231
|
+
* - `ariaLabel`: Accessible name for the `role="group"` container. User-facing text the consuming
|
|
232
|
+
* app is responsible for translating.
|
|
233
|
+
*
|
|
234
|
+
* Outputs:
|
|
235
|
+
* - `buttonClicked`: Emits the clicked entry's `id` and the `MouseEvent`. An entry with
|
|
236
|
+
* `interactive: false` is inert chrome and never emits.
|
|
237
|
+
*
|
|
238
|
+
* An entry's content is its `label`, or an `<ng-template yuwButtonGroupContent="<id>">` when it
|
|
239
|
+
* needs markup instead of a string.
|
|
240
|
+
*
|
|
241
|
+
* `_resolved` walks the entries once, resolving each value most-specific-first: the entry's
|
|
242
|
+
* state-matching field, then the entry's base field, then the group's state-matching input, then
|
|
243
|
+
* the group's base. An entry always outranks the group, so an entry carrying `selectedColor` keeps
|
|
244
|
+
* it in a row that sets its own — the entry is the specific case by definition. Every step is
|
|
245
|
+
* `undefined` until someone sets it, so no level can be shadowed by a hardcoded default.
|
|
246
|
+
* Content templates are read from a `Map` rather than a per-entry `.find()`, which would make an
|
|
247
|
+
* n-entry group cost n².
|
|
248
|
+
*
|
|
249
|
+
* Seams are pure CSS (`theme/components/button-group.css`), not classes. The helm's base `border`
|
|
250
|
+
* sets all four sides and re-applies its own radius at runtime through `classes()`, and tailwind-
|
|
251
|
+
* merge cannot drop a side from `border` — `border-y border-e` only re-asserts widths, leaving the
|
|
252
|
+
* leading border in place, which is what made each entry draw its own left edge and tint the seam
|
|
253
|
+
* with the wrong entry's color. The stylesheet zeroes the leading border width and owns the corners,
|
|
254
|
+
* where no utility class can displace it.
|
|
255
|
+
*
|
|
256
|
+
* Usage:
|
|
257
|
+
* ```html
|
|
258
|
+
* <yuw-button-group [buttons]="alignActions" (buttonClicked)="onAction($event)" />
|
|
259
|
+
*
|
|
260
|
+
* <yuw-button-group [buttons]="entries" variant="outline" color="primary">
|
|
261
|
+
* <ng-template yuwButtonGroupContent="count">
|
|
262
|
+
* <yuw-badge>{{ total() }}</yuw-badge>
|
|
263
|
+
* </ng-template>
|
|
264
|
+
* </yuw-button-group>
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
declare class YuwButtonGroupComponent {
|
|
268
|
+
private readonly _contents;
|
|
269
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
270
|
+
readonly buttons: _angular_core.InputSignal<readonly YuwButtonGroupItemDto[]>;
|
|
271
|
+
readonly color: _angular_core.InputSignal<YuwColorDto>;
|
|
272
|
+
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
273
|
+
readonly selectedColor: _angular_core.InputSignal<YuwColorDto | undefined>;
|
|
274
|
+
readonly selectedVariant: _angular_core.InputSignal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
275
|
+
readonly size: _angular_core.InputSignal<"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined>;
|
|
276
|
+
readonly variant: _angular_core.InputSignal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
277
|
+
readonly buttonClicked: _angular_core.OutputEmitterRef<YuwButtonGroupClickDto>;
|
|
278
|
+
protected readonly _resolved: _angular_core.Signal<{
|
|
279
|
+
interactive: boolean;
|
|
280
|
+
template: _angular_core.TemplateRef<unknown> | undefined;
|
|
250
281
|
variant: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
251
282
|
size: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
252
283
|
color: YuwColorDto;
|
|
284
|
+
transparent: boolean;
|
|
253
285
|
disabled: boolean;
|
|
254
286
|
type: "button" | "submit" | "reset";
|
|
255
287
|
class: string;
|
|
256
288
|
id: string;
|
|
257
|
-
label
|
|
258
|
-
|
|
289
|
+
label?: string;
|
|
290
|
+
selected?: boolean;
|
|
291
|
+
selectedVariant?: ButtonVariants["variant"];
|
|
292
|
+
selectedColor?: YuwColorDto;
|
|
259
293
|
href?: string;
|
|
260
294
|
target?: string;
|
|
261
295
|
ariaLabel?: string;
|
|
262
|
-
yuwDropdownMenuTrigger?: TemplateRef<unknown
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwButtonComponent, never>;
|
|
268
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwButtonComponent, "yuw-button", never, { "animationDisabled": { "alias": "animationDisabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "buttons": { "alias": "buttons"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "groupAriaLabel": { "alias": "groupAriaLabel"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "transparent": { "alias": "transparent"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "yuwDropdownMenuTrigger": { "alias": "yuwDropdownMenuTrigger"; "required": false; "isSignal": true; }; }, { "buttonClicked": "buttonClicked"; "clicked": "clicked"; }, ["_texts"], ["[yuwButtonIcon]", "*", "[yuwButtonIcon]", "*"], true, never>;
|
|
296
|
+
yuwDropdownMenuTrigger?: _angular_core.TemplateRef<unknown>;
|
|
297
|
+
}[]>;
|
|
298
|
+
protected onClick(entry: YuwButtonGroupItemDto, event: MouseEvent): void;
|
|
299
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwButtonGroupComponent, never>;
|
|
300
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwButtonGroupComponent, "yuw-button-group", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "buttons": { "alias": "buttons"; "required": true; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "selectedColor": { "alias": "selectedColor"; "required": false; "isSignal": true; }; "selectedVariant": { "alias": "selectedVariant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "buttonClicked": "buttonClicked"; }, ["_contents"], never, true, never>;
|
|
269
301
|
}
|
|
270
302
|
|
|
271
303
|
/**
|
|
272
|
-
* Declares the content of a single
|
|
273
|
-
*
|
|
274
|
-
* in the `buttons` input.
|
|
304
|
+
* Declares the content of a single entry inside `<yuw-button-group>`. Apply it to an
|
|
305
|
+
* `<ng-template>` and pass the id of the entry it belongs to.
|
|
275
306
|
*
|
|
276
|
-
* Exists because
|
|
277
|
-
*
|
|
278
|
-
* back to its `label`, so the plain-string case needs no template at all.
|
|
307
|
+
* Exists because an entry's content often isn't a string — an icon with a count, a checkbox, a
|
|
308
|
+
* badge — and markup cannot travel through a data array. An entry whose id has no matching
|
|
309
|
+
* template falls back to its `label`, so the plain-string case needs no template at all.
|
|
279
310
|
*
|
|
280
311
|
* Usage:
|
|
281
312
|
* ```html
|
|
282
|
-
* <yuw-button [buttons]="entries">
|
|
283
|
-
* <ng-template
|
|
313
|
+
* <yuw-button-group [buttons]="entries">
|
|
314
|
+
* <ng-template yuwButtonGroupContent="select-all">
|
|
284
315
|
* <yuw-checkbox [(checked)]="allSelected" />
|
|
285
316
|
* </ng-template>
|
|
286
|
-
* </yuw-button>
|
|
317
|
+
* </yuw-button-group>
|
|
287
318
|
* ```
|
|
288
319
|
*/
|
|
289
|
-
declare class
|
|
320
|
+
declare class YuwButtonGroupContentDirective {
|
|
290
321
|
readonly templateRef: TemplateRef<unknown>;
|
|
291
322
|
readonly entryId: _angular_core.InputSignal<string>;
|
|
292
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
293
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<
|
|
323
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwButtonGroupContentDirective, never>;
|
|
324
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<YuwButtonGroupContentDirective, "ng-template[yuwButtonGroupContent]", never, { "entryId": { "alias": "yuwButtonGroupContent"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
294
325
|
}
|
|
295
326
|
|
|
296
327
|
/**
|
|
@@ -3180,5 +3211,5 @@ declare const YUW_SIDEBAR_RAIL_PADDING = "22px";
|
|
|
3180
3211
|
declare const YUW_SIDEBAR_RAIL_ICON_SIZE = "20px";
|
|
3181
3212
|
declare const YUW_SIDEBAR_RAIL_WIDTH = "78px";
|
|
3182
3213
|
|
|
3183
|
-
export { DATATABLE_ALIGN_CLASS, YUW_PASSWORD_REVEAL_STATES, YUW_SIDEBAR_RAIL_ICON_SIZE, YUW_SIDEBAR_RAIL_PADDING, YUW_SIDEBAR_RAIL_WIDTH, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertDialogTriggerDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwButtonComponent,
|
|
3184
|
-
export type { YuwAlertDialogSizeDto, YuwAlertVariantDto, YuwAvatarGroupItemDto, YuwAvatarSizeDto, YuwBreadcrumbItemDto, YuwButtonGroupClickDto,
|
|
3214
|
+
export { DATATABLE_ALIGN_CLASS, YUW_PASSWORD_REVEAL_STATES, YUW_SIDEBAR_RAIL_ICON_SIZE, YUW_SIDEBAR_RAIL_PADDING, YUW_SIDEBAR_RAIL_WIDTH, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertDialogTriggerDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwButtonComponent, YuwButtonGroupComponent, YuwButtonGroupContentDirective, YuwCaptionDirective, YuwCardActionDirective, YuwCardContentDirective, YuwCardDescriptionDirective, YuwCardDirective, YuwCardFooterDirective, YuwCardHeaderDirective, YuwCardImports, YuwCardTitleDirective, YuwCheckboxComponent, YuwComboboxComponent, YuwComboboxItemDirective, YuwContextMenuCheckboxDirective, YuwContextMenuCheckboxIndicatorComponent, YuwContextMenuDirective, YuwContextMenuGroupDirective, YuwContextMenuImports, YuwContextMenuItemDirective, YuwContextMenuLabelDirective, YuwContextMenuRadioDirective, YuwContextMenuRadioIndicatorComponent, YuwContextMenuSeparatorDirective, YuwContextMenuShortcutDirective, YuwContextMenuSubDirective, YuwContextMenuSubIndicatorComponent, YuwContextMenuSubTriggerDirective, YuwContextMenuTriggerDirective, YuwDatatableComponent, YuwDatatablePaginationDirective, YuwDatatableRowSelect, YuwDatepickerComponent, YuwDialogCloseDirective, YuwDialogComponent, YuwDialogFooterDirective, YuwDialogImports, YuwDialogTriggerDirective, YuwEmptyContentDirective, YuwEmptyDescriptionDirective, YuwEmptyDirective, YuwEmptyHeaderDirective, YuwEmptyImports, YuwEmptyMediaDirective, YuwEmptyTitleDirective, YuwInputAddonImports, YuwInputComponent, YuwInputOtpComponent, YuwItemActionsDirective, YuwItemContentDirective, YuwItemDescriptionDirective, YuwItemDirective, YuwItemFooterDirective, YuwItemGroupDirective, YuwItemHeaderDirective, YuwItemImports, YuwItemMediaDirective, YuwItemSeparatorDirective, YuwItemTitleDirective, YuwLabel, YuwLeftAddonDirective, YuwPaginationComponent, YuwPasswordInputComponent, YuwPopoverComponent, YuwPopoverTriggerDirective, YuwRadioGroupComponent, YuwRightAddonDirective, YuwSearchInputComponent, YuwSheetCloseDirective, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetImports, YuwSheetTriggerDirective, YuwSidebarComponent, YuwSidebarContentDirective, YuwSidebarContentExtraDirective, YuwSidebarFooterDirective, YuwSidebarFooterExtraDirective, YuwSidebarGroupContentDirective, YuwSidebarGroupDirective, YuwSidebarGroupLabelDirective, YuwSidebarHeaderDirective, YuwSidebarInsetDirective, YuwSidebarMenuBadgeDirective, YuwSidebarMenuButtonDirective, YuwSidebarMenuDirective, YuwSidebarMenuItemDirective, YuwSidebarMenuSubButtonDirective, YuwSidebarMenuSubDirective, YuwSidebarMenuSubItemDirective, YuwSidebarRailDirective, YuwSidebarRailService, YuwSidebarSeparatorDirective, YuwSidebarSubmenuService, YuwSidebarTriggerComponent, YuwSidebarWrapperDirective, YuwSkeletonDirective, YuwSpinnerComponent, YuwSwitchComponent, YuwTBodyDirective, YuwTFootDirective, YuwTHeadDirective, YuwTabPanelDirective, YuwTableContainerDirective, YuwTableDirective, YuwTableImports, YuwTabsComponent, YuwTdDirective, YuwTextareaComponent, YuwThDirective, YuwToasterComponent, YuwTooltipDirective, YuwTrDirective, YuwValueAccessorBase, buildInputOtpGroups, cn, datatableCellVariants, datatableContainerVariants, datatableHeadVariants, datatableHeaderCellVariants, datatableRowVariants, getPaginationRange, provideValueAccessor, totalInputOtpLength };
|
|
3215
|
+
export type { YuwAlertDialogSizeDto, YuwAlertVariantDto, YuwAvatarGroupItemDto, YuwAvatarSizeDto, YuwBreadcrumbItemDto, YuwButtonGroupClickDto, YuwButtonGroupItemDto, YuwColorDto, YuwComboboxItemContext, YuwComboboxOptionDto, YuwComboboxValue, YuwDatatableAlign, YuwDatatableAppearanceDto, YuwDatatableColumnDef, YuwDatepickerModeDto, YuwDatepickerValue, YuwFieldSizeDto, YuwInputModeDto, YuwInputOtpGroupDto, YuwInputOtpModeDto, YuwInputTypeDto, YuwPaginationRangeItem, YuwPaginationSizeDto, YuwPasswordRevealStateDto, YuwPopoverAlignDto, YuwRadioOptionDto, YuwSearchInputCollapseFromDto, YuwSheetScrollStrategyDto, YuwSheetSideDto, YuwSidebarCollapsibleDto, YuwSidebarContentDto, YuwSidebarGroupDto, YuwSidebarItemClickDto, YuwSidebarItemDto, YuwSidebarSideDto, YuwSidebarSubItemDto, YuwSidebarVariantDto, YuwSwitchSizeDto, YuwTabItemDto, YuwTabsActivationModeDto, YuwTabsOrientationDto, YuwTabsVariantDto, YuwTextFieldContract, YuwToasterPositionDto, YuwToasterThemeDto, YuwTooltipPositionDto };
|