@dosgato/dialog 1.1.1 → 1.1.2

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.
@@ -243,15 +243,24 @@ $: void updateSelected($value);
243
243
  align-items: flex-start;
244
244
  margin-top: 0.2em;
245
245
  }
246
+ :global([data-eq~="400px"]) .dialog-chooser-entry {
247
+ flex-direction: column;
248
+ }
246
249
  .dialog-chooser-entry > button {
247
250
  border-radius: 0.25em;
248
- border: 1px solid #808080;
249
- color: black;
251
+ border: 0;
252
+ background-color: var(--dg-button-bg, #501214);
253
+ color: var(--dg-button-text, #fff);
254
+ padding: 0.5em 1em;
255
+ font-size: 0.8em;
250
256
  }
251
257
  .dialog-chooser-entry-input {
252
258
  position: relative;
253
259
  flex-grow: 1;
254
260
  }
261
+ :global([data-eq~="400px"]) .dialog-chooser-entry-input {
262
+ margin-bottom: 0.2em;
263
+ }
255
264
  .dialog-chooser-entry-input input {
256
265
  width: 100%;
257
266
  padding-right: 1.4em;
package/dist/Tabs.svelte CHANGED
@@ -11,6 +11,11 @@ export let active = undefined;
11
11
  export let store = new TabStore(tabs, active);
12
12
  export let disableDialogControl = false;
13
13
  export let accordionOnMobile = true;
14
+ /**
15
+ * Takes the width of the tabs area, in pixels, and returns the number of tabs that should be
16
+ * displayed at that width.
17
+ */
18
+ export let columnsShown = undefined;
14
19
  $: store.update(v => ({ ...v, tabs, accordionOnMobile }));
15
20
  const activeStore = new Store({});
16
21
  const tabelements = [];
@@ -30,7 +35,7 @@ if (!disableDialogControl)
30
35
  const currentName = store.currentName();
31
36
  const currentIdx = store.currentIdx();
32
37
  const accordion = store.accordion();
33
- $: cols = Math.min(Math.floor(($store.clientWidth ?? 1024) / 90), $store.tabs.length);
38
+ $: cols = (typeof columnsShown === 'function') ? columnsShown($store.clientWidth ?? 1024) : Math.min(Math.floor(($store.clientWidth ?? 1024) / 90), $store.tabs.length);
34
39
  $: scalefactor = Math.min(roundTo(($store.clientWidth ?? 1024) / (cols * 130), 4), 1);
35
40
  $: wrapping = cols !== $store.tabs.length;
36
41
  $: dialogContext.hasTabs = !$accordion;
@@ -7,6 +7,10 @@ declare const __propDef: {
7
7
  store?: TabStore | undefined;
8
8
  disableDialogControl?: boolean | undefined;
9
9
  accordionOnMobile?: boolean | undefined;
10
+ /**
11
+ * Takes the width of the tabs area, in pixels, and returns the number of tabs that should be
12
+ * displayed at that width.
13
+ */ columnsShown?: ((tabsWidth: number) => number) | undefined;
10
14
  };
11
15
  events: {
12
16
  [evt: string]: CustomEvent<any>;
@@ -151,7 +151,7 @@ let thumbnailExpanded = false;
151
151
  .dialog-chooser-chooser {
152
152
  order: 3;
153
153
  width: 100%;
154
- height: 50%;
154
+ height: 70%;
155
155
  }
156
156
  }
157
157
 
@@ -156,8 +156,11 @@ function onKeyDown(e) {
156
156
  <style>
157
157
  .select-icon {
158
158
  border-radius: 0.25em;
159
- border: 1px solid #808080;
160
- color: black;
159
+ border: 0px;
160
+ background-color: var(--dg-button-bg, #501214);
161
+ color: var(--dg-button-text, #fff);
162
+ padding: 0.5em 1em;
163
+ font-size: 0.8em;
161
164
  }
162
165
  section {
163
166
  position: relative;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dosgato/dialog",
3
3
  "description": "A component library for building forms that edit a JSON document.",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "scripts": {
6
6
  "prepublishOnly": "svelte-package",
7
7
  "dev": "vite dev --force",