@kraft.stitch/angular 0.0.3 → 0.0.4-beta.2

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/package.json CHANGED
@@ -1,17 +1,27 @@
1
1
  {
2
2
  "name": "@kraft.stitch/angular",
3
- "version": "0.0.3",
3
+ "version": "0.0.4-beta.2",
4
4
  "description": "Hand-written Angular wrapper for the <ks-button> Stencil custom element from @kraft.stitch/core — proof-of-concept for the WebComponents wrapper pattern (core in Stencil, framework-idiomatic Input/Output/DI in the wrapper).",
5
5
  "license": "MIT",
6
- "main": "src/public-api.ts",
7
- "types": "src/public-api.ts",
6
+ "keywords": [
7
+ "ks-ui",
8
+ "kraft-stitch",
9
+ "ui",
10
+ "ui-components",
11
+ "component-library",
12
+ "design-system",
13
+ "web-components",
14
+ "stencil",
15
+ "angular",
16
+ "react"
17
+ ],
8
18
  "peerDependencies": {
9
19
  "@angular/core": "^21.2.0 || ^22.0.0",
10
20
  "@angular/common": "^21.2.0 || ^22.0.0",
11
21
  "@angular/forms": "^21.2.0 || ^22.0.0"
12
22
  },
13
23
  "dependencies": {
14
- "@kraft.stitch/core": "^0.0.2",
24
+ "@kraft.stitch/core": "^0.0.3",
15
25
  "tslib": "^2.3.0"
16
26
  },
17
27
  "sideEffects": false,
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ElementRef } from '@angular/core';
3
- import { KsVariant, KsBaseSize, KsBaseVariant, KsSize, Palette, ThemeMode, KsPosition, LoaderStateEnum, KsToastPosition } from '@kraft.stitch/core';
4
- export { KsToast, KsToastPosition, toastStore } from '@kraft.stitch/core';
3
+ import { KsVariant, KsBaseSize, KsBaseVariant, KsSize, Palette, ThemeMode, KsRollingGrouping, KsRollingDirection, KsRollingDesign, KsTextTone, KsPosition, LoaderStateEnum, KsToastPosition } from '@kraft.stitch/core';
4
+ export { KsRollingDesign, KsRollingDirection, KsRollingGrouping, KsToast, KsToastPosition, toastStore } from '@kraft.stitch/core';
5
5
  import { ControlValueAccessor } from '@angular/forms';
6
6
 
7
7
  /** DOM shape of the real `<ks-button>` custom element, typed for the wrapper. */
@@ -320,6 +320,72 @@ declare class KsFabComponent {
320
320
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<KsFabComponent, "ks-fab", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "appendToParent": { "alias": "appendToParent"; "required": false; "isSignal": true; }; }, { "ksClick": "ksClick"; }, never, never, true, never>;
321
321
  }
322
322
 
