@pnx-mixtape/mxds 0.0.11 → 0.0.13

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 (42) hide show
  1. package/dist/build/accordion.css +6 -16
  2. package/dist/build/accordion.entry.js +1 -57
  3. package/dist/build/accordion.entry.js.map +1 -1
  4. package/dist/build/button.css +2 -2
  5. package/dist/build/chunks/Accordion-DSze7pxN.js +61 -0
  6. package/dist/build/chunks/Accordion-DSze7pxN.js.map +1 -0
  7. package/dist/build/filters.entry.js +137 -0
  8. package/dist/build/filters.entry.js.map +1 -0
  9. package/dist/build/header.css +19 -4
  10. package/dist/build/in-page-navigation.entry.js +18 -8
  11. package/dist/build/in-page-navigation.entry.js.map +1 -1
  12. package/dist/build/navigation.css +5 -1
  13. package/dist/build/sidebar.css +18 -64
  14. package/package.json +2 -2
  15. package/src/Atom/Button/_buttons.css +1 -1
  16. package/src/Atom/Media/media.twig +1 -1
  17. package/src/Atom/Video/video.twig +1 -1
  18. package/src/Component/Filters/filters.entry.js +1 -0
  19. package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +19 -9
  20. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +29 -1
  21. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +23 -62
  22. package/src/Component/InPageNavigation/in-page-navigation.twig +5 -1
  23. package/src/Component/InPageNavigation/twig/content-example.twig +4 -12
  24. package/src/Component/Navigation/_navigation-dropdown.css +4 -0
  25. package/src/Component/SideNavigation/SideNavigation.stories.ts +1 -1
  26. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +3 -2
  27. package/src/Component/SideNavigation/side-navigation.twig +1 -1
  28. package/src/Form/Search/Search.stories.ts +2 -27
  29. package/src/Form/Search/__snapshots__/Search.stories.ts.snap +1 -1
  30. package/src/Form/Search/search-form.twig +5 -2
  31. package/src/Layout/Header/Header.stories.ts +22 -46
  32. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +34 -32
  33. package/src/Layout/Header/_header.css +15 -3
  34. package/src/Layout/Header/header.twig +22 -5
  35. package/src/Layout/Sidebar/Sidebar.stories.ts +0 -2
  36. package/src/Layout/Sidebar/sidebar.css +14 -17
  37. package/src/Layout/Sidebar/sidebar.twig +4 -2
  38. package/dist/build/steps.entry.js +0 -2
  39. package/dist/build/steps.entry.js.map +0 -1
  40. package/src/Component/Steps/steps.entry.js +0 -0
  41. package/src/Layout/Header/header-stacked.twig +0 -51
  42. package/src/Layout/images/mixtape-logo.png +0 -0
@@ -1,25 +1,28 @@
1
1
  import { Meta, StoryObj } from "@storybook/html"
2
2
  import Component from "./header.twig"
3
- import StackedComponent from "./header-stacked.twig"
4
- import Icon from "../../Atom/Icon/icon.twig"
5
- import Logo from "../Header/twig/logo.twig"
6
- import SearchForm from "../../Form/Search/search-form.twig"
7
- import InputText from "../../Form/TextInput/input-text.twig"
8
- import Button from "../../Atom/Button/button.twig"
9
- import Navigation from "../../Component/Navigation/navigation.twig"
10
3
  import "./_header.css"
11
4
  import "./_toggles.css"
12
5
  import "./Elements/GlobalToggle"
13
- import "../../Component/Navigation/Elements/Navigation"
14
- import {
15
- ButtonTypes,
16
- Header as HeaderType,
17
- InputTypeTypes,
18
- } from "@pnx-mixtape/ids-shape"
6
+ import { ButtonTypes, Header as HeaderType } from "@pnx-mixtape/ids-shape"
19
7
  import { Page } from "../../../.storybook/decorators"
20
8
  import { Icons } from "../../enums"
21
9
 
