aidos-ui 3.0.30 → 4.0.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.
Files changed (94) hide show
  1. package/README.md +43 -29
  2. package/dist/Badge.d.ts +2 -2
  3. package/dist/Badge.js.map +1 -1
  4. package/dist/BaseButton.d.ts +2 -2
  5. package/dist/BaseButton.js +2 -2
  6. package/dist/BaseButton.js.map +1 -1
  7. package/dist/BaseInput.d.ts +2 -2
  8. package/dist/BaseInput.js.map +1 -1
  9. package/dist/BaseLink.d.ts +2 -2
  10. package/dist/BaseLink.js +2 -2
  11. package/dist/BaseLink.js.map +1 -1
  12. package/dist/BaseListItem.d.ts +2 -2
  13. package/dist/BaseListItem.js.map +1 -1
  14. package/dist/BaseView.d.ts +2 -2
  15. package/dist/BaseView.js.map +1 -1
  16. package/dist/Calendar.d.ts +2 -2
  17. package/dist/DateInput.d.ts +2 -2
  18. package/dist/DatetimeInput.d.ts +2 -2
  19. package/dist/Dropdown.d.ts +3 -3
  20. package/dist/Dropdown.js.map +1 -1
  21. package/dist/IconLink.js +2 -1
  22. package/dist/IconLink.js.map +1 -1
  23. package/dist/Interactable.d.ts +4 -4
  24. package/dist/Interactable.js +2 -2
  25. package/dist/Interactable.js.map +1 -1
  26. package/dist/ListButtonItem.js +2 -2
  27. package/dist/ListButtonItem.js.map +1 -1
  28. package/dist/ListLinkItem.js +2 -2
  29. package/dist/ListLinkItem.js.map +1 -1
  30. package/dist/MenuIcon.js.map +1 -1
  31. package/dist/NextJSRouter.js.map +1 -1
  32. package/dist/Popover.d.ts +4 -4
  33. package/dist/Popover.js +2 -2
  34. package/dist/Popover.js.map +1 -1
  35. package/dist/ProgressBar.d.ts +2 -2
  36. package/dist/ProgressBar.js.map +1 -1
  37. package/dist/Providers.js +2 -2
  38. package/dist/Providers.js.map +1 -1
  39. package/dist/RangeInput.d.ts +2 -2
  40. package/dist/RangeInput.js +2 -2
  41. package/dist/RangeInput.js.map +1 -1
  42. package/dist/Select.d.ts +2 -2
  43. package/dist/Select.js.map +1 -1
  44. package/dist/StaticCheckbox.js.map +1 -1
  45. package/dist/Sublist.d.ts +2 -2
  46. package/dist/Tabs.d.ts +5 -3
  47. package/dist/Tabs.js +2 -2
  48. package/dist/Tabs.js.map +1 -1
  49. package/dist/Text.d.ts +2 -2
  50. package/dist/TextArea.d.ts +2 -2
  51. package/dist/TextArea.js.map +1 -1
  52. package/dist/TextInput.d.ts +2 -2
  53. package/dist/TextInput.js +2 -2
  54. package/dist/TextInput.js.map +1 -1
  55. package/dist/TextPairing.d.ts +2 -2
  56. package/dist/Tooltip.d.ts +2 -2
  57. package/dist/Tooltip.js.map +1 -1
  58. package/dist/jss.d.ts +15 -15
  59. package/dist/jss.js +4 -4
  60. package/dist/jss.js.map +1 -1
  61. package/package.json +1 -1
  62. package/src/Badge.tsx +2 -2
  63. package/src/BaseButton.tsx +4 -4
  64. package/src/BaseInput.tsx +2 -2
  65. package/src/BaseLink.tsx +4 -4
  66. package/src/BaseListItem.tsx +2 -2
  67. package/src/BaseView.tsx +3 -3
  68. package/src/Calendar.tsx +2 -2
  69. package/src/DateInput.tsx +2 -2
  70. package/src/DatetimeInput.tsx +2 -2
  71. package/src/Dropdown.tsx +4 -4
  72. package/src/IconLink.tsx +2 -1
  73. package/src/Interactable.tsx +4 -4
  74. package/src/ListButtonItem.tsx +2 -2
  75. package/src/ListLinkItem.tsx +2 -2
  76. package/src/MenuIcon.tsx +2 -2
  77. package/src/NextJSRouter.tsx +2 -2
  78. package/src/Popover.tsx +6 -6
  79. package/src/ProgressBar.tsx +3 -3
  80. package/src/Providers.tsx +3 -3
  81. package/src/RangeInput.tsx +4 -4
  82. package/src/Select.tsx +2 -2
  83. package/src/StaticCheckbox.tsx +2 -2
  84. package/src/Sublist.tsx +2 -2
  85. package/src/Tabs.tsx +4 -4
  86. package/src/Text.tsx +2 -2
  87. package/src/TextArea.tsx +2 -2
  88. package/src/TextInput.tsx +4 -4
  89. package/src/TextPairing.tsx +2 -2
  90. package/src/Tooltip.tsx +3 -3
  91. package/src/docs/searchIndex.ts +1 -1
  92. package/src/jss.tsx +15 -15
  93. package/src/pages/Tabs.mdx +59 -0
  94. package/src/pages/_app.tsx +1 -1
package/src/jss.tsx CHANGED
@@ -11,13 +11,13 @@ export type Styles = CSS.Properties<
11
11
  string | number | CSS.Properties<string | number>
12
12
  >;
13
13
 
14
- export type JSStyle =
14
+ export type JSS =
15
15
  | Styles
16
16
  | null
17
17
  | false
18
18
  | undefined
19
19
  | { [key: string]: Styles }
20
- | Array<JSStyle>;
20
+ | Array<JSS>;
21
21
 
22
22
  const aliases: {
23
23
  [alias: string]: (value: StylesValueType) => [string, StylesValueType][];
@@ -137,21 +137,21 @@ const getCSS = (key: string, value): [string, string] => {
137
137
  return [cssProp, cssValue];
138
138
  };
139
139
 
140
- const flattenJSStyle = (jss: JSStyle): Styles => {
140
+ const flattenJSS = (jss: JSS): Styles => {
141
141
  if (!jss) {
142
142
  return {};
143
143
  } else if (Array.isArray(jss)) {
144
144
  // @ts-ignore
145
- return jss.reduce((acc: Styles, jss: JSStyle) => {
146
- return { ...acc, ...flattenJSStyle(jss) };
145
+ return jss.reduce((acc: Styles, jss: JSS) => {
146
+ return { ...acc, ...flattenJSS(jss) };
147
147
  }, {});
148
148
  } else {
149
149
  return jss;
150
150
  }
151
151
  };
152
152
 
153
- export const toClassnames = (jss: JSStyle): string => {
154
- jss = flattenJSStyle(jss);
153
+ export const toClassnames = (jss: JSS): string => {
154
+ jss = flattenJSS(jss);
155
155
 
156
156
  const stylesStack = Object.entries(jss);
157
157
  const classNames = [];
@@ -205,7 +205,7 @@ export const toClassnames = (jss: JSStyle): string => {
205
205
 
206
206
  const serverStyles = [];
207
207
 
208
- export function JSStylesProvider({
208
+ export function JSSProvider({
209
209
  themes,
210
210
  children,
211
211
  }: {
@@ -324,7 +324,7 @@ export function getSpacing(spacing: Spacing): string {
324
324
  }
325
325
  }
326
326
 
327
- export function getPadding(padding: Padding): JSStyle {
327
+ export function getPadding(padding: Padding): JSS {
328
328
  if (Array.isArray(padding)) {
329
329
  const [vertical, horizontal] = padding;
330
330
  return {
@@ -340,7 +340,7 @@ export function getPadding(padding: Padding): JSStyle {
340
340
  }
341
341
  }
342
342
 
343
- export function getMargin(margin: Margin): JSStyle {
343
+ export function getMargin(margin: Margin): JSS {
344
344
  if (Array.isArray(margin)) {
345
345
  const [vertical, horizontal] = margin;
346
346
  return {
@@ -559,7 +559,7 @@ const backgroundStyles = {
559
559
  },
560
560
  };
561
561
 
562
- export const getBackground = (color: Color): JSStyle => {
562
+ export const getBackground = (color: Color): JSS => {
563
563
  return backgroundStyles[color];
564
564
  };
565
565
 
@@ -572,25 +572,25 @@ export const TABLET_MEDIA = `@media (min-width: ${MOBILE}px) and (max-width: ${T
572
572
  export const LAPTOP_MEDIA = `@media (min-width: ${TABLET}px) and (max-width: ${LAPTOP}px)`;
573
573
  export const DESKTOP_MEDIA = `@media (min-width: ${LAPTOP}px)`;
574
574
 
575
- export function mobile(jss: JSStyle): { [key: string]: JSStyle } {
575
+ export function mobile(jss: JSS): { [key: string]: JSS } {
576
576
  return {
577
577
  [MOBILE_MEDIA]: jss,
578
578
  };
579
579
  }
580
580
 
581
- export function tablet(jss: JSStyle): { [key: string]: JSStyle } {
581
+ export function tablet(jss: JSS): { [key: string]: JSS } {
582
582
  return {
583
583
  [TABLET_MEDIA]: jss,
584
584
  };
585
585
  }
586
586
 
587
- export function laptop(jss: JSStyle): { [key: string]: JSStyle } {
587
+ export function laptop(jss: JSS): { [key: string]: JSS } {
588
588
  return {
589
589
  [LAPTOP_MEDIA]: jss,
590
590
  };
591
591
  }
592
592
 
593
- export function desktop(jss: JSStyle): { [key: string]: JSStyle } {
593
+ export function desktop(jss: JSS): { [key: string]: JSS } {
594
594
  return {
595
595
  [DESKTOP_MEDIA]: jss,
596
596
  };
@@ -363,4 +363,63 @@ You can customize how tab labels are rendered by providing a `labelRenderer` fun
363
363
  ]}
364
364
  />
365
365
  </Column>
366
+ ```
367
+
368
+
369
+ ## Custom tab styles
370
+
371
+ You can provide custom styles to individual tabs using the `tabJSStyle` prop, which can either be a style object or a function that receives the tab's selected state.
372
+
373
+ <Column>
374
+ <Tabs
375
+ aria-controls="foo"
376
+ tabJSStyle={(data) => ({
377
+ borderBottom: data.selected ? "2px solid cyan" : "2px solid magenta",
378
+ })}
379
+ tabs={[
380
+ {
381
+ href: "/Tabs",
382
+ selected: true,
383
+ label: "Styled Tab 1",
384
+ },
385
+ {
386
+ href: "/Tabs",
387
+ selected: false,
388
+ label: "Styled Tab 2",
389
+ },
390
+ {
391
+ href: "/Tabs",
392
+ selected: false,
393
+ label: "Styled Tab 3",
394
+ },
395
+ ]}
396
+ />
397
+ </Column>
398
+
399
+ ```js
400
+ <Column>
401
+ <Tabs
402
+ aria-controls="foo"
403
+ tabJSStyle={(data) => ({
404
+ borderBottom: data.selected ? "2px solid cyan" : "2px solid magenta",
405
+ })}
406
+ tabs={[
407
+ {
408
+ href: "/Tabs",
409
+ selected: true,
410
+ label: "Styled Tab 1",
411
+ },
412
+ {
413
+ href: "/Tabs",
414
+ selected: false,
415
+ label: "Styled Tab 2",
416
+ },
417
+ {
418
+ href: "/Tabs",
419
+ selected: false,
420
+ label: "Styled Tab 3",
421
+ },
422
+ ]}
423
+ />
424
+ </Column>
366
425
  ```
@@ -292,7 +292,7 @@ export default function App({ Component, pageProps }: AppProps) {
292
292
  justify="space-between"
293
293
  >
294
294
  <TextInput
295
- rootJSStyle={{ flexGrow: 1 }}
295
+ jssRoot={{ flexGrow: 1 }}
296
296
  ref={queryInputRef}
297
297
  role="combobox"
298
298
  aria-haspopup="grid"