323
+ /**
324
+ * Mirrors `KsSplitButtonItem` exported by
325
+ * `core/src/components/Buttons/split-button/split-button.tsx`. Duplicated
326
+ * locally — see the note in `button-group/button-group.ts` for why.
327
+ */
328
+ interface KsSplitButtonItem {
329
+ key: string;
330
+ label?: string;
331
+ /** Icon class string (e.g. ks-icon-pencil) */
332
+ icon?: string;
333
+ disabled?: boolean;
334
+ /** Renders the item in the danger colour */
335
+ destructive?: boolean;
336
+ /** Renders a divider line instead of an item */
337
+ separator?: boolean;
338
+ }
339
+ /** DOM shape of the real `<ks-split-button>` custom element, typed for the wrapper. */
340
+ type KsSplitButtonElement = HTMLElement & {
341
+ label: string;
342
+ icon: string;
343
+ variant: KsVariant;
344
+ size: KsBaseSize;
345
+ disabled: boolean;
346
+ items: KsSplitButtonItem[];
347
+ };
348
+ /**
349
+ * Angular wrapper around the `<ks-split-button>` Stencil custom element.
350
+ *
351
+ * Outputs are prefixed with `ks` (`ksClick`, `ksItemSelected`) instead of
352
+ * reusing the native event names `clicked` / `itemSelected` — see
353
+ * `button/button.ts` for why a same-named output would fire twice.
354
+ * `template: ''` — the wrapped Stencil `render()` has no `<slot>`.
355
+ *
356
+ * @example
357
+ * ```html
358
+ * <ks-split-button
359
+ * label="Save"
360
+ * [items]="items"
361
+ * (ksClick)="save()"
362
+ * (ksItemSelected)="onSelect($event)"
363
+ * ></ks-split-button>
364
+ * ```
365
+ */
366
+ declare class KsSplitButtonComponent {
367
+ private readonly el;
368
+ /** Main button label */
369
+ readonly label: _angular_core.InputSignal<string>;
370
+ /** Main button icon class */
371
+ readonly icon: _angular_core.InputSignal<string>;
372
+ /** Visual style variant */
373
+ readonly variant: _angular_core.InputSignal<KsVariant>;
374
+ /** Size */
375
+ readonly size: _angular_core.InputSignal<KsBaseSize>;
376
+ /** Disables both buttons */
377
+ readonly disabled: _angular_core.InputSignal<boolean>;
378
+ /** Menu entries */
379
+ readonly items: _angular_core.InputSignal<KsSplitButtonItem[]>;
380
+ /** Emits the `MouseEvent` when the main button is clicked. From the native `clicked` event. */
381
+ readonly ksClick: _angular_core.OutputEmitterRef<MouseEvent>;
382
+ /** Emits the selected item's `key`. From the native `itemSelected` event. */
383
+ readonly ksItemSelected: _angular_core.OutputEmitterRef<string>;
384
+ constructor(ref: ElementRef<KsSplitButtonElement>);
385
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KsSplitButtonComponent, never>;
386
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KsSplitButtonComponent, "ks-split-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; }, { "ksClick": "ksClick"; "ksItemSelected": "ksItemSelected"; }, never, never, true, never>;
387
+ }
388
+
323
389
  /** DOM shape of the real `<ks-datepicker>` custom element, typed for the wrapper. */
