@sebgroup/green-core 2.19.0 → 2.20.0-rc.20251215154321804

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 (64) hide show
  1. package/components/badge/badge.component.d.ts +0 -23
  2. package/components/badge/badge.component.js +18 -105
  3. package/components/badge/badge.styles.js +96 -2
  4. package/components/checkbox/checkbox.component.js +24 -22
  5. package/components/checkbox/checkbox.styles.js +0 -8
  6. package/components/dropdown/dropdown.component.js +4 -1
  7. package/components/index.d.ts +2 -0
  8. package/components/index.js +2 -0
  9. package/components/input/input.styles.js +10 -1
  10. package/components/pagination/index.d.ts +1 -0
  11. package/components/pagination/index.js +1 -0
  12. package/components/pagination/pagination.component.d.ts +82 -0
  13. package/components/pagination/pagination.component.js +441 -0
  14. package/components/pagination/pagination.d.ts +2 -0
  15. package/components/pagination/pagination.js +6 -0
  16. package/components/pagination/pagination.styles.d.ts +1 -0
  17. package/components/pagination/pagination.styles.js +19 -0
  18. package/components/table/index.d.ts +2 -0
  19. package/components/table/index.js +6 -0
  20. package/components/table/table.component.d.ts +140 -0
  21. package/components/table/table.component.js +1090 -0
  22. package/components/table/table.d.ts +2 -0
  23. package/components/table/table.imports.d.ts +6 -0
  24. package/components/table/table.imports.js +63 -0
  25. package/components/table/table.js +6 -0
  26. package/components/table/table.stories.data.d.ts +53 -0
  27. package/components/table/table.stories.data.js +401 -0
  28. package/components/table/table.styles.d.ts +1 -0
  29. package/components/table/table.styles.js +788 -0
  30. package/components/table/table.types.d.ts +155 -0
  31. package/components/table/table.types.js +24 -0
  32. package/custom-elements.json +12280 -10492
  33. package/gds-element.js +1 -1
  34. package/generated/locales/da.d.ts +32 -0
  35. package/generated/locales/da.js +32 -0
  36. package/generated/locales/de.d.ts +32 -0
  37. package/generated/locales/de.js +32 -0
  38. package/generated/locales/fi.d.ts +32 -0
  39. package/generated/locales/fi.js +32 -0
  40. package/generated/locales/fr.d.ts +32 -0
  41. package/generated/locales/fr.js +32 -0
  42. package/generated/locales/it.d.ts +32 -0
  43. package/generated/locales/it.js +32 -0
  44. package/generated/locales/nl.d.ts +32 -0
  45. package/generated/locales/nl.js +32 -0
  46. package/generated/locales/no.d.ts +32 -0
  47. package/generated/locales/no.js +33 -1
  48. package/generated/locales/sv.d.ts +32 -0
  49. package/generated/locales/sv.js +32 -0
  50. package/generated/react/index.d.ts +8 -6
  51. package/generated/react/index.js +8 -6
  52. package/generated/react/input/index.d.ts +1 -1
  53. package/generated/react/pagination/index.d.ts +395 -0
  54. package/generated/react/pagination/index.js +13 -0
  55. package/generated/react/table/index.d.ts +395 -0
  56. package/generated/react/table/index.js +13 -0
  57. package/package.json +8 -1
  58. package/primitives/field-base/field-base.component.d.ts +1 -0
  59. package/primitives/field-base/field-base.component.js +8 -0
  60. package/primitives/field-base/field-base.styles.js +9 -1
  61. package/pure.d.ts +2 -0
  62. package/pure.js +2 -0
  63. package/shared-styles/rbcb-toggle.style.js +41 -12
  64. package/utils/helpers/custom-element-scoping.js +1 -1
