runeforge 0.0.1

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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +551 -0
  3. package/dist/components/Avatar.svelte +31 -0
  4. package/dist/components/Avatar.svelte.d.ts +10 -0
  5. package/dist/components/IconRenderer.svelte +22 -0
  6. package/dist/components/IconRenderer.svelte.d.ts +8 -0
  7. package/dist/components/Modal.svelte +47 -0
  8. package/dist/components/Modal.svelte.d.ts +9 -0
  9. package/dist/components/common/Header.svelte +30 -0
  10. package/dist/components/common/Header.svelte.d.ts +11 -0
  11. package/dist/components/crud/Field.svelte +159 -0
  12. package/dist/components/crud/Field.svelte.d.ts +30 -0
  13. package/dist/components/crud/GenericCRUD.svelte +236 -0
  14. package/dist/components/crud/GenericCRUD.svelte.d.ts +44 -0
  15. package/dist/components/crud/columns/Avatar.svelte +15 -0
  16. package/dist/components/crud/columns/Avatar.svelte.d.ts +8 -0
  17. package/dist/components/crud/columns/Icon.svelte +8 -0
  18. package/dist/components/crud/columns/Icon.svelte.d.ts +4 -0
  19. package/dist/components/crud/utils/constants.d.ts +1 -0
  20. package/dist/components/crud/utils/constants.js +6 -0
  21. package/dist/components/crud/utils/formatters.d.ts +6 -0
  22. package/dist/components/crud/utils/formatters.js +42 -0
  23. package/dist/components/crud/utils/misc.d.ts +5 -0
  24. package/dist/components/crud/utils/misc.js +8 -0
  25. package/dist/components/crud/utils/resolution.d.ts +4 -0
  26. package/dist/components/crud/utils/resolution.js +22 -0
  27. package/dist/components/crud/views/Create.svelte +147 -0
  28. package/dist/components/crud/views/Create.svelte.d.ts +34 -0
  29. package/dist/components/crud/views/List.svelte +170 -0
  30. package/dist/components/crud/views/List.svelte.d.ts +41 -0
  31. package/dist/components/crud/views/Read.svelte +85 -0
  32. package/dist/components/crud/views/Read.svelte.d.ts +33 -0
  33. package/dist/components/crud/views/Update.svelte +148 -0
  34. package/dist/components/crud/views/Update.svelte.d.ts +35 -0
  35. package/dist/components/form/Button.svelte +27 -0
  36. package/dist/components/form/Button.svelte.d.ts +10 -0
  37. package/dist/components/form/Label.svelte +37 -0
  38. package/dist/components/form/Label.svelte.d.ts +14 -0
  39. package/dist/components/form/PasswordInput.svelte +61 -0
  40. package/dist/components/form/PasswordInput.svelte.d.ts +13 -0
  41. package/dist/components/form/Required.svelte +1 -0
  42. package/dist/components/form/Required.svelte.d.ts +26 -0
  43. package/dist/components/form/Select.svelte +114 -0
  44. package/dist/components/form/Select.svelte.d.ts +14 -0
  45. package/dist/components/navigation/Breadcrumbs.svelte +51 -0
  46. package/dist/components/navigation/Breadcrumbs.svelte.d.ts +9 -0
  47. package/dist/components/table/ColumnFilter.svelte +140 -0
  48. package/dist/components/table/ColumnFilter.svelte.d.ts +33 -0
  49. package/dist/components/table/PaginatedTable.svelte +106 -0
  50. package/dist/components/table/PaginatedTable.svelte.d.ts +35 -0
  51. package/dist/components/table/Paginator.svelte +62 -0
  52. package/dist/components/table/Paginator.svelte.d.ts +10 -0
  53. package/dist/components/table/SortHeader.svelte +43 -0
  54. package/dist/components/table/SortHeader.svelte.d.ts +10 -0
  55. package/dist/components/table/TableBody.svelte +70 -0
  56. package/dist/components/table/TableBody.svelte.d.ts +36 -0
  57. package/dist/components/table/TableHeader.svelte +83 -0
  58. package/dist/components/table/TableHeader.svelte.d.ts +39 -0
  59. package/dist/components/table/state.svelte.d.ts +30 -0
  60. package/dist/components/table/state.svelte.js +109 -0
  61. package/dist/components/table/utils.d.ts +7 -0
  62. package/dist/components/table/utils.js +44 -0
  63. package/dist/i18n/context.d.ts +3 -0
  64. package/dist/i18n/context.js +10 -0
  65. package/dist/i18n/en.d.ts +2 -0
  66. package/dist/i18n/en.js +24 -0
  67. package/dist/i18n/es.d.ts +2 -0
  68. package/dist/i18n/es.js +24 -0
  69. package/dist/i18n/types.d.ts +24 -0
  70. package/dist/i18n/types.js +1 -0
  71. package/dist/icons/bootstrapIconSet.d.ts +1 -0
  72. package/dist/icons/bootstrapIconSet.js +1 -0
  73. package/dist/icons/context.d.ts +3 -0
  74. package/dist/icons/context.js +9 -0
  75. package/dist/icons/defaultIconSet.d.ts +1 -0
  76. package/dist/icons/defaultIconSet.js +1 -0
  77. package/dist/icons/defaults/Create.svelte +6 -0
  78. package/dist/icons/defaults/Create.svelte.d.ts +7 -0
  79. package/dist/icons/defaults/Delete.svelte +6 -0
  80. package/dist/icons/defaults/Delete.svelte.d.ts +7 -0
  81. package/dist/icons/defaults/Edit.svelte +7 -0
  82. package/dist/icons/defaults/Edit.svelte.d.ts +7 -0
  83. package/dist/icons/defaults/Filter.svelte +6 -0
  84. package/dist/icons/defaults/Filter.svelte.d.ts +7 -0
  85. package/dist/icons/defaults/FilterActive.svelte +6 -0
  86. package/dist/icons/defaults/FilterActive.svelte.d.ts +7 -0
  87. package/dist/icons/defaults/Folder.svelte +6 -0
  88. package/dist/icons/defaults/Folder.svelte.d.ts +7 -0
  89. package/dist/icons/defaults/Home.svelte +6 -0
  90. package/dist/icons/defaults/Home.svelte.d.ts +7 -0
  91. package/dist/icons/defaults/PasswordHide.svelte +9 -0
  92. package/dist/icons/defaults/PasswordHide.svelte.d.ts +7 -0
  93. package/dist/icons/defaults/PasswordShow.svelte +7 -0
  94. package/dist/icons/defaults/PasswordShow.svelte.d.ts +7 -0
  95. package/dist/icons/defaults/SortAsc.svelte +6 -0
  96. package/dist/icons/defaults/SortAsc.svelte.d.ts +7 -0
  97. package/dist/icons/defaults/SortDesc.svelte +6 -0
  98. package/dist/icons/defaults/SortDesc.svelte.d.ts +7 -0
  99. package/dist/icons/defaults/SortNone.svelte +6 -0
  100. package/dist/icons/defaults/SortNone.svelte.d.ts +7 -0
  101. package/dist/icons/defaults/View.svelte +7 -0
  102. package/dist/icons/defaults/View.svelte.d.ts +7 -0
  103. package/dist/icons/sets/bootstrap.d.ts +2 -0
  104. package/dist/icons/sets/bootstrap.js +29 -0
  105. package/dist/icons/sets/default.d.ts +2 -0
  106. package/dist/icons/sets/default.js +28 -0
  107. package/dist/icons/types.d.ts +26 -0
  108. package/dist/icons/types.js +1 -0
  109. package/dist/index.d.ts +42 -0
  110. package/dist/index.js +41 -0
  111. package/dist/types/attribute.d.ts +38 -0
  112. package/dist/types/attribute.js +11 -0
  113. package/dist/types/breadcrumb.d.ts +7 -0
  114. package/dist/types/breadcrumb.js +1 -0
  115. package/dist/types/crud.d.ts +48 -0
  116. package/dist/types/crud.js +1 -0
  117. package/dist/types/table.d.ts +16 -0
  118. package/dist/types/table.js +1 -0
  119. package/package.json +82 -0
