frontile 0.18.0-alpha.19 → 0.18.0-alpha.20
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.
|
@@ -6,7 +6,11 @@ import { precompileTemplate } from '@ember/template-compilation';
|
|
|
6
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
7
|
import templateOnly from '@ember/component/template-only';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// `data-drawer-header-icon` and `data-drawer-header-description` are what the
|
|
10
|
+
// theme's header grid keys its icon alignment off: the icon spans both text
|
|
11
|
+
// rows only when a description is actually rendered (see `headerContent` in
|
|
12
|
+
// `overlays.ts`). They are structural hooks, not state, so they are always on.
|
|
13
|
+
const DrawerHeaderIcon = setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} data-drawer-header-icon ...attributes>\n {{yield}}\n</div>", {
|
|
10
14
|
strictMode: true,
|
|
11
15
|
scope: () => ({
|
|
12
16
|
twMerge
|
|
@@ -24,7 +28,7 @@ class DrawerHeaderTitle extends Component {
|
|
|
24
28
|
}
|
|
25
29
|
class DrawerHeaderDescription extends Component {
|
|
26
30
|
static {
|
|
27
|
-
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n</div>", {
|
|
31
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} data-drawer-header-description ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n</div>", {
|
|
28
32
|
strictMode: true,
|
|
29
33
|
scope: () => ({
|
|
30
34
|
twMerge
|
|
@@ -40,7 +44,7 @@ class DrawerHeader extends Component {
|
|
|
40
44
|
};
|
|
41
45
|
});
|
|
42
46
|
static {
|
|
43
|
-
setComponentTemplate(precompileTemplate("<div id={{@labelledById}} class={{twMerge @classFromParent @class}} {{this.register}} ...attributes>\n <div class={{@contentClass}}>\n {{#if (has-block)}}\n {{yield (hash Icon=(component DrawerHeaderIcon classFromParent=@iconClass) Title=(component DrawerHeaderTitle classFromParent=@titleClass value=@title) Description=(component DrawerHeaderDescription classFromParent=@descriptionClass value=@description))}}\n {{else}}\n {{#if @title}}\n <div class={{@titleClass}}>{{@title}}</div>\n {{/if}}\n {{#if @description}}\n <div class={{@descriptionClass}}
|
|
47
|
+
setComponentTemplate(precompileTemplate("<div id={{@labelledById}} class={{twMerge @classFromParent @class}} {{this.register}} ...attributes>\n <div class={{@contentClass}}>\n {{#if (has-block)}}\n {{yield (hash Icon=(component DrawerHeaderIcon classFromParent=@iconClass) Title=(component DrawerHeaderTitle classFromParent=@titleClass value=@title) Description=(component DrawerHeaderDescription classFromParent=@descriptionClass value=@description))}}\n {{else}}\n {{#if @title}}\n <div class={{@titleClass}}>{{@title}}</div>\n {{/if}}\n {{#if @description}}\n <div class={{@descriptionClass}} data-drawer-header-description>\n {{@description}}\n </div>\n {{/if}}\n {{/if}}\n </div>\n\n {{!-- Only rendered when there is something to put in it: an empty flex\n child would still consume the header's gap, leaving a phantom space to\n the right of the title on every plain header. --}}\n {{#if (has-block \"actions\")}}\n <div class={{@actionsClass}}>\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @closeButton}}\n <@closeButton />\n {{/if}}\n</div>", {
|
|
44
48
|
strictMode: true,
|
|
45
49
|
scope: () => ({
|
|
46
50
|
twMerge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sources":["../../../../src/components/overlays/drawer/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\nimport { twMerge } from '@frontile/theme';\nimport type { TOC } from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { CloseButtonSignature } from '../../buttons/close-button';\n\nexport interface DrawerHeaderIconSignature {\n Args: {\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nconst DrawerHeaderIcon: TOC<DrawerHeaderIconSignature> = <template>\n <div
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/overlays/drawer/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\nimport { twMerge } from '@frontile/theme';\nimport type { TOC } from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { CloseButtonSignature } from '../../buttons/close-button';\n\nexport interface DrawerHeaderIconSignature {\n Args: {\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n// `data-drawer-header-icon` and `data-drawer-header-description` are what the\n// theme's header grid keys its icon alignment off: the icon spans both text\n// rows only when a description is actually rendered (see `headerContent` in\n// `overlays.ts`). They are structural hooks, not state, so they are always on.\nconst DrawerHeaderIcon: TOC<DrawerHeaderIconSignature> = <template>\n <div\n class={{twMerge @classFromParent @class}}\n data-drawer-header-icon\n ...attributes\n >\n {{yield}}\n </div>\n</template>;\n\nexport interface DrawerHeaderTitleSignature {\n Args: {\n /**\n * Fallback content, used when this component is given no block.\n */\n value?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nclass DrawerHeaderTitle extends Component<DrawerHeaderTitleSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n </div>\n </template>\n}\n\nexport interface DrawerHeaderDescriptionSignature {\n Args: {\n /**\n * Fallback content, used when this component is given no block.\n */\n value?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nclass DrawerHeaderDescription extends Component<DrawerHeaderDescriptionSignature> {\n <template>\n <div\n class={{twMerge @classFromParent @class}}\n data-drawer-header-description\n ...attributes\n >\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n </div>\n </template>\n}\n\nexport interface DrawerHeaderArgs {\n /**\n * The id used to reference labelledById in Drawer component\n */\n labelledById: string;\n\n /**\n * Header title. Rendered into the themed title slot when the header is given\n * no block, and used as the fallback content for a blockless `<h.Title />`.\n */\n title?: string;\n\n /**\n * Header description, shown under the title. Behaves like `@title`.\n */\n description?: string;\n\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n\n /**\n * @internal\n */\n iconClass?: string;\n\n /**\n * @internal\n */\n titleClass?: string;\n\n /**\n * @internal\n */\n descriptionClass?: string;\n\n /**\n * @internal\n */\n contentClass?: string;\n\n /**\n * @internal\n */\n actionsClass?: string;\n\n /**\n * Called with `true` when this header is rendered and `false` when it is\n * removed, so the Drawer knows whether it may point `aria-labelledby` at us.\n *\n * @internal\n */\n registerSelf?: (isRendered: boolean) => void;\n\n /**\n * The Drawer's close button, fully bound and rendered inside the header's\n * own grid so it can be centred against the header's actual height. Only\n * present when the Drawer should show a close button at all.\n *\n * @internal\n */\n closeButton?: ComponentLike<CloseButtonSignature>;\n}\n\nexport interface DrawerHeaderSignature {\n Args: DrawerHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n Icon: ComponentLike<DrawerHeaderIconSignature>;\n Title: ComponentLike<DrawerHeaderTitleSignature>;\n Description: ComponentLike<DrawerHeaderDescriptionSignature>;\n }\n ];\n\n /**\n * Controls placed beside the close button. Rendered in flow, so a taller\n * control makes the header band taller -- unlike the close button, which\n * is positioned out of flow precisely so it never does.\n */\n actions: [];\n };\n}\n\nexport default class DrawerHeader extends Component<DrawerHeaderSignature> {\n register = modifier(() => {\n this.args.registerSelf?.(true);\n\n return () => {\n this.args.registerSelf?.(false);\n };\n });\n\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n {{this.register}}\n ...attributes\n >\n <div class={{@contentClass}}>\n {{#if (has-block)}}\n {{yield\n (hash\n Icon=(component DrawerHeaderIcon classFromParent=@iconClass)\n Title=(component\n DrawerHeaderTitle classFromParent=@titleClass value=@title\n )\n Description=(component\n DrawerHeaderDescription\n classFromParent=@descriptionClass\n value=@description\n )\n )\n }}\n {{else}}\n {{#if @title}}\n <div class={{@titleClass}}>{{@title}}</div>\n {{/if}}\n {{#if @description}}\n <div class={{@descriptionClass}} data-drawer-header-description>\n {{@description}}\n </div>\n {{/if}}\n {{/if}}\n </div>\n\n {{! Only rendered when there is something to put in it: an empty flex\n child would still consume the header's gap, leaving a phantom space to\n the right of the title on every plain header. }}\n {{#if (has-block \"actions\")}}\n <div class={{@actionsClass}}>\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @closeButton}}\n <@closeButton />\n {{/if}}\n </div>\n </template>\n}\n\nexport { DrawerHeaderIcon, DrawerHeaderTitle, DrawerHeaderDescription };\n"],"names":["DrawerHeaderIcon","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge","templateOnly","DrawerHeaderTitle","Component","DrawerHeaderDescription","DrawerHeader","register","modifier","args","registerSelf","hash"],"mappings":";;;;;;;;AAoBA;AACA;AACA;AACA;AACA,MAAMA,gBAAsB,GAAAC,oBAAA,CAA6BC,kBAAA,CAAA,4GAAA,EAQzD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAmBV,MAAMC,0BAA0BC,SAAA,CAAU;AACxC,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAAA,gIAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AAmBA,MAAMI,gCAAgCD,SAAA,CAAU;AAC9C,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAAA,+JAAA,EAQA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AA0Fe,MAAMK,qBAAqBF,SAAA,CAAU;EAClDG,QAAA,GAAWC,QAAA,CAAS,MAAA;AAClB,IAAA,IAAI,CAACC,IAAI,CAACC,YAAY,GAAG,IAAA,CAAA;AAEzB,IAAA,OAAO,MAAA;AACL,MAAA,IAAI,CAACD,IAAI,CAACC,YAAY,GAAG,KAAA,CAAA;IAC3B,CAAA;AACF,EAAA,CAAA,CAAA;AAEA,EAAA;IAAAb,oBAAA,CAAAC,kBAAA,CAAA,olCAAA,EA+CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAU,IAAA;QAAAf,gBAAA;QAAAO,iBAAA;AAAAE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frontile",
|
|
3
|
-
"version": "0.18.0-alpha.
|
|
3
|
+
"version": "0.18.0-alpha.20",
|
|
4
4
|
"description": "Component Library for Ember Octane apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@embroider/addon-shim": "^1.10.3",
|
|
95
95
|
"@embroider/macros": "^1.20.6",
|
|
96
96
|
"@floating-ui/dom": "^1.0.1",
|
|
97
|
-
"@frontile/theme": "^0.18.0-alpha.
|
|
97
|
+
"@frontile/theme": "^0.18.0-alpha.20",
|
|
98
98
|
"@glint/template": "^1.8.0",
|
|
99
99
|
"@universal-ember/table": "^4.0.0",
|
|
100
100
|
"date-fns": "^4.4.0",
|
|
@@ -153,5 +153,5 @@
|
|
|
153
153
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
-
"gitHead": "
|
|
156
|
+
"gitHead": "4ad0d3245ae37878e92ab6452d8c4ebe07a5a403"
|
|
157
157
|
}
|