@@ -0,0 +1,155 @@
1
+ import type { GdsElement } from '../../gds-element';
2
+ import type { GdsBadge, GdsButton, GdsContextMenu, GdsIcon, GdsImg, GdsLink } from '../../pure';
3
+ import type { AccountFormats, DateTimeFormat, NumberFormats } from '../formatted-text/formatters';
4
+ /**
5
+ * ============================================================================
6
+ * TABLE TYPES
7
+ * ============================================================================
8
+ */
9
+ export interface Column {
10
+ key: string;
11
+ value?: (row: any) => string;
12
+ label: string;
13
+ sortable?: boolean;
14
+ align?: 'start' | 'center' | 'stretch' | 'end';
15
+ justify?: 'start' | 'center' | 'space-between' | 'end';
16
+ visible?: boolean;
17
+ width?: string;
18
+ cell?: {
19
+ lead?: Cell | Cell[];
20
+ value?: Cell | Cell[];
21
+ trail?: Cell | Cell[];
22
+ };
23
+ }
24
+ export interface Actions {
25
+ label?: string;
26
+ align?: 'start' | 'center' | 'stretch' | 'end';
27
+ justify?: 'start' | 'center' | 'space-between' | 'end';
28
+ cell: Cell | Cell[];
29
+ }
30
+ export interface Row {
31
+ [key: string]: any;
32
+ }
33
+ export interface State {
34
+ page: number;
35
+ rows: number;
36
+ sortColumn?: string;
37
+ sortDirection?: 'asc' | 'desc';
38
+ searchQuery: string;
39
+ visibleColumns: Set<string>;
40
+ }
41
+ export interface Request {
42
+ page: number;
43
+ rows: number;
44
+ sortColumn?: string;
45
+ sortDirection?: 'asc' | 'desc';
46
+ searchQuery?: string;
47
+ }
48
+ export interface Response<T> {
49
+ rows: T[];
50
+ total: number;
51
+ }
52
+ export declare const DENSITY_CONFIG: {
53
+ readonly compact: {
54
+ readonly button: "small";
55
+ readonly input: "small";
56
+ readonly dropdown: "small";
57
+ readonly badge: "small";
58
+ };
59
+ readonly comfortable: {
60
+ readonly button: "small";
61
+ readonly input: "small";
62
+ readonly dropdown: "small";
63
+ readonly badge: "small";
64
+ };
65
+ readonly spacious: {
66
+ readonly button: "medium";
67
+ readonly input: "large";
68
+ readonly dropdown: "medium";
69
+ readonly badge: "default";
70
+ };
71
+ };
72
+ export type Density = 'comfortable' | 'compact' | 'spacious';
73
+ export type DensityConfig = (typeof DENSITY_CONFIG)[Density];
74
+ export interface CacheEntry<T> {
75
+ rows: T[];
76
+ total: number;
77
+ timestamp: number;
78
+ }
79
+ export interface Cache<T> {
80
+ [key: string]: CacheEntry<T>;
81
+ }
82
+ export type TableActions = Actions;
83
+ export type TableColumn = Column;
84
+ export type TableRow = Row;
85
+ export type TableState = State;
86
+ export type TableRequest = Request;
87
+ export type TableResponse<T> = Response<T>;
88
+ export type TableDensity = Density;
89
+ export type TableDensityConfig = DensityConfig;
90
+ export type TableCache<T> = Cache<T>;
91
+ export type TableCacheEntry<T> = CacheEntry<T>;
92
+ /**
93
+ * ============================================================================
94
+ * CELL COMPONENT TYPES
95
+ * ============================================================================
96
+ */
97
+ type CellProps<T> = {
98
+ [K in keyof T]?: T[K] | ((row: any) => T[K]);
99
+ };
100
+ export interface Badge extends CellProps<Pick<GdsBadge, 'variant' | 'size'>> {
101
+ type: 'badge';
102
+ value: string | ((row: any) => string);
103
+ }
104
+ export interface Image extends CellProps<Omit<GdsImg, keyof GdsElement>> {
105
+ type: 'image';
106
+ src: string | ((row: any) => string);
107
+ }
108
+ export interface Icon extends CellProps<Omit<GdsIcon, keyof GdsElement>> {
109
+ type: 'icon';
110
+ template: string | ((row: any) => string);
111
+ }
112
+ export interface Button extends CellProps<Omit<GdsButton, keyof GdsElement>> {
113
+ type: 'button';
114
+ template?: string | ((row: any) => string);
115
+ onClick: (row: any) => void;
116
+ }
117
+ export interface Link extends CellProps<Omit<GdsLink, keyof GdsElement>> {
118
+ type: 'link';
119
+ template?: string | ((row: any) => string);
120
+ onClick?: (row: any) => void;
121
+ }
122
+ export interface ContextMenu extends CellProps<Omit<GdsContextMenu, keyof GdsElement>> {
123
+ type: 'context-menu';
124
+ items: Array<{
125
+ label: string | ((row: any) => string);
126
+ divider?: boolean;
127
+ onClick: (row: any) => void;
128
+ }>;
129
+ }
130
+ export interface FormattedNumber {
131
+ type: 'formatted-number';
132
+ value: number | string | ((row: any) => number | string);
133
+ locale?: string;
134
+ currency?: string;
135
+ decimals?: number;
136
+ format?: NumberFormats;
137
+ }
138
+ export interface FormattedAccount {
139
+ type: 'formatted-account';
140
+ value: string | ((row: any) => string);
141
+ format?: AccountFormats;
142
+ }
143
+ export interface FormattedDate {
144
+ type: 'formatted-date';
145
+ value: string | Date | ((row: any) => string | Date);
146
+ locale?: string;
147
+ format?: DateTimeFormat;
148
+ }
149
+ export type Cell = Image | Icon | Button | Link | Badge | ContextMenu | FormattedNumber | FormattedAccount | FormattedDate;
150
+ export interface CellConfig {
151
+ lead?: Cell;
152
+ value?: Cell;
153
+ trail?: Cell;
154
+ }
155
+ export {};
@@ -0,0 +1,24 @@
1
+ import "../../chunks/chunk.QU3DSPNU.js";
2
+ const DENSITY_CONFIG = {
3
+ compact: {
4
+ button: "small",
5
+ input: "small",
6
+ dropdown: "small",
7
+ badge: "small"
8
+ },
9
+ comfortable: {
10
+ button: "small",
11
+ input: "small",
12
+ dropdown: "small",
13
+ badge: "small"
14
+ },
15
+ spacious: {
16
+ button: "medium",
17
+ input: "large",
18
+ dropdown: "medium",
19
+ badge: "default"
20
+ }
21
+ };
22
+ export {
23
+ DENSITY_CONFIG
24
+ };