element-book 5.0.0 → 6.0.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.
@@ -9,7 +9,7 @@ export type ElementBookPageExampleInit<ParentControls extends ElementBookPageCon
9
9
  /** This example's title. Each title in a page must be unique. */
10
10
  title: string;
11
11
  /** Initialize the state for this example. */
12
- stateInit?: StateInit;
12
+ stateInitStatic?: StateInit;
13
13
  /** Specify which events this example should intercept (so the user can see them). */
14
14
  capturedEvents?: ReadonlyArray<string | TypedEvent>;
15
15
  /**
@@ -2,4 +2,4 @@ import { ElementBookFullRoute, ElementBookRouter } from '../../../routing/elemen
2
2
  export declare const ElementBookRouteLink: import("element-vir").DeclarativeElementDefinition<"element-book-route-link", {
3
3
  route: Partial<ElementBookFullRoute>;
4
4
  router: ElementBookRouter | undefined;
5
- }, {}, {}, string, "anchorPadding", import("lit-html").HTMLTemplateResult>;
5
+ }, {}, {}, `element-book-route-link-${string}`, "element-book-route-link-anchor-padding", import("lit-html").HTMLTemplateResult>;
@@ -5,13 +5,13 @@ import { defineElementBookElement } from '../define-book-element';
5
5
  export const ElementBookRouteLink = defineElementBookElement()({
6
6
  tagName: 'element-book-route-link',
7
7
  cssVars: {
8
- anchorPadding: '',
8
+ 'element-book-route-link-anchor-padding': '',
9
9
  },
10
- styles: ({ cssVarValues }) => css `
10
+ styles: ({ cssVars }) => css `
11
11
  a {
12
12
  box-sizing: border-box;
13
13
  display: block;
14
- padding: ${cssVarValues.anchorPadding};
14
+ padding: ${cssVars['element-book-route-link-anchor-padding'].value};
15
15
  text-decoration: inherit;
16
16
  color: inherit;
17
17
  height: 100%;
@@ -1,2 +1,2 @@
1
1
  export type BookTagName = `element-book-${string}`;
2
- export declare const defineElementBookElement: <InputsGeneric extends {}>() => <TagNameGeneric extends `element-book-${string}`, StateInitGeneric extends {}, EventsInitGeneric extends {}, HostClassKeysGeneric extends string, CssVarKeysGeneric extends string, RenderOutputGeneric extends any>(inputs: import("element-vir").DeclarativeElementInit<TagNameGeneric, InputsGeneric, StateInitGeneric, EventsInitGeneric, HostClassKeysGeneric, CssVarKeysGeneric, RenderOutputGeneric>) => import("element-vir").DeclarativeElementDefinition<TagNameGeneric, InputsGeneric, StateInitGeneric, EventsInitGeneric, HostClassKeysGeneric, CssVarKeysGeneric, RenderOutputGeneric>, defineElementBookElementNoInputs: <TagNameGeneric_1 extends `element-book-${string}`, InputsGeneric_1 extends {}, StateInitGeneric_1 extends {}, EventsInitGeneric_1 extends {}, HostClassKeysGeneric_1 extends string, CssVarKeysGeneric_1 extends string, RenderOutputGeneric_1 extends any>(inputs: import("element-vir").DeclarativeElementInit<TagNameGeneric_1, InputsGeneric_1, StateInitGeneric_1, EventsInitGeneric_1, HostClassKeysGeneric_1, CssVarKeysGeneric_1, RenderOutputGeneric_1>) => import("element-vir").DeclarativeElementDefinition<TagNameGeneric_1, InputsGeneric_1, StateInitGeneric_1, EventsInitGeneric_1, HostClassKeysGeneric_1, CssVarKeysGeneric_1, RenderOutputGeneric_1>;
2
+ export declare const defineElementBookElement: <InputsGeneric extends {}>() => <TagName extends `element-book-${string}`, StateInit extends {}, EventsInit extends {}, HostClassKeys extends `${TagName}-${string}`, CssVarKeys extends `${TagName}-${string}`, RenderOutput extends any>(inputs: import("element-vir").DeclarativeElementInit<TagName, InputsGeneric, StateInit, EventsInit, HostClassKeys, CssVarKeys, RenderOutput>) => import("element-vir").DeclarativeElementDefinition<TagName, InputsGeneric, StateInit, EventsInit, HostClassKeys, CssVarKeys, RenderOutput>, defineElementBookElementNoInputs: <TagName_1 extends `element-book-${string}`, Inputs extends {}, StateInit_1 extends {}, EventsInit_1 extends {}, HostClassKeys_1 extends `${TagName_1}-${string}`, CssVarKeys_1 extends `${TagName_1}-${string}`, RenderOutput_1 extends any>(inputs: import("element-vir").DeclarativeElementInit<TagName_1, Inputs, StateInit_1, EventsInit_1, HostClassKeys_1, CssVarKeys_1, RenderOutput_1>) => import("element-vir").DeclarativeElementDefinition<TagName_1, Inputs, StateInit_1, EventsInit_1, HostClassKeys_1, CssVarKeys_1, RenderOutput_1>;
@@ -11,5 +11,5 @@ export declare const ElementBookApp: import("element-vir").DeclarativeElementDef
11
11
  colors: ColorThemeState;
12
12
  }, {
13
13
  pathUpdate: import("element-vir").DefinedTypedEventNameDefinition<readonly string[]>;
14
- }, "", "", import("lit-html").HTMLTemplateResult>;
14
+ }, "element-book-app-", "element-book-app-", import("lit-html").HTMLTemplateResult>;
15
15
  export {};
@@ -16,7 +16,7 @@ export const ElementBookApp = defineElement()({
16
16
  events: {
17
17
  pathUpdate: defineElementEvent(),
18
18
  },
19
- stateInit: {
19
+ stateInitStatic: {
20
20
  currentRoute: defaultElementBookFullRoute,
21
21
  router: undefined,
22
22
  colors: {
@@ -2,4 +2,4 @@ import { ElementBookFullRoute, ElementBookRouter } from '../../routing/element-b
2
2
  export declare const ElementBookBreadcrumbs: import("element-vir").DeclarativeElementDefinition<"element-book-breadcrumbs", {
3
3
  currentRoute: Readonly<ElementBookFullRoute>;
4
4
  router: ElementBookRouter;
5
- }, {}, {}, string, string, import("lit-html").HTMLTemplateResult | import("lit-html").HTMLTemplateResult[]>;
5
+ }, {}, {}, `element-book-breadcrumbs-${string}`, `element-book-breadcrumbs-${string}`, import("lit-html").HTMLTemplateResult | import("lit-html").HTMLTemplateResult[]>;
@@ -4,4 +4,4 @@ export declare const ElementBookNav: import("element-vir").DeclarativeElementDef
4
4
  tree: EntryTreeNode;
5
5
  selectedPath: ReadonlyArray<string>;
6
6
  router: ElementBookRouter | undefined;
7
- }, {}, {}, string, string, import("lit-html").HTMLTemplateResult>;
7
+ }, {}, {}, `element-book-nav-${string}`, `element-book-nav-${string}`, import("lit-html").HTMLTemplateResult>;
@@ -30,10 +30,9 @@ export const ElementBookNav = defineElementBookElement()({
30
30
  }
31
31
 
32
32
  .title-row {
33
- padding-right: 16px;
34
33
  display: block;
35
- ${ElementBookRouteLink.cssVarNames
36
- .anchorPadding}: 1px 24px 1px calc(calc(16px * var(--indent, 0)) + 8px);
34
+ ${ElementBookRouteLink.cssVars['element-book-route-link-anchor-padding']
35
+ .name}: 1px 24px 1px calc(calc(16px * var(--indent, 0)) + 8px);
37
36
  }
38
37
 
39
38
  ${ElementBookRouteLink} {
@@ -5,4 +5,4 @@ export declare const ElementBookEntryDisplay: import("element-vir").DeclarativeE
5
5
  currentRoute: Readonly<ElementBookFullRoute>;
6
6
  currentNode: Readonly<EntryTreeNode>;
7
7
  router: ElementBookRouter;
8
- }, {}, {}, string, string, HTMLTemplateResult>;
8
+ }, {}, {}, `element-book-entry-display-${string}`, `element-book-entry-display-${string}`, HTMLTemplateResult>;
@@ -35,6 +35,8 @@ export const ElementBookEntryDisplay = defineElementBookElement()({
35
35
  }
36
36
 
37
37
  .all-examples-wrapper {
38
+ flex-grow: 1;
39
+ box-sizing: border-box;
38
40
  padding: 32px;
39
41
  display: flex;
40
42
  flex-direction: column;
@@ -1,4 +1,4 @@
1
1
  import { ElementBookPageExampleInit } from '../../../data/element-book-entry/element-book-page/element-book-page-example';
2
2
  export declare const ElementBookExampleControls: import("element-vir").DeclarativeElementDefinition<"element-book-example-controls", {
3
3
  example: ElementBookPageExampleInit<any, any, any>;
4
- }, {}, {}, string, string, import("lit-html").HTMLTemplateResult>;
4
+ }, {}, {}, `element-book-example-controls-${string}`, `element-book-example-controls-${string}`, import("lit-html").HTMLTemplateResult>;
@@ -3,4 +3,4 @@ export declare const ElementBookExampleViewer: import("element-vir").Declarative
3
3
  example: ElementBookPageExampleInit<any, any, any>;
4
4
  breadcrumbs: ReadonlyArray<string>;
5
5
  currentPageControls: Record<string, any>;
6
- }, any, {}, string, string, string | import("lit-html").HTMLTemplateResult>;
6
+ }, any, {}, `element-book-example-viewer-${string}`, `element-book-example-viewer-${string}`, string | import("lit-html").HTMLTemplateResult>;
@@ -4,7 +4,7 @@ import { unsetInternalState } from '../../../data/unset';
4
4
  import { defineElementBookElement } from '../define-book-element';
5
5
  export const ElementBookExampleViewer = defineElementBookElement()({
6
6
  tagName: 'element-book-example-viewer',
7
- stateInit: {
7
+ stateInitStatic: {
8
8
  isUnset: unsetInternalState,
9
9
  },
10
10
  renderCallback({ state, inputs, updateState }) {
@@ -14,7 +14,7 @@ export const ElementBookExampleViewer = defineElementBookElement()({
14
14
  if (state.isUnset === unsetInternalState) {
15
15
  updateState({
16
16
  isUnset: undefined,
17
- ...inputs.example.stateInit,
17
+ ...inputs.example.stateInitStatic,
18
18
  });
19
19
  }
20
20
  try {
@@ -8,4 +8,4 @@ export declare const ElementBookPageControls: import("element-vir").DeclarativeE
8
8
  name: string;
9
9
  value: unknown;
10
10
  }>;
11
- }, string, string, import("lit-html").HTMLTemplateResult[]>;
11
+ }, `element-book-page-controls-${string}`, `element-book-page-controls-${string}`, import("lit-html").HTMLTemplateResult[]>;
@@ -4,4 +4,4 @@ export declare const ElementBookPageExamples: import("element-vir").DeclarativeE
4
4
  parentBreadcrumbs: ReadonlyArray<string>;
5
5
  }, {
6
6
  unset: symbol;
7
- }, {}, string, string, import("lit-html").HTMLTemplateResult>;
7
+ }, {}, `element-book-page-examples-${string}`, `element-book-page-examples-${string}`, import("lit-html").HTMLTemplateResult>;
@@ -37,7 +37,7 @@ export const ElementBookPageExamples = defineElementBookElement()({
37
37
  color: ${colorThemeCssVars['element-book-accent-icon-color'].value};
38
38
  }
39
39
  `,
40
- stateInit: {
40
+ stateInitStatic: {
41
41
  unset: unsetInternalState,
42
42
  },
43
43
  renderCallback({ inputs, state, updateState }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-book",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "keywords": [
5
5
  "book",
6
6
  "design system",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@augment-vir/common": "^14.2.0",
42
- "@electrovir/icon-element": "^0.0.2",
42
+ "@electrovir/icon-element": "^1.0.0",
43
43
  "colorjs.io": "^0.4.3",
44
- "element-vir": "^12.5.4",
44
+ "element-vir": "^13.0.0",
45
45
  "lit-css-vars": "^2.0.2",
46
46
  "spa-router-vir": "^2.1.0",
47
47
  "typed-event-target": "^1.2.0"