@@ -0,0 +1,44 @@
1
+ export function cellRenderedText(row, col) {
2
+ const value = row[col.attribute];
3
+ if (col.formatter) {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ return col.formatter(value, row).replace(/<[^>]*>/g, '').trim();
6
+ }
7
+ return value == null ? '' : String(value);
8
+ }
9
+ export function isSortable(col) {
10
+ return col.sortable !== false;
11
+ }
12
+ export function isFilterable(col) {
13
+ return col.filterable !== false;
14
+ }
15
+ export function compare(a, b) {
16
+ if (a == null && b == null)
17
+ return 0;
18
+ if (a == null)
19
+ return -1;
20
+ if (b == null)
21
+ return 1;
22
+ if (typeof a === 'number' && typeof b === 'number')
23
+ return a - b;
24
+ return String(a).localeCompare(String(b), undefined, { numeric: true });
25
+ }
26
+ export function distinctEntries(data, columns) {
27
+ const result = {};
28
+ for (const col of columns) {
29
+ if (!isFilterable(col))
30
+ continue;
31
+ const seen = {};
32
+ const list = [];
33
+ for (const row of data) {
34
+ const key = cellRenderedText(row, col);
35
+ if (seen[key])
36
+ continue;
37
+ seen[key] = true;
38
+ list.push({ key, row });
39
+ }
40
+ list.sort((a, b) => a.key.localeCompare(b.key, undefined, { numeric: true }));
41
+ result[col.attribute] = list;
42
+ }
43
+ return result;
44
+ }
@@ -0,0 +1,3 @@
1
+ import type { RuneforgeStrings } from './types.js';
2
+ export declare function setStrings(strings: Partial<RuneforgeStrings>): void;
3
+ export declare function getStrings(): RuneforgeStrings;
@@ -0,0 +1,10 @@
1
+ import { getContext, setContext } from 'svelte';
2
+ import { es } from './es.js';
3
+ const KEY = Symbol('runeforge-strings');
4
+ export function setStrings(strings) {
5
+ const existing = getContext(KEY) ?? es;
6
+ setContext(KEY, { ...existing, ...strings });
7
+ }
8
+ export function getStrings() {
9
+ return getContext(KEY) ?? es;
10
+ }
@@ -0,0 +1,2 @@
1
+ import type { RuneforgeStrings } from './types.js';
2
+ export declare const en: RuneforgeStrings;
@@ -0,0 +1,24 @@
1
+ export const en = {
2
+ showing: (start, end, total) => `Showing ${start}–${end} of ${total}`,
3
+ actions: 'Actions',
4
+ filter: 'Filter',
5
+ filterColumn: (column) => `Filter ${column}`,
6
+ filterPlaceholder: 'Filter…',
7
+ clearFilter: 'Clear filter',
8
+ emptyValue: '(empty)',
9
+ previous: 'Previous',
10
+ next: 'Next',
11
+ selectPlaceholder: 'Select an option',
12
+ selectSearch: 'Search...',
13
+ selectNoResults: 'No results',
14
+ view: 'View',
15
+ edit: 'Edit',
16
+ delete: 'Delete',
17
+ create: 'Create',
18
+ save: 'Save',
19
+ saveAndContinue: 'Save and continue',
20
+ cancel: 'Cancel',
21
+ back: 'Back',
22
+ required: (field) => `${field} is required`,
23
+ serverError: 'Unexpected server error.',
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { RuneforgeStrings } from './types.js';
2
+ export declare const es: RuneforgeStrings;
@@ -0,0 +1,24 @@
1
+ export const es = {
2
+ showing: (start, end, total) => `Mostrando ${start}–${end} de ${total}`,
3
+ actions: 'Acciones',
4
+ filter: 'Filtrar',
5
+ filterColumn: (column) => `Filtrar ${column}`,
6
+ filterPlaceholder: 'Filtrar…',
7
+ clearFilter: 'Limpiar filtro',
8
+ emptyValue: '(vacío)',
9
+ previous: 'Anterior',
10
+ next: 'Siguiente',
11
+ selectPlaceholder: 'Seleccioná una opción',
12
+ selectSearch: 'Buscar...',
13
+ selectNoResults: 'Sin resultados',
14
+ view: 'Ver',
15
+ edit: 'Editar',
16
+ delete: 'Eliminar',
17
+ create: 'Crear',
18
+ save: 'Guardar',
19
+ saveAndContinue: 'Guardar y continuar',
20
+ cancel: 'Cancelar',
21
+ back: 'Volver',
22
+ required: (field) => `${field} es requerido`,
23
+ serverError: 'Error inesperado del servidor.',
24
+ };
@@ -0,0 +1,24 @@
1
+ export interface RuneforgeStrings {
2
+ showing: (start: number, end: number, total: number) => string;
3
+ actions: string;
4
+ filter: string;
5
+ filterColumn: (column: string) => string;
6
+ filterPlaceholder: string;
7
+ clearFilter: string;
8
+ emptyValue: string;
9
+ previous: string;
10
+ next: string;
11
+ selectPlaceholder: string;
12
+ selectSearch: string;
13
+ selectNoResults: string;
14
+ view: string;
15
+ edit: string;
16
+ delete: string;
17
+ create: string;
18
+ save: string;
19
+ saveAndContinue: string;
20
+ cancel: string;
21
+ back: string;
22
+ required: (field: string) => string;
23
+ serverError: string;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { bootstrapIconSet } from './sets/bootstrap.js';
@@ -0,0 +1 @@
1
+ export { bootstrapIconSet } from './sets/bootstrap.js';
@@ -0,0 +1,3 @@
1
+ import type { CRUDIconSet } from './types.js';
2
+ export declare function setIconSet(icons: Partial<CRUDIconSet>): void;
3
+ export declare function getIconSet(): CRUDIconSet | undefined;
@@ -0,0 +1,9 @@
1
+ import { getContext, setContext } from 'svelte';
2
+ const KEY = Symbol('runeforge-icons');
3
+ export function setIconSet(icons) {
4
+ const existing = getContext(KEY);
5
+ setContext(KEY, { ...existing, ...icons });
6
+ }
7
+ export function getIconSet() {
8
+ return getContext(KEY);
9
+ }
@@ -0,0 +1 @@
1
+ export { defaultIconSet } from './sets/default.js';
@@ -0,0 +1 @@
1
+ export { defaultIconSet } from './sets/default.js';
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Create: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Create = ReturnType<typeof Create>;
7
+ export default Create;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5M11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 0 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47M8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Delete: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Delete = ReturnType<typeof Delete>;
7
+ export default Delete;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12z"/>
6
+ <path d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Edit: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Edit = ReturnType<typeof Edit>;
7
+ export default Edit;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Filter: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Filter = ReturnType<typeof Filter>;
7
+ export default Filter;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const FilterActive: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type FilterActive = ReturnType<typeof FilterActive>;
7
+ export default FilterActive;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a2 2 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3m-8.322.12q.322-.119.684-.12h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Folder: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Folder = ReturnType<typeof Folder>;
7
+ export default Folder;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const Home: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Home = ReturnType<typeof Home>;
7
+ export default Home;
@@ -0,0 +1,9 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755l.708.709z"/>
6
+ <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
7
+ <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238z"/>
8
+ <path fill-rule="evenodd" d="M13.646 14.354l-12-12 .708-.708 12 12-.708.708z"/>
9
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const PasswordHide: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type PasswordHide = ReturnType<typeof PasswordHide>;
7
+ export default PasswordHide;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z"/>
6
+ <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0"/>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const PasswordShow: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type PasswordShow = ReturnType<typeof PasswordShow>;
7
+ export default PasswordShow;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const SortAsc: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type SortAsc = ReturnType<typeof SortAsc>;
7
+ export default SortAsc;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const SortDesc: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type SortDesc = ReturnType<typeof SortDesc>;
7
+ export default SortDesc;
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const SortNone: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type SortNone = ReturnType<typeof SortNone>;
7
+ export default SortNone;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
3
+ </script>
4
+ <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
5
+ <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z"/>
6
+ <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0"/>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ size?: string | number;
3
+ class?: string;
4
+ };
5
+ declare const View: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type View = ReturnType<typeof View>;
7
+ export default View;
@@ -0,0 +1,2 @@
1
+ import type { CRUDIconSet } from '../types.js';
2
+ export declare const bootstrapIconSet: CRUDIconSet;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Bootstrap Icons adapter for runeforge.
3
+ *
4
+ * Requires `svelte-bootstrap-icons` to be installed in the consuming project:
5
+ * npm install svelte-bootstrap-icons
6
+ *
7
+ * Usage:
8
+ * import { setIconSet } from 'runeforge';
9
+ * import { bootstrapIconSet } from 'runeforge/icons/sets/bootstrap';
10
+ * setIconSet(bootstrapIconSet);
11
+ */
12
+ import { ChevronExpand, CaretUpFill, CaretDownFill, Funnel, FunnelFill, Plus, Eye, PencilSquare, Trash3, HouseDoor, Folder, EyeSlash, } from 'svelte-bootstrap-icons';
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ function asIcon(c) { return c; }
15
+ export const bootstrapIconSet = {
16
+ sortNone: asIcon(ChevronExpand),
17
+ sortAsc: asIcon(CaretUpFill),
18
+ sortDesc: asIcon(CaretDownFill),
19
+ filter: asIcon(Funnel),
20
+ filterActive: asIcon(FunnelFill),
21
+ create: asIcon(Plus),
22
+ view: asIcon(Eye),
23
+ edit: asIcon(PencilSquare),
24
+ delete: asIcon(Trash3),
25
+ home: asIcon(HouseDoor),
26
+ folder: asIcon(Folder),
27
+ passwordShow: asIcon(Eye),
28
+ passwordHide: asIcon(EyeSlash),
29
+ };
@@ -0,0 +1,2 @@
1
+ import type { CRUDIconSet } from '../types.js';
2
+ export declare const defaultIconSet: CRUDIconSet;
@@ -0,0 +1,28 @@
1
+ import SortNone from '../defaults/SortNone.svelte';
2
+ import SortAsc from '../defaults/SortAsc.svelte';
3
+ import SortDesc from '../defaults/SortDesc.svelte';
4
+ import Filter from '../defaults/Filter.svelte';
5
+ import FilterActive from '../defaults/FilterActive.svelte';
6
+ import Create from '../defaults/Create.svelte';
7
+ import View from '../defaults/View.svelte';
8
+ import Edit from '../defaults/Edit.svelte';
9
+ import Delete from '../defaults/Delete.svelte';
10
+ import Home from '../defaults/Home.svelte';
11
+ import Folder from '../defaults/Folder.svelte';
12
+ import PasswordShow from '../defaults/PasswordShow.svelte';
13
+ import PasswordHide from '../defaults/PasswordHide.svelte';
14
+ export const defaultIconSet = {
15
+ sortNone: SortNone,
16
+ sortAsc: SortAsc,
17
+ sortDesc: SortDesc,
18
+ filter: Filter,
19
+ filterActive: FilterActive,
20
+ create: Create,
21
+ view: View,
22
+ edit: Edit,
23
+ delete: Delete,
24
+ home: Home,
25
+ folder: Folder,
26
+ passwordShow: PasswordShow,
27
+ passwordHide: PasswordHide,
28
+ };
@@ -0,0 +1,26 @@
1
+ import type { Component } from 'svelte';
2
+ export type IconComponent = Component<{
3
+ size?: string | number;
4
+ class?: string;
5
+ }>;
6
+ export type IconByNameComponent = Component<{
7
+ name: string;
8
+ size?: string | number;
9
+ class?: string;
10
+ }>;
11
+ export interface CRUDIconSet {
12
+ sortNone: IconComponent;
13
+ sortAsc: IconComponent;
14
+ sortDesc: IconComponent;
15
+ filter: IconComponent;
16
+ filterActive: IconComponent;
17
+ create: IconComponent;
18
+ view: IconComponent;
19
+ edit: IconComponent;
20
+ delete: IconComponent;
21
+ home: IconComponent;
22
+ folder: IconComponent;
23
+ passwordShow: IconComponent;
24
+ passwordHide: IconComponent;
25
+ renderByName?: IconByNameComponent;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ export type { BreadcrumbItem } from './types/breadcrumb.js';
2
+ export { AttributeType } from './types/attribute.js';
3
+ export type { AttributeMetadata, InterfaceMetadata, SelectOption, OptionsResolver, FormatterResolver } from './types/attribute.js';
4
+ export type { CellProps, CellComponent, CellFormatter, SortDirection, IndexedRow, DistinctEntry } from './types/table.js';
5
+ export type { ColumnDefinition, FieldDefinition, ActionConfiguration, CustomAction, RowAction } from './types/crud.js';
6
+ export type { CRUDIconSet, IconComponent, IconByNameComponent } from './icons/types.js';
7
+ export { setIconSet, getIconSet } from './icons/context.js';
8
+ export { defaultIconSet } from './icons/sets/default.js';
9
+ export type { RuneforgeStrings } from './i18n/types.js';
10
+ export { setStrings, getStrings } from './i18n/context.js';
11
+ export { es } from './i18n/es.js';
12
+ export { en } from './i18n/en.js';
13
+ export { default as Button } from './components/form/Button.svelte';
14
+ export { default as Label } from './components/form/Label.svelte';
15
+ export { default as Required } from './components/form/Required.svelte';
16
+ export { default as Select } from './components/form/Select.svelte';
17
+ export { default as PasswordInput } from './components/form/PasswordInput.svelte';
18
+ export { default as Avatar } from './components/Avatar.svelte';
19
+ export { default as Modal } from './components/Modal.svelte';
20
+ export { default as IconRenderer } from './components/IconRenderer.svelte';
21
+ export { default as Breadcrumbs } from './components/navigation/Breadcrumbs.svelte';
22
+ export { default as PaginatedTable } from './components/table/PaginatedTable.svelte';
23
+ export { default as TableHeader } from './components/table/TableHeader.svelte';
24
+ export { default as TableBody } from './components/table/TableBody.svelte';
25
+ export { default as SortHeader } from './components/table/SortHeader.svelte';
26
+ export { default as Paginator } from './components/table/Paginator.svelte';
27
+ export { default as ColumnFilter } from './components/table/ColumnFilter.svelte';
28
+ export { SortState, FilterState } from './components/table/state.svelte.js';
29
+ export { cellRenderedText, isSortable, isFilterable, compare, distinctEntries } from './components/table/utils.js';
30
+ export { default as GenericCRUD } from './components/crud/GenericCRUD.svelte';
31
+ export { default as Field } from './components/crud/Field.svelte';
32
+ export { default as Header } from './components/common/Header.svelte';
33
+ export { default as AvatarCell } from './components/crud/columns/Avatar.svelte';
34
+ export { default as IconCell } from './components/crud/columns/Icon.svelte';
35
+ export { default as CRUDList } from './components/crud/views/List.svelte';
36
+ export { default as CRUDCreate } from './components/crud/views/Create.svelte';
37
+ export { default as CRUDRead } from './components/crud/views/Read.svelte';
38
+ export { default as CRUDUpdate } from './components/crud/views/Update.svelte';
39
+ export { AUTO_EXCLUDED } from './components/crud/utils/constants.js';
40
+ export { resolveOptions, resolveFormatter, inferType } from './components/crud/utils/resolution.js';
41
+ export { fieldLabel, initials } from './components/crud/utils/misc.js';
42
+ export { formatBoolean, formatDatetime, formatTruncateTextUpTo, formatInstance } from './components/crud/utils/formatters.js';
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ export { AttributeType } from './types/attribute.js';
2
+ export { setIconSet, getIconSet } from './icons/context.js';
3
+ export { defaultIconSet } from './icons/sets/default.js';
4
+ export { setStrings, getStrings } from './i18n/context.js';
5
+ export { es } from './i18n/es.js';
6
+ export { en } from './i18n/en.js';
7
+ // Form components
8
+ export { default as Button } from './components/form/Button.svelte';
9
+ export { default as Label } from './components/form/Label.svelte';
10
+ export { default as Required } from './components/form/Required.svelte';
11
+ export { default as Select } from './components/form/Select.svelte';
12
+ export { default as PasswordInput } from './components/form/PasswordInput.svelte';
13
+ // Shared components
14
+ export { default as Avatar } from './components/Avatar.svelte';
15
+ export { default as Modal } from './components/Modal.svelte';
16
+ export { default as IconRenderer } from './components/IconRenderer.svelte';
17
+ export { default as Breadcrumbs } from './components/navigation/Breadcrumbs.svelte';
18
+ // Table components
19
+ export { default as PaginatedTable } from './components/table/PaginatedTable.svelte';
20
+ export { default as TableHeader } from './components/table/TableHeader.svelte';
21
+ export { default as TableBody } from './components/table/TableBody.svelte';
22
+ export { default as SortHeader } from './components/table/SortHeader.svelte';
23
+ export { default as Paginator } from './components/table/Paginator.svelte';
24
+ export { default as ColumnFilter } from './components/table/ColumnFilter.svelte';
25
+ export { SortState, FilterState } from './components/table/state.svelte.js';
26
+ export { cellRenderedText, isSortable, isFilterable, compare, distinctEntries } from './components/table/utils.js';
27
+ // CRUD components
28
+ export { default as GenericCRUD } from './components/crud/GenericCRUD.svelte';
29
+ export { default as Field } from './components/crud/Field.svelte';
30
+ export { default as Header } from './components/common/Header.svelte';
31
+ export { default as AvatarCell } from './components/crud/columns/Avatar.svelte';
32
+ export { default as IconCell } from './components/crud/columns/Icon.svelte';
33
+ export { default as CRUDList } from './components/crud/views/List.svelte';
34
+ export { default as CRUDCreate } from './components/crud/views/Create.svelte';
35
+ export { default as CRUDRead } from './components/crud/views/Read.svelte';
36
+ export { default as CRUDUpdate } from './components/crud/views/Update.svelte';
37
+ // CRUD utilities
38
+ export { AUTO_EXCLUDED } from './components/crud/utils/constants.js';
39
+ export { resolveOptions, resolveFormatter, inferType } from './components/crud/utils/resolution.js';
40
+ export { fieldLabel, initials } from './components/crud/utils/misc.js';
41
+ export { formatBoolean, formatDatetime, formatTruncateTextUpTo, formatInstance } from './components/crud/utils/formatters.js';