@lavalogic/scoria 0.4.4 → 0.5.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.
- package/dist/Components/CollapsibleCard.svelte +9 -3
- package/dist/Components/CollapsibleCard.svelte.d.ts +1 -0
- package/dist/Components/Contexts/Toast.svelte +1 -1
- package/dist/Components/Table/Misc/FilterInput.svelte +26 -4
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +2 -0
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +2 -0
- package/dist/Components/Table/Types/Filtering/ColumnFiltersState.d.ts +2 -2
- package/dist/Components/Table/Types/Filtering/CustomRemoteFilters.d.ts +2 -1
- package/dist/Components/Touch/BoolCard.svelte +1 -1
- package/dist/Components/Touch/SummaryCard.svelte +3 -3
- package/dist/Components/Touch/UtilityButton.svelte +1 -1
- package/dist/Helpers/Helpers.svelte.d.ts +1 -0
- package/dist/Helpers/Helpers.svelte.js +19 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/scss/_mixins.scss +228 -0
- package/dist/scss/_sizing.scss +5 -8
- package/dist/scss/sizing.d.ts +46 -0
- package/dist/scss/sizing.js +62 -0
- package/package.json +16 -16
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
children?: Snippet;
|
|
10
10
|
maxHeight?: number;
|
|
11
11
|
grow?: boolean;
|
|
12
|
+
isCollapsed?: boolean;
|
|
12
13
|
}
|
|
13
14
|
</script>
|
|
14
15
|
|
|
@@ -17,9 +18,14 @@
|
|
|
17
18
|
import { Size } from '../Types/Internal/Size.js';
|
|
18
19
|
import { Colour } from '../scss/colours.js';
|
|
19
20
|
|
|
20
|
-
let {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let {
|
|
22
|
+
title,
|
|
23
|
+
subtitle,
|
|
24
|
+
maxHeight: maxHeight,
|
|
25
|
+
children,
|
|
26
|
+
grow,
|
|
27
|
+
isCollapsed = $bindable(false)
|
|
28
|
+
}: CollapsibleCard = $props();
|
|
23
29
|
|
|
24
30
|
let cardRef: HTMLDivElement | undefined = $state();
|
|
25
31
|
|
|
@@ -146,9 +146,16 @@
|
|
|
146
146
|
if (isRemoteSelect && !tableContext.paginationRepo?.filtering) {
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
+
if (def.debug) {
|
|
150
|
+
console.log('filtering state value:', $state.snapshot(filteringStateValue));
|
|
151
|
+
}
|
|
149
152
|
void filteringStateValue;
|
|
150
153
|
|
|
151
154
|
if (hasQuery) {
|
|
155
|
+
if (def.debug) {
|
|
156
|
+
console.log('has query');
|
|
157
|
+
}
|
|
158
|
+
|
|
152
159
|
untrack(async () => {
|
|
153
160
|
try {
|
|
154
161
|
// as unknown as string | number | undefined;
|
|
@@ -157,6 +164,10 @@
|
|
|
157
164
|
const x = tableContext.__queryValues.get(
|
|
158
165
|
customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey ?? _uuid
|
|
159
166
|
);
|
|
167
|
+
|
|
168
|
+
if (def.debug) {
|
|
169
|
+
console.log('value:', x);
|
|
170
|
+
}
|
|
160
171
|
value = (x ?? null) as SelectOption<unknown> | null;
|
|
161
172
|
}
|
|
162
173
|
} catch (e) {
|
|
@@ -165,9 +176,16 @@
|
|
|
165
176
|
}
|
|
166
177
|
});
|
|
167
178
|
} else if (isSelect) {
|
|
179
|
+
if (def.debug) {
|
|
180
|
+
console.log('is select (not query)');
|
|
181
|
+
}
|
|
168
182
|
untrack(async () => {
|
|
169
183
|
try {
|
|
170
|
-
const
|
|
184
|
+
const opts = await options;
|
|
185
|
+
if (def.debug) {
|
|
186
|
+
console.log('possible options:', $state.snapshot(options));
|
|
187
|
+
}
|
|
188
|
+
const x = opts.filter((it) => {
|
|
171
189
|
if (it.value != null && (typeof it.value == 'string' || typeof it.value == 'number')) {
|
|
172
190
|
return (
|
|
173
191
|
filteringStateValue as unknown as Array<string | number> | undefined
|
|
@@ -175,6 +193,9 @@
|
|
|
175
193
|
}
|
|
176
194
|
return false;
|
|
177
195
|
});
|
|
196
|
+
if (def.debug) {
|
|
197
|
+
console.log('selected options:', x);
|
|
198
|
+
}
|
|
178
199
|
selectedOptions = x;
|
|
179
200
|
} catch (e) {
|
|
180
201
|
console.warn(e);
|
|
@@ -211,7 +232,7 @@
|
|
|
211
232
|
) {
|
|
212
233
|
value = filteringStateValue;
|
|
213
234
|
} else {
|
|
214
|
-
console.
|
|
235
|
+
console.warn('unknown value type:', $state.snapshot(filteringStateValue));
|
|
215
236
|
value = filteringStateValue as string; // HACK attempt to keep production running
|
|
216
237
|
}
|
|
217
238
|
}
|
|
@@ -354,7 +375,7 @@
|
|
|
354
375
|
<!-- TODO: multiselect -->
|
|
355
376
|
|
|
356
377
|
<QuerySelect
|
|
357
|
-
valueAsObject
|
|
378
|
+
valueAsObject={customFilter!.valueAsObject ?? true}
|
|
358
379
|
{label}
|
|
359
380
|
clearable
|
|
360
381
|
name={customFilter?.objectName ?? 'Item'}
|
|
@@ -366,7 +387,8 @@
|
|
|
366
387
|
onchange={(newValue) => {
|
|
367
388
|
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
368
389
|
tableContext.__queryValues.set(label ?? _uuid, newValue);
|
|
369
|
-
|
|
390
|
+
// FIXME <T> is lost when autoformatting. why?
|
|
391
|
+
value = newValue as SelectOption<T> | null;
|
|
370
392
|
}}
|
|
371
393
|
/>
|
|
372
394
|
{:else}
|
|
@@ -9,6 +9,7 @@ import type { FilterValueType } from '../../Filtering/FilterValueType.js';
|
|
|
9
9
|
export interface ColumnDefProps<T extends object, FilterFnType = undefined> {
|
|
10
10
|
id: string;
|
|
11
11
|
header: string | Snippet;
|
|
12
|
+
debug?: boolean;
|
|
12
13
|
index?: number;
|
|
13
14
|
allowFiltering?: boolean;
|
|
14
15
|
allowSorting?: boolean;
|
|
@@ -26,6 +27,7 @@ export interface ColumnDefProps<T extends object, FilterFnType = undefined> {
|
|
|
26
27
|
export declare abstract class ColumnDef<T extends object, FilterFnType = undefined> {
|
|
27
28
|
protected constructor(props: ColumnDefProps<T, FilterFnType>);
|
|
28
29
|
readonly id: string;
|
|
30
|
+
debug: boolean;
|
|
29
31
|
private _index;
|
|
30
32
|
get index(): number;
|
|
31
33
|
set index(v: number);
|
|
@@ -15,8 +15,10 @@ export class ColumnDef {
|
|
|
15
15
|
this.header = $derived(props.header);
|
|
16
16
|
this._filterValueType = $derived(props.filterValueType);
|
|
17
17
|
this._getDisplayValue = $derived(props.getDisplayValue);
|
|
18
|
+
this.debug = $derived(props.debug ?? false);
|
|
18
19
|
}
|
|
19
20
|
id;
|
|
21
|
+
debug;
|
|
20
22
|
_index;
|
|
21
23
|
get index() {
|
|
22
24
|
return this._index;
|
|
@@ -284,7 +284,7 @@ button.summary-card h3 {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
.card-detail {
|
|
287
|
-
font-size: 1.
|
|
287
|
+
font-size: 1.125rem;
|
|
288
288
|
font-weight: 600;
|
|
289
289
|
background-color: #f4f7f9;
|
|
290
290
|
color: #3a4952;
|
|
@@ -301,7 +301,7 @@ button.summary-card h3 {
|
|
|
301
301
|
cursor: unset;
|
|
302
302
|
}
|
|
303
303
|
.card-detail.uom {
|
|
304
|
-
font-size: 1.
|
|
304
|
+
font-size: 1.0625rem;
|
|
305
305
|
color: #647d8e;
|
|
306
306
|
--colour: #8096a5;
|
|
307
307
|
text-transform: uppercase;
|
|
@@ -336,7 +336,7 @@ button.summary-card h3 {
|
|
|
336
336
|
}
|
|
337
337
|
.card-detail.optional {
|
|
338
338
|
justify-content: end;
|
|
339
|
-
font-size: 1.
|
|
339
|
+
font-size: 1.0625rem;
|
|
340
340
|
display: none;
|
|
341
341
|
line-height: 1.5;
|
|
342
342
|
}
|
|
@@ -25,4 +25,5 @@ interface IErrorResponse {
|
|
|
25
25
|
export declare function isErrorResponse(error: unknown): error is IErrorResponse;
|
|
26
26
|
export declare function getErrorMessage(error: unknown, includeUUID?: boolean): string;
|
|
27
27
|
export declare function isValidEmailAddress(emailAddress: string): RegExpMatchArray | null;
|
|
28
|
+
export declare function gridItem(element: HTMLElement): (() => void) | undefined;
|
|
28
29
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Sizing } from '../scss/sizing.js';
|
|
1
2
|
export function autoPluralise(text, quantity = 2, { capitalise = false } = {}) {
|
|
2
3
|
if (quantity === 1) {
|
|
3
4
|
return text;
|
|
@@ -146,3 +147,21 @@ export function isValidEmailAddress(emailAddress) {
|
|
|
146
147
|
.toLowerCase()
|
|
147
148
|
.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
|
148
149
|
}
|
|
150
|
+
export function gridItem(element) {
|
|
151
|
+
const firstChild = element.firstElementChild;
|
|
152
|
+
if (!firstChild) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
let height = $state(0);
|
|
156
|
+
const spanHeight = $derived.by(() => {
|
|
157
|
+
return Math.ceil((height + Sizing['$regular-gap']) / 4);
|
|
158
|
+
});
|
|
159
|
+
$effect(() => {
|
|
160
|
+
element.style.gridRow = spanHeight ? `span ${spanHeight}` : '';
|
|
161
|
+
});
|
|
162
|
+
const observer = new ResizeObserver((entries) => {
|
|
163
|
+
height = entries[0].borderBoxSize[0].blockSize;
|
|
164
|
+
});
|
|
165
|
+
observer.observe(firstChild);
|
|
166
|
+
return () => observer.unobserve(firstChild);
|
|
167
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export { TooltipContext } from './Contexts/TooltipContext.svelte.js';
|
|
|
123
123
|
export { UntypedInputContext } from './Contexts/UntypedInputContext.svelte.js';
|
|
124
124
|
export { Delay } from './Delay/Delay.js';
|
|
125
125
|
export { DATAMatrix } from './Helpers/Datamatrix.js';
|
|
126
|
-
export { autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
|
|
126
|
+
export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
|
|
127
127
|
export { type INamed } from './Helpers/INamed.js';
|
|
128
128
|
export { AttributeOperation } from './Types/Internal/AttributeOperation.js';
|
|
129
129
|
export { type BigRadioOption } from './Types/Internal/BigRadioOption.js';
|
|
@@ -153,5 +153,6 @@ export { Validity } from './Types/Internal/Validity.js';
|
|
|
153
153
|
export { type ValidityWrapper } from './Types/Internal/ValidityWrapper.js';
|
|
154
154
|
export { Variant } from './Types/Internal/Variant.js';
|
|
155
155
|
export { Colour, ColourSet } from './scss/colours.js';
|
|
156
|
+
export { Sizing } from './scss/sizing.js';
|
|
156
157
|
export { FilterValueType } from './Components/Table/Types/Filtering/FilterValueType.js';
|
|
157
158
|
export { default as Pagination, type PaginationProps } from './Components/Base/Pagination.svelte';
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ export { TooltipContext } from './Contexts/TooltipContext.svelte.js';
|
|
|
130
130
|
export { UntypedInputContext } from './Contexts/UntypedInputContext.svelte.js';
|
|
131
131
|
export { Delay } from './Delay/Delay.js';
|
|
132
132
|
export { DATAMatrix } from './Helpers/Datamatrix.js';
|
|
133
|
-
export { autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
|
|
133
|
+
export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
|
|
134
134
|
export {} from './Helpers/INamed.js';
|
|
135
135
|
export { AttributeOperation } from './Types/Internal/AttributeOperation.js';
|
|
136
136
|
export {} from './Types/Internal/BigRadioOption.js';
|
|
@@ -158,5 +158,6 @@ export { Validity } from './Types/Internal/Validity.js';
|
|
|
158
158
|
export {} from './Types/Internal/ValidityWrapper.js';
|
|
159
159
|
export { Variant } from './Types/Internal/Variant.js';
|
|
160
160
|
export { Colour, ColourSet } from './scss/colours.js';
|
|
161
|
+
export { Sizing } from './scss/sizing.js';
|
|
161
162
|
export { FilterValueType } from './Components/Table/Types/Filtering/FilterValueType.js';
|
|
162
163
|
export { default as Pagination } from './Components/Base/Pagination.svelte';
|
package/dist/scss/_mixins.scss
CHANGED
|
@@ -2781,3 +2781,231 @@
|
|
|
2781
2781
|
background-color: rgba(0, 0, 0, 0.2);
|
|
2782
2782
|
}
|
|
2783
2783
|
}
|
|
2784
|
+
|
|
2785
|
+
@mixin grid {
|
|
2786
|
+
//taken from https://medium.com/@genildocs/the-12-column-grid-system-why-it-still-matters-in-the-css-grid-era-855eb835e038
|
|
2787
|
+
//adapted with https://css-tricks.com/piecing-together-approaches-for-a-css-masonry-layout/#aa-is-vertical-order-with-ragged-bottoms-ok
|
|
2788
|
+
|
|
2789
|
+
.grid {
|
|
2790
|
+
display: grid;
|
|
2791
|
+
grid-template-columns: repeat(12, 1fr);
|
|
2792
|
+
grid-auto-rows: 4px;
|
|
2793
|
+
width: 100%;
|
|
2794
|
+
|
|
2795
|
+
column-gap: sizing.$regular-gap;
|
|
2796
|
+
padding: sizing.$regular-padding;
|
|
2797
|
+
box-sizing: border-box;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
.nested-grid {
|
|
2801
|
+
display: grid;
|
|
2802
|
+
grid-template-columns: repeat(12, 1fr);
|
|
2803
|
+
gap: sizing.$regular-gap;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/* Responsive adjustments */
|
|
2807
|
+
@media (max-width: 768px) {
|
|
2808
|
+
.grid {
|
|
2809
|
+
grid-template-columns: 1fr;
|
|
2810
|
+
gap: sizing.$two-thirds-gap;
|
|
2811
|
+
padding: sizing.$two-thirds-padding;
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
@media (max-width: 480px) {
|
|
2816
|
+
.grid {
|
|
2817
|
+
padding: sizing.$half-gap;
|
|
2818
|
+
gap: sizing.$half-padding;
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
/* Column spanning utilities */
|
|
2823
|
+
.col-1 {
|
|
2824
|
+
grid-column: span 1;
|
|
2825
|
+
}
|
|
2826
|
+
.col-2 {
|
|
2827
|
+
grid-column: span 2;
|
|
2828
|
+
}
|
|
2829
|
+
.col-3 {
|
|
2830
|
+
grid-column: span 3;
|
|
2831
|
+
}
|
|
2832
|
+
.col-4 {
|
|
2833
|
+
grid-column: span 4;
|
|
2834
|
+
}
|
|
2835
|
+
.col-5 {
|
|
2836
|
+
grid-column: span 5;
|
|
2837
|
+
}
|
|
2838
|
+
.col-6 {
|
|
2839
|
+
grid-column: span 6;
|
|
2840
|
+
}
|
|
2841
|
+
.col-7 {
|
|
2842
|
+
grid-column: span 7;
|
|
2843
|
+
}
|
|
2844
|
+
.col-8 {
|
|
2845
|
+
grid-column: span 8;
|
|
2846
|
+
}
|
|
2847
|
+
.col-9 {
|
|
2848
|
+
grid-column: span 9;
|
|
2849
|
+
}
|
|
2850
|
+
.col-10 {
|
|
2851
|
+
grid-column: span 10;
|
|
2852
|
+
}
|
|
2853
|
+
.col-11 {
|
|
2854
|
+
grid-column: span 11;
|
|
2855
|
+
}
|
|
2856
|
+
.col-12 {
|
|
2857
|
+
grid-column: span 12;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/* Mobile-first responsive utilities */
|
|
2861
|
+
@media (min-width: 769px) {
|
|
2862
|
+
.md-col-1 {
|
|
2863
|
+
grid-column: span 1;
|
|
2864
|
+
}
|
|
2865
|
+
.md-col-2 {
|
|
2866
|
+
grid-column: span 2;
|
|
2867
|
+
}
|
|
2868
|
+
.md-col-3 {
|
|
2869
|
+
grid-column: span 3;
|
|
2870
|
+
}
|
|
2871
|
+
.md-col-4 {
|
|
2872
|
+
grid-column: span 4;
|
|
2873
|
+
}
|
|
2874
|
+
.md-col-5 {
|
|
2875
|
+
grid-column: span 5;
|
|
2876
|
+
}
|
|
2877
|
+
.md-col-6 {
|
|
2878
|
+
grid-column: span 6;
|
|
2879
|
+
}
|
|
2880
|
+
.md-col-7 {
|
|
2881
|
+
grid-column: span 7;
|
|
2882
|
+
}
|
|
2883
|
+
.md-col-8 {
|
|
2884
|
+
grid-column: span 8;
|
|
2885
|
+
}
|
|
2886
|
+
.md-col-9 {
|
|
2887
|
+
grid-column: span 9;
|
|
2888
|
+
}
|
|
2889
|
+
.md-col-10 {
|
|
2890
|
+
grid-column: span 10;
|
|
2891
|
+
}
|
|
2892
|
+
.md-col-11 {
|
|
2893
|
+
grid-column: span 11;
|
|
2894
|
+
}
|
|
2895
|
+
.md-col-12 {
|
|
2896
|
+
grid-column: span 12;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
@media (min-width: 1024px) {
|
|
2901
|
+
.lg-col-1 {
|
|
2902
|
+
grid-column: span 1;
|
|
2903
|
+
}
|
|
2904
|
+
.lg-col-2 {
|
|
2905
|
+
grid-column: span 2;
|
|
2906
|
+
}
|
|
2907
|
+
.lg-col-3 {
|
|
2908
|
+
grid-column: span 3;
|
|
2909
|
+
}
|
|
2910
|
+
.lg-col-4 {
|
|
2911
|
+
grid-column: span 4;
|
|
2912
|
+
}
|
|
2913
|
+
.lg-col-5 {
|
|
2914
|
+
grid-column: span 5;
|
|
2915
|
+
}
|
|
2916
|
+
.lg-col-6 {
|
|
2917
|
+
grid-column: span 6;
|
|
2918
|
+
}
|
|
2919
|
+
.lg-col-7 {
|
|
2920
|
+
grid-column: span 7;
|
|
2921
|
+
}
|
|
2922
|
+
.lg-col-8 {
|
|
2923
|
+
grid-column: span 8;
|
|
2924
|
+
}
|
|
2925
|
+
.lg-col-9 {
|
|
2926
|
+
grid-column: span 9;
|
|
2927
|
+
}
|
|
2928
|
+
.lg-col-10 {
|
|
2929
|
+
grid-column: span 10;
|
|
2930
|
+
}
|
|
2931
|
+
.lg-col-11 {
|
|
2932
|
+
grid-column: span 11;
|
|
2933
|
+
}
|
|
2934
|
+
.lg-col-12 {
|
|
2935
|
+
grid-column: span 12;
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
/* Column start utilities */
|
|
2940
|
+
.col-start-1 {
|
|
2941
|
+
grid-column-start: 1;
|
|
2942
|
+
}
|
|
2943
|
+
.col-start-2 {
|
|
2944
|
+
grid-column-start: 2;
|
|
2945
|
+
}
|
|
2946
|
+
.col-start-3 {
|
|
2947
|
+
grid-column-start: 3;
|
|
2948
|
+
}
|
|
2949
|
+
.col-start-4 {
|
|
2950
|
+
grid-column-start: 4;
|
|
2951
|
+
}
|
|
2952
|
+
.col-start-5 {
|
|
2953
|
+
grid-column-start: 5;
|
|
2954
|
+
}
|
|
2955
|
+
.col-start-6 {
|
|
2956
|
+
grid-column-start: 6;
|
|
2957
|
+
}
|
|
2958
|
+
.col-start-7 {
|
|
2959
|
+
grid-column-start: 7;
|
|
2960
|
+
}
|
|
2961
|
+
.col-start-8 {
|
|
2962
|
+
grid-column-start: 8;
|
|
2963
|
+
}
|
|
2964
|
+
.col-start-9 {
|
|
2965
|
+
grid-column-start: 9;
|
|
2966
|
+
}
|
|
2967
|
+
.col-start-10 {
|
|
2968
|
+
grid-column-start: 10;
|
|
2969
|
+
}
|
|
2970
|
+
.col-start-11 {
|
|
2971
|
+
grid-column-start: 11;
|
|
2972
|
+
}
|
|
2973
|
+
.col-start-12 {
|
|
2974
|
+
grid-column-start: 12;
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
/* Offset utilities (alternative approach) */
|
|
2978
|
+
.offset-1 {
|
|
2979
|
+
grid-column-start: 2;
|
|
2980
|
+
}
|
|
2981
|
+
.offset-2 {
|
|
2982
|
+
grid-column-start: 3;
|
|
2983
|
+
}
|
|
2984
|
+
.offset-3 {
|
|
2985
|
+
grid-column-start: 4;
|
|
2986
|
+
}
|
|
2987
|
+
.offset-4 {
|
|
2988
|
+
grid-column-start: 5;
|
|
2989
|
+
}
|
|
2990
|
+
.offset-5 {
|
|
2991
|
+
grid-column-start: 6;
|
|
2992
|
+
}
|
|
2993
|
+
.offset-6 {
|
|
2994
|
+
grid-column-start: 7;
|
|
2995
|
+
}
|
|
2996
|
+
.offset-7 {
|
|
2997
|
+
grid-column-start: 8;
|
|
2998
|
+
}
|
|
2999
|
+
.offset-8 {
|
|
3000
|
+
grid-column-start: 9;
|
|
3001
|
+
}
|
|
3002
|
+
.offset-9 {
|
|
3003
|
+
grid-column-start: 10;
|
|
3004
|
+
}
|
|
3005
|
+
.offset-10 {
|
|
3006
|
+
grid-column-start: 11;
|
|
3007
|
+
}
|
|
3008
|
+
.offset-11 {
|
|
3009
|
+
grid-column-start: 12;
|
|
3010
|
+
}
|
|
3011
|
+
}
|
package/dist/scss/_sizing.scss
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
$input-height: 3rem;
|
|
2
2
|
$input-width: 12rem;
|
|
3
|
-
// $input-width: 18.75rem;
|
|
4
|
-
// $input-width: 26rem;
|
|
5
3
|
|
|
6
4
|
$text-xx-large: 2rem;
|
|
7
5
|
$text-x-large: 1.75rem;
|
|
8
6
|
$text-large: 1.5rem;
|
|
9
7
|
$text-medium-large: 1.25rem;
|
|
10
|
-
$text-medium: 1.
|
|
11
|
-
$text-small-medium: 1.
|
|
12
|
-
$text-medium-small-medium: 1.
|
|
8
|
+
$text-medium: 1.1875rem; //19 px. not ideal
|
|
9
|
+
$text-small-medium: 1.125rem;
|
|
10
|
+
$text-medium-small-medium: 1.0625rem;
|
|
13
11
|
$text-regular: 1rem;
|
|
14
12
|
$text-small-small-medium: 0.875rem;
|
|
15
|
-
// $text-small: 0.84rem;
|
|
16
13
|
$text-small: 0.8125rem;
|
|
17
14
|
$text-extra-small: 0.75rem;
|
|
18
15
|
|
|
19
16
|
$font-weight-touch: 600;
|
|
20
17
|
|
|
21
|
-
$text-table: 0.
|
|
22
|
-
$text-table-footer: 0.
|
|
18
|
+
$text-table: 0.9375rem;
|
|
19
|
+
$text-table-footer: 0.8125rem;
|
|
23
20
|
|
|
24
21
|
$border-width-double: 2px;
|
|
25
22
|
$border-width: 1px;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const Sizing: {
|
|
2
|
+
'$input-height': number;
|
|
3
|
+
'$input-width': number;
|
|
4
|
+
'$text-xx-large': number;
|
|
5
|
+
'$text-x-large': number;
|
|
6
|
+
'$text-large': number;
|
|
7
|
+
'$text-medium-large': number;
|
|
8
|
+
'$text-medium': number;
|
|
9
|
+
'$text-small-medium': number;
|
|
10
|
+
'$text-medium-small-medium': number;
|
|
11
|
+
'$text-regular': number;
|
|
12
|
+
'$text-small-small-medium': number;
|
|
13
|
+
'$text-small': number;
|
|
14
|
+
'$text-extra-small': number;
|
|
15
|
+
'$text-table': number;
|
|
16
|
+
'$text-table-footer': number;
|
|
17
|
+
'$border-width-double': number;
|
|
18
|
+
'$border-width': number;
|
|
19
|
+
'$button-padding-xl': number;
|
|
20
|
+
'$button-padding-lg': number;
|
|
21
|
+
'$column-1-width': number;
|
|
22
|
+
'$column-3-width': number;
|
|
23
|
+
'$row-1-width': number;
|
|
24
|
+
'$double-padding': number;
|
|
25
|
+
'$double-gap': number;
|
|
26
|
+
'$five-quarters-padding': number;
|
|
27
|
+
'$five-quarters-gap': number;
|
|
28
|
+
'$regular-padding': number;
|
|
29
|
+
'$regular-gap': number;
|
|
30
|
+
'$two-thirds-gap': number;
|
|
31
|
+
'$two-thirds-padding': number;
|
|
32
|
+
'$half-gap': number;
|
|
33
|
+
'$half-padding': number;
|
|
34
|
+
'$third-gap': number;
|
|
35
|
+
'$third-padding': number;
|
|
36
|
+
'$quarter-gap': number;
|
|
37
|
+
'$quarter-padding': number;
|
|
38
|
+
'$button-card-inner-gap': number;
|
|
39
|
+
'$border-radius': number;
|
|
40
|
+
'$thick-border-radius': number;
|
|
41
|
+
'$min-modal-width': number;
|
|
42
|
+
'$max-modal-width': number;
|
|
43
|
+
'$table-header-height': number;
|
|
44
|
+
'$nav-height': number;
|
|
45
|
+
};
|
|
46
|
+
export type Sizing = (typeof Sizing)[keyof typeof Sizing];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//HACK manually created copy of the scss values IN PIXELS
|
|
2
|
+
// assumed font size is 16 for rem-px conversions
|
|
3
|
+
// If the values get updated on one side
|
|
4
|
+
// they MUST be manually updated on the other side too
|
|
5
|
+
export const Sizing = {
|
|
6
|
+
'$input-height': 48,
|
|
7
|
+
'$input-width': 192,
|
|
8
|
+
'$text-xx-large': 32,
|
|
9
|
+
'$text-x-large': 28,
|
|
10
|
+
'$text-large': 24,
|
|
11
|
+
'$text-medium-large': 20,
|
|
12
|
+
'$text-medium': 19,
|
|
13
|
+
'$text-small-medium': 18,
|
|
14
|
+
'$text-medium-small-medium': 17,
|
|
15
|
+
'$text-regular': 16,
|
|
16
|
+
'$text-small-small-medium': 14,
|
|
17
|
+
'$text-small': 13,
|
|
18
|
+
'$text-extra-small': 12,
|
|
19
|
+
// '$font-weight-touch': '600', //unrepresentable
|
|
20
|
+
'$text-table': 15,
|
|
21
|
+
'$text-table-footer': 13,
|
|
22
|
+
'$border-width-double': 2,
|
|
23
|
+
'$border-width': 1,
|
|
24
|
+
'$button-padding-xl': 32,
|
|
25
|
+
// '$button-padding-lg-wide': '1rem 2rem', //unrepresentable
|
|
26
|
+
'$button-padding-lg': 16,
|
|
27
|
+
'$column-1-width': 400,
|
|
28
|
+
// '$column-2-width': '1fr', //unrepresentable
|
|
29
|
+
'$column-3-width': 400,
|
|
30
|
+
'$row-1-width': 64,
|
|
31
|
+
// '$row-2-width': '1fr',//unrepresentable
|
|
32
|
+
'$double-padding': 48,
|
|
33
|
+
'$double-gap': 48,
|
|
34
|
+
'$five-quarters-padding': 30,
|
|
35
|
+
'$five-quarters-gap': 30,
|
|
36
|
+
'$regular-padding': 24,
|
|
37
|
+
'$regular-gap': 24,
|
|
38
|
+
'$two-thirds-gap': 20,
|
|
39
|
+
'$two-thirds-padding': 20,
|
|
40
|
+
'$half-gap': 12,
|
|
41
|
+
'$half-padding': 12,
|
|
42
|
+
'$third-gap': 8,
|
|
43
|
+
'$third-padding': 8,
|
|
44
|
+
'$quarter-gap': 6,
|
|
45
|
+
'$quarter-padding': 6,
|
|
46
|
+
// '$circular-button-padding': '0.52rem',
|
|
47
|
+
// '$card-half-padding': '0.38rem',
|
|
48
|
+
// '$card-padding': '0.76rem',
|
|
49
|
+
// '$card-gap': '0.76rem',
|
|
50
|
+
// '$card-gap-half': '0.38rem',
|
|
51
|
+
// '$card-detail-padding': '4px 12px',
|
|
52
|
+
// '$card-title': '$text-large',
|
|
53
|
+
// '$card-inner-gap': '0.25rem',
|
|
54
|
+
'$button-card-inner-gap': 8,
|
|
55
|
+
'$border-radius': 4,
|
|
56
|
+
'$thick-border-radius': 5,
|
|
57
|
+
'$min-modal-width': 644,
|
|
58
|
+
'$max-modal-width': 1728,
|
|
59
|
+
'$table-header-height': 48,
|
|
60
|
+
'$nav-height': 52
|
|
61
|
+
};
|
|
62
|
+
Object.freeze(Sizing);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lavalogic/scoria",
|
|
3
3
|
"description": "Svelte components used for the FloWMS Web Frontend",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -33,38 +33,38 @@
|
|
|
33
33
|
"@eslint/compat": "^2.0.0",
|
|
34
34
|
"@eslint/js": "^9.39.1",
|
|
35
35
|
"@playwright/test": "^1.57.0",
|
|
36
|
-
"@storybook/addon-a11y": "^10.1.
|
|
37
|
-
"@storybook/addon-docs": "^10.1.
|
|
36
|
+
"@storybook/addon-a11y": "^10.1.7",
|
|
37
|
+
"@storybook/addon-docs": "^10.1.7",
|
|
38
38
|
"@storybook/addon-svelte-csf": "^5.0.10",
|
|
39
|
-
"@storybook/addon-vitest": "^10.1.
|
|
40
|
-
"@storybook/sveltekit": "^10.1.
|
|
39
|
+
"@storybook/addon-vitest": "^10.1.7",
|
|
40
|
+
"@storybook/sveltekit": "^10.1.7",
|
|
41
41
|
"@sveltejs/adapter-node": "^5.4.0",
|
|
42
|
-
"@sveltejs/kit": "^2.49.
|
|
42
|
+
"@sveltejs/kit": "^2.49.2",
|
|
43
43
|
"@sveltejs/package": "^2.5.7",
|
|
44
44
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
45
45
|
"@types/eslint": "^9.6.1",
|
|
46
|
-
"@types/node": "^24.10.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
48
|
-
"@typescript-eslint/parser": "^8.
|
|
46
|
+
"@types/node": "^24.10.3",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^8.49.0",
|
|
48
|
+
"@typescript-eslint/parser": "^8.49.0",
|
|
49
49
|
"@vitest/browser": "^4.0.15",
|
|
50
50
|
"eslint": "^9.39.1",
|
|
51
51
|
"eslint-config-prettier": "^10.1.8",
|
|
52
52
|
"eslint-plugin-storybook": "10.1.4",
|
|
53
|
-
"eslint-plugin-svelte": "^3.13.
|
|
53
|
+
"eslint-plugin-svelte": "^3.13.1",
|
|
54
54
|
"globals": "^16.5.0",
|
|
55
55
|
"mdsvex": "^0.12.6",
|
|
56
56
|
"playwright": "^1.57.0",
|
|
57
57
|
"prettier": "^3.7.4",
|
|
58
58
|
"prettier-plugin-svelte": "^3.4.0",
|
|
59
|
-
"publint": "^0.3.
|
|
60
|
-
"sass-embedded": "^1.
|
|
61
|
-
"storybook": "^10.1.
|
|
62
|
-
"svelte": "^5.45.
|
|
59
|
+
"publint": "^0.3.16",
|
|
60
|
+
"sass-embedded": "^1.96.0",
|
|
61
|
+
"storybook": "^10.1.7",
|
|
62
|
+
"svelte": "^5.45.10",
|
|
63
63
|
"svelte-check": "^4.3.4",
|
|
64
64
|
"svelte-render-scan": "^1.1.0",
|
|
65
65
|
"typescript": "^5.9.3",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
67
|
-
"vite": "^7.2.
|
|
66
|
+
"typescript-eslint": "^8.49.0",
|
|
67
|
+
"vite": "^7.2.7",
|
|
68
68
|
"vite-plugin-devtools-json": "^1.0.0",
|
|
69
69
|
"vitest": "^4.0.15",
|
|
70
70
|
"vitest-browser-svelte": "^2.0.1"
|