gantri-components 2.234.0 → 2.235.7

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 (49) hide show
  1. package/CLAUDE.md +111 -1
  2. package/dist/components/button-menu/button-menu.d.ts +1 -4
  3. package/dist/components/checkbox-list/checkbox-list.d.ts +1 -4
  4. package/dist/components/color-picker/color-picker.types.d.ts +7 -1
  5. package/dist/components/color-picker/components/color-picker-item/color-picker-item.styles.d.ts +3 -3
  6. package/dist/components/color-picker/components/color-picker-item/color-picker-item.types.d.ts +2 -2
  7. package/dist/components/dropdown-menu/dropdown-menu.d.ts +1 -4
  8. package/dist/components/file-uploader/components/file-uploader-thumbnail-variant/file-uploader-thumbnail-variant.d.ts +1 -4
  9. package/dist/components/file-uploader/file-uploader.d.ts +1 -4
  10. package/dist/components/icon/generated/work/Moon.d.ts +3 -0
  11. package/dist/components/icon/generated/work/Moon24.d.ts +3 -0
  12. package/dist/components/icon/generated/work/index.d.ts +2 -0
  13. package/dist/components/icon/icon.type.d.ts +1 -1
  14. package/dist/components/index.d.ts +1 -0
  15. package/dist/components/multi-select-list/multi-select-list.d.ts +1 -4
  16. package/dist/components/option-selector/option-selector.d.ts +1 -4
  17. package/dist/components/picture/__test__/build-cloudinary-url.test.d.ts +1 -0
  18. package/dist/components/picture/__test__/build-srcset.test.d.ts +1 -0
  19. package/dist/components/picture/__test__/detect-source.test.d.ts +1 -0
  20. package/dist/components/picture/__test__/picture.test.d.ts +1 -0
  21. package/dist/components/picture/helpers/build-cloudinary-url.d.ts +21 -0
  22. package/dist/components/picture/helpers/build-placeholder.d.ts +2 -0
  23. package/dist/components/picture/helpers/build-srcset.d.ts +22 -0
  24. package/dist/components/picture/helpers/detect-source.d.ts +2 -0
  25. package/dist/components/picture/helpers/index.d.ts +5 -0
  26. package/dist/components/picture/helpers/normalize-resolution-aware.d.ts +8 -0
  27. package/dist/components/picture/index.d.ts +3 -0
  28. package/dist/components/picture/picture.d.ts +3 -0
  29. package/dist/components/picture/picture.presets.d.ts +2 -0
  30. package/dist/components/picture/picture.styles.d.ts +8 -0
  31. package/dist/components/picture/picture.types.d.ts +72 -0
  32. package/dist/components/radio/radio.d.ts +1 -4
  33. package/dist/components/radio-list/radio-list.d.ts +1 -4
  34. package/dist/components/responsive/responsive.d.ts +19 -0
  35. package/dist/components/responsive/responsive.types.d.ts +4 -0
  36. package/dist/components/search-field/search-field.d.ts +1 -4
  37. package/dist/components/table/components/table-actions-wrapper/components/paging/paging.d.ts +1 -4
  38. package/dist/components/table/components/table-actions-wrapper/components/search/search.d.ts +1 -4
  39. package/dist/components/table/table.d.ts +1 -4
  40. package/dist/helpers/get-file-url/helpers/get-cloudinary-prefix/get-cloudinary-prefix.d.ts +2 -2
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.d.ts +2 -1
  43. package/dist/index.esm.js +1 -1
  44. package/dist/styles/__tests__/media-style.test.d.ts +1 -0
  45. package/dist/styles/index.d.ts +1 -0
  46. package/dist/styles/media-style.d.ts +56 -0
  47. package/dist/styles/media.d.ts +7 -0
  48. package/dist/styles/theme.d.ts +17 -280
  49. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export { getButtonsColors, getThemeColor, getThemeSpacing, palette, spacing, lightTheme, darkTheme, modernLightTheme, modernDarkTheme, createTheme, } from './theme';
2
2
  export { themeStyle } from './theme-style';
3
+ export { mediaStyle } from './media-style';
3
4
  export { type PaletteColor as Color } from './theme';
