playbook_ui 16.1.0.pre.alpha.play2712navkitadddisabledstatecollapsible13821 → 16.1.0.pre.alpha.play2724typeaheadindicator13970

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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
  3. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +17 -0
  4. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +10 -1
  5. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +2 -0
  6. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.html.erb +6 -0
  7. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.jsx +17 -0
  8. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.md +3 -0
  9. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -0
  10. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  11. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +8 -6
  12. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -0
  13. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +37 -2
  14. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_rails.md +3 -0
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_react.md +3 -0
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.html.erb +52 -0
  17. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.jsx +72 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.md +5 -0
  19. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height.jsx +33 -0
  20. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.html.erb +20 -0
  21. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.md +8 -0
  22. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_react.md +8 -0
  23. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.html.erb +9 -0
  24. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.jsx +33 -0
  25. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.md +3 -0
  26. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -0
  27. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +4 -1
  28. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
  29. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -0
  30. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +94 -0
  31. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +5 -1
  32. data/app/pb_kits/playbook/pb_dropdown/index.js +59 -4
  33. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +3 -0
  34. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -1
  35. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +1 -1
  36. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +2 -2
  37. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +16 -9
  38. data/app/pb_kits/playbook/pb_filter/filter.rb +2 -2
  39. data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +5 -2
  40. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +5 -5
  41. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +4 -4
  42. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +4 -0
  43. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -5
  44. data/app/pb_kits/playbook/pb_nav/_nav.scss +1 -27
  45. data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -2
  46. data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
  47. data/app/pb_kits/playbook/pb_nav/item.rb +2 -7
  48. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +20 -5
  49. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx +1 -0
  50. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.html.erb +7 -0
  51. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.jsx +24 -0
  52. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.md +3 -0
  53. data/app/pb_kits/playbook/pb_passphrase/docs/example.yml +2 -0
  54. data/app/pb_kits/playbook/pb_passphrase/docs/index.js +1 -0
  55. data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +2 -0
  56. data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +30 -1
  57. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -0
  58. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.html.erb +5 -0
  59. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.jsx +14 -0
  60. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.md +3 -0
  61. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
  62. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  63. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  64. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +34 -3
  65. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +4 -3
  66. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -1
  67. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +10 -10
  68. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +24 -1
  69. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +412 -324
  70. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +2 -0
  71. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +4 -1
  72. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.html.erb +16 -0
  73. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.jsx +23 -0
  74. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.md +3 -0
  75. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +1 -1
  76. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +1 -1
  77. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  78. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +22 -21
  79. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
  80. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +7 -1
  81. data/dist/chunks/{_pb_line_graph-BgKF_zz1.js → _pb_line_graph-CFpRBk64.js} +1 -1
  82. data/dist/chunks/_typeahead-D2EbYcmG.js +1 -0
  83. data/dist/chunks/{globalProps-BhVYCqRf.js → globalProps-CXOg_9fx.js} +1 -1
  84. data/dist/chunks/lib-DTxpoePf.js +29 -0
  85. data/dist/chunks/vendor.js +2 -2
  86. data/dist/playbook-rails-react-bindings.js +1 -1
  87. data/dist/playbook-rails.js +1 -1
  88. data/dist/playbook.css +1 -1
  89. data/lib/playbook/align_content.rb +13 -3
  90. data/lib/playbook/align_items.rb +13 -3
  91. data/lib/playbook/align_self.rb +13 -3
  92. data/lib/playbook/display.rb +5 -0
  93. data/lib/playbook/flex.rb +13 -3
  94. data/lib/playbook/flex_direction.rb +13 -3
  95. data/lib/playbook/flex_grow.rb +13 -3
  96. data/lib/playbook/flex_shrink.rb +13 -3
  97. data/lib/playbook/flex_wrap.rb +13 -3
  98. data/lib/playbook/forms/builder/form_field_builder.rb +1 -1
  99. data/lib/playbook/forms/builder/phone_number_field.rb +9 -0
  100. data/lib/playbook/forms/builder/typeahead_field.rb +15 -1
  101. data/lib/playbook/forms/builder.rb +2 -2
  102. data/lib/playbook/justify_content.rb +13 -3
  103. data/lib/playbook/justify_self.rb +13 -3
  104. data/lib/playbook/order.rb +13 -3
  105. data/lib/playbook/spacing.rb +39 -9
  106. data/lib/playbook/text_align.rb +13 -3
  107. data/lib/playbook/truncate.rb +1 -1
  108. data/lib/playbook/version.rb +1 -1
  109. data/lib/playbook/vertical_align.rb +13 -3
  110. data/lib/playbook/z_index.rb +5 -0
  111. metadata +30 -9
  112. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.html.erb +0 -24
  113. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.jsx +0 -89
  114. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_rows.jsx +0 -67
  115. data/dist/chunks/_typeahead-BvrkfO0L.js +0 -1
  116. data/dist/chunks/lib-DD34ZrWL.js +0 -29