22
- const meta: Meta<HeaderType> = {
10
+ // Deps.
11
+ import Icon from "../../Atom/Icon/icon.twig"
12
+ import Logo from "../Header/twig/logo.twig"
13
+ import Button from "../../Atom/Button/button.twig"
14
+ import Navigation from "../../Component/Navigation/navigation.twig"
15
+ import SearchForm from "../../Form/Search/search-form.twig"
16
+ // js.
17
+ import "../../Component/Navigation/Elements/Navigation"
18
+ // css.
19
+ import "../../Component/Navigation/navigation.css"
20
+
21
+ type MxHeaderType = HeaderType & {
22
+ stacked: boolean
23
+ }
24
+
25
+ const meta: Meta<MxHeaderType> = {
23
26
  tags: ["autodocs", "ids-mvp"],
24
27
  component: Component,
25
28
  args: {
@@ -64,6 +67,7 @@ const meta: Meta<HeaderType> = {
64
67
  deepControls: { enabled: true },
65
68
  },
66
69
  argTypes: {
70
+ stacked: { control: "boolean" },
67
71
  title: { control: "text" },
68
72
  description: { control: "text" },
69
73
  // @ts-expect-error The controls follow the shape
@@ -75,7 +79,7 @@ const meta: Meta<HeaderType> = {
75
79
  }
76
80
 
77
81
  export default meta
78
- type Story = StoryObj<HeaderType>
82
+ type Story = StoryObj<MxHeaderType>
79
83
 
80
84
  export const Header: Story = {}
81
85
 
@@ -90,21 +94,7 @@ export const Search: Story = {
90
94
  args: {
91
95
  search: SearchForm({
92
96
  action: "#search",
93
- input: InputText({
94
- id: "search-keyword",
95
- type: InputTypeTypes.SEARCH,
96
- name: "search-form",
97
- placeholder: "Keywords...",
98
- label: "Search by keywords",
99
- }),
100
- button: Button({
101
- title: "Search",
102
- iconOnly: true,
103
- iconStart: Icon({
104
- icon: Icons.SEARCH,
105
- }),
106
- as: ButtonTypes.SUBMIT,
107
- }),
97
+ id: "search-keyword",
108
98
  }),
109
99
  },
110
100
  }
@@ -125,23 +115,10 @@ export const Controls: Story = {
125
115
 
126
116
  export const Stacked: Story = {
127
117
  args: {
118
+ stacked: true,
128
119
  search: SearchForm({
129
120
  action: "#search",
130
- input: InputText({
131
- id: "search-keyword",
132
- type: InputTypeTypes.SEARCH,
133
- name: "search-form",
134
- placeholder: "Keywords...",
135
- label: "Search by keywords",
136
- }),
137
- button: Button({
138
- title: "Search",
139
- iconOnly: true,
140
- iconStart: Icon({
141
- icon: Icons.SEARCH,
142
- }),
143
- as: ButtonTypes.SUBMIT,
144
- }),
121
+ id: "search-keyword",
145
122
  }),
146
123
  controls: [
147
124
  Button({
@@ -248,5 +225,4 @@ export const Stacked: Story = {
248
225
  ],
249
226
  }),
250
227
  },
251
- render: args => `${StackedComponent(args)}`,
252
228
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Layout/Header Controls smoke-test 1`] = `
4
4
  <div class="mx-page">
5
- <header class="mx-header mx-section mx-section--s">
5
+ <header class="mx-header mx-section__full mx-page mx-section--s">
6
6
  <div class="mx-header__inner">
7
7
  <div class="mx-header__brand">
8
8
  <a class="mx-logo"
@@ -77,7 +77,7 @@ exports[`Layout/Header Controls smoke-test 1`] = `
77
77
 
78
78
  exports[`Layout/Header Header smoke-test 1`] = `
79
79
  <div class="mx-page">
80
- <header class="mx-header mx-section mx-section--s">
80
+ <header class="mx-header mx-section__full mx-page mx-section--s">
81
81
  <div class="mx-header__inner">
82
82
  <div class="mx-header__brand">
83
83
  <a class="mx-logo"
@@ -143,7 +143,7 @@ exports[`Layout/Header Header smoke-test 1`] = `
143
143
 
144
144
  exports[`Layout/Header Search smoke-test 1`] = `
145
145
  <div class="mx-page">
146
- <header class="mx-header mx-section mx-section--s">
146
+ <header class="mx-header mx-section__full mx-page mx-section--s">
147
147
  <div class="mx-header__inner">
148
148
  <div class="mx-header__brand">
149
149
  <a class="mx-logo"
@@ -228,7 +228,7 @@ exports[`Layout/Header Search smoke-test 1`] = `
228
228
  <button class="mx-button mx-button--icon-only"
229
229
  type="submit"
230
230
  >
231
- <span class="mx-icon mx-icon--search ">
231
+ <span class="mx-icon mx-icon--search">
232
232
  </span>
233
233
  <span class="sr-only">
234
234
  Search
@@ -244,7 +244,7 @@ exports[`Layout/Header Search smoke-test 1`] = `
244
244
 
245
245
  exports[`Layout/Header Stacked smoke-test 1`] = `
246
246
  <div class="mx-page">
247
- <header class="mx-header mx-section mx-section--s">
247
+ <header class="mx-header mx-section__full mx-page mx-section--s">
248
248
  <div class="mx-header__inner">
249
249
  <div class="mx-header__brand">
250
250
  <a class="mx-logo"
@@ -273,38 +273,40 @@ exports[`Layout/Header Stacked smoke-test 1`] = `
273
273
  </button>
274
274
  </mx-global-toggle>
275
275
  </div>
276
- <div id="unique-0"
277
- class="mx-header__search"
278
- aria-label="Search"
279
- role="region"
280
- >
281
- <form class="mx-form mx-form--inline-button"
282
- role="search"
283
- action="#search"
276
+ <div class="mx-header__main">
277
+ <div id="unique-0"
278
+ class="mx-header__search"
279
+ aria-label="Search"
280
+ role="region"
284
281
  >
285
- <input class="mx-input__text "
286
- id="search-keyword"
287
- name="search-form"
288
- type="search"
289
- value
290
- aria-label="Search by keywords"
291
- placeholder="Keywords..."
292
- >
293
- <button class="mx-button mx-button--icon-only"
294
- type="submit"
282
+ <form class="mx-form mx-form--inline-button"
283
+ role="search"
284
+ action="#search"
295
285
  >
296
- <span class="mx-icon mx-icon--search ">
297
- </span>
298
- <span class="sr-only">
299
- Search
300
- </span>
301
- </button>
302
- </form>
286
+ <input class="mx-input__text "
287
+ id="search-keyword"
288
+ name="search-form"
289
+ type="search"
290
+ value
291
+ aria-label="Search by keywords"
292
+ placeholder="Keywords..."
293
+ >
294
+ <button class="mx-button mx-button--icon-only"
295
+ type="submit"
296
+ >
297
+ <span class="mx-icon mx-icon--search">
298
+ </span>
299
+ <span class="sr-only">
300
+ Search
301
+ </span>
302
+ </button>
303
+ </form>
304
+ </div>
303
305
  </div>
304
306
  </div>
305
307
  </header>
306
308
  <div id="unique-1"
307
- class="mx-header__nav mx-section"
309
+ class="mx-header__nav mx-section__full mx-page"
308
310
  aria-label="Primary navigation"
309
311
  role="region"
310
312
  >
@@ -450,7 +452,7 @@ exports[`Layout/Header Stacked smoke-test 1`] = `
450
452
 
451
453
  exports[`Layout/Header WithTitle smoke-test 1`] = `
452
454
  <div class="mx-page">
453
- <header class="mx-header mx-section mx-section--s">
455
+ <header class="mx-header mx-section__full mx-page mx-section--s">
454
456
  <div class="mx-header__inner">
455
457
  <div class="mx-header__brand">
456
458
  <a class="mx-logo"
@@ -7,6 +7,7 @@
7
7
  position: relative;
8
8
  display: grid;
9
9
  grid-template-columns: 1fr auto;
10
+ align-items: center;
10
11
  }
11
12
 
12
13
  .mx-header__brand {
@@ -51,6 +52,7 @@
51
52
 
52
53
  .mx-header__search {
53
54
  position: absolute;
55
+ z-index: 2;
54
56
  inset-block-start: 2px;
55
57
  inset-inline-start: 0;
56
58
  inline-size: 100%;
@@ -73,7 +75,9 @@
73
75
  }
74
76
 
75
77
  & input {
76
- max-inline-size: 150px;
78
+ @media (--global-nav-up) {
79
+ max-inline-size: 150px;
80
+ }
77
81
  }
78
82
  }
79
83
 
@@ -81,11 +85,19 @@
81
85
  * Primary Header Stacked
82
86
  */
83
87
  .mx-header__nav-inner {
84
- display: flex;
88
+ @media (--global-nav-up) {
89
+ display: flex;
90
+ }
85
91
  }
86
92
 
87
93
  .mx-header__nav-right {
88
- margin-inline-start: auto;
94
+ margin-block: var(--spacing-m);
95
+
96
+ @media (--global-nav-up) {
97
+ margin-inline-start: auto;
98
+ margin-block: 0;
99
+ padding-block: 4px;
100
+ }
89
101
  }
90
102
  }
91
103
 
@@ -1,7 +1,8 @@
1
1
  {% set baseClass = 'mx-header' %}
2
2
  {% set classes = [
3
3
  baseClass,
4
- 'mx-section',
4
+ 'mx-section__full',
5
+ 'mx-page',
5
6
  'mx-section--s',
6
7
  ] %}
7
8
  {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
@@ -29,7 +30,7 @@
29
30
  </div>
30
31
  {% endif %}
31
32
  <div class="mx-header__main">
32
- {% if navigation is not empty %}
33
+ {% if navigation is not empty and not stacked %}
33
34
  <div id="primary-nav" class="mx-header__nav global-nav-up-only" aria-label="Primary navigation">
34
35
  {{ navigation }}
35
36
  </div>
@@ -39,9 +40,25 @@
39
40
  {{ search }}
40
41
  </div>
41
42
  {% endif %}
42
- {% for control in controls %}
43
- {{ control }}
44
- {% endfor %}
43
+ {% if not stacked %}
44
+ {% for control in controls %}
45
+ {{ control }}
46
+ {% endfor %}
47
+ {% endif %}
45
48
  </div>
46
49
  </div>
47
50
  </header>
51
+ {% if stacked and (navigation is not empty or controls is not empty) %}
52
+ <div id="primary-nav" class="mx-header__nav mx-section__full mx-page global-nav-up-only" aria-label="Primary navigation">
53
+ <div class="mx-header__nav-inner">
54
+ {{ navigation }}
55
+ {% if controls is not empty %}
56
+ <div class="mx-header__nav-right">
57
+ {% for control in controls %}
58
+ {{ control }}
59
+ {% endfor %}
60
+ </div>
61
+ {% endif %}
62
+ </div>
63
+ </div>
64
+ {% endif %}
@@ -6,11 +6,9 @@ import { Page } from "../../../.storybook/decorators"
6
6
 
7
7
  type SidebarArgs = {
8
8
  content?: string | HTMLElement
9
- contentClass?: string
10
9
  order?: SidebarOrder
11
10
  before?: boolean
12
11
  sidebarContent?: string | HTMLElement
13
- sidebarClass?: string
14
12
  }
15
13
 
16
14
  const meta: Meta<SidebarArgs> = {
@@ -9,14 +9,21 @@
9
9
  }
10
10
 
11
11
  &:where(:has(> aside)) {
12
- @media (--medium-up) {
13
- display: grid;
14
- grid-template-columns: var(--container-max-width, 76ch) auto;
15
- gap: var(--sidebar-gap, var(--gap));
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ gap: var(--sidebar-gap, var(--gap));
15
+ justify-content: space-between;
16
16
 
17
- @media (--large-up) {
18
- --sidebar-gap: 18ch;
19
- }
17
+ & > aside {
18
+ flex-grow: 1;
19
+ max-inline-size: var(--sidebar-width, 24ch);
20
+ }
21
+
22
+ & > section {
23
+ flex-basis: 0;
24
+ flex-grow: 999;
25
+ min-inline-size: var(--content-min, 50%);
26
+ max-inline-size: var(--container-max-width, 76ch);
20
27
  }
21
28
 
22
29
  &.mx-grid--sidebar-rev {
@@ -44,16 +51,6 @@
44
51
  }
45
52
  }
46
53
  }
47
-
48
- &:is(.mx-grid--sidebar-rev, .mx-grid--sidebar-rev-lg) {
49
- @media (--large-up) {
50
- grid-template-columns: auto var(--container-max-width, 76ch);
51
- }
52
- }
53
- }
54
-
55
- &:where(:has(> aside:first-child)) {
56
- grid-template-columns: auto var(--container-max-width, 76ch);
57
54
  }
58
55
  }
59
56
  }
@@ -4,10 +4,12 @@
4
4
  order ? "mx-grid--"~order : null,
5
5
  ] %}
6
6
  {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
7
+ {% set sidebarAttributes = (sidebarAttributes ?? create_attribute()) %}
8
+ {% set contentAttributes = (contentAttributes ?? create_attribute()) %}
7
9
 
8
10
  {% if sidebarContent is not empty %}
9
11
  {% set sidebar %}
10
- <aside{% if sidebarClass is not empty %} class="{{ sidebarClass }}"{% endif %}>
12
+ <aside{{ sidebarAttributes }}>
11
13
  {{ sidebarContent }}
12
14
  </aside>
13
15
  {% endset %}
@@ -17,7 +19,7 @@
17
19
  {% if sidebar is not empty and before %}
18
20
  {{ sidebar }}
19
21
  {% endif %}
20
- <section{% if contentClass is not empty %} class="{{ contentClass }}"{% endif %}>
22
+ <section{{ contentAttributes }}>
21
23
  {{ content }}
22
24
  </section>
23
25
  {% if sidebar is not empty and not before %}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=steps.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"steps.entry.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
File without changes
@@ -1,51 +0,0 @@
1
- {% set baseClass = 'mx-header' %}
2
- {% set classes = [
3
- baseClass,
4
- 'mx-section',
5
- 'mx-section--s',
6
- ] %}
7
- {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
8
- <header{{ attributes }}>
9
- <div class="mx-header__inner">
10
- {% if logo is not empty or title is not empty or description is not empty %}
11
- <div class="mx-header__brand">
12
- <a class="mx-logo" href="/">{{ logo }}</a>
13
- {% if title is not empty or description is not empty %}
14
- <div class="mx-header__name">
15
- {% if title is not empty %}<strong>{{ title }}</strong>{% endif %}
16
- {{ description }}
17
- </div>
18
- {% endif %}
19
- </div>
20
- {% endif %}
21
- {% if navigation is not empty or search is not empty %}
22
- <div class="mx-header__toggles">
23
- {% if search is not empty %}
24
- <mx-global-toggle hideMenu><button aria-controls="primary-search" class="mx-button mx-button--icon-only mx-icon mx-icon--search" disabled>Open Search</button></mx-global-toggle>
25
- {% endif %}
26
- {% if navigation is not empty %}
27
- <mx-global-toggle><button aria-controls="primary-nav" class="mx-button mx-button--dark mx-button--icon-only mx-icon mx-icon--menu" disabled>Open Menu</button></mx-global-toggle>
28
- {% endif %}
29
- </div>
30
- {% endif %}
31
- {% if search is not empty %}
32
- <div id="primary-search" class="mx-header__search global-nav-up-only" aria-label="Search">
33
- {{ search }}
34
- </div>
35
- {% endif %}
36
- </div>
37
- </header>
38
- {% if navigation is not empty or controls is not empty %}
39
- <div id="primary-nav" class="mx-header__nav mx-section global-nav-up-only" aria-label="Primary navigation">
40
- <div class="mx-header__nav-inner">
41
- {{ navigation }}
42
- {% if controls is not empty %}
43
- <div class="mx-header__nav-right">
44
- {% for control in controls %}
45
- {{ control }}
46
- {% endfor %}
47
- </div>
48
- {% endif %}
49
- </div>
50
- </div>
51
- {% endif %}
Binary file