ember-freestyle 0.18.0 → 0.20.0

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/addon/components/freestyle/usage/component-like/control/index.hbs +12 -0
  3. package/addon/components/freestyle/usage/component-like/control/index.ts +21 -0
  4. package/addon/components/freestyle/usage/component-like/index.hbs +14 -0
  5. package/addon/components/freestyle/usage/component-like/index.ts +17 -0
  6. package/addon/components/freestyle/usage/index.hbs +1 -0
  7. package/addon/components/freestyle/usage/index.ts +4 -3
  8. package/addon/components/freestyle-collection/index.ts +1 -1
  9. package/addon/components/freestyle-dynamic/index.ts +2 -2
  10. package/addon/components/freestyle-palette/index.ts +1 -1
  11. package/addon/components/freestyle-section/index.ts +1 -1
  12. package/addon/components/freestyle-source/index.ts +3 -3
  13. package/addon/components/freestyle-subsection/index.ts +1 -1
  14. package/addon/decorators/css-variable.ts +7 -7
  15. package/addon/glint.ts +5 -0
  16. package/addon/utils/css-rules.ts +3 -3
  17. package/app/components/freestyle/usage/component-like/control.js +1 -0
  18. package/app/components/freestyle/usage/component-like.js +1 -0
  19. package/app/styles/components/freestyle-collection.scss +2 -1
  20. package/app/styles/components/freestyle-guide.scss +2 -1
  21. package/app/styles/components/freestyle-menu.scss +9 -4
  22. package/app/styles/components/freestyle-section.scss +0 -1
  23. package/app/styles/components/freestyle-subsection.scss +0 -1
  24. package/app/styles/components/freestyle-usage-controls.scss +2 -1
  25. package/components/freestyle/usage/component-like/control/index.d.ts +13 -0
  26. package/components/freestyle/usage/component-like/index.d.ts +15 -0
  27. package/components/freestyle/usage/index.d.ts +2 -1
  28. package/glint.d.ts +5 -0
  29. package/lib/ast-transform.js +4 -4
  30. package/package.json +25 -20
  31. package/types/ember-truth-helpers/helpers/and.d.ts +1 -1
  32. package/types/ember-truth-helpers/helpers/or.d.ts +1 -1
  33. package/vendor/ember-freestyle.css +9 -6
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
5
 