@@ -9,6 +9,7 @@ type Props = {
9
9
  dark?: boolean,
10
10
  label: string,
11
11
  error?: string,
12
+ requiredIndicator?: boolean,
12
13
  },
13
14
  }
14
15
 
@@ -19,6 +20,7 @@ const TypeaheadControl = (props: Props) => (
19
20
  error={props.selectProps.error}
20
21
  label={props.selectProps.label}
21
22
  marginBottom="none"
23
+ requiredIndicator={props.selectProps.requiredIndicator}
22
24
  >
23
25
  <Flex>
24
26
  <components.Control
@@ -18,9 +18,12 @@ type Props = {
18
18
 
19
19
  const MultiValue = (props: Props) => {
20
20
  const { removeProps, isFocused } = props
21
- const { imageUrl, label } = props.data
21
+ const { imageUrl } = props.data
22
22
  const { dark, multiKit, pillColor, truncate, wrapped, inputDisplay } = props.selectProps
23
23
 
24
+ // Extract label - use data.label or data.name if available, otherwise use empty string
25
+ const label = props.data.label || props.data.name || ''
26
+
24
27
  // If inputDisplay is "none", don't render the pill/badge, just return null (the count handled in ValueContainer file)
25
28
  if (inputDisplay === 'none') {
26
29
  return null
@@ -0,0 +1,16 @@
1
+ <%
2
+ options = [
3
+ { label: 'Orange', value: '#FFA500' },
4
+ { label: 'Red', value: '#FF0000' },
5
+ { label: 'Green', value: '#00FF00' },
6
+ { label: 'Blue', value: '#0000FF' },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("typeahead", props: {
11
+ id: "typeahead-required-indicator",
12
+ is_multi: false,
13
+ label: "Colors",
14
+ options: options,
15
+ required_indicator: true,
16
+ }) %>
@@ -0,0 +1,23 @@
1
+ import React from "react"
2
+ import Typeahead from "../../pb_typeahead/_typeahead"
3
+
4
+ const options = [
5
+ {label: "Orange", value: "#FFA500"},
6
+ {label: "Red", value: "#FF0000"},
7
+ {label: "Green", value: "#00FF00"},
8
+ {label: "Blue", value: "#0000FF"},
9
+ ]
10
+
11
+ const TypeaheadRequiredIndicator = (props) => {
12
+ return (
13
+ <Typeahead
14
+ id="typeahead_required_indicator"
15
+ label="Colors"
16
+ options={options}
17
+ requiredIndicator
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ export default TypeaheadRequiredIndicator
@@ -0,0 +1,3 @@
1
+ The `requiredIndicator`/`required_indicator` prop displays a red asterisk (*) next to the label, visually indicating that the field is required. This is purely visual and does not enforce validation.
2
+
3
+ You can use `requiredIndicator`/`required_indicator` with any validation approach: HTML5 validation via the `required` prop, client-side validation, or backend validation. For this reason, it works independently and doesn't need to be paired with the `required` prop.
@@ -15,5 +15,5 @@
15
15
  options: names,
16
16
  label: "Truncation Within Typeahead",
17
17
  pills: true,
18
- truncate: 1,
18
+ truncate: "1",
19
19
  }) %>
@@ -17,7 +17,7 @@ const TypeaheadTruncatedText = (props) => {
17
17
  isMulti
18
18
  label="Truncation Within Typeahead"
19
19
  options={names}
20
- truncate={1}
20
+ truncate={"1"}
21
21
  {...props}
22
22
  />
23
23
  </>
@@ -19,6 +19,7 @@ examples:
19
19
  - typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
20
20
  - typeahead_disabled: Disabled
21
21
  - typeahead_preserve_input: Preserve Search Input
22
+ - typeahead_required_indicator: Required Indicator
22
23
 
23
24
  react:
24
25
  - typeahead_default: Default
@@ -42,3 +43,4 @@ examples:
42
43
  - typeahead_truncated_text: Truncated Text
43
44
  - typeahead_disabled: Disabled
44
45
  - typeahead_preserve_input: Preserve Search Input
46
+ - typeahead_required_indicator: Required Indicator
@@ -1,21 +1,22 @@
1
- export { default as TypeaheadDefault } from './_typeahead_default.jsx'
2
- export { default as TypeaheadWithHighlight } from './_typeahead_with_highlight.jsx'
3
- export { default as TypeaheadWithPills } from './_typeahead_with_pills.jsx'
4
- export { default as TypeaheadWithPillsAsync } from './_typeahead_with_pills_async.jsx'
5
- export { default as TypeaheadWithPillsAsyncUsers } from './_typeahead_with_pills_async_users.jsx'
6
- export { default as TypeaheadWithPillsAsyncCustomOptions } from './_typeahead_with_pills_async_custom_options.jsx'
7
- export { default as TypeaheadInline } from './_typeahead_inline.jsx'
8
- export { default as TypeaheadMultiKit } from './_typeahead_multi_kit.jsx'
9
- export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
10
- export { default as TypeaheadAsyncCreateable } from './_typeahead_async_createable.jsx'
11
- export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
12
- export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
13
- export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
14
- export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
15
- export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.jsx'
16
- export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
17
- export { default as TypeaheadDisabled } from './_typeahead_disabled.jsx'
18
- export { default as TypeaheadPreserveInput } from './_typeahead_preserve_input.jsx'
19
- export { default as TypeaheadDefaultValue } from './_typeahead_default_value.jsx'
20
- export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
21
- export { default as TypeaheadInputDisplay } from './_typeahead_input_display.jsx'
1
+ export {default as TypeaheadDefault} from "./_typeahead_default.jsx"
2
+ export {default as TypeaheadWithHighlight} from "./_typeahead_with_highlight.jsx"
3
+ export {default as TypeaheadWithPills} from "./_typeahead_with_pills.jsx"
4
+ export {default as TypeaheadWithPillsAsync} from "./_typeahead_with_pills_async.jsx"
5
+ export {default as TypeaheadWithPillsAsyncUsers} from "./_typeahead_with_pills_async_users.jsx"
6
+ export {default as TypeaheadWithPillsAsyncCustomOptions} from "./_typeahead_with_pills_async_custom_options.jsx"
7
+ export {default as TypeaheadInline} from "./_typeahead_inline.jsx"
8
+ export {default as TypeaheadMultiKit} from "./_typeahead_multi_kit.jsx"
9
+ export {default as TypeaheadCreateable} from "./_typeahead_createable.jsx"
10
+ export {default as TypeaheadAsyncCreateable} from "./_typeahead_async_createable.jsx"
11
+ export {default as TypeaheadErrorState} from "./_typeahead_error_state.jsx"
12
+ export {default as TypeaheadCustomMenuList} from "./_typeahead_custom_menu_list.jsx"
13
+ export {default as TypeaheadMarginBottom} from "./_typeahead_margin_bottom.jsx"
14
+ export {default as TypeaheadWithPillsColor} from "./_typeahead_with_pills_color.jsx"
15
+ export {default as TypeaheadTruncatedText} from "./_typeahead_truncated_text.jsx"
16
+ export {default as TypeaheadReactHook} from "./_typeahead_react_hook.jsx"
17
+ export {default as TypeaheadDisabled} from "./_typeahead_disabled.jsx"
18
+ export {default as TypeaheadPreserveInput} from "./_typeahead_preserve_input.jsx"
19
+ export {default as TypeaheadDefaultValue} from "./_typeahead_default_value.jsx"
20
+ export {default as TypeaheadCustomOptions} from "./_typeahead_custom_options.jsx"
21
+ export {default as TypeaheadInputDisplay} from "./_typeahead_input_display.jsx"
22
+ export {default as TypeaheadRequiredIndicator} from "./_typeahead_required_indicator.jsx"
@@ -1,8 +1,8 @@
1
1
  <% if object.is_react? %>
2
2
  <%= react_component('Typeahead', object.typeahead_react_options) %>
3
3
  <% else %>
4
- <%= pb_content_tag(:div,
5
- class: object.classname + object.inline_class) do %>
4
+ <%= pb_content_tag(:div, class: object.classname + object.inline_class) do %>
5
+
6
6
  <div class="pb_typeahead_wrapper">
7
7
  <div class="pb_typeahead_loading_indicator" data-pb-typeahead-kit-loading-indicator>
8
8
  <%= pb_rails("icon", props: {
@@ -21,6 +21,7 @@
21
21
  required: object.required,
22
22
  validation: object.validation,
23
23
  label: object.label,
24
+ required_indicator: object.required_indicator,
24
25
  id: object.input_options[:id],
25
26
  dark: object.dark,
26
27
  }) %>
@@ -60,7 +60,8 @@ module Playbook
60
60
  default: false
61
61
  prop :preserve_search_input, type: Playbook::Props::Boolean,
62
62
  default: false
63
-
63
+ prop :required_indicator, type: Playbook::Props::Boolean,
64
+ default: false
64
65
  def classname
65
66
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
66
67
  generate_classname("pb_typeahead_kit") + default_margin_bottom
@@ -107,6 +108,7 @@ module Playbook
107
108
  truncate: truncate,
108
109
  wrapped: wrapped,
109
110
  required: required,
111
+ requiredIndicator: required_indicator,
110
112
  validation: validation,
111
113
  searchContextSelector: search_context_selector,
112
114
  optionsByContext: options_by_context,
@@ -123,6 +125,10 @@ module Playbook
123
125
  end
124
126
  base_options
125
127
  end
128
+
129
+ def truncate_props
130
+ nil unless is_react?
131
+ end
126
132
  end
127
133
  end
128
134
  end
@@ -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-BhVYCqRf.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-DD34ZrWL.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-CXOg_9fx.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-DTxpoePf.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};