@onsvisual/svelte-components 0.1.86-component.toolbar → 0.1.88-component.toolbar

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,6 +9,7 @@ declare const __propDef: {
9
9
  helpText?: string | null;
10
10
  selected?: boolean;
11
11
  custom?: boolean;
12
+ hasAriaControls?: boolean;
12
13
  };
13
14
  events: {
14
15
  click: CustomEvent<any>;
@@ -21,7 +21,8 @@ $: if (triggerElement) {
21
21
  const spaceRight = window.innerWidth - rect.right;
22
22
  // Default to position below the trigger element
23
23
  modalPosition = {
24
- top: rect.bottom + window.scrollY + 10,
24
+ // top: rect.bottom + window.scrollY + 10,
25
+ top: window.scrollY + 55,
25
26
  left: window.scrollX - 10,
26
27
  };
27
28
  // Align notch with the center of the trigger element
@@ -118,7 +119,8 @@ function handleKeydown(event) {
118
119
  />
119
120
  </div>
120
121
  <div class="ons-grid--flex ons-grid--between ons-grid--vertical-center">
121
- <a on:click="{handleSkip}">Skip</a>
122
+ <button class="btn-link" on:click="{handleSkip}" aria-label="Skip instructions">Skip</button
123
+ >
122
124
  {#if $buttonIds.indexOf($activeModalId) > 0}
123
125
  <span style="margin-left:auto; margin-right:10px">
124
126
  <Button variant="secondary" on:click="{previousModal}">Back</Button>
@@ -154,7 +156,7 @@ function handleKeydown(event) {
154
156
  }
155
157
 
156
158
  .help-modal {
157
- position: absolute;
159
+ position: fixed;
158
160
  flex-direction: column;
159
161
  justify-content: center;
160
162
  align-items: flex-start;
@@ -191,4 +193,28 @@ function handleKeydown(event) {
191
193
  .ons-padding-4 {
192
194
  padding-top: var(--4-units, 16px);
193
195
  padding-bottom: var(--4-units, 16px);
196
+ }
197
+
198
+ button.btn-link {
199
+ line-height: 1.3;
200
+ color: var(--link, #206095);
201
+ background: none;
202
+ margin: 0;
203
+ padding: 0;
204
+ border: none;
205
+ text-decoration: underline;
206
+ text-decoration-thickness: 1px;
207
+ text-underline-position: under;
208
+ }
209
+ button.btn-link:hover {
210
+ color: var(--link-hover, #003c57) !important;
211
+ text-decoration-thickness: 2px;
212
+ }
213
+ button.btn-link:focus {
214
+ background-color: #fbc900 !important;
215
+ box-shadow: 0 -2px #fbc900, 0 4px #222;
216
+ color: #222 !important;
217
+ outline: 3px solid transparent;
218
+ outline-offset: 1px;
219
+ text-decoration: none;
194
220
  }</style>
@@ -48,7 +48,7 @@
48
48
  display: flex;
49
49
  align-items: center;
50
50
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
51
- border-radius: 16px;
51
+ border-radius: 8px;
52
52
  padding: 8px;
53
53
  justify-content: flex-start;
54
54
  align-content: flex-start;
@@ -57,6 +57,8 @@
57
57
  max-width: -moz-fit-content;
58
58
  max-width: fit-content;
59
59
  height: 100%;
60
+ margin: 8px;
61
+ background: white;
60
62
  }
61
63
 
62
64
  .flex-col {
@@ -11,6 +11,7 @@ export let classes = "";
11
11
  export let helpText = null;
12
12
  export let selected = false;
13
13
  export let custom = false;
14
+ export let hasAriaControls = false;
14
15
  const dispatch = createEventDispatcher();
15
16
  let buttonElement;
16
17
  // Get activeModalId store from context
@@ -53,7 +54,7 @@ function handleClick() {
53
54
  disabled="{disabled}"
54
55
  bind:this="{buttonElement}"
55
56
  id="button-{id}"
56
- aria-controls="panel-{id}"
57
+ aria-controls="{hasAriaControls ? `panel-${id}` : undefined}"
57
58
  >
58
59
  {#if icon}
59
60
  <Icon type="{icon}" selected="{isActive ? true : false}" disabled="{disabled}" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.86-component.toolbar",
3
+ "version": "0.1.88-component.toolbar",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",
@@ -17,7 +17,8 @@
17
17
  "build": "npm-run-all build:package build:docs",
18
18
  "deploy": "gh-pages -d docs -t true",
19
19
  "prepublishOnly": "npm run build:package",
20
- "postversion": "git push origin && git push origin --tags"
20
+ "postversion": "git push origin && git push origin --tags",
21
+ "watch:package": "npx nodemon --ext svelte,js,ts --ignore dist/ --exec 'npm run build:package'"
21
22
  },
22
23
  "license": "MIT",
23
24
  "types": "./dist/@types/index.d.ts",
@@ -71,6 +72,7 @@
71
72
  "gh-pages": "^6.2.0",
72
73
  "kleur": "^4.1.5",
73
74
  "nanoid": "^5.0.9",
75
+ "nodemon": "^3.1.9",
74
76
  "npm-run-all": "^4.1.5",
75
77
  "postcss": "^8.4.24",
76
78
  "postcss-load-config": "^4.0.1",