324
390
  type KsDatepickerElement = HTMLElement & {
325
391
  label: string;
@@ -1247,6 +1313,86 @@ declare class KsUploaderComponent {
1247
1313
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<KsUploaderComponent, "ks-uploader", never, { "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "previewImages": { "alias": "previewImages"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "ksFilesChange": "ksFilesChange"; "ksFilesRejected": "ksFilesRejected"; }, never, never, true, never>;
1248
1314
  }
1249
1315
 
1316
+ /**
1317
+ * DOM shape of the real `<ks-rolling-number>` custom element, typed for the wrapper.
1318
+ * `prefixText` / `suffixText` / `animated` are used on the element because
1319
+ * `prefix` and `animate` collide with native `Element` members.
1320
+ */
1321
+ type KsRollingNumberElement = HTMLElement & {
1322
+ value: number | string | bigint;
1323
+ prefixText: string;
1324
+ suffixText: string;
1325
+ startValue: number | string | bigint;
1326
+ decimals: number | null;
1327
+ separator: string;
1328
+ decimalSeparator: string;
1329
+ grouping: KsRollingGrouping;
1330
+ duration: number;
1331
+ delay: number;
1332
+ easing: string;
1333
+ stagger: number | null;
1334
+ spins: number;
1335
+ direction: KsRollingDirection;
1336
+ design: KsRollingDesign;
1337
+ size: KsSize;
1338
+ tone: KsTextTone;
1339
+ animated: boolean;
1340
+ label: string;
1341
+ };
1342
+ /**
1343
+ * Angular wrapper around the `<ks-rolling-number>` Stencil custom element.
1344
+ * Purely presentational — no events, no `<slot>`, plain inputs only.
1345
+ *
1346
+ * @example
1347
+ * ```html
1348
+ * <ks-rolling-number [value]="total()" prefix="$" [decimals]="2" design="finance" />
1349
+ * ```
1350
+ */
1351
+ declare class KsRollingNumberComponent {
1352
+ private readonly el;
1353
+ /** Target value. Use a string or bigint for numbers beyond 2^53 */
1354
+ readonly value: _angular_core.InputSignal<string | number | bigint>;
1355
+ /** Shown before the number ($, €, ₹ …) */
1356
+ readonly prefix: _angular_core.InputSignal<string>;
1357
+ /** Shown after the number (K, M, %, " users" …). Leading spaces are preserved */
1358
+ readonly suffix: _angular_core.InputSignal<string>;
1359
+ /** Value the reels roll from on first render */
1360
+ readonly startValue: _angular_core.InputSignal<string | number | bigint>;
1361
+ /** Fixed decimal places. Leave unset to infer from the value */
1362
+ readonly decimals: _angular_core.InputSignal<number>;
1363
+ /** Thousands separator. Empty string disables grouping */
1364
+ readonly separator: _angular_core.InputSignal<string>;
1365
+ /** Decimal separator */
1366
+ readonly decimalSeparator: _angular_core.InputSignal<string>;
1367
+ /** Digit grouping style (`indian` gives 12,34,567) */
1368
+ readonly grouping: _angular_core.InputSignal<KsRollingGrouping>;
1369
+ /** Total roll time in ms, including the cascade between digits */
1370
+ readonly duration: _angular_core.InputSignal<number>;
1371
+ /** Delay before rolling starts, in ms */
1372
+ readonly delay: _angular_core.InputSignal<number>;
1373
+ /** Any CSS easing. The default decelerates gently into place */
1374
+ readonly easing: _angular_core.InputSignal<string>;
1375
+ /** Gap in ms between neighbouring digits stopping. Unset = automatic */
1376
+ readonly stagger: _angular_core.InputSignal<number>;
1377
+ /** Extra full revolutions each reel makes on the first roll */
1378
+ readonly spins: _angular_core.InputSignal<number>;
1379
+ /** `auto` rolls up when the value grows and down when it shrinks */
1380
+ readonly direction: _angular_core.InputSignal<KsRollingDirection>;
1381
+ /** Visual style */
1382
+ readonly design: _angular_core.InputSignal<KsRollingDesign>;
1383
+ /** Size */
1384
+ readonly size: _angular_core.InputSignal<KsSize>;
1385
+ /** Text colour */
1386
+ readonly tone: _angular_core.InputSignal<KsTextTone>;
1387
+ /** Set false to skip animation entirely */
1388
+ readonly animate: _angular_core.InputSignal<boolean>;
1389
+ /** Accessible name. Defaults to the formatted value */
1390
+ readonly label: _angular_core.InputSignal<string>;
1391
+ constructor(ref: ElementRef<KsRollingNumberElement>);
1392
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KsRollingNumberComponent, never>;
1393
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KsRollingNumberComponent, "ks-rolling-number", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "startValue": { "alias": "startValue"; "required": false; "isSignal": true; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "decimalSeparator": { "alias": "decimalSeparator"; "required": false; "isSignal": true; }; "grouping": { "alias": "grouping"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "easing": { "alias": "easing"; "required": false; "isSignal": true; }; "stagger": { "alias": "stagger"; "required": false; "isSignal": true; }; "spins": { "alias": "spins"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "design": { "alias": "design"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "animate": { "alias": "animate"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1394
+ }
1395
+
1250
1396
  /** DOM shape of the real `<ks-avatar>` custom element, typed for the wrapper. */
1251
1397
  type KsAvatarElement = HTMLElement & {
1252
1398
  src: string;
@@ -2243,5 +2389,7 @@ declare class KsToastOutletComponent {
2243
2389
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<KsToastOutletComponent, "ks-toast-outlet", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
2244
2390
  }
2245
2391
 
2246
- export { KsAccordionComponent, KsAvatarComponent, KsBadgeComponent, KsBreadcrumbComponent, KsButtonComponent, KsButtonGroupComponent, KsCardComponent, KsCarouselComponent, KsCheckboxComponent, KsChipsComponent, KsCodeViewComponent, KsColourPickerComponent, KsContextMenuComponent, KsDatepickerComponent, KsDaterangeComponent, KsDialogComponent, KsDropdownComponent, KsFabComponent, KsInputComponent, KsListBoxComponent, KsLoaderComponent, KsMessageComponent, KsNavBarComponent, KsNotFoundComponent, KsOtpInputComponent, KsPaginationComponent, KsProgressComponent, KsRadioComponent, KsRatingComponent, KsSidebarComponent, KsSliderComponent, KsSpinnerComponent, KsStepperComponent, KsSwitchComponent, KsTabComponent, KsTableComponent, KsTextareaComponent, KsThemeSwitchComponent, KsTimepickerComponent, KsToastOutletComponent, KsToolbarComponent, KsTooltipComponent, KsTopNavBarComponent, KsTreeViewComponent, KsUploaderComponent };
2247
- export type { ActionButtonsConfig, KsAccordionItem, KsBreadcrumbItem, KsButtonGroupDisplayStyle, KsButtonGroupItem, KsCardVariant, KsCarouselSlide, KsCheckboxOption, KsChipOption, KsChipsValue, KsCodeViewLanguage, KsColourPickerVariant, KsContextMenuItem, KsContextMenuPosition, KsDateRange, KsDialogSize, KsDropdownOption, KsDropdownValue, KsFabAction, KsFabPosition, KsInputType, KsListBoxOption, KsListBoxValue, KsNavBarItem, KsNavBarMode, KsNavBarSection, KsNavBarSectionItem, KsPresetRange, KsRadioOption, KsSidebarPosition, KsSidebarType, KsStepItem, KsStepperOrientation, KsTabItem, KsTableSize, KsTableVariant, KsTimeValue, KsToolbarItem, KsTopNavBarItem, KsTopNavBarVariant, KsTreeNode, KsUploadedFile };
2392
+ declare function provideInBuildTheme(themeName: string, startUpMode: ThemeMode): _angular_core.EnvironmentProviders;
2393
+
2394
+ export { KsAccordionComponent, KsAvatarComponent, KsBadgeComponent, KsBreadcrumbComponent, KsButtonComponent, KsButtonGroupComponent, KsCardComponent, KsCarouselComponent, KsCheckboxComponent, KsChipsComponent, KsCodeViewComponent, KsColourPickerComponent, KsContextMenuComponent, KsDatepickerComponent, KsDaterangeComponent, KsDialogComponent, KsDropdownComponent, KsFabComponent, KsInputComponent, KsListBoxComponent, KsLoaderComponent, KsMessageComponent, KsNavBarComponent, KsNotFoundComponent, KsOtpInputComponent, KsPaginationComponent, KsProgressComponent, KsRadioComponent, KsRatingComponent, KsRollingNumberComponent, KsSidebarComponent, KsSliderComponent, KsSpinnerComponent, KsSplitButtonComponent, KsStepperComponent, KsSwitchComponent, KsTabComponent, KsTableComponent, KsTextareaComponent, KsThemeSwitchComponent, KsTimepickerComponent, KsToastOutletComponent, KsToolbarComponent, KsTooltipComponent, KsTopNavBarComponent, KsTreeViewComponent, KsUploaderComponent, provideInBuildTheme };
2395
+ export type { ActionButtonsConfig, KsAccordionItem, KsBreadcrumbItem, KsButtonGroupDisplayStyle, KsButtonGroupItem, KsCardVariant, KsCarouselSlide, KsCheckboxOption, KsChipOption, KsChipsValue, KsCodeViewLanguage, KsColourPickerVariant, KsContextMenuItem, KsContextMenuPosition, KsDateRange, KsDialogSize, KsDropdownOption, KsDropdownValue, KsFabAction, KsFabPosition, KsInputType, KsListBoxOption, KsListBoxValue, KsNavBarItem, KsNavBarMode, KsNavBarSection, KsNavBarSectionItem, KsPresetRange, KsRadioOption, KsSidebarPosition, KsSidebarType, KsSplitButtonItem, KsStepItem, KsStepperOrientation, KsTabItem, KsTableSize, KsTableVariant, KsTimeValue, KsToolbarItem, KsTopNavBarItem, KsTopNavBarVariant, KsTreeNode, KsUploadedFile };