playbook_ui 14.6.2.pre.alpha.PLAY1550lazysizesupgrade4295 → 14.6.2.pre.alpha.PLAY15814348

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_card/_card.tsx +12 -4
  3. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -2
  4. data/app/pb_kits/playbook/pb_card/docs/_card_light.jsx +17 -3
  5. data/app/pb_kits/playbook/pb_currency/_currency.tsx +16 -6
  6. data/app/pb_kits/playbook/pb_currency/currency.rb +38 -11
  7. data/app/pb_kits/playbook/pb_currency/currency.test.js +35 -0
  8. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +7 -0
  9. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +18 -0
  10. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md +3 -0
  11. data/app/pb_kits/playbook/pb_currency/docs/example.yml +3 -1
  12. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
  13. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +5 -1
  14. data/app/pb_kits/playbook/pb_flex/_flex.tsx +3 -1
  15. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +8 -2
  16. data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +3 -6
  17. data/app/pb_kits/playbook/pb_flex/flex_item.rb +7 -2
  18. data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
  19. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +67 -1
  20. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -0
  21. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  22. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +5 -1
  23. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +3 -0
  24. data/app/pb_kits/playbook/utilities/globalProps.ts +39 -2
  25. data/dist/chunks/_typeahead-BtdghxJo.js +22 -0
  26. data/dist/chunks/_weekday_stacked-D1RoR5CN.js +45 -0
  27. data/dist/chunks/vendor.js +1 -1
  28. data/dist/playbook-doc.js +1 -1
  29. data/dist/playbook-rails-react-bindings.js +1 -1
  30. data/dist/playbook-rails.js +1 -1
  31. data/dist/playbook.css +1 -1
  32. data/lib/playbook/kit_base.rb +21 -1
  33. data/lib/playbook/version.rb +1 -1
  34. metadata +7 -4
  35. data/dist/chunks/_typeahead-BV_n6U5W.js +0 -22
  36. data/dist/chunks/_weekday_stacked-Cken8pfG.js +0 -45
@@ -170,12 +170,24 @@ type ZIndex = {
170
170
  zIndex?: ZIndexType,
171
171
  } | ZIndexResponsiveType
172
172
 
173
+ type Height = {
174
+ height?: string
175
+ }
176
+
177
+ type MaxHeight = {
178
+ maxHeight?: string
179
+ }
180
+
181
+ type MinHeight = {
182
+ minHeight?: string
183
+ }
184
+
173
185
  // keep this as the last type definition
174
186
  export type GlobalProps = AlignContent & AlignItems & AlignSelf &
175
187
  BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
176
188
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
177
189
  LineHeight & Margin & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
178
- Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left;
190
+ Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
179
191
 
180
192
  const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
181
193
  const keys: string[] = Object.keys(prop)
@@ -498,7 +510,22 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
498
510
  } else {
499
511
  return verticalAlign ? `vertical_align_${verticalAlign} ` : ''
500
512
  }
501
- }
513
+ },
514
+
515
+ }
516
+
517
+ const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[key: string]: any}} = {
518
+ heightProps: ({ height }: Height) => {
519
+ return height ? { height } : {};
520
+ },
521
+
522
+ maxHeightProps: ({ maxHeight }: MaxHeight) => {
523
+ return maxHeight ? { maxHeight } : {};
524
+ },
525
+
526
+ minHeightProps: ({ minHeight }: MinHeight) => {
527
+ return minHeight ? { minHeight } : {};
528
+ },
502
529
  }
503
530
 
504
531
  type DefaultProps = {[key: string]: string} | Record<string, unknown>
@@ -510,6 +537,16 @@ export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {})
510
537
  }).filter((value) => value?.length > 0).join(" ")
511
538
  }
512
539
 
540
+ // New function for inline styles
541
+ export const globalInlineProps = (props: GlobalProps): React.CSSProperties => {
542
+ const styles = Object.keys(PROP_INLINE_CATEGORIES).reduce((acc, key) => {
543
+ const result = PROP_INLINE_CATEGORIES[key](props);
544
+ return { ...acc, ...(typeof result === 'object' ? result : {}) }; // Ensure result is an object before spreading
545
+ }, {});
546
+
547
+ return styles; // Return the styles object directly
548
+ }
549
+
513
550
 
514
551
  export const deprecatedProps = (): void => {
515
552
  // if (process.env.NODE_ENV === 'development') {