6
+
7
+
8
+ ## v0.20.0 (2023-10-07)
9
+
10
+ #### :rocket: Enhancement
11
+ * [#973](https://github.com/chrislopresto/ember-freestyle/pull/973) Eliminate uppercase'ing of menu items and update menu item hover state ([@lukemelia](https://github.com/lukemelia))
12
+
13
+ #### Committers: 1
14
+ - Luke Melia ([@lukemelia](https://github.com/lukemelia))
15
+
16
+ ## v0.19.0 (2023-09-28)
17
+
18
+ #### :boom: Breaking Change
19
+ * [#957](https://github.com/chrislopresto/ember-freestyle/pull/957) Add `@ember/string` as a peer dependency ([@bertdeblock](https://github.com/bertdeblock))
20
+
21
+ #### :rocket: Enhancement
22
+ * [#963](https://github.com/chrislopresto/ember-freestyle/pull/963) Add an Api type to Freestyle::Usage for when you expect a component as argument ([@lukemelia](https://github.com/lukemelia))
23
+
24
+ #### :bug: Bug Fix
25
+ * [#957](https://github.com/chrislopresto/ember-freestyle/pull/957) Add `@ember/string` as a peer dependency ([@bertdeblock](https://github.com/bertdeblock))
26
+
27
+ #### Committers: 2
28
+ - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
29
+ - Luke Melia ([@lukemelia](https://github.com/lukemelia))
30
+
6
31
  ## v0.18.0 (2023-07-18)
7
32
 
8
33
  #### :rocket: Enhancement
@@ -0,0 +1,12 @@
1
+ {{! template-lint-disable require-input-label }}
2
+
3
+ {{#if @options}}
4
+ <select {{on 'change' this.callOnChange}}>
5
+ {{#each @options as |componentLike|}}
6
+ <option
7
+ value={{componentLike.name}}
8
+ selected={{eq componentLike.name @value.name}}
9
+ >{{componentLike.name}}</option>
10
+ {{/each}}
11
+ </select>
12
+ {{/if}}
@@ -0,0 +1,21 @@
1
+ import Component from '@glimmer/component';
2
+ import { action } from '@ember/object';
3
+ import type { ComponentLike } from '@glint/template';
4
+
5
+ interface Signature {
6
+ Args: {
7
+ value?: ComponentLike;
8
+ onChange: (c: ComponentLike | undefined) => void;
9
+ options?: ComponentLike[];
10
+ };
11
+ }
12
+ export default class FreestyleUsageComponentLikeControlComponent extends Component<Signature> {
13
+ @action
14
+ callOnChange(event: InputEvent): void {
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ const eventTarget = event.target as any;
17
+ const componentName = eventTarget?.value;
18
+ const value = this.args.options?.find((c) => c.name === componentName);
19
+ this.args.onChange(value);
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ <Freestyle::Usage::Argument
2
+ @type="ComponentLike"
3
+ @name={{@name}}
4
+ @description={{@description}}
5
+ @required={{@required}}
6
+ @defaultValue={{@defaultValue}}
7
+ @hideControls={{@hideControls}}
8
+ >
9
+ <Freestyle::Usage::ComponentLike::Control
10
+ @options={{@options}}
11
+ @value={{@value}}
12
+ @onChange={{@onChange}}
13
+ />
14
+ </Freestyle::Usage::Argument>
@@ -0,0 +1,17 @@
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
+ import type { ComponentLike } from '@glint/template';
3
+
4
+ interface Signature {
5
+ Args: {
6
+ name?: string;
7
+ description?: string;
8
+ required?: boolean;
9
+ defaultValue?: ComponentLike;
10
+ hideControls?: boolean;
11
+ value?: ComponentLike;
12
+ options?: ComponentLike[];
13
+ onChange: (val: ComponentLike | null | undefined) => void;
14
+ };
15
+ }
16
+ const FreestyleUsageComponentLikeComponent = templateOnlyComponent<Signature>();
17
+ export default FreestyleUsageComponentLikeComponent;
@@ -46,6 +46,7 @@
46
46
  Number=(component 'freestyle/usage/number')
47
47
  Object=(component 'freestyle/usage/object')
48
48
  String=(component 'freestyle/usage/string')
49
+ Component=(component 'freestyle/usage/component-like')
49
50
  Action=(component 'freestyle/usage/argument' type="Action")
50
51
  Yield=(component 'freestyle/usage/argument' type="Yield")
51
52
  )
@@ -20,20 +20,21 @@ interface Signature {
20
20
  example: [];
21
21
  api: [
22
22
  {
23
+ Action: any;
23
24
  Array: any;
24
25
  Base: any;
25
26
  Bool: any;
27
+ Component: any;
26
28
  Number: any;
27
29
  Object: any;
28
30
  String: any;
29
- Action: any;
30
31
  Yield: any;
31
- }
32
+ },
32
33
  ];
33
34
  cssVars: [
34
35
  {
35
36
  Basic: any;
36
- }
37
+ },
37
38
  ];
38
39
  };
39
40
  }
@@ -20,7 +20,7 @@ interface Signature {
20
20
  };
21
21
  Blocks: {
22
22
  default: [
23
- { variant: WithBoundArgs<typeof FreestyleVariant, 'collection'> }
23
+ { variant: WithBoundArgs<typeof FreestyleVariant, 'collection'> },
24
24
  ];
25
25
  };
26
26
  }
@@ -46,7 +46,7 @@ export default class FreestyleDynamic extends Component<Signature> {
46
46
  if (this.args.dynamicProperties) {
47
47
  assert(
48
48
  `dynamicProperties passed into freestyle-dynamic must be an object. You passed: ${this.args.dynamicProperties}`,
49
- typeof this.args.dynamicProperties === 'object'
49
+ typeof this.args.dynamicProperties === 'object',
50
50
  );
51
51
  this._dynamicProperties = this.args.dynamicProperties;
52
52
  }
@@ -63,7 +63,7 @@ export default class FreestyleDynamic extends Component<Signature> {
63
63
  Object.keys(dynamicProperties).forEach((propertyName) => {
64
64
  dynamicPropertyValues[propertyName] = get(
65
65
  dynamicProperties,
66
- `${propertyName}.value`
66
+ `${propertyName}.value`,
67
67
  ) as SupportedValue;
68
68
  });
69
69
  return dynamicPropertyValues;
@@ -36,7 +36,7 @@ export default class FreestylePalette extends Component<Signature> {
36
36
  return A(
37
37
  Object.keys(colorPalette).map((k) => {
38
38
  return colorPalette[k];
39
- })
39
+ }),
40
40
  );
41
41
  }
42
42
  }
@@ -12,7 +12,7 @@ interface Signature {
12
12
  };
13
13
  Blocks: {
14
14
  default: [
15
- { subsection: WithBoundArgs<typeof FreestyleSubsection, 'section'> }
15
+ { subsection: WithBoundArgs<typeof FreestyleSubsection, 'section'> },
16
16
  ];
17
17
  };
18
18
  }
@@ -42,15 +42,15 @@ export default class FreestyleSource extends Component<Signature> {
42
42
  // First, replace in-block dynamic properties
43
43
  sourceCode = sourceCode.replace(
44
44
  `={{dynamic.${property}}}`,
45
- `=${angleAssignmentVal}`
45
+ `=${angleAssignmentVal}`,
46
46
  );
47
47
  sourceCode = sourceCode.replace(
48
48
  `=dynamic.${property}`,
49
- `=${curlyAssignmentVal}`
49
+ `=${curlyAssignmentVal}`,
50
50
  );
51
51
  sourceCode = sourceCode.replace(
52
52
  `{{dynamic.${property}}}`,
53
- expressionVal as string
53
+ expressionVal as string,
54
54
  );
55
55
  });
56
56
 
@@ -18,7 +18,7 @@ export default class FreestyleSubsection extends Component<Signature> {
18
18
  get show(): boolean {
19
19
  return this.emberFreestyle.shouldShowSubsection(
20
20
  this.args.section,
21
- this.args.name
21
+ this.args.name,
22
22
  );
23
23
  }
24
24
  }
@@ -37,7 +37,7 @@ export function cssVariable(target: TargetInstance, key: string): any;
37
37
  export function cssVariable(options: Partial<CSSVariableDecoratorOptions>): any;
38
38
  export function cssVariable(
39
39
  targetOrOptions: TargetInstance | CSSVariableDecoratorOptions,
40
- key?: string
40
+ key?: string,
41
41
  ): any {
42
42
  if (typeof key === 'string') {
43
43
  return {
@@ -77,7 +77,7 @@ export class CSSVariableInfo {
77
77
 
78
78
  let computed: string | undefined = cssVarComputedValue(
79
79
  variableName,
80
- cssClassName
80
+ cssClassName,
81
81
  );
82
82
  computed = computed?.trim() ?? undefined;
83
83
  computed = computed === '' ? undefined : computed;
@@ -114,7 +114,7 @@ interface CSSVariableDecoratorOptions {
114
114
  function getCssVariableInfoMemoized(
115
115
  target: TargetInstance,
116
116
  key: string,
117
- options: CSSVariableDecoratorOptions
117
+ options: CSSVariableDecoratorOptions,
118
118
  ): CSSVariableInfo {
119
119
  if (!memoizationMap.get(target)) {
120
120
  memoizationMap.set(target, new Map());
@@ -130,21 +130,21 @@ function getCssVariableInfoMemoized(
130
130
  return result;
131
131
  } else {
132
132
  throw new Error(
133
- 'Unexpected missing key in cssVariable decorator implementation'
133
+ 'Unexpected missing key in cssVariable decorator implementation',
134
134
  );
135
135
  }
136
136
  }
137
137
 
138
138
  function prepareOptions(
139
139
  targetInstance: TargetInstance,
140
- userSpecifiedOptions: Partial<CSSVariableDecoratorOptions>
140
+ userSpecifiedOptions: Partial<CSSVariableDecoratorOptions>,
141
141
  ): CSSVariableDecoratorOptions {
142
142
  let options = userSpecifiedOptions;
143
143
  if (!options.cssClassName) {
144
144
  const cssClassName = targetInstance['cssClassName'];
145
145
  if (!cssClassName) {
146
146
  throw new Error(
147
- 'Must specify `cssClassName` as an option to @cssVariable decorator or define `cssClassName` on the class owning the decorated property'
147
+ 'Must specify `cssClassName` as an option to @cssVariable decorator or define `cssClassName` on the class owning the decorated property',
148
148
  );
149
149
  }
150
150
  options = Object.assign({}, options, { cssClassName });
@@ -154,6 +154,6 @@ function prepareOptions(
154
154
  toVariableName: dasherize,
155
155
  },
156
156
  options as Pick<CSSVariableDecoratorOptions, 'cssClassName'> &
157
- Partial<CSSVariableDecoratorOptions>
157
+ Partial<CSSVariableDecoratorOptions>,
158
158
  );
159
159
  }
package/addon/glint.ts CHANGED
@@ -10,6 +10,8 @@ import type FreestyleUsageObject from 'ember-freestyle/components/freestyle/usag
10
10
  import type FreestyleUsageObjectControl from 'ember-freestyle/components/freestyle/usage/object/control';
11
11
  import type FreestyleUsageString from 'ember-freestyle/components/freestyle/usage/string';
12
12
  import type FreestyleUsageStringControl from 'ember-freestyle/components/freestyle/usage/string/control';
13
+ import type FreestyleUsageComponentLike from 'ember-freestyle/components/freestyle/usage/component-like';
14
+ import type FreestyleUsageComponentLikeControl from 'ember-freestyle/components/freestyle/usage/component-like/control';
13
15
  import type FreestyleAnnotation from 'ember-freestyle/components/freestyle-annotation';
14
16
  import type FreestyleCollection from 'ember-freestyle/components/freestyle-collection';
15
17
  import type FreestyleDynamic from 'ember-freestyle/components/freestyle-dynamic';
@@ -51,6 +53,9 @@ declare module '@glint/environment-ember-loose/registry' {
51
53
  'Freestyle::Usage::String': typeof FreestyleUsageString;
52
54
  'freestyle/usage/string': typeof FreestyleUsageString;
53
55
  'Freestyle::Usage::String::Control': typeof FreestyleUsageStringControl;
56
+ 'Freestyle::Usage::ComponentLike': typeof FreestyleUsageComponentLike;
57
+ 'freestyle/usage/component-like': typeof FreestyleUsageComponentLike;
58
+ 'Freestyle::Usage::ComponentLike::Control': typeof FreestyleUsageComponentLikeControl;
54
59
  FreestyleAnnotation: typeof FreestyleAnnotation;
55
60
  FreestyleCollection: typeof FreestyleCollection;
56
61
  FreestyleDynamic: typeof FreestyleDynamic;
@@ -26,7 +26,7 @@ function getStyleDeclarations(selector: string): CSSStyleDeclaration[] {
26
26
 
27
27
  export function getCssVariableDefinition(
28
28
  variableName: string,
29
- selector: string
29
+ selector: string,
30
30
  ): string {
31
31
  // find the last declaration of the selector that contains a value
32
32
  // for the CSS variable we're interested in
@@ -40,7 +40,7 @@ export function getCssVariableDefinition(
40
40
 
41
41
  export function getComputedValueForCssVariable(
42
42
  variableName: string,
43
- cssClassName: string
43
+ cssClassName: string,
44
44
  ): string {
45
45
  let element = document.querySelector('.' + cssClassName);
46
46
  let tempElement;
@@ -54,7 +54,7 @@ export function getComputedValueForCssVariable(
54
54
  element = tempElement;
55
55
  }
56
56
  const result = getComputedStyle(element).getPropertyValue(
57
- `--${variableName}`
57
+ `--${variableName}`,
58
58
  );
59
59
  tempElement?.remove();
60
60
  return result;
@@ -0,0 +1 @@
1
+ export { default } from 'ember-freestyle/components/freestyle/usage/component-like/control';
@@ -0,0 +1 @@
1
+ export { default } from 'ember-freestyle/components/freestyle/usage/component-like';
@@ -1,7 +1,8 @@
1
1
  $FreestyleCollection-maxWidth: $FreestyleGuide-maxWidth !default;
2
2
  $FreestyleCollection-shadow1: rgba(0, 0, 0, 0.16);
3
3
  $FreestyleCollection-shadow2: rgba(0, 0, 0, 0.12);
4
- $FreestyleCollection-boxShadow: 0 2px 5px 0 $FreestyleCollection-shadow1,
4
+ $FreestyleCollection-boxShadow:
5
+ 0 2px 5px 0 $FreestyleCollection-shadow1,
5
6
  0 2px 10px 0 $FreestyleCollection-shadow2;
6
7
 
7
8
  .FreestyleCollection {
@@ -8,7 +8,8 @@ $FreestyleGuide-maxWidth: 1200px !default;
8
8
  $FreestyleGuide-asideBackgroundColor: #fff !default;
9
9
  $FreestyleGuide-shadow1: rgba(0, 0, 0, 0.16);
10
10
  $FreestyleGuide-shadow2: rgba(0, 0, 0, 0.12);
11
- $FreestyleGuide-boxShadow: 0 2px 5px 0 $FreestyleGuide-shadow1,
11
+ $FreestyleGuide-boxShadow:
12
+ 0 2px 5px 0 $FreestyleGuide-shadow1,
12
13
  0 2px 10px 0 $FreestyleGuide-shadow2;
13
14
 
14
15
  .FreestyleGuide {
@@ -5,22 +5,27 @@
5
5
 
6
6
  &-item,
7
7
  &-submenuItem {
8
- padding-top: 0.6rem;
9
- text-transform: uppercase;
8
+ padding-top: 0.1rem;
10
9
  }
11
10
 
12
11
  &-itemLink,
13
12
  &-submenuItemLink {
13
+ border-radius: 6px;
14
14
  color: $FreestyleGuide-color--foreground;
15
+ display: block;
16
+ padding: 0.3rem 0.3rem 0.3rem 0.5rem;
15
17
  text-decoration: none;
16
18
 
17
19
  &.active {
18
- color: $FreestyleGuide-color--primary;
20
+ background-color: $FreestyleGuide-color--primary;
21
+ color: white;
19
22
  text-decoration: none;
23
+ font-weight: bold;
20
24
  }
21
25
 
22
26
  &:hover {
23
- color: $FreestyleGuide-color--accent;
27
+ background-color: $FreestyleGuide-color--primary;
28
+ color: white;
24
29
  text-decoration: none;
25
30
  }
26
31
  }
@@ -9,7 +9,6 @@ $FreestyleSection-borderColor: #ccc !default;
9
9
  margin: 0 1rem;
10
10
  max-width: calc(1200px - 1rem);
11
11
  padding: 1rem 0 0.4rem;
12
- text-transform: uppercase;
13
12
  }
14
13
 
15
14
  &--hidden {
@@ -7,6 +7,5 @@
7
7
  font-size: 1.3rem;
8
8
  margin: 0 1rem;
9
9
  padding: 0.8rem 0 0.4rem;
10
- text-transform: uppercase;
11
10
  }
12
11
  }
@@ -1,7 +1,8 @@
1
1
  $FreestyleUsageControls-backgroundColor: #fff !default;
2
2
  $FreestyleUsageControls-shadow1: rgba(0, 0, 0, 0.16);
3
3
  $FreestyleUsageControls-shadow2: rgba(0, 0, 0, 0.12);
4
- $FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
4
+ $FreestyleUsageControls-boxShadow:
5
+ 0 2px 5px 0 $FreestyleUsageControls-shadow1,
5
6
  0 2px 10px 0 $FreestyleUsageControls-shadow2;
6
7
 
7
8
  .FreestyleUsageControls {
@@ -0,0 +1,13 @@
1
+ import Component from '@glimmer/component';
2
+ import type { ComponentLike } from '@glint/template';
3
+ interface Signature {
4
+ Args: {
5
+ value?: ComponentLike;
6
+ onChange: (c: ComponentLike | undefined) => void;
7
+ options?: ComponentLike[];
8
+ };
9
+ }
10
+ export default class FreestyleUsageComponentLikeControlComponent extends Component<Signature> {
11
+ callOnChange(event: InputEvent): void;
12
+ }
13
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { ComponentLike } from '@glint/template';
2
+ interface Signature {
3
+ Args: {
4
+ name?: string;
5
+ description?: string;
6
+ required?: boolean;
7
+ defaultValue?: ComponentLike;
8
+ hideControls?: boolean;
9
+ value?: ComponentLike;
10
+ options?: ComponentLike[];
11
+ onChange: (val: ComponentLike | null | undefined) => void;
12
+ };
13
+ }
14
+ declare const FreestyleUsageComponentLikeComponent: import("@ember/component/template-only").TemplateOnlyComponent<Signature>;
15
+ export default FreestyleUsageComponentLikeComponent;
@@ -14,13 +14,14 @@ interface Signature {
14
14
  example: [];
15
15
  api: [
16
16
  {
17
+ Action: any;
17
18
  Array: any;
18
19
  Base: any;
19
20
  Bool: any;
21
+ Component: any;
20
22
  Number: any;
21
23
  Object: any;
22
24
  String: any;
23
- Action: any;
24
25
  Yield: any;
25
26
  }
26
27
  ];
package/glint.d.ts CHANGED
@@ -10,6 +10,8 @@ import type FreestyleUsageObject from 'ember-freestyle/components/freestyle/usag
10
10
  import type FreestyleUsageObjectControl from 'ember-freestyle/components/freestyle/usage/object/control';
11
11
  import type FreestyleUsageString from 'ember-freestyle/components/freestyle/usage/string';
12
12
  import type FreestyleUsageStringControl from 'ember-freestyle/components/freestyle/usage/string/control';
13
+ import type FreestyleUsageComponentLike from 'ember-freestyle/components/freestyle/usage/component-like';
14
+ import type FreestyleUsageComponentLikeControl from 'ember-freestyle/components/freestyle/usage/component-like/control';
13
15
  import type FreestyleAnnotation from 'ember-freestyle/components/freestyle-annotation';
14
16
  import type FreestyleCollection from 'ember-freestyle/components/freestyle-collection';
15
17
  import type FreestyleDynamic from 'ember-freestyle/components/freestyle-dynamic';
@@ -50,6 +52,9 @@ declare module '@glint/environment-ember-loose/registry' {
50
52
  'Freestyle::Usage::String': typeof FreestyleUsageString;
51
53
  'freestyle/usage/string': typeof FreestyleUsageString;
52
54
  'Freestyle::Usage::String::Control': typeof FreestyleUsageStringControl;
55
+ 'Freestyle::Usage::ComponentLike': typeof FreestyleUsageComponentLike;
56
+ 'freestyle/usage/component-like': typeof FreestyleUsageComponentLike;
57
+ 'Freestyle::Usage::ComponentLike::Control': typeof FreestyleUsageComponentLikeControl;
53
58
  FreestyleAnnotation: typeof FreestyleAnnotation;
54
59
  FreestyleCollection: typeof FreestyleCollection;
55
60
  FreestyleDynamic: typeof FreestyleDynamic;
@@ -30,11 +30,11 @@ function cleanupNamedBlocksPolyfillSyntax(sourceString) {
30
30
  sourceString = sourceString.trim();
31
31
  sourceString = sourceString.replace(
32
32
  /({{#if \(-is-named-block-invocation __arg0 "(.+?)"\)}})(\s*)(.*?)(\s*){{\/if}}/gs,
33
- '\n <:$2>$3$4$5</:$2>\n'
33
+ '\n <:$2>$3$4$5</:$2>\n',
34
34
  );
35
35
  sourceString = sourceString.replace(
36
36
  / @namedBlocksInfo={{hash .+?=0}} as \|__arg0\|/,
37
- ''
37
+ '',
38
38
  );
39
39
  sourceString = sourceString.replace(/(\s\s+)/g, '\n$1');
40
40
  sourceString = sourceString.replace(/ @(\w+)=/g, '\n @$1=');
@@ -95,11 +95,11 @@ module.exports = function ({ contents, syntax }) {
95
95
  BlockStatement(node) {
96
96
  if (
97
97
  ['freestyle-usage', 'freestyle-dynamic'].includes(
98
- node.path.original
98
+ node.path.original,
99
99
  ) &&
100
100
  (!node.loc.source ||
101
101
  !node.loc.source.includes(
102
- 'templates/components/freestyle-dynamic.hbs'
102
+ 'templates/components/freestyle-dynamic.hbs',
103
103
  ))
104
104
  ) {
105
105
  const sourceString = extractSource(node.program.body, contents);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-freestyle",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Create a living styleguide for your Ember app.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -23,6 +23,7 @@
23
23
  "lint:hbs:fix": "ember-template-lint . --fix",
24
24
  "lint:js": "eslint . --cache",
25
25
  "lint:js:fix": "eslint . --fix",
26
+ "lint:glint": "glint",
26
27
  "prepare": "husky install",
27
28
  "start": "ember serve",
28
29
  "test": "npm-run-all lint test:*",
@@ -45,7 +46,7 @@
45
46
  "ember-focus-trap": "^1.0.1",
46
47
  "ember-modifier": "^3.2.7 || ^4.0.0",
47
48
  "ember-named-blocks-polyfill": "^0.2.5",
48
- "ember-truth-helpers": "^3.1.1",
49
+ "ember-truth-helpers": "^4.0.3",
49
50
  "json-formatter-js": "^2.3.4",
50
51
  "macro-decorators": "^0.1.2",
51
52
  "strip-indent": "^3.0.0",
@@ -55,16 +56,17 @@
55
56
  "@ember/optional-features": "^2.0.0",
56
57
  "@ember/string": "^3.1.1",
57
58
  "@ember/test-helpers": "^3.2.0",
58
- "@embroider/test-setup": "^1.8.3",
59
- "@glint/core": "^0.9.4",
60
- "@glint/environment-ember-loose": "^0.9.7",
59
+ "@embroider/test-setup": "^3.0.1",
60
+ "@glint/core": "^1.2.0",
61
+ "@glint/template": "^1.2.0",
62
+ "@glint/environment-ember-loose": "^1.2.0",
61
63
  "@release-it-plugins/lerna-changelog": "^5.0.0",
62
- "@tsconfig/ember": "^1.0.1",
63
- "@types/ember": "^4.0.1",
64
+ "@tsconfig/ember": "^3.0.1",
65
+ "@types/ember": "^4.0.6",
64
66
  "@types/ember-resolver": "^5.0.11",
65
67
  "@types/ember__application": "^4.0.2",
66
68
  "@types/ember__array": "^4.0.2",
67
- "@types/ember__component": "^4.0.10",
69
+ "@types/ember__component": "^4.0.18",
68
70
  "@types/ember__controller": "^4.0.4",
69
71
  "@types/ember__debug": "^4.0.1",
70
72
  "@types/ember__engine": "^4.0.4",
@@ -79,7 +81,7 @@
79
81
  "@types/ember__string": "^3.0.9",
80
82
  "@types/ember__template": "^4.0.0",
81
83
  "@types/ember__test": "^4.0.0",
82
- "@types/ember__utils": "^4.0.1",
84
+ "@types/ember__utils": "^4.0.4",
83
85
  "@types/qunit": "^2.19.3",
84
86
  "@types/remarkable": "^2.0.3",
85
87
  "@types/rsvp": "^4.0.4",
@@ -91,7 +93,7 @@
91
93
  "ember-cli-autoprefixer": "^2.0.0",
92
94
  "ember-cli-dependency-checker": "^3.3.1",
93
95
  "ember-cli-deploy": "^1.0.2",
94
- "ember-cli-deploy-build": "^2.0.0",
96
+ "ember-cli-deploy-build": "^3.0.0",
95
97
  "ember-cli-deploy-git": "^1.3.4",
96
98
  "ember-cli-inject-live-reload": "^2.1.0",
97
99
  "ember-cli-sass": "^11.0.1",
@@ -108,33 +110,36 @@
108
110
  "ember-source-channel-url": "^3.0.0",
109
111
  "ember-style-modifier": "^0.8.0",
110
112
  "ember-template-imports": "^3.3.1",
111
- "ember-template-lint": "^4.14.0",
113
+ "ember-template-lint": "^5.11.2",
112
114
  "ember-try": "^2.0.0",
113
115
  "eslint": "^8.35.0",
114
116
  "eslint-config-ember": "0.3.0",
115
- "eslint-config-prettier": "^8.5.0",
117
+ "eslint-config-prettier": "^9.0.0",
116
118
  "eslint-plugin-ember": "^11.10.0",
117
119
  "eslint-plugin-node": "^11.1.0",
118
- "eslint-plugin-prettier": "^4.2.1",
120
+ "eslint-plugin-prettier": "^5.0.0",
119
121
  "eslint-plugin-qunit": "^7.3.1",
120
122
  "husky": "^8.0.1",
121
123
  "loader.js": "^4.7.0",
122
124
  "npm-run-all": "^4.1.5",
123
- "prettier": "^2.7.1",
124
- "prettier-plugin-ember-template-tag": "^0.3.2",
125
+ "prettier": "^3.0.3",
126
+ "prettier-plugin-ember-template-tag": "^1.1.0",
125
127
  "qunit": "^2.19.3",
126
128
  "qunit-dom": "^2.0.0",
127
129
  "release-it": "^14.10.0",
128
130
  "remarkable": "^2.0.1",
129
- "sass": "^1.55.0",
130
- "stylelint": "^15.10.1",
131
- "stylelint-config-prettier": "^9.0.3",
132
- "stylelint-config-recommended-scss": "^7.0.0",
133
- "stylelint-prettier": "^2.0.0",
131
+ "sass": "^1.68.0",
132
+ "stylelint": "^15.10.3",
133
+ "stylelint-config-prettier": "^9.0.5",
134
+ "stylelint-config-recommended-scss": "^13.0.0",
135
+ "stylelint-prettier": "^4.0.2",
134
136
  "stylelint-scss": "^4.3.0",
135
137
  "typescript": "^4.9.5",
136
138
  "webpack": "^5.76.0"
137
139
  },
140
+ "peerDependencies": {
141
+ "@ember/string": "^3.1.1"
142
+ },
138
143
  "engines": {
139
144
  "node": "14.* || >= 16"
140
145
  },
@@ -23,5 +23,5 @@ export default class AndHelper<
23
23
  B = UnsetValue,
24
24
  C = UnsetValue,
25
25
  D = UnsetValue,
26
- E = UnsetValue
26
+ E = UnsetValue,
27
27
  > extends Helper<AndHelperSignature<A, B, C, D, E>> {}
@@ -25,5 +25,5 @@ export default class OrHelper<
25
25
  B = UnsetValue,
26
26
  C = UnsetValue,
27
27
  D = UnsetValue,
28
- E = UnsetValue
28
+ E = UnsetValue,
29
29
  > extends Helper<OrHelperSignature<A, B, C, D, E>> {}
@@ -307,7 +307,6 @@ END-FREESTYLE-USAGE */
307
307
  margin: 0 1rem;
308
308
  max-width: calc(1200px - 1rem);
309
309
  padding: 1rem 0 0.4rem;
310
- text-transform: uppercase;
311
310
  }
312
311
  .FreestyleSection--hidden {
313
312
  display: none;
@@ -320,7 +319,6 @@ END-FREESTYLE-USAGE */
320
319
  font-size: 1.3rem;
321
320
  margin: 0 1rem;
322
321
  padding: 0.8rem 0 0.4rem;
323
- text-transform: uppercase;
324
322
  }
325
323
 
326
324
  .FreestyleMenu {
@@ -329,19 +327,24 @@ END-FREESTYLE-USAGE */
329
327
  padding-left: 1rem;
330
328
  }
331
329
  .FreestyleMenu-item, .FreestyleMenu-submenuItem {
332
- padding-top: 0.6rem;
333
- text-transform: uppercase;
330
+ padding-top: 0.1rem;
334
331
  }
335
332
  .FreestyleMenu-itemLink, .FreestyleMenu-submenuItemLink {
333
+ border-radius: 6px;
336
334
  color: #212121;
335
+ display: block;
336
+ padding: 0.3rem 0.3rem 0.3rem 0.5rem;
337
337
  text-decoration: none;
338
338
  }
339
339
  .FreestyleMenu-itemLink.active, .FreestyleMenu-submenuItemLink.active {
340
- color: #00bcd4;
340
+ background-color: #00bcd4;
341
+ color: white;
341
342
  text-decoration: none;
343
+ font-weight: bold;
342
344
  }
343
345
  .FreestyleMenu-itemLink:hover, .FreestyleMenu-submenuItemLink:hover {
344
- color: #ffc107;
346
+ background-color: #00bcd4;
347
+ color: white;
345
348
  text-decoration: none;
346
349
  }
347
350
  .FreestyleMenu-submenu {