Skip to content

Commit db17877

Browse files
committed
refactor: update imports and descriptions in Angular stories
- Consolidated import statements in forms.stories.ts and other story files to use the new design system paths. - Enhanced documentation in MDX files for various components, including Accordion, Dialog, and Form controls, to provide clearer descriptions and usage examples. - Added event binding examples for form controls in wrappers-form.stories.ts to demonstrate how to handle state changes. - Improved overall consistency and clarity in story descriptions across multiple components.
1 parent a180123 commit db17877

29 files changed

+513
-65
lines changed

packages/angular/package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"start": "wireit",
1818
"storybook": "wireit",
1919
"extract-templates": "wireit",
20-
"extract-templates:force": "node ../../scripts/extract-story-templates.js --force",
21-
"extract-templates:watch": "node ../../scripts/extract-story-templates.js --watch"
20+
"extract-templates:force": "wireit",
21+
"extract-templates:watch": "wireit"
2222
},
2323
"wireit": {
2424
"build": {
@@ -72,6 +72,16 @@
7272
"output": [
7373
"stories/generated/*.mdx"
7474
]
75+
},
76+
"extract-templates:force": {
77+
"command": "node ../../scripts/extract-story-templates.js --force",
78+
"output": [
79+
"stories/generated/*.mdx"
80+
]
81+
},
82+
"extract-templates:watch": {
83+
"command": "node ../../scripts/extract-story-templates.js --watch",
84+
"service": true
7585
}
7686
},
7787
"dependencies": {

packages/angular/src/forms/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from './checkbox-group.directive';
22
export * from './checkbox.directive';
3+
export * from './combobox.directive';
34
export * from './form-control-element.directive';
45
export * from './number-field.directive';
56
export * from './radio-group.directive';

packages/angular/stories/accordion.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747

4848
export const ExternalActions: StoryObj = {
4949
render: () => ({
50-
description: `There are scenarios where you want to be able to controle the state of the accordion with an external trigger, for example when the user selects an option elsewhere on the page.
50+
description: `There are scenarios where you want to be able to control the state of the accordion with an external trigger, for example when the user selects an option elsewhere on the page.
5151
5252
This example shows how to bind a boolean that exist in your angular component to the open state of the accordion item. It also shows how to update your boolean when the value is changed from within the accordion itself.`,
5353
template: '<sla-accordion-external-actions></sla-accordion-external-actions>'

packages/angular/stories/dialog-service.stories.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ export default {
225225
} as Meta;
226226

227227
export const DialogServiceExample: StoryFn = () => ({
228-
description: 'A button bar groups multiple buttons together.',
228+
description:
229+
'A simple example of using the DialogService to open a dialog. This works with any dialog. How you can create a dialog can be seen in the next example.<br/><br/>Note the <code>@Inject(DIALOG_DATA)</code> that is used to get the data passed to the dialog component.',
229230
template: '<sla-dialog-service></sla-dialog-service>'
230231
});
231232

packages/angular/stories/forms.stories.ts

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,34 @@ import {
88
ReactiveFormsModule,
99
type ValidationErrors
1010
} from '@angular/forms';
11+
import { ButtonComponent } from '@sl-design-system/angular/button';
12+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
13+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
14+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
15+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
16+
import {
17+
CheckboxDirective,
18+
CheckboxGroupDirective,
19+
ComboboxDirective,
20+
NumberFieldDirective,
21+
RadioGroupDirective,
22+
SelectDirective,
23+
SwitchDirective,
24+
TextAreaDirective,
25+
TextFieldDirective,
26+
TimeFieldDirective
27+
} from '@sl-design-system/angular/forms';
28+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
29+
import { OptionComponent } from '@sl-design-system/angular/listbox';
30+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
31+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
32+
import { SelectComponent } from '@sl-design-system/angular/select';
33+
import { SwitchComponent } from '@sl-design-system/angular/switch';
34+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
35+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
36+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
1137
import { Form } from '@sl-design-system/form';
1238
import { type Meta, type StoryFn, moduleMetadata } from '@storybook/angular';
13-
import { ButtonComponent } from '../src/button/button.component';
14-
import { ButtonBarComponent } from '../src/button-bar/button-bar.component';
15-
import { CheckboxGroupComponent } from '../src/checkbox/checkbox-group.component';
16-
import { CheckboxComponent } from '../src/checkbox/checkbox.component';
17-
import { ComboboxComponent } from '../src/combobox/combobox.component';
18-
import { FormFieldComponent } from '../src/form/form-field.component';
19-
import { FormComponent } from '../src/form/form.component';
20-
import { CheckboxGroupDirective } from '../src/forms/checkbox-group.directive';
21-
import { CheckboxDirective } from '../src/forms/checkbox.directive';
22-
import { ComboboxDirective } from '../src/forms/combobox-directive';
23-
import { NumberFieldDirective } from '../src/forms/number-field.directive';
24-
import { RadioGroupDirective } from '../src/forms/radio-group.directive';
25-
import { SelectDirective } from '../src/forms/select.directive';
26-
import { SwitchDirective } from '../src/forms/switch.directive';
27-
import { TextAreaDirective } from '../src/forms/text-area.directive';
28-
import { TextFieldDirective } from '../src/forms/text-field.directive';
29-
import { TimeFieldDirective } from '../src/forms/time-field.directive';
30-
import { InlineMessageComponent } from '../src/inline-message/inline-message.component';
31-
import { OptionComponent } from '../src/listbox/option.component';
32-
import { NumberFieldComponent } from '../src/number-field/number-field.component';
33-
import { RadioGroupComponent } from '../src/radio-group/radio-group.component';
34-
import { RadioComponent } from '../src/radio-group/radio.component';
35-
import { SelectComponent } from '../src/select/select.component';
36-
import { SwitchComponent } from '../src/switch/switch.component';
37-
import { TextAreaComponent } from '../src/text-area/text-area.component';
38-
import { TextFieldComponent } from '../src/text-field/text-field.component';
39-
import { TimeFieldComponent } from '../src/time-field/time-field.component';
4039

4140
@Component({
4241
selector: 'sla-all-form-controls-reactive',

packages/angular/stories/generated/accordion.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ To add custom introduction content, create accordion.intro.md */}
1111

1212
## External Actions
1313

14-
There are scenarios where you want to be able to controle the state of the accordion with an external trigger, for example when the user selects an option elsewhere on the page.
14+
There are scenarios where you want to be able to control the state of the accordion with an external trigger, for example when the user selects an option elsewhere on the page.
1515

1616
This example shows how to bind a boolean that exist in your angular component to the open state of the accordion item. It also shows how to update your boolean when the value is changed from within the accordion itself.
1717

1818

1919
```typescript
20+
import { AccordionComponent } from '@sl-design-system/angular/accordion';
21+
import { ButtonComponent } from '@sl-design-system/angular/button';
22+
2023
@Component({
2124
selector: 'sla-accordion-external-actions',
2225
template: `<sl-button (click)="this.onClick('dino')">Toggle 🦖</sl-button>

packages/angular/stories/generated/dialog-service.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ To add custom introduction content, create dialog-service.intro.md */}
1111

1212
## Dialog Service Example
1313

14-
A button bar groups multiple buttons together.
14+
A simple example of using the DialogService to open a dialog. This works with any dialog. How you can create a dialog can be seen in the next example.<br/><br/>Note the <code>@Inject(DIALOG_DATA)</code> that is used to get the data passed to the dialog component.
1515

1616

1717
```typescript
18+
import { ButtonComponent } from '../src/button/button.component';
19+
import { DialogComponent } from '../src/dialog/dialog.component';
20+
import { FormFieldComponent } from '../src/form/form-field.component';
21+
import { FormComponent } from '../src/form/form.component';
22+
import { TextAreaDirective } from '../src/forms/text-area.directive';
23+
import { TextFieldDirective } from '../src/forms/text-field.directive';
24+
import { DialogRef, DialogService } from '../src/services/dialog.service';
25+
import { TextAreaComponent } from '../src/text-area/text-area.component';
26+
import { TextFieldComponent } from '../src/text-field/text-field.component';
27+
1828
@Component({
1929
selector: 'sla-dialog-service',
2030
template: `<h3>Dialog Service examples</h3>
@@ -72,6 +82,16 @@ Example of using a form inside a dialog.
7282

7383

7484
```typescript
85+
import { ButtonComponent } from '../src/button/button.component';
86+
import { DialogComponent } from '../src/dialog/dialog.component';
87+
import { FormFieldComponent } from '../src/form/form-field.component';
88+
import { FormComponent } from '../src/form/form.component';
89+
import { TextAreaDirective } from '../src/forms/text-area.directive';
90+
import { TextFieldDirective } from '../src/forms/text-field.directive';
91+
import { DialogRef, DialogService } from '../src/services/dialog.service';
92+
import { TextAreaComponent } from '../src/text-area/text-area.component';
93+
import { TextFieldComponent } from '../src/text-field/text-field.component';
94+
7595
@Component({
7696
selector: 'sla-dialog-form',
7797
template: `<span slot="title">{{ data.title }}</span>

packages/angular/stories/generated/forms.mdx

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,34 @@ An example form that includes all form controls using reactive forms.
1515

1616

1717
```typescript
18+
import { ButtonComponent } from '@sl-design-system/angular/button';
19+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
20+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
21+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
22+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
23+
import {
24+
CheckboxDirective,
25+
CheckboxGroupDirective,
26+
ComboboxDirective,
27+
NumberFieldDirective,
28+
RadioGroupDirective,
29+
SelectDirective,
30+
SwitchDirective,
31+
TextAreaDirective,
32+
TextFieldDirective,
33+
TimeFieldDirective
34+
} from '@sl-design-system/angular/forms';
35+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
36+
import { OptionComponent } from '@sl-design-system/angular/listbox';
37+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
38+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
39+
import { SelectComponent } from '@sl-design-system/angular/select';
40+
import { SwitchComponent } from '@sl-design-system/angular/switch';
41+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
42+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
43+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
44+
import { Form } from '@sl-design-system/form';
45+
1846
@Component({
1947
selector: 'sla-all-form-controls-reactive',
2048
template: `<sl-form [formGroup]="formGroup">
@@ -140,6 +168,34 @@ An example form that includes all form controls using reactive forms with empty
140168

141169

142170
```typescript
171+
import { ButtonComponent } from '@sl-design-system/angular/button';
172+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
173+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
174+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
175+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
176+
import {
177+
CheckboxDirective,
178+
CheckboxGroupDirective,
179+
ComboboxDirective,
180+
NumberFieldDirective,
181+
RadioGroupDirective,
182+
SelectDirective,
183+
SwitchDirective,
184+
TextAreaDirective,
185+
TextFieldDirective,
186+
TimeFieldDirective
187+
} from '@sl-design-system/angular/forms';
188+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
189+
import { OptionComponent } from '@sl-design-system/angular/listbox';
190+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
191+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
192+
import { SelectComponent } from '@sl-design-system/angular/select';
193+
import { SwitchComponent } from '@sl-design-system/angular/switch';
194+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
195+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
196+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
197+
import { Form } from '@sl-design-system/form';
198+
143199
@Component({
144200
selector: 'sla-all-form-controls-empty-reactive',
145201
template: `<sl-form #form [formGroup]="formGroup">
@@ -277,6 +333,34 @@ An example form that includes all form controls using template-driven forms.
277333

278334

279335
```typescript
336+
import { ButtonComponent } from '@sl-design-system/angular/button';
337+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
338+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
339+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
340+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
341+
import {
342+
CheckboxDirective,
343+
CheckboxGroupDirective,
344+
ComboboxDirective,
345+
NumberFieldDirective,
346+
RadioGroupDirective,
347+
SelectDirective,
348+
SwitchDirective,
349+
TextAreaDirective,
350+
TextFieldDirective,
351+
TimeFieldDirective
352+
} from '@sl-design-system/angular/forms';
353+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
354+
import { OptionComponent } from '@sl-design-system/angular/listbox';
355+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
356+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
357+
import { SelectComponent } from '@sl-design-system/angular/select';
358+
import { SwitchComponent } from '@sl-design-system/angular/switch';
359+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
360+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
361+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
362+
import { Form } from '@sl-design-system/form';
363+
280364
@Component({
281365
selector: 'sla-all-form-controls-template',
282366
template: `<sl-form>
@@ -390,6 +474,34 @@ An example form that includes all form controls using template-driven forms with
390474

391475

392476
```typescript
477+
import { ButtonComponent } from '@sl-design-system/angular/button';
478+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
479+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
480+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
481+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
482+
import {
483+
CheckboxDirective,
484+
CheckboxGroupDirective,
485+
ComboboxDirective,
486+
NumberFieldDirective,
487+
RadioGroupDirective,
488+
SelectDirective,
489+
SwitchDirective,
490+
TextAreaDirective,
491+
TextFieldDirective,
492+
TimeFieldDirective
493+
} from '@sl-design-system/angular/forms';
494+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
495+
import { OptionComponent } from '@sl-design-system/angular/listbox';
496+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
497+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
498+
import { SelectComponent } from '@sl-design-system/angular/select';
499+
import { SwitchComponent } from '@sl-design-system/angular/switch';
500+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
501+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
502+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
503+
import { Form } from '@sl-design-system/form';
504+
393505
@Component({
394506
selector: 'sla-all-form-controls-empty-template',
395507
template: `<sl-form #form>
@@ -510,6 +622,34 @@ A simple login form example using reactive forms with custom validation.
510622

511623

512624
```typescript
625+
import { ButtonComponent } from '@sl-design-system/angular/button';
626+
import { ButtonBarComponent } from '@sl-design-system/angular/button-bar';
627+
import { CheckboxComponent, CheckboxGroupComponent } from '@sl-design-system/angular/checkbox';
628+
import { ComboboxComponent } from '@sl-design-system/angular/combobox';
629+
import { FormComponent, FormFieldComponent } from '@sl-design-system/angular/form';
630+
import {
631+
CheckboxDirective,
632+
CheckboxGroupDirective,
633+
ComboboxDirective,
634+
NumberFieldDirective,
635+
RadioGroupDirective,
636+
SelectDirective,
637+
SwitchDirective,
638+
TextAreaDirective,
639+
TextFieldDirective,
640+
TimeFieldDirective
641+
} from '@sl-design-system/angular/forms';
642+
import { InlineMessageComponent } from '@sl-design-system/angular/inline-message';
643+
import { OptionComponent } from '@sl-design-system/angular/listbox';
644+
import { NumberFieldComponent } from '@sl-design-system/angular/number-field';
645+
import { RadioComponent, RadioGroupComponent } from '@sl-design-system/angular/radio-group';
646+
import { SelectComponent } from '@sl-design-system/angular/select';
647+
import { SwitchComponent } from '@sl-design-system/angular/switch';
648+
import { TextAreaComponent } from '@sl-design-system/angular/text-area';
649+
import { TextFieldComponent } from '@sl-design-system/angular/text-field';
650+
import { TimeFieldComponent } from '@sl-design-system/angular/time-field';
651+
import { Form } from '@sl-design-system/form';
652+
513653
@Component({
514654
selector: 'sla-login-form',
515655
template: `<sl-form #form [formGroup]="formGroup">

packages/angular/stories/generated/routing.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ providers: [
2929

3030

3131
```typescript
32+
import { MenuComponent } from '../src/menu/menu.component';
33+
import { TabGroupComponent } from '../src/tabs/tab-group.component';
34+
import { TabComponent } from '../src/tabs/tab.component';
35+
3236
@Component({
3337
selector: 'sla-routing',
3438
template: `<sl-tab-group>

0 commit comments

Comments
 (0)