4
5
  export { ThemeProvider } from './theme-provider';
5
6
  export { ScopedThemeProvider } from './scoped-theme-provider';
@@ -0,0 +1,56 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ type Breakpoint = 'lg' | 'md' | 'sm';
3
+ type MediaStyleValue<P = Record<string, unknown>> = any | ((props: P & {
4
+ theme: DefaultTheme;
5
+ }) => any);
6
+ type MediaStyleMap<P = Record<string, unknown>> = Partial<Record<Breakpoint, MediaStyleValue<P>>>;
7
+ /**
8
+ * Resolves CSS blocks per breakpoint with a `lg → md → sm` cascade, mirroring
9
+ * how `ResolutionAwareProp` works on component props.
10
+ *
11
+ * - `lg` is the base (no media query) and applies at every breakpoint unless
12
+ * overridden.
13
+ * - `md` is wrapped in `@media (max-width: <md>)` and overrides `lg` for
14
+ * tablet and below.
15
+ * - `sm` is wrapped in `@media (max-width: <sm>)` and overrides everything
16
+ * for mobile only.
17
+ *
18
+ * Each block must be a `css` tagged template (or a function returning one) —
19
+ * this enables CSS autocomplete and syntax highlighting in your editor.
20
+ *
21
+ * Prefer this over `media.lessThan('md')` / `media.lessThan('sm')` calls
22
+ * spread across a stylesheet — colocates all breakpoint variants in one block.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import styled, { mediaStyle, css } from 'gantri-components';
27
+ *
28
+ * const StyledCard = styled.div`
29
+ * border: 1px solid var(--divider-t1);
30
+ *
31
+ * ${mediaStyle({
32
+ * lg: css`border-radius: 16px;`,
33
+ * md: css`border-radius: 8px;`,
34
+ * sm: css`border-radius: 4px;`,
35
+ * })}
36
+ * `;
37
+ * ```
38
+ *
39
+ * Renders to:
40
+ * ```css
41
+ * border-radius: 16px;
42
+ * @media (max-width: 1024px) { border-radius: 8px; }
43
+ * @media (max-width: 720px) { border-radius: 4px; }
44
+ * ```
45
+ *
46
+ * Use a function when you need to read styled-component props:
47
+ * ```ts
48
+ * ${mediaStyle<{ $highlighted: boolean }>({
49
+ * lg: ({ $highlighted }) => css`
50
+ * background: ${$highlighted ? 'var(--surface-green-t1)' : 'transparent'};
51
+ * `,
52
+ * })}
53
+ * ```
54
+ */
55
+ export declare const mediaStyle: <P = Record<string, unknown>>(styles: Partial<Record<Breakpoint, any>>) => import("styled-components").RuleSet<object>;
56
+ export {};
@@ -3,6 +3,13 @@ export declare const mediaBreakpoints: {
3
3
  md: string;
4
4
  sm: string;
5
5
  };
6
+ /**
7
+ * @deprecated Prefer `mediaStyle` for `lessThan('md')` / `lessThan('sm')`
8
+ * use cases — it colocates lg/md/sm CSS blocks in a single declaration with
9
+ * the same cascade as `ResolutionAwareProp`. This `media` helper remains
10
+ * exported for backward compatibility with `greaterThan` / `between` cases
11
+ * that `mediaStyle` does not cover.
12
+ */
6
13
  export declare const media: import("styled-media-query").MediaGenerator<{
7
14
  lg: string;
8
15
  md: string;
@@ -235,292 +235,29 @@ export interface ProductColorDetails {
235
235
  shortColorName: string;
236
236
  status: ProductColorStatus;
237
237
  }
238
- declare const productColorsDefinition: {
239
- blossompink: {
240
- code: string;
241
- fullColorName: string;
242
- hexColor: string;
243
- inventoryColor: string;
244
- shortColorName: string;
245
- status: "active";
246
- };
247
- canyon: {
248
- code: string;
249
- fullColorName: string;
250
- hexColor: string;
251
- inventoryColor: string;
252
- shortColorName: string;
253
- status: "active";
254
- };
255
- carbon: {
256
- code: string;
257
- fullColorName: string;
258
- hexColor: string;
259
- inventoryColor: string;
260
- shortColorName: string;
261
- status: "active";
262
- };
263
- cobalt: {
264
- code: string;
265
- fullColorName: string;
266
- hexColor: string;
267
- inventoryColor: string;
268
- shortColorName: string;
269
- status: "active";
270
- };
271
- coral: {
272
- code: string;
273
- fullColorName: string;
274
- hexColor: string;
275
- inventoryColor: string;
276
- shortColorName: string;
277
- status: "archived";
278
- };
279
- fog: {
280
- code: string;
281
- fullColorName: string;
282
- hexColor: string;
283
- inventoryColor: string;
284
- shortColorName: string;
285
- status: "archived";
286
- };
287
- forest: {
288
- code: string;
289
- fullColorName: string;
290
- hexColor: string;
291
- inventoryColor: string;
292
- shortColorName: string;
293
- status: "archived";
294
- };
295
- gantri: {
296
- availability: {
297
- flag: "allowGantriColors";
298
- type: "flag-gated";
299
- };
300
- code: string;
301
- fullColorName: string;
302
- hexColor: string;
303
- inventoryColor: string;
304
- shortColorName: string;
305
- status: "active";
306
- };
307
- glossysnowwhite: {
308
- availability: {
309
- productIds: number[];
310
- type: "only-on-products";
311
- };
312
- code: string;
313
- fullColorName: string;
314
- hexColor: string;
315
- inventoryColor: string;
316
- shortColorName: string;
317
- status: "archived";
318
- };
319
- hibiscus: {
320
- code: string;
321
- fullColorName: string;
322
- hexColor: string;
323
- inventoryColor: string;
324
- shortColorName: string;
325
- status: "archived";
326
- };
327
- lichen: {
328
- code: string;
329
- fullColorName: string;
330
- hexColor: string;
331
- inventoryColor: string;
332
- shortColorName: string;
333
- status: "active";
334
- };
335
- lilac: {
336
- code: string;
337
- fullColorName: string;
338
- hexColor: string;
339
- inventoryColor: string;
340
- shortColorName: string;
341
- status: "active";
342
- };
343
- magnolia: {
344
- code: string;
345
- fullColorName: string;
346
- hexColor: string;
347
- inventoryColor: string;
348
- shortColorName: string;
349
- status: "active";
350
- };
351
- manzanita: {
352
- code: string;
353
- fullColorName: string;
354
- hexColor: string;
355
- inventoryColor: string;
356
- shortColorName: string;
357
- status: "active";
358
- };
359
- meadow: {
360
- code: string;
361
- fullColorName: string;
362
- hexColor: string;
363
- inventoryColor: string;
364
- shortColorName: string;
365
- status: "active";
366
- };
367
- midnight: {
368
- code: string;
369
- fullColorName: string;
370
- hexColor: string;
371
- inventoryColor: string;
372
- shortColorName: string;
373
- status: "active";
374
- };
375
- mist: {
376
- code: string;
377
- fullColorName: string;
378
- hexColor: string;
379
- inventoryColor: string;
380
- shortColorName: string;
381
- status: "active";
382
- };
383
- mustard: {
384
- code: string;
385
- fullColorName: string;
386
- hexColor: string;
387
- inventoryColor: string;
388
- shortColorName: string;
389
- status: "active";
390
- };
391
- olive: {
392
- code: string;
393
- fullColorName: string;
394
- hexColor: string;
395
- inventoryColor: string;
396
- shortColorName: string;
397
- status: "active";
398
- };
399
- peach: {
400
- code: string;
401
- fullColorName: string;
402
- hexColor: string;
403
- inventoryColor: string;
404
- shortColorName: string;
405
- status: "active";
406
- };
407
- persimmon: {
408
- code: string;
409
- fullColorName: string;
410
- hexColor: string;
411
- inventoryColor: string;
412
- shortColorName: string;
413
- status: "active";
414
- };
415
- poppy: {
416
- code: string;
417
- fullColorName: string;
418
- hexColor: string;
419
- inventoryColor: string;
420
- shortColorName: string;
421
- status: "active";
422
- };
423
- sage: {
424
- code: string;
425
- fullColorName: string;
426
- hexColor: string;
427
- inventoryColor: string;
428
- shortColorName: string;
429
- status: "active";
430
- };
431
- sand: {
432
- code: string;
433
- fullColorName: string;
434
- hexColor: string;
435
- inventoryColor: string;
436
- shortColorName: string;
437
- status: "active";
438
- };
439
- sedona: {
440
- code: string;
441
- fullColorName: string;
442
- hexColor: string;
443
- inventoryColor: string;
444
- shortColorName: string;
445
- status: "active";
446
- };
447
- sky: {
448
- code: string;
449
- fullColorName: string;
450
- hexColor: string;
451
- inventoryColor: string;
452
- shortColorName: string;
453
- status: "archived";
454
- };
455
- smoke: {
456
- code: string;
457
- fullColorName: string;
458
- hexColor: string;
459
- inventoryColor: string;
460
- shortColorName: string;
461
- status: "active";
462
- };
463
- snow: {
464
- code: string;
465
- fullColorName: string;
466
- hexColor: string;
467
- inventoryColor: string;
468
- shortColorName: string;
469
- status: "active";
470
- };
471
- sproutgreen: {
472
- code: string;
473
- fullColorName: string;
474
- hexColor: string;
475
- inventoryColor: string;
476
- shortColorName: string;
477
- status: "archived";
478
- };
479
- spruce: {
480
- code: string;
481
- fullColorName: string;
482
- hexColor: string;
483
- inventoryColor: string;
484
- shortColorName: string;
485
- status: "active";
486
- };
487
- stone: {
488
- code: string;
489
- fullColorName: string;
490
- hexColor: string;
491
- inventoryColor: string;
492
- shortColorName: string;
493
- status: "active";
494
- };
495
- sunrise: {
496
- code: string;
497
- fullColorName: string;
498
- hexColor: string;
499
- inventoryColor: string;
500
- shortColorName: string;
501
- status: "active";
502
- };
503
- walnut: {
504
- code: string;
505
- fullColorName: string;
506
- hexColor: string;
507
- inventoryColor: string;
508
- shortColorName: string;
509
- status: "active";
510
- };
511
- };
238
+ /** Shape of a color entry before ProductColorCode is derived. */
239
+ interface ProductColorEntry {
240
+ availability?: ColorAvailabilityRule;
241
+ code: string;
242
+ fullColorName: string;
243
+ hexColor: string;
244
+ inventoryColor: string;
245
+ shortColorName: string;
246
+ status: ProductColorStatus;
247
+ }
248
+ declare const productColorsDefinition: Record<string, ProductColorEntry>;
512
249
  export type ProductColorCode = keyof typeof productColorsDefinition;
513
- export declare const productColorsMap: Record<"blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut", ProductColorDetails>;
250
+ export declare const productColorsMap: Record<string, ProductColorDetails>;
514
251
  /** All product color codes, auto-derived from productColorsMap. */
515
- export declare const allProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
252
+ export declare const allProductColorCodes: string[];
516
253
  /** Color codes that are currently active. */
517
- export declare const activeProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
254
+ export declare const activeProductColorCodes: string[];
518
255
  /** Color codes that have been archived (no longer offered but may exist on past orders). */
519
- export declare const archivedProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
256
+ export declare const archivedProductColorCodes: string[];
520
257
  /** @deprecated Use archivedProductColorCodes. Kept for backward compatibility. */
521
- export declare const retiredProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
258
+ export declare const retiredProductColorCodes: string[];
522
259
  /** Active color codes for consumer-facing UIs (excludes archived). */
523
- export declare const consumerProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
260
+ export declare const consumerProductColorCodes: string[];
524
261
  export declare const lightTheme: DefaultTheme;
525
262
  export declare const darkTheme: DefaultTheme;
526
263
  export declare const modernLightTheme: DefaultTheme;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "gantri-components",
3
- "version": "2.234.0",
3
+ "version": "2.235.7",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
- "repository": "git@github.com:gantri/gantri-components.git",
7
+ "repository": "https://github.com/gantri/gantri-components.git",
8
8
  "author": "Danny <danny@gantri.com>",
9
9
  "sideEffects": false,
10
10
  "license": "MIT",