@almadar/patterns 2.17.2 → 2.18.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "exportedAt": "2026-04-22T03:26:00.903Z",
3
+ "exportedAt": "2026-04-25T12:02:50.943Z",
4
4
  "patterns": {
5
5
  "entity-table": {
6
6
  "type": "entity-table",
@@ -699,12 +699,6 @@
699
699
  ],
700
700
  "description": "Panel width (CSS value, e.g., '400px', '50%')"
701
701
  },
702
- "entityId": {
703
- "types": [
704
- "string"
705
- ],
706
- "description": "Entity ID for fetching specific entity"
707
- },
708
702
  "displayFields": {
709
703
  "types": [
710
704
  "array"
@@ -895,11 +889,7 @@
895
889
  "types": [
896
890
  "string"
897
891
  ],
898
- "description": "Form mode - 'create' for new records, 'edit' for updating existing",
899
- "enumValues": [
900
- "create",
901
- "edit"
902
- ]
892
+ "description": "Form mode 'create' for new records, 'edit' for updating existing. Accepts `string` so schema-driven callers (whose `config.mode` is typed as `string` per the trait's declared config block) compile cleanly. The runtime treats anything other than 'edit' as 'create'."
903
893
  },
904
894
  "fields": {
905
895
  "types": [
@@ -965,12 +955,6 @@
965
955
  "description": "Event to dispatch on cancel (defaults to 'CANCEL')",
966
956
  "kind": "event"
967
957
  },
968
- "entityId": {
969
- "types": [
970
- "string"
971
- ],
972
- "description": "Entity ID binding for edit mode (triggers initialData from selectedEntity in compiled code)"
973
- },
974
958
  "relationsData": {
975
959
  "types": [
976
960
  "object"
@@ -1105,11 +1089,7 @@
1105
1089
  "types": [
1106
1090
  "string"
1107
1091
  ],
1108
- "description": "Form mode - 'create' for new records, 'edit' for updating existing",
1109
- "enumValues": [
1110
- "create",
1111
- "edit"
1112
- ]
1092
+ "description": "Form mode 'create' for new records, 'edit' for updating existing. Accepts `string` so schema-driven callers (whose `config.mode` is typed as `string` per the trait's declared config block) compile cleanly. The runtime treats anything other than 'edit' as 'create'."
1113
1093
  },
1114
1094
  "fields": {
1115
1095
  "types": [
@@ -1175,12 +1155,6 @@
1175
1155
  "description": "Event to dispatch on cancel (defaults to 'CANCEL')",
1176
1156
  "kind": "event"
1177
1157
  },
1178
- "entityId": {
1179
- "types": [
1180
- "string"
1181
- ],
1182
- "description": "Entity ID binding for edit mode (triggers initialData from selectedEntity in compiled code)"
1183
- },
1184
1158
  "relationsData": {
1185
1159
  "types": [
1186
1160
  "object"
@@ -2109,188 +2083,36 @@
2109
2083
  ],
2110
2084
  "typicalSize": "small",
2111
2085
  "propsSchema": {
2112
- "entity": {
2113
- "types": [
2114
- "string"
2115
- ],
2116
- "description": "Entity name for schema-driven integration"
2117
- },
2118
- "data": {
2119
- "types": [
2120
- "array"
2121
- ],
2122
- "description": "Data array provided by the trait via render-ui"
2123
- },
2124
- "className": {
2125
- "types": [
2126
- "string"
2127
- ],
2128
- "description": "Additional CSS classes"
2129
- },
2130
- "isLoading": {
2131
- "types": [
2132
- "boolean"
2133
- ],
2134
- "description": "Loading state indicator"
2135
- },
2136
- "error": {
2137
- "types": [
2138
- "object"
2139
- ],
2140
- "description": "Error state"
2141
- },
2142
- "sortBy": {
2143
- "types": [
2144
- "string"
2145
- ],
2146
- "description": "Current sort field"
2147
- },
2148
- "sortDirection": {
2149
- "types": [
2150
- "string"
2151
- ],
2152
- "description": "Current sort direction"
2153
- },
2154
- "searchValue": {
2086
+ "value": {
2155
2087
  "types": [
2156
2088
  "string"
2157
2089
  ],
2158
- "description": "Current search query value"
2159
- },
2160
- "page": {
2161
- "types": [
2162
- "number"
2163
- ],
2164
- "description": "Current page number"
2165
- },
2166
- "pageSize": {
2167
- "types": [
2168
- "number"
2169
- ],
2170
- "description": "Number of items per page"
2171
- },
2172
- "totalCount": {
2173
- "types": [
2174
- "number"
2175
- ],
2176
- "description": "Total number of items"
2177
- },
2178
- "activeFilters": {
2179
- "types": [
2180
- "object"
2181
- ],
2182
- "description": "Active filters"
2183
- },
2184
- "selectedIds": {
2185
- "types": [
2186
- "array"
2187
- ],
2188
- "description": "Currently selected item IDs"
2090
+ "description": "The stat value to display prominently",
2091
+ "required": true
2189
2092
  },
2190
2093
  "label": {
2191
2094
  "types": [
2192
2095
  "string"
2193
2096
  ],
2194
- "description": "Main label"
2195
- },
2196
- "title": {
2197
- "types": [
2198
- "string"
2199
- ],
2200
- "description": "Title (alias for label)"
2201
- },
2202
- "value": {
2203
- "types": [
2204
- "string",
2205
- "number",
2206
- "array",
2207
- "unknown"
2208
- ],
2209
- "description": "Primary value - accepts array/unknown from generated code (will use first element or length)"
2210
- },
2211
- "previousValue": {
2212
- "types": [
2213
- "number"
2214
- ],
2215
- "description": "Previous value for comparison"
2216
- },
2217
- "currentValue": {
2218
- "types": [
2219
- "number"
2220
- ],
2221
- "description": "Current value as number for trend calculation"
2222
- },
2223
- "trend": {
2224
- "types": [
2225
- "number"
2226
- ],
2227
- "description": "Manual trend percentage (overrides calculation)"
2097
+ "description": "Label describing the value",
2098
+ "required": true
2228
2099
  },
2229
- "trendDirection": {
2100
+ "size": {
2230
2101
  "types": [
2231
2102
  "string"
2232
2103
  ],
2233
- "description": "Trend direction (overrides calculation)",
2104
+ "description": "Size of the value text",
2234
2105
  "enumValues": [
2235
- "up",
2236
- "down",
2237
- "neutral"
2106
+ "sm",
2107
+ "md",
2108
+ "lg"
2238
2109
  ]
2239
2110
  },
2240
- "invertTrend": {
2241
- "types": [
2242
- "boolean"
2243
- ],
2244
- "description": "Whether up is good (green) or bad (red)"
2245
- },
2246
- "icon": {
2247
- "types": [
2248
- "icon",
2249
- "string"
2250
- ],
2251
- "description": "Icon to display (Lucide component or icon name string)"
2252
- },
2253
- "iconBg": {
2254
- "types": [
2255
- "string"
2256
- ],
2257
- "description": "Icon background color"
2258
- },
2259
- "iconColor": {
2260
- "types": [
2261
- "string"
2262
- ],
2263
- "description": "Icon color"
2264
- },
2265
- "subtitle": {
2111
+ "className": {
2266
2112
  "types": [
2267
2113
  "string"
2268
2114
  ],
2269
- "description": "Subtitle or description"
2270
- },
2271
- "action": {
2272
- "types": [
2273
- "object"
2274
- ],
2275
- "description": "Action button"
2276
- },
2277
- "metrics": {
2278
- "types": [
2279
- "array"
2280
- ],
2281
- "description": "Metrics to display (schema format) - accepts readonly for compatibility with generated const arrays"
2282
- },
2283
- "compact": {
2284
- "types": [
2285
- "boolean"
2286
- ],
2287
- "description": "Compact display mode"
2288
- },
2289
- "sparklineData": {
2290
- "types": [
2291
- "array"
2292
- ],
2293
- "description": "Sparkline data points for an inline trend chart"
2115
+ "description": "Additional class names"
2294
2116
  }
2295
2117
  }
2296
2118
  },
@@ -4107,90 +3929,53 @@
4107
3929
  ],
4108
3930
  "typicalSize": "small",
4109
3931
  "propsSchema": {
4110
- "title": {
4111
- "types": [
4112
- "string"
4113
- ],
4114
- "description": "Card title"
4115
- },
4116
- "subtitle": {
4117
- "types": [
4118
- "string"
4119
- ],
4120
- "description": "Card subtitle or description"
4121
- },
4122
- "image": {
3932
+ "variant": {
4123
3933
  "types": [
4124
3934
  "string"
4125
3935
  ],
4126
- "description": "Image URL to display at top of card"
4127
- },
4128
- "actions": {
4129
- "types": [
4130
- "array"
4131
- ],
4132
- "description": "Action buttons to display in card footer"
4133
- },
4134
- "children": {
4135
- "types": [
4136
- "node"
4137
- ],
4138
- "description": "Card content"
4139
- },
4140
- "onClick": {
4141
- "types": [
4142
- "function"
4143
- ],
4144
- "description": "Click handler for the entire card"
3936
+ "description": "variant prop",
3937
+ "enumValues": [
3938
+ "default",
3939
+ "bordered",
3940
+ "elevated",
3941
+ "interactive"
3942
+ ]
4145
3943
  },
4146
- "className": {
3944
+ "padding": {
4147
3945
  "types": [
4148
3946
  "string"
4149
3947
  ],
4150
- "description": "Additional CSS classes"
3948
+ "description": "padding prop",
3949
+ "enumValues": [
3950
+ "none",
3951
+ "sm",
3952
+ "md",
3953
+ "lg"
3954
+ ]
4151
3955
  },
4152
- "action": {
3956
+ "title": {
4153
3957
  "types": [
4154
3958
  "string"
4155
3959
  ],
4156
- "description": "Declarative event name emits UI:{action} via eventBus on card click",
4157
- "kind": "event"
3960
+ "description": "Card title - renders in header if provided"
4158
3961
  },
4159
- "isSelected": {
4160
- "types": [
4161
- "boolean"
4162
- ],
4163
- "description": "Whether the card is selected (highlighted state)"
4164
- },
4165
- "name": {
3962
+ "subtitle": {
4166
3963
  "types": [
4167
3964
  "string"
4168
3965
  ],
4169
- "description": "Card name (alias for title)"
4170
- },
4171
- "level": {
4172
- "types": [
4173
- "number"
4174
- ],
4175
- "description": "Level indicator"
3966
+ "description": "Card subtitle - renders below title"
4176
3967
  },
4177
- "maxLevel": {
4178
- "types": [
4179
- "number"
4180
- ],
4181
- "description": "Maximum level"
4182
- },
4183
- "longPressEvent": {
3968
+ "shadow": {
4184
3969
  "types": [
4185
3970
  "string"
4186
3971
  ],
4187
- "description": "Event emitted on long press: UI:{longPressEvent}"
4188
- },
4189
- "longPressPayload": {
4190
- "types": [
4191
- "object"
4192
- ],
4193
- "description": "Additional payload for long-press events"
3972
+ "description": "Shadow size override",
3973
+ "enumValues": [
3974
+ "none",
3975
+ "sm",
3976
+ "md",
3977
+ "lg"
3978
+ ]
4194
3979
  }
4195
3980
  }
4196
3981
  },
@@ -6351,34 +6136,41 @@
6351
6136
  "typicalSize": "medium",
6352
6137
  "propsSchema": {
6353
6138
  "action": {
6139
+ "types": [
6140
+ "string"
6141
+ ],
6142
+ "description": "Declarative event name. When set, clicking the FAB emits `UI:{action}` via the event bus and (if also provided) calls `onClick`. Mirrors the Button atom's `action` prop so schemas can write `{ type: \"floating-action-button\", action: \"INIT\" }` uniformly.",
6143
+ "kind": "event"
6144
+ },
6145
+ "actionPayload": {
6354
6146
  "types": [
6355
6147
  "object"
6356
6148
  ],
6357
- "description": "Single action (if only one action, button will directly trigger onClick)"
6149
+ "description": "Payload to include with the dispatched action event."
6358
6150
  },
6359
6151
  "actions": {
6360
6152
  "types": [
6361
6153
  "array"
6362
6154
  ],
6363
- "description": "Multiple actions (if provided, button will expand to show all actions)"
6155
+ "description": "Multiple actions. When provided, the button expands to show all of them."
6364
6156
  },
6365
6157
  "icon": {
6366
6158
  "types": [
6367
6159
  "string"
6368
6160
  ],
6369
- "description": "Icon name (simplified API for pattern compatibility)"
6161
+ "description": "Icon name (resolves to a Lucide icon by PascalCase / kebab-case lookup)."
6370
6162
  },
6371
6163
  "onClick": {
6372
6164
  "types": [
6373
6165
  "function"
6374
6166
  ],
6375
- "description": "Click handler (simplified API for pattern compatibility)"
6167
+ "description": "Optional direct click handler. Runs after the action emit when both are present."
6376
6168
  },
6377
6169
  "variant": {
6378
6170
  "types": [
6379
6171
  "string"
6380
6172
  ],
6381
- "description": "Variant (simplified API for pattern compatibility)",
6173
+ "description": "Visual variant.",
6382
6174
  "enumValues": [
6383
6175
  "primary",
6384
6176
  "secondary",
@@ -6387,6 +6179,12 @@
6387
6179
  "warning"
6388
6180
  ]
6389
6181
  },
6182
+ "label": {
6183
+ "types": [
6184
+ "string"
6185
+ ],
6186
+ "description": "Optional label shown via `aria-label` (visually hidden in single-action mode; rendered as a tooltip beside expanded actions in multi-action mode)."
6187
+ },
6390
6188
  "position": {
6391
6189
  "types": [
6392
6190
  "string"
@@ -6999,78 +6797,29 @@
6999
6797
  ],
7000
6798
  "typicalSize": "large",
7001
6799
  "propsSchema": {
7002
- "label": {
7003
- "types": [
7004
- "string"
7005
- ],
7006
- "description": "label prop",
7007
- "required": true
7008
- },
7009
- "variant": {
7010
- "types": [
7011
- "string"
7012
- ],
7013
- "description": "variant prop",
7014
- "enumValues": [
7015
- "primary",
7016
- "secondary",
7017
- "ghost",
7018
- "danger",
7019
- "success",
7020
- "warning",
7021
- "default"
7022
- ]
7023
- },
7024
- "size": {
7025
- "types": [
7026
- "string"
7027
- ],
7028
- "description": "size prop",
7029
- "enumValues": [
7030
- "sm",
7031
- "md",
7032
- "lg"
7033
- ]
7034
- },
7035
- "disabled": {
7036
- "types": [
7037
- "boolean"
7038
- ],
7039
- "description": "disabled prop"
7040
- },
7041
6800
  "onClick": {
7042
6801
  "types": [
7043
6802
  "string"
7044
6803
  ],
7045
- "description": "onClick prop"
6804
+ "description": "Legacy alias for {@link ButtonProps.action} (string event name).",
6805
+ "kind": "event"
7046
6806
  },
7047
6807
  "event": {
7048
6808
  "types": [
7049
6809
  "string"
7050
6810
  ],
7051
- "description": "event prop"
7052
- },
7053
- "icon": {
7054
- "types": [
7055
- "string"
7056
- ],
7057
- "description": "icon prop"
6811
+ "description": "Legacy alias for {@link ButtonProps.action}.",
6812
+ "kind": "event"
7058
6813
  },
7059
6814
  "iconPosition": {
7060
6815
  "types": [
7061
6816
  "string"
7062
6817
  ],
7063
- "description": "iconPosition prop",
6818
+ "description": "Icon placement — maps to Button's `icon` (left) or `iconRight` (right).",
7064
6819
  "enumValues": [
7065
6820
  "left",
7066
6821
  "right"
7067
6822
  ]
7068
- },
7069
- "className": {
7070
- "types": [
7071
- "string"
7072
- ],
7073
- "description": "className prop"
7074
6823
  }
7075
6824
  }
7076
6825
  },
@@ -8879,12 +8628,6 @@
8879
8628
  ],
8880
8629
  "description": "Actions"
8881
8630
  },
8882
- "entity": {
8883
- "types": [
8884
- "string"
8885
- ],
8886
- "description": "Entity name for schema-driven auto-fetch"
8887
- },
8888
8631
  "isLoading": {
8889
8632
  "types": [
8890
8633
  "boolean"
@@ -13515,10 +13258,10 @@
13515
13258
  "propsSchema": {
13516
13259
  "entity": {
13517
13260
  "types": [
13518
- "unknown",
13261
+ "object",
13519
13262
  "array"
13520
13263
  ],
13521
- "description": "Entity data array",
13264
+ "description": "Schema entity data — single record or collection, typed against `@almadar/core`'s `EntityRow` so the narrow type declared on the emitting trait's `Event { data : [X] }` flows through to the prop without widening. The generic `T` lets consumers pass a narrower entity (e.g. `CartItem`) and have the `children` render function receive cards typed to that exact shape.",
13522
13265
  "required": true
13523
13266
  },
13524
13267
  "fields": {
@@ -13627,7 +13370,7 @@
13627
13370
  "types": [
13628
13371
  "function"
13629
13372
  ],
13630
- "description": "Render prop for custom per-item content. When provided, `fields` and `itemActions` are ignored."
13373
+ "description": "Render prop for custom per-card content, typed to the grid's entity shape `T`. When provided, `fields` and `itemActions` are ignored."
13631
13374
  },
13632
13375
  "renderItem": {
13633
13376
  "types": [
@@ -13656,10 +13399,10 @@
13656
13399
  "propsSchema": {
13657
13400
  "entity": {
13658
13401
  "types": [
13659
- "unknown",
13402
+ "object",
13660
13403
  "array"
13661
13404
  ],
13662
- "description": "Entity data array",
13405
+ "description": "Schema entity data — single record or collection, typed against `@almadar/core`'s `EntityRow` so the narrow type declared on the emitting trait's `Event { data : [X] }` flows through to the prop without widening. The generic `T` lets consumers pass a narrower entity (e.g. `CartItem`) and have the `children` render function receive items of that exact shape.",
13663
13406
  "required": true
13664
13407
  },
13665
13408
  "fields": {
@@ -14556,23 +14299,29 @@
14556
14299
  "propsSchema": {
14557
14300
  "value": {
14558
14301
  "types": [
14302
+ "number",
14559
14303
  "string"
14560
14304
  ],
14561
- "description": "Target value to count to (e.g. \"500+\", \"99.9%\", \"3x\")",
14305
+ "description": "The target value to animate to. Strings are parsed numerically (e.g. \"500\", \"99.9\").",
14562
14306
  "required": true
14563
14307
  },
14564
- "label": {
14308
+ "duration": {
14309
+ "types": [
14310
+ "number"
14311
+ ],
14312
+ "description": "Animation duration in milliseconds"
14313
+ },
14314
+ "prefix": {
14565
14315
  "types": [
14566
14316
  "string"
14567
14317
  ],
14568
- "description": "Label displayed below the number",
14569
- "required": true
14318
+ "description": "Text to display before the number"
14570
14319
  },
14571
- "duration": {
14320
+ "suffix": {
14572
14321
  "types": [
14573
- "number"
14322
+ "string"
14574
14323
  ],
14575
- "description": "Animation duration in ms"
14324
+ "description": "Text to display after the number"
14576
14325
  },
14577
14326
  "className": {
14578
14327
  "types": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/patterns",
3
- "version": "2.17.2",
3
+ "version": "2.18.2",
4
4
  "description": "Pattern registry and component mappings for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",