@ship-ui/core 0.18.4 → 0.18.5

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@ship-ui/core",
3
3
  "license": "MIT",
4
- "version": "0.18.4",
4
+ "version": "0.18.5",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20",
7
7
  "@angular/core": ">=20",
@@ -9,7 +9,7 @@
9
9
  "ShipIcon: With Options": {
10
10
  "prefix": "sh-icon-full",
11
11
  "body": [
12
- "<sh-icon [color]=\"${1|primary,accent,warn,error,success|}\" [variant]=\"${2|simple,outlined,flat,raised|}\" [size]=\"${3|small,large|}\">",
12
+ "<sh-icon [color]=\"${1|primary,accent,warn,error,success|}\" [size]=\"${2|small,large|}\">",
13
13
  " $0",
14
14
  "</sh-icon>"
15
15
  ],
@@ -152,7 +152,7 @@
152
152
  "ShipSelect: With Options": {
153
153
  "prefix": "sh-select-full",
154
154
  "body": [
155
- "<sh-select [readonly]=\"${1:false}\">",
155
+ "<sh-select [color]=\"${1|primary,accent,warn,error,success|}\" [variant]=\"${2|simple,outlined,flat,raised|}\" [size]=\"${3|small|}\" [readonly]=\"${4:false}\">",
156
156
  " $0",
157
157
  "</sh-select>"
158
158
  ],
@@ -188,6 +188,22 @@
188
188
  ],
189
189
  "description": "Basic usage of ShipThemeToggle"
190
190
  },
191
+ "ShipAccordion: Basic": {
192
+ "prefix": "sh-accordion",
193
+ "body": [
194
+ "<sh-accordion>$0</sh-accordion>"
195
+ ],
196
+ "description": "Basic usage of ShipAccordion"
197
+ },
198
+ "ShipAccordion: With Options": {
199
+ "prefix": "sh-accordion-full",
200
+ "body": [
201
+ "<sh-accordion [variant]=\"${1:null}\" [size]=\"${2:null}\">",
202
+ " $0",
203
+ "</sh-accordion>"
204
+ ],
205
+ "description": "Full usage of ShipAccordion with common options"
206
+ },
191
207
  "ShipToggleCard: Basic": {
192
208
  "prefix": "sh-toggle-card",
193
209
  "body": [
@@ -0,0 +1,83 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipAccordion: true !default;
4
+
5
+ @if $shipAccordion == true {
6
+ sh-accordion {
7
+ --acc-pad: #{p2r(16)};
8
+ --acc-f: var(--paragraph-30);
9
+ --acc-bc: var(--base-4);
10
+ --acc-s: var(--shape-2);
11
+
12
+ display: flex;
13
+ flex-direction: column;
14
+ border: 1px solid var(--acc-bc);
15
+ border-radius: var(--acc-s);
16
+ overflow: hidden;
17
+
18
+ &:empty {
19
+ display: none;
20
+ }
21
+
22
+ &.small {
23
+ --acc-pad: #{p2r(12)};
24
+ --acc-f: var(--paragraph-40);
25
+ }
26
+
27
+ details {
28
+ width: 100%;
29
+
30
+ // Hide standard browser marker
31
+ & > summary {
32
+ list-style: none;
33
+
34
+ &::-webkit-details-marker {
35
+ display: none;
36
+ }
37
+ }
38
+
39
+ summary {
40
+ display: flex;
41
+ align-items: center;
42
+ padding: var(--acc-pad);
43
+ cursor: pointer;
44
+ user-select: none;
45
+ transition: background-color 0.2s;
46
+ font-weight: 500;
47
+ font-size: var(--acc-f);
48
+ border-bottom: 1px solid var(--acc-bc);
49
+
50
+ &:focus-visible {
51
+ outline: 2px solid var(--primary-8);
52
+ outline-offset: -2px;
53
+ border-radius: var(--acc-s);
54
+ }
55
+
56
+ sh-icon {
57
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
58
+ color: var(--mono-11);
59
+ margin-left: auto;
60
+ }
61
+ }
62
+
63
+ &[open] {
64
+ summary {
65
+ border-bottom: 1px solid var(--acc-bc);
66
+
67
+ sh-icon {
68
+ transform: rotate(180deg);
69
+ }
70
+ }
71
+
72
+ + details {
73
+ border-top: 1px solid var(--acc-bc);
74
+ }
75
+ }
76
+
77
+ > .content {
78
+ padding: var(--acc-pad);
79
+ background: var(--base-2);
80
+ }
81
+ }
82
+ }
83
+ }
@@ -369,6 +369,27 @@ $shipFormFieldShadow: false !default;
369
369
  &.success {
370
370
  --ff-ic: var(--success-8);
371
371
  }
372
+
373
+ &.horizontal {
374
+ display: grid;
375
+ grid-template-columns: auto 1fr;
376
+ align-items: center;
377
+ gap: 0 p2r(16);
378
+
379
+ label {
380
+ padding-bottom: 0;
381
+ margin-bottom: 0;
382
+ grid-column: 1;
383
+ }
384
+
385
+ .input-wrap {
386
+ grid-column: 2;
387
+ }
388
+
389
+ .helpers {
390
+ grid-column: 2;
391
+ }
392
+ }
372
393
  }
373
394
  }
374
395
 
package/styles/index.scss CHANGED
@@ -50,6 +50,7 @@ $shipToggleCard: true !default;
50
50
  $shipTable: true !default;
51
51
  $shipTabs: true !default;
52
52
  $shipFileUpload: true !default;
53
+ $shipAccordion: true !default;
53
54
 
54
55
  @use './components/ship-alert-container.scss' with (
55
56
  $shipAlert: $shipAlert
@@ -160,3 +161,6 @@ $shipFileUpload: true !default;
160
161
  @use './components/ship-file-upload.scss' with (
161
162
  $shipFileUpload: $shipFileUpload
162
163
  );
164
+ @use './components/ship-accordion.scss' with (
165
+ $shipAccordion: $shipAccordion
166
+ );
@@ -493,15 +493,29 @@ declare class ShipFormField {
493
493
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipFormField, "sh-form-field", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, {}, never, ["label", "[boxPrefix]", "[prefix]", "[textPrefix]", "input", "textarea", "[textSuffix]", "[suffix]", "[boxSuffix]", "[error]", "[hint]"], true, never>;
494
494
  }
495
495
 
496
+ declare class ShipAccordion {
497
+ private selfElement;
498
+ readonly name: _angular_core.InputSignal<string>;
499
+ readonly value: _angular_core.ModelSignal<string | null>;
500
+ readonly allowMultiple: _angular_core.InputSignal<boolean>;
501
+ readonly variant: _angular_core.InputSignal<"outlined" | "flat" | "base" | null>;
502
+ readonly size: _angular_core.InputSignal<string | null>;
503
+ hostClasses: _angular_core.Signal<string>;
504
+ protected items: _angular_core.Signal<HTMLDetailsElement[]>;
505
+ constructor();
506
+ onToggle(event: Event): void;
507
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShipAccordion, never>;
508
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipAccordion, "sh-accordion", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "allowMultiple": { "alias": "allowMultiple"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["*"], true, never>;
509
+ }
510
+
496
511
  declare class ShipIcon implements AfterContentInit {
497
512
  #private;
498
513
  color: _angular_core.InputSignal<ShipColor | null>;
499
- variant: _angular_core.InputSignal<ShipSheetVariant | null>;
500
514
  size: _angular_core.InputSignal<ShipIconSize | null>;
501
515
  hostClasses: _angular_core.Signal<string>;
502
516
  ngAfterContentInit(): void;
503
517
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShipIcon, never>;
504
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipIcon, "sh-icon", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
518
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipIcon, "sh-icon", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
505
519
  }
506
520
 
507
521
  declare class ShipList {
@@ -642,6 +656,9 @@ declare class ShipSelect {
642
656
  value: _angular_core.InputSignal<string | undefined>;
643
657
  label: _angular_core.InputSignal<string | undefined>;
644
658
  asFreeText: _angular_core.InputSignal<boolean>;
659
+ color: _angular_core.InputSignal<ShipColor | null>;
660
+ variant: _angular_core.InputSignal<ShipSheetVariant | null>;
661
+ size: _angular_core.InputSignal<ShipSize | null>;
645
662
  optionTitle: _angular_core.InputSignal<string | null>;
646
663
  freeTextTitle: _angular_core.InputSignal<string | null>;
647
664
  freeTextPlaceholder: _angular_core.InputSignal<string | null>;
@@ -649,6 +666,7 @@ declare class ShipSelect {
649
666
  placeholder: _angular_core.InputSignal<string | undefined>;
650
667
  readonly: _angular_core.ModelSignal<boolean>;
651
668
  disabled: _angular_core.ModelSignal<boolean>;
669
+ hostClasses: _angular_core.Signal<string>;
652
670
  lazySearch: _angular_core.InputSignal<boolean>;
653
671
  inlineSearch: _angular_core.InputSignal<boolean>;
654
672
  asText: _angular_core.InputSignal<boolean>;
@@ -686,7 +704,7 @@ declare class ShipSelect {
686
704
  inputValueEffect: _angular_core.EffectRef;
687
705
  inputRefElEffect: _angular_core.EffectRef;
688
706
  selectedLabels: _angular_core.Signal<string>;
689
- inputState: _angular_core.Signal<"closed" | "selected" | "loading" | "open-searching" | "open" | "searching">;
707
+ inputState: _angular_core.Signal<"open" | "closed" | "selected" | "loading" | "open-searching" | "searching">;
690
708
  hasSearch: _angular_core.Signal<boolean>;
691
709
  ngOnInit(): void;
692
710
  setInitInput(): void;
@@ -704,7 +722,7 @@ declare class ShipSelect {
704
722
  updateInputElValue(): void;
705
723
  ngOnDestroy(): void;
706
724
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShipSelect, never>;
707
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipSelect, "sh-select", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "asFreeText": { "alias": "asFreeText"; "required": false; "isSignal": true; }; "optionTitle": { "alias": "optionTitle"; "required": false; "isSignal": true; }; "freeTextTitle": { "alias": "freeTextTitle"; "required": false; "isSignal": true; }; "freeTextPlaceholder": { "alias": "freeTextPlaceholder"; "required": false; "isSignal": true; }; "validateFreeText": { "alias": "validateFreeText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "lazySearch": { "alias": "lazySearch"; "required": false; "isSignal": true; }; "inlineSearch": { "alias": "inlineSearch"; "required": false; "isSignal": true; }; "asText": { "alias": "asText"; "required": false; "isSignal": true; }; "isClearable": { "alias": "isClearable"; "required": false; "isSignal": true; }; "selectMultiple": { "alias": "selectMultiple"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; "isSignal": true; }; "selectedOptionTemplate": { "alias": "selectedOptionTemplate"; "required": false; "isSignal": true; }; "placeholderTemplate": { "alias": "placeholderTemplate"; "required": false; "isSignal": true; }; "freeTextOptionTemplate": { "alias": "freeTextOptionTemplate"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "selectedOptions": { "alias": "selectedOptions"; "required": false; "isSignal": true; }; }, { "readonly": "readonlyChange"; "disabled": "disabledChange"; "isOpen": "isOpenChange"; "isLoading": "isLoadingChange"; "options": "optionsChange"; "selectedOptions": "selectedOptionsChange"; "cleared": "cleared"; "onAddNewFreeTextOption": "onAddNewFreeTextOption"; }, ["inlineTemplate"], ["label", "[prefix]", "[boxPrefix]", "input", "textarea"], true, never>;
725
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipSelect, "sh-select", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "asFreeText": { "alias": "asFreeText"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "optionTitle": { "alias": "optionTitle"; "required": false; "isSignal": true; }; "freeTextTitle": { "alias": "freeTextTitle"; "required": false; "isSignal": true; }; "freeTextPlaceholder": { "alias": "freeTextPlaceholder"; "required": false; "isSignal": true; }; "validateFreeText": { "alias": "validateFreeText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "lazySearch": { "alias": "lazySearch"; "required": false; "isSignal": true; }; "inlineSearch": { "alias": "inlineSearch"; "required": false; "isSignal": true; }; "asText": { "alias": "asText"; "required": false; "isSignal": true; }; "isClearable": { "alias": "isClearable"; "required": false; "isSignal": true; }; "selectMultiple": { "alias": "selectMultiple"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; "isSignal": true; }; "selectedOptionTemplate": { "alias": "selectedOptionTemplate"; "required": false; "isSignal": true; }; "placeholderTemplate": { "alias": "placeholderTemplate"; "required": false; "isSignal": true; }; "freeTextOptionTemplate": { "alias": "freeTextOptionTemplate"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "selectedOptions": { "alias": "selectedOptions"; "required": false; "isSignal": true; }; }, { "readonly": "readonlyChange"; "disabled": "disabledChange"; "isOpen": "isOpenChange"; "isLoading": "isLoadingChange"; "options": "optionsChange"; "selectedOptions": "selectedOptionsChange"; "cleared": "cleared"; "onAddNewFreeTextOption": "onAddNewFreeTextOption"; }, ["inlineTemplate"], ["label", "[prefix]", "[boxPrefix]", "input", "textarea"], true, never>;
708
726
  }
709
727
 
710
728
  type ShipSidenavType = 'overlay' | 'simple' | '';
@@ -1019,6 +1037,10 @@ interface ShipConfig {
1019
1037
  icon?: ShipComponentConfig;
1020
1038
  stepper?: ShipComponentConfig;
1021
1039
  select?: ShipComponentConfig;
1040
+ accordion?: ShipComponentConfig;
1041
+ tabs?: ShipComponentConfig;
1042
+ 'event-card'?: ShipComponentConfig;
1043
+ datepicker?: ShipComponentConfig;
1022
1044
  alertVariant?: '' | 'simple' | 'outlined' | 'flat' | 'raised';
1023
1045
  cardType?: '' | 'type-b' | 'type-c';
1024
1046
  dialogType?: 'type-b';
@@ -1026,5 +1048,5 @@ interface ShipConfig {
1026
1048
  sidenavType?: 'overlay' | 'simple';
1027
1049
  }
1028
1050
 
1029
- export { GridSortable, SHIP_CONFIG, ShipAlert, ShipAlertContainer, ShipAlertModule, ShipAlertService, ShipBlueprint, ShipButton, ShipButtonGroup, ShipCard, ShipCheckbox, ShipChip, ShipColorPicker, ShipDatepicker, ShipDatepickerInput, ShipDaterangeInput, ShipDialog, ShipDialogService, ShipDivider, ShipEventCard, ShipFileDragDrop, ShipFileUpload, ShipFormField, ShipFormFieldExperimental, ShipIcon, ShipInputMask, ShipList, ShipMenu, ShipPopover, ShipPreventWheel, ShipProgressBar, ShipRadio, ShipRangeSlider, ShipResize, ShipSelect, ShipSidenav, ShipSort, ShipSortable, ShipSpinner, ShipStepper, ShipStickyColumns, ShipTable, ShipTabs, ShipThemeToggle, ShipToggle, ShipToggleCard, ShipTooltip, ShipTooltipWrapper, ShipVirtualScroll, TEST_NODES, moveIndex, watchHostClass };
1051
+ export { GridSortable, SHIP_CONFIG, ShipAccordion, ShipAlert, ShipAlertContainer, ShipAlertModule, ShipAlertService, ShipBlueprint, ShipButton, ShipButtonGroup, ShipCard, ShipCheckbox, ShipChip, ShipColorPicker, ShipDatepicker, ShipDatepickerInput, ShipDaterangeInput, ShipDialog, ShipDialogService, ShipDivider, ShipEventCard, ShipFileDragDrop, ShipFileUpload, ShipFormField, ShipFormFieldExperimental, ShipIcon, ShipInputMask, ShipList, ShipMenu, ShipPopover, ShipPreventWheel, ShipProgressBar, ShipRadio, ShipRangeSlider, ShipResize, ShipSelect, ShipSidenav, ShipSort, ShipSortable, ShipSpinner, ShipStepper, ShipStickyColumns, ShipTable, ShipTabs, ShipThemeToggle, ShipToggle, ShipToggleCard, ShipTooltip, ShipTooltipWrapper, ShipVirtualScroll, TEST_NODES, moveIndex, watchHostClass };
1030
1052
  export type { AfterDropResponse, BlueprintNode, ComponentClosedType, ComponentDataType, Coordinates, Exact, ShipAlertItem, ShipAlertItemInternal, ShipAlertType, ShipButtonGroupVariant, ShipButtonSize, ShipCardVariant, ShipChipConfig, ShipColor, ShipComponentConfig, ShipConfig, ShipDialogInstance, ShipDialogOptions, ShipDialogServiceOptions, ShipDialogTemplateInstance, ShipIconSize, ShipPopoverOptions, ShipProgressBarMode, ShipSheetVariant, ShipSidenavType, ShipSize, ShipTableVariant, ShipTypeVariant, ShipVariant };