playbook_ui 16.2.0.pre.alpha.advancedtablecascadingcollapsereact14676 → 16.2.0.pre.alpha.faiconbuttonfix14520

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. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +4 -17
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +9 -21
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +1 -25
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -5
  7. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -74
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
  10. data/app/pb_kits/playbook/pb_collapsible/index.js +4 -16
  11. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -4
  12. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
  13. data/app/pb_kits/playbook/pb_dialog/index.js +5 -45
  14. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +0 -2
  15. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
  16. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -1
  17. data/app/pb_kits/playbook/pb_dropdown/index.js +13 -68
  18. data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +3 -19
  19. data/app/pb_kits/playbook/pb_enhanced_element/element_observer.ts +1 -1
  20. data/app/pb_kits/playbook/pb_enhanced_element/index.ts +1 -2
  21. data/app/pb_kits/playbook/pb_icon/icon.rb +19 -168
  22. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +0 -2
  23. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -1
  24. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  25. data/app/pb_kits/playbook/pb_pagination/_pagination.scss +1 -101
  26. data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +1 -172
  27. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +15 -178
  28. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +0 -4
  30. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +0 -2
  31. data/app/pb_kits/playbook/pb_select/_select.tsx +0 -2
  32. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  33. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +1 -1
  34. data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_interactive.tsx +0 -1
  35. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +0 -2
  36. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +2 -2
  37. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +21 -43
  38. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +0 -1
  39. data/app/pb_kits/playbook/pb_textarea/docs/index.js +8 -9
  40. data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +4 -4
  41. data/app/pb_kits/playbook/pb_textarea/textarea.rb +2 -6
  42. data/app/pb_kits/playbook/pb_textarea/textarea.test.js +1 -134
  43. data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +0 -6
  44. data/app/pb_kits/playbook/pb_time_picker/time_picker.test.jsx +2 -2
  45. data/app/pb_kits/playbook/pb_tooltip/index.js +15 -60
  46. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -1
  47. data/dist/chunks/{_pb_line_graph-BGY7jEks.js → _pb_line_graph-BSLb5VXP.js} +1 -1
  48. data/dist/chunks/{_typeahead-QhswHQnq.js → _typeahead-DXIBDeMj.js} +1 -1
  49. data/dist/chunks/{globalProps-CK2YuA9O.js → globalProps-DyTB8IdV.js} +1 -1
  50. data/dist/chunks/{lib-DspaUdlc.js → lib-9wz3x5jl.js} +1 -1
  51. data/dist/chunks/vendor.js +5 -5
  52. data/dist/menu.yml +1 -1
  53. data/dist/playbook-rails-react-bindings.js +1 -1
  54. data/dist/playbook-rails.js +1 -1
  55. data/dist/playbook.css +1 -1
  56. data/lib/playbook/forms/builder/checkbox_field.rb +1 -1
  57. data/lib/playbook/version.rb +1 -1
  58. metadata +6 -12
  59. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.jsx +0 -50
  60. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +0 -1
  61. data/app/pb_kits/playbook/pb_kit_registry/index.ts +0 -180
  62. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_reset_key.jsx +0 -100
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_reset_key.md +0 -1
  64. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.jsx +0 -68
@@ -149,7 +149,7 @@ describe("TextArea Kit Props", () => {
149
149
  )
150
150
 
151
151
  const kit = screen.getByTestId(testId)
152
- const error = kit.querySelector(".pb_caption_kit_md_lighter")
152
+ const error = kit.querySelector(".pb_caption_kit_md")
153
153
 
154
154
  expect(error.innerHTML).toBe("Test Label")
155
155
  })
@@ -283,136 +283,3 @@ describe("Textarea Emoji Mask", () => {
283
283
  expect(kit).toHaveTextContent('*')
284
284
  })
285
285
  })
286
-
287
- describe("Textarea Input Options", () => {
288
- test("should apply inputOptions.id to textarea element", () => {
289
- render(<Textarea data={{ testid: testId }}
290
- inputOptions={{ id: "custom-textarea-id" }}
291
- />)
292
-
293
- const kit = screen.getByTestId(testId)
294
- const textarea = kit.querySelector("textarea")
295
-
296
- expect(textarea).toHaveAttribute("id", "custom-textarea-id")
297
- })
298
-
299
- test("should apply id prop to container and inputOptions.id to textarea", () => {
300
- render(
301
- <Textarea data={{ testid: testId }}
302
- id="wrapper-id"
303
- inputOptions={{ id: "textarea-id" }}
304
- />
305
- )
306
-
307
- const kit = screen.getByTestId(testId)
308
- const textarea = kit.querySelector("textarea")
309
-
310
- expect(kit).toHaveAttribute("id", "wrapper-id")
311
- expect(textarea).toHaveAttribute("id", "textarea-id")
312
- })
313
-
314
- test("should apply id prop to container and derived id to textarea when only id passed", () => {
315
- render(
316
- <Textarea data={{ testid: testId }}
317
- id="wrapper-id"
318
- label="Label"
319
- />
320
- )
321
-
322
- const kit = screen.getByTestId(testId)
323
- const textarea = kit.querySelector("textarea")
324
- const label = kit.querySelector("label")
325
-
326
- expect(kit).toHaveAttribute("id", "wrapper-id")
327
- expect(textarea).toHaveAttribute("id", "wrapper-id-input")
328
- expect(label).toHaveAttribute("for", "wrapper-id-input")
329
- })
330
-
331
- test("should apply inputOptions.data as data-* attributes", () => {
332
- render(
333
- <Textarea
334
- data={{ testid: testId }}
335
- inputOptions={{
336
- data: { controller: "textarea", action: "focus->handleFocus" }
337
- }}
338
- />
339
- )
340
-
341
- const kit = screen.getByTestId(testId)
342
- const textarea = kit.querySelector("textarea")
343
-
344
- expect(textarea).toHaveAttribute("data-controller", "textarea")
345
- expect(textarea).toHaveAttribute("data-action", "focus->handleFocus")
346
- })
347
-
348
- test("should apply multiple inputOptions attributes to textarea", () => {
349
- render(
350
- <Textarea
351
- data={{ testid: testId }}
352
- inputOptions={{
353
- id: "textarea-id",
354
- className: "custom-class",
355
- data: { controller: "textarea" }
356
- }}
357
- />
358
- )
359
-
360
- const kit = screen.getByTestId(testId)
361
- const textarea = kit.querySelector("textarea")
362
-
363
- expect(textarea).toHaveAttribute("id", "textarea-id")
364
- expect(textarea).toHaveAttribute("class", "custom-class")
365
- expect(textarea).toHaveAttribute("data-controller", "textarea")
366
- })
367
-
368
- test("should merge aria-describedby from error and inputOptions", () => {
369
- render(
370
- <Textarea
371
- data={{ testid: testId }}
372
- error="This is an error"
373
- inputOptions={{
374
- id: "describedby-textarea",
375
- "aria-describedby": "custom-help-text"
376
- }}
377
- />
378
- )
379
-
380
- const kit = screen.getByTestId(testId)
381
- const textarea = kit.querySelector("textarea")
382
-
383
- // Should contain both the error ID and custom ID
384
- expect(textarea).toHaveAttribute("aria-describedby", expect.stringContaining("-error"))
385
- expect(textarea).toHaveAttribute(
386
- "aria-describedby",
387
- expect.stringContaining("custom-help-text")
388
- )
389
- })
390
-
391
- test("should allow inputOptions aria-invalid to override error state", () => {
392
- render(
393
- <Textarea
394
- data={{ testid: testId }}
395
- error="This is an error"
396
- inputOptions={{
397
- "aria-invalid": false
398
- }}
399
- />
400
- )
401
-
402
- const kit = screen.getByTestId(testId)
403
- const textarea = kit.querySelector("textarea")
404
-
405
- expect(textarea).toHaveAttribute("aria-invalid", "false")
406
- })
407
-
408
- test("should default aria-invalid to error state when not provided in inputOptions", () => {
409
- render(<Textarea data={{ testid: testId }}
410
- error="This is an error"
411
- />)
412
-
413
- const kit = screen.getByTestId(testId)
414
- const textarea = kit.querySelector("textarea")
415
-
416
- expect(textarea).toHaveAttribute("aria-invalid", "true")
417
- })
418
- })
@@ -707,7 +707,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
707
707
  {requiredIndicator ? (
708
708
  <Caption
709
709
  className="pb_time_picker_kit_label"
710
- color="lighter"
711
710
  dark={dark}
712
711
  marginBottom="xs"
713
712
  size="md"
@@ -717,7 +716,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
717
716
  ) : (
718
717
  <Caption
719
718
  className="pb_time_picker_kit_label"
720
- color="lighter"
721
719
  dark={dark}
722
720
  marginBottom="xs"
723
721
  size="md"
@@ -768,7 +766,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
768
766
  <label htmlFor={`${uniqueId}-hour`}>
769
767
  <Caption
770
768
  className="time_input_label"
771
- color="lighter"
772
769
  dark={dark}
773
770
  size="sm"
774
771
  text="Hour"
@@ -816,7 +813,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
816
813
  <label htmlFor={`${uniqueId}-minute`}>
817
814
  <Caption
818
815
  className="time_input_label"
819
- color="lighter"
820
816
  dark={dark}
821
817
  size="sm"
822
818
  text="Minute"
@@ -863,7 +859,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
863
859
  <div className="meridiem">
864
860
  <Caption
865
861
  className="time_input_label"
866
- color="lighter"
867
862
  dark={dark}
868
863
  size="sm"
869
864
  text="Period"
@@ -910,7 +905,6 @@ const TimePicker = (props: TimePickerProps): JSX.Element => {
910
905
  )}
911
906
  {showTimezone && (
912
907
  <Caption
913
- color="lighter"
914
908
  dark={dark}
915
909
  lineHeight="tight"
916
910
  marginTop="sm"
@@ -71,14 +71,14 @@ describe('TimePicker', () => {
71
71
  render(<TimePicker data={{ testid: 'clickable-picker' }} />)
72
72
  const input = screen.getByPlaceholderText('Select Time')
73
73
  fireEvent.click(input)
74
- expect(screen.getByText('Hour', { selector: '.pb_caption_kit_sm_lighter' })).toBeInTheDocument()
74
+ expect(screen.getByText('Hour', { selector: '.pb_caption_kit_sm' })).toBeInTheDocument()
75
75
  })
76
76
 
77
77
  test('does not open dropdown on input click when disabled', () => {
78
78
  render(<TimePicker disabled />)
79
79
  const input = screen.getByPlaceholderText('Select Time')
80
80
  fireEvent.click(input)
81
- expect(screen.queryByText('Hour', { selector: '.pb_caption_kit_sm_lighter' })).not.toBeInTheDocument()
81
+ expect(screen.queryByText('Hour', { selector: '.pb_caption_kit_sm' })).not.toBeInTheDocument()
82
82
  })
83
83
 
84
84
  test('renders with required attribute', () => {
@@ -11,14 +11,11 @@ export default class PbTooltip extends PbEnhancedElement {
11
11
  }
12
12
 
13
13
  connect() {
14
- this.triggerHandlers = new Map()
15
-
16
14
  if (this.tooltipInteraction) {
17
- this.mouseMoveHandler = (e) => {
15
+ document.addEventListener('mousemove', (e) => {
18
16
  this.lastMouseX = e.clientX
19
17
  this.lastMouseY = e.clientY
20
- }
21
- document.addEventListener('mousemove', this.mouseMoveHandler)
18
+ })
22
19
  }
23
20
 
24
21
  this.triggerElements.forEach((trigger) => {
@@ -26,7 +23,7 @@ export default class PbTooltip extends PbEnhancedElement {
26
23
  const interactionEnabled = this.tooltipInteraction
27
24
 
28
25
  if (method === 'click') {
29
- const clickHandler = (e) => {
26
+ trigger.addEventListener('click', (e) => {
30
27
  if (this.useClickToOpen) {
31
28
  e.preventDefault()
32
29
  if (this.isTooltipVisible()) {
@@ -37,12 +34,10 @@ export default class PbTooltip extends PbEnhancedElement {
37
34
  } else {
38
35
  this.showTooltip(trigger)
39
36
  }
40
- }
41
- trigger.addEventListener('click', clickHandler)
42
- this.triggerHandlers.set(trigger, { click: clickHandler })
37
+ })
43
38
  } else {
44
39
  if (!this.useClickToOpen) {
45
- const mouseenterHandler = () => {
40
+ trigger.addEventListener('mouseenter', () => {
46
41
  clearSafeZoneListener(this)
47
42
  clearTimeout(this.mouseleaveTimeout)
48
43
  this.currentTrigger = trigger
@@ -53,9 +48,9 @@ export default class PbTooltip extends PbEnhancedElement {
53
48
  this.checkCloseTooltip(trigger)
54
49
  }
55
50
  }, delayOpen)
56
- }
51
+ })
57
52
 
58
- const mouseleaveHandler = () => {
53
+ trigger.addEventListener('mouseleave', () => {
59
54
  clearTimeout(this.mouseenterTimeout)
60
55
  if (this.delayClose) {
61
56
  const delayClose = parseInt(this.delayClose)
@@ -73,62 +68,22 @@ export default class PbTooltip extends PbEnhancedElement {
73
68
  this.hideTooltip()
74
69
  }
75
70
  }
76
- }
77
-
78
- trigger.addEventListener('mouseenter', mouseenterHandler)
79
- trigger.addEventListener('mouseleave', mouseleaveHandler)
80
- this.triggerHandlers.set(trigger, { mouseenter: mouseenterHandler, mouseleave: mouseleaveHandler })
71
+ })
81
72
 
82
73
  if (interactionEnabled) {
83
- if (!this.tooltipMouseenterHandler) {
84
- this.tooltipMouseenterHandler = () => {
85
- clearSafeZoneListener(this)
86
- }
87
- this.tooltipMouseleaveHandler = () => {
88
- this.attachSafeZoneListener()
89
- }
90
- this.tooltip.addEventListener('mouseenter', this.tooltipMouseenterHandler)
91
- this.tooltip.addEventListener('mouseleave', this.tooltipMouseleaveHandler)
92
- }
74
+ this.tooltip.addEventListener('mouseenter', () => {
75
+ clearSafeZoneListener(this)
76
+ })
77
+
78
+ this.tooltip.addEventListener('mouseleave', () => {
79
+ this.attachSafeZoneListener()
80
+ })
93
81
  }
94
82
  }
95
83
  }
96
84
  })
97
85
  }
98
86
 
99
- disconnect() {
100
- // Clean up timers
101
- clearTimeout(this.mouseenterTimeout)
102
- clearTimeout(this.mouseleaveTimeout)
103
- clearTimeout(this.autoHideTimeout)
104
- clearSafeZoneListener(this)
105
-
106
- // Clean up autoUpdate
107
- if (this.cleanup) {
108
- this.cleanup()
109
- this.cleanup = null
110
- }
111
-
112
- // Clean up document mousemove listener
113
- if (this.mouseMoveHandler) {
114
- document.removeEventListener('mousemove', this.mouseMoveHandler)
115
- }
116
-
117
- // Clean up trigger element listeners
118
- this.triggerHandlers.forEach((handlers, trigger) => {
119
- Object.entries(handlers).forEach(([event, handler]) => {
120
- trigger.removeEventListener(event, handler)
121
- })
122
- })
123
- this.triggerHandlers.clear()
124
-
125
- // Clean up tooltip listeners
126
- if (this.tooltipMouseenterHandler) {
127
- this.tooltip.removeEventListener('mouseenter', this.tooltipMouseenterHandler)
128
- this.tooltip.removeEventListener('mouseleave', this.tooltipMouseleaveHandler)
129
- }
130
- }
131
-
132
87
  isTooltipVisible() {
133
88
  return this.tooltip && this.tooltip.classList.contains('show')
134
89
  }
@@ -20,7 +20,7 @@ test('typeahead classname + label renders as expected', () => {
20
20
  )
21
21
 
22
22
  const kit = screen.getByTestId('typeahead-test')
23
- const label = kit.querySelector(".pb_caption_kit_md_lighter.pb_text_input_kit_label")
23
+ const label = kit.querySelector(".pb_caption_kit_md.pb_text_input_kit_label")
24
24
  expect(kit).toHaveClass("pb_typeahead_kit")
25
25
  expect(label).toHaveTextContent("Colors")
26
26
  })
@@ -1 +1 @@
1
- import{jsx}from"react/jsx-runtime";import{useMemo}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,e as buildCss,g as globalProps}from"./globalProps-CK2YuA9O.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-DspaUdlc.js";import highchartsMore from"highcharts/highcharts-more";import solidGauge from"highcharts/modules/solid-gauge";const barGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"column"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],credits:{enabled:false},legend:{enabled:false,itemStyle:{color:colors.text_lt_light,fill:colors.text_lt_light,fontSize:typography.text_smaller}},xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbBarGraph=props=>{const{aria:aria={},data:data={},id:id,htmlOptions:htmlOptions={},options:options,className:className}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_bar_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbBarGraph />",options);return{}}return Highcharts.merge({},barGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbCircleChartTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},chart:{type:"pie"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{pie:{dataLabels:{enabled:false,connectorShape:"straight",connectorWidth:3,format:"<div>{point.name}</div>",style:{fontFamily:typography.font_family_base,fontSize:typography.text_smaller,color:colors.text_lt_light,fontWeight:typography.regular,textOutline:"2px $white"}},innerSize:"50%",borderColor:"",borderWidth:null,colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7]}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},credits:{enabled:false}};const PbCircleChart=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_circle_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbCircleChart />",options);return{}}return Highcharts.merge({},pbCircleChartTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbGaugeGraphTheme={title:{text:"",style:{fontFamily:typography.font_family_base,fontSize:typography.text_larger}},chart:{type:"solidgauge",events:{render(){this.container;const arc=this.container.querySelector("path.gauge-pane");if(arc)arc.setAttribute("stroke-linejoin","round")}}},pane:{size:"90%",startAngle:-100,endAngle:100,background:[{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane",borderColor:colors.border_light,borderRadius:"50%"}]},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{borderColor:colors.data_1,borderWidth:20,color:colors.data_1,radius:90,innerRadius:"90%",y:-26,dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:'<span class="fix">{y:,f}</span>',style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}},credits:{enabled:false}};const PbGaugeChart=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,ref:ref,options:options={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_gauge_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbGaugeGraphTheme,options)}),[options]);highchartsMore(Highcharts);solidGauge(Highcharts);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,ref:ref,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbLineGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"line"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{line:{dataLabels:{enabled:false}}},credits:{enabled:false},legend:{enabled:false,itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,tickPixelInterval:50,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbLineGraph=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_line_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbLineGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};export{PbBarGraph as P,PbCircleChart as a,PbGaugeChart as b,PbLineGraph as c};
1
+ import{jsx}from"react/jsx-runtime";import{useMemo}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,e as buildCss,g as globalProps}from"./globalProps-DyTB8IdV.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-9wz3x5jl.js";import highchartsMore from"highcharts/highcharts-more";import solidGauge from"highcharts/modules/solid-gauge";const barGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"column"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],credits:{enabled:false},legend:{enabled:false,itemStyle:{color:colors.text_lt_light,fill:colors.text_lt_light,fontSize:typography.text_smaller}},xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbBarGraph=props=>{const{aria:aria={},data:data={},id:id,htmlOptions:htmlOptions={},options:options,className:className}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_bar_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbBarGraph />",options);return{}}return Highcharts.merge({},barGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbCircleChartTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},chart:{type:"pie"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{pie:{dataLabels:{enabled:false,connectorShape:"straight",connectorWidth:3,format:"<div>{point.name}</div>",style:{fontFamily:typography.font_family_base,fontSize:typography.text_smaller,color:colors.text_lt_light,fontWeight:typography.regular,textOutline:"2px $white"}},innerSize:"50%",borderColor:"",borderWidth:null,colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7]}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},credits:{enabled:false}};const PbCircleChart=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_circle_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbCircleChart />",options);return{}}return Highcharts.merge({},pbCircleChartTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbGaugeGraphTheme={title:{text:"",style:{fontFamily:typography.font_family_base,fontSize:typography.text_larger}},chart:{type:"solidgauge",events:{render(){this.container;const arc=this.container.querySelector("path.gauge-pane");if(arc)arc.setAttribute("stroke-linejoin","round")}}},pane:{size:"90%",startAngle:-100,endAngle:100,background:[{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane",borderColor:colors.border_light,borderRadius:"50%"}]},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{borderColor:colors.data_1,borderWidth:20,color:colors.data_1,radius:90,innerRadius:"90%",y:-26,dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:'<span class="fix">{y:,f}</span>',style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}},credits:{enabled:false}};const PbGaugeChart=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,ref:ref,options:options={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_gauge_chart"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbGaugeGraphTheme,options)}),[options]);highchartsMore(Highcharts);solidGauge(Highcharts);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,ref:ref,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};const pbLineGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"line"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{line:{dataLabels:{enabled:false}}},credits:{enabled:false},legend:{enabled:false,itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,tickPixelInterval:50,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const PbLineGraph=props=>{const{aria:aria={},className:className,data:data={},id:id,htmlOptions:htmlOptions={},options:options}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pb_line_graph"),globalProps(props),className);const mergedOptions=useMemo((()=>{if(!options||typeof options!=="object"){console.error("❌ Invalid options passed to <PbLineGraph />",options);return{}}return Highcharts.merge({},pbLineGraphTheme,options)}),[options]);return jsx("div",{children:jsx(HighchartsReact,{containerProps:{className:classnames(classes),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:mergedOptions})})};export{PbBarGraph as P,PbCircleChart as a,PbGaugeChart as b,PbLineGraph as c};