playbook_ui 16.5.0.pre.alpha.AVNGR110715795 → 16.5.0.pre.alpha.PLAY2893datepickerlabelclicktoggle15576

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -33
  4. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +0 -1
  5. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -30
  6. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
  7. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -1
  8. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -51
  9. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +5 -5
  10. data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
  11. data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -3
  12. data/app/pb_kits/playbook/pb_kit/dateTime.ts +22 -4
  13. data/app/pb_kits/playbook/pb_select/select.rb +0 -7
  14. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -4
  15. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
  16. data/app/pb_kits/playbook/pb_typeahead/kit.schema.json +2 -4
  17. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -4
  18. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +58 -0
  19. data/dist/chunks/{_pb_line_graph-D7f-RfJJ.js → _pb_line_graph-EzcacMw_.js} +1 -1
  20. data/dist/chunks/{_typeahead-DO5eU-VL.js → _typeahead-B_Avup-T.js} +1 -1
  21. data/dist/chunks/{globalProps-BwwZkfTI.js → globalProps-6Hsm3bJX.js} +1 -1
  22. data/dist/chunks/{lib-Ch18RlJa.js → lib-o4u12zAw.js} +1 -1
  23. data/dist/chunks/vendor.js +1 -1
  24. data/dist/playbook-rails-react-bindings.js +1 -1
  25. data/dist/playbook-rails.js +1 -1
  26. data/lib/playbook/forms/builder/collection_select_field.rb +0 -1
  27. data/lib/playbook/forms/builder/date_picker_field.rb +0 -1
  28. data/lib/playbook/forms/builder/select_field.rb +0 -1
  29. data/lib/playbook/forms/builder/time_zone_select_field.rb +0 -1
  30. data/lib/playbook/pb_forms_helper.rb +2 -17
  31. data/lib/playbook/version.rb +1 -1
  32. metadata +7 -12
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.jsx +0 -62
  34. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.md +0 -1
  35. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.html.erb +0 -90
  36. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.md +0 -13
  37. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.html.erb +0 -29
  38. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 020a93f89c099ec899d7d2fff17521fa6bf88974f7db82daf7856f3279037ca4
4
- data.tar.gz: 5358edd4c8d27cd5bef021ec3ab2b58e6267e62ed8108c63a040c125e2318901
3
+ metadata.gz: d77932d5ca1ce89caa56b927c3872fab1b7c023388a07072aabdb384268514b6
4
+ data.tar.gz: 72e5ce55c6161081686b6eb4e4fde9569aa4c01d171de959ecaefd292378652f
5
5
  SHA512:
6
- metadata.gz: 2d2df0c132670c39ed3fbadbdb094d9025898feb06ec70e6bfe52543cf4af9cb2252d6c1b08e8f644b0a2c601a4e16d72ed76b2d65959a1fba1e116738ef0d18
7
- data.tar.gz: 0c618f6b2afbe7fbb521d8413fa171925791690ecaf5121f1566c953ca075710f3e3e03a3e7ed122a8ac29b48db11fe2c281fb9d2036d1bd3e91f7b74e745836
6
+ metadata.gz: f168b973e873f2ea3961d24cf24fba9a40d4a5de4391ee7fa9251b13de97e8b7c480d0fe276dcbd0192ae7eaae9efea4f1d490fb3d4364e5777f7c6a42046a25
7
+ data.tar.gz: c990aad5891f894aae33d998c597238819426f531e241742f07d6ecc62b356ffef0a6bc1dfb4e9f73d24f0b4aa4c2830e8b67c18aac69c706b2a59323158ec53
@@ -7,7 +7,7 @@
7
7
  <% header_row.each_with_index do |cell, cell_index| %>
8
8
  <% header_component = object.header_component_info(cell, cell_index, row_index) %>
9
9
  <%= pb_rails(header_component[:name], props: header_component[:props]) do %>
10
- <%= pb_rails("flex", props: { align: "center", justify: object.header_flex_justify(cell, cell_index, row_index), text_align: object.header_flex_text_align(cell) }) do %>
10
+ <%= pb_rails("flex", props: { align: "center", justify: cell_index.zero? ? "start" : row_index === header_rows.size - 1 ? "end" : "center", text_align: (cell[:header_alignment] || "end") }) do %>
11
11
  <% if cell_index.zero? && row_index === header_rows.size - 1 %>
12
12
  <% if object.selectable_rows && object.enable_toggle_expansion != "none" %>
13
13
  <%= pb_rails("flex/flex_item", props: { padding_right: "xs" }) do %>
@@ -192,19 +192,6 @@ module Playbook
192
192
  { name: component_name, props: component_props }
193
193
  end
194
194
 
195
- # Flex justify for header cells: column_styling header_alignment when present (otherwisedefault by column/row index)
196
- def header_flex_justify(cell, cell_index, row_index)
197
- ha = cell[:header_alignment]
198
- return header_alignment_to_justify(ha) if ha.present?
199
-
200
- default_header_flex_justify(cell_index, row_index)
201
- end
202
-
203
- # Flex text_align from column_styling header_alignment (default is end)
204
- def header_flex_text_align(cell)
205
- (cell[:header_alignment].presence || "end").to_s
206
- end
207
-
208
195
  private
209
196
 
210
197
  # Find the original column definition for a cell
@@ -364,26 +351,6 @@ module Playbook
364
351
  row[:children] || row["children"]
365
352
  end
366
353
  end
367
-
368
- # 2 header alignment helper methods
369
- def header_alignment_to_justify(header_alignment)
370
- case header_alignment.to_s
371
- when "left" then "start"
372
- when "center" then "center"
373
- when "right" then "end"
374
- else "end"
375
- end
376
- end
377
-
378
- def default_header_flex_justify(cell_index, row_index)
379
- if cell_index.zero?
380
- "start"
381
- elsif row_index == header_rows.size - 1
382
- "end"
383
- else
384
- "center"
385
- end
386
- end
387
354
  end
388
355
  end
389
356
  end
@@ -31,7 +31,6 @@
31
31
  name: object.name,
32
32
  placeholder: object.placeholder,
33
33
  required: object.required,
34
- validation: object.validation_message.present? ? { message: object.validation_message } : {},
35
34
  }) %>
36
35
  <% end %>
37
36
  <% if object.selection_type == "quickpick" %>
@@ -310,34 +310,4 @@ describe('DatePicker Kit', () => {
310
310
  expect(label).toBeInTheDocument()
311
311
  expect(kit).not.toHaveTextContent("*")
312
312
  })
313
-
314
- test('Last month quickpick includes the correct last day of previous month', async () => {
315
- const testId = 'datepicker-last-month'
316
- render(
317
- <DatePicker
318
- allowInput
319
- data={{ testid: testId }}
320
- mode="range"
321
- pickerId="date-picker-last-month"
322
- placeholder="mm/dd/yyyy to mm/dd/yyyy"
323
- selectionType="quickpick"
324
- />
325
- )
326
-
327
- const kit = screen.getByTestId(testId)
328
- const input = within(kit).getByPlaceholderText('mm/dd/yyyy to mm/dd/yyyy')
329
-
330
- fireEvent(input, new MouseEvent('click', { bubbles: true, cancelable: true }))
331
-
332
- const lastMonth = within(kit).getByText('Last month')
333
- fireEvent(lastMonth, new MouseEvent('click', { bubbles: true, cancelable: true }))
334
-
335
- await waitFor(() => {
336
- expect(input).toHaveValue(
337
- DateTime.getPreviousMonthStartDate(new Date()).formatDate() +
338
- " to " +
339
- DateTime.getPreviousMonthEndDate(new Date()).formatDate()
340
- )
341
- })
342
- })
343
313
  })
@@ -66,4 +66,3 @@ examples:
66
66
  - date_picker_positions: Custom Positions
67
67
  - date_picker_positions_element: Custom Position (based on element)
68
68
  - date_picker_required_indicator: Required Indicator
69
- - date_picker_dialog_submission: Dialog Form Submission
@@ -29,4 +29,3 @@ export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_
29
29
  export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
30
30
  export { default as DatePickerAndDropdownRange } from './_date_picker_and_dropdown_range.jsx'
31
31
  export { default as DatePickerRequiredIndicator } from "./_date_picker_required_indicator.jsx";
32
- export { default as DatePickerDialogSubmission } from "./_date_picker_dialog_submission.jsx";
@@ -1,8 +1,7 @@
1
1
  import React, { useState } from "react"
2
- import { render, screen, fireEvent, waitFor } from "../utilities/test-utils"
2
+ import { render, screen, fireEvent } from "../utilities/test-utils"
3
3
 
4
4
  import { Dropdown, Icon, IconCircle } from 'playbook-ui'
5
- import DateTime from "../pb_kit/dateTime.ts"
6
5
 
7
6
 
8
7
  const testId = 'dropdown'
@@ -779,52 +778,3 @@ test("requiredIndicator prop renders asterisk when true", () => {
779
778
  expect(label).toBeInTheDocument();
780
779
  expect(kit).toHaveTextContent("*");
781
780
  });
782
-
783
- describe("quickpick Last Month range when current month is shorter than the previous month", () => {
784
- const quickpickTestId = "dropdown-quickpick-last-month-march"
785
-
786
- const formatDate = (date) => {
787
- const month = (date.getMonth() + 1).toString().padStart(2, "0")
788
- const day = date.getDate().toString().padStart(2, "0")
789
- const year = date.getFullYear()
790
- return `${month}/${day}/${year}`
791
- }
792
-
793
- beforeEach(() => {
794
- jest.setSystemTime(new Date(2026, 3, 15, 12, 0, 0))
795
- })
796
-
797
- afterEach(() => {
798
- jest.setSystemTime()
799
- })
800
-
801
- test("selecting Last Month matches DateTime previous-month range (full March when today is in April)", async () => {
802
- const onSelect = jest.fn()
803
- const now = new Date()
804
-
805
- render(
806
- <Dropdown
807
- data={{ testid: quickpickTestId }}
808
- onSelect={onSelect}
809
- variant="quickpick"
810
- />
811
- )
812
-
813
- const kit = screen.getByTestId(quickpickTestId)
814
- const lastMonthOption = Array.from(kit.querySelectorAll(".pb_dropdown_option_list")).find(
815
- (el) => el.textContent === "Last Month"
816
- )
817
-
818
- expect(lastMonthOption).toBeTruthy()
819
- fireEvent.click(lastMonthOption)
820
-
821
- await waitFor(() => {
822
- expect(onSelect).toHaveBeenCalled()
823
- })
824
-
825
- const [startDate, endDate] = onSelect.mock.calls[0][0].value
826
-
827
- expect(formatDate(startDate)).toBe(formatDate(DateTime.getPreviousMonthStartDate(now)))
828
- expect(formatDate(endDate)).toBe(formatDate(DateTime.getPreviousMonthEndDate(now)))
829
- })
830
- })
@@ -97,8 +97,8 @@
97
97
  }] %>
98
98
 
99
99
  <%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
100
- <%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true } %>
101
- <%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true } %>
100
+ <%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true, validation: { message: "Please select a user." } } %>
101
+ <%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true, validation: { message: "Please select a color." } } %>
102
102
  <%= form.typeahead :example_typeahead_validation_react_2, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead 2 (React Rendered)", placeholder: "Search for a user", required: true } %>
103
103
  <%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
104
104
  <%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field", hidden_inputs: true, required: true } %>
@@ -110,14 +110,14 @@
110
110
  <%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
111
111
  <%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
112
112
  <%= form.dropdown_field :example_dropdown_validation_multi, props: { label: true, options: example_dropdown_options, multi_select: true, required: true } %>
113
- <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
113
+ <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true, validation_message: "Please, select an option." } %>
114
114
  <%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
115
115
  <%= form.check_box :example_checkbox_validation, props: { text: "Example Checkbox Validation", label: true, required: true }, checked_value: "1", unchecked_value: "0" %>
116
- <%= form.date_picker :example_date_picker_2, props: { label: true, required: true, allow_input: true } %>
116
+ <%= form.date_picker :example_date_picker_2, props: { label: true, required: true, validation_message: "Please, select a date.", allow_input: true } %>
117
117
  <%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
118
118
  <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
119
119
  <%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form", tree_data: treeData, margin_bottom: "sm", required: true, label: "Example Multi Level Select field" } %>
120
- <%= form.time_picker :example_time_picker_validation, props: { label: true, required: true } %>
120
+ <%= form.time_picker :example_time_picker_validation, props: { label: true, required: true, validation_message: "Please select a time." } %>
121
121
 
122
122
  <%= form.actions do |action| %>
123
123
  <%= action.submit %>
@@ -3,6 +3,5 @@ examples:
3
3
  rails:
4
4
  - form_form_with: Default
5
5
  - form_form_with_validate: Default + Validation
6
- - form_form_with_validation_msg: Validation + Custom Validation Message
7
6
  - form_form_with_loading: Default + Loading
8
7
  - form_with_required_indicator: With Optional Required Indicator
@@ -121,6 +121,4 @@ class PbFormValidation extends PbEnhancedElement {
121
121
  }
122
122
  }
123
123
 
124
- window.PbFormValidation = PbFormValidation
125
-
126
- export default PbFormValidation
124
+ window.PbFormValidation = PbFormValidation
@@ -281,8 +281,17 @@ export const getPreviousMonthStartDate = (newDate: Date | string): Date => {
281
281
  }
282
282
 
283
283
  export const getPreviousMonthEndDate = (newDate: Date | string): Date => {
284
- const date = formatDate(newDate)
285
- return new Date(date.getFullYear(), date.getMonth(), 0, 23, 59, 59)
284
+ const lastDayOfMonth = getMonthEndDate(newDate)
285
+ const lastDayOfPreviousMonth = new Date(
286
+ lastDayOfMonth.getFullYear(),
287
+ lastDayOfMonth.getMonth() - 1,
288
+ lastDayOfMonth.getDate(),
289
+ lastDayOfMonth.getHours(),
290
+ lastDayOfMonth.getMinutes(),
291
+ lastDayOfMonth.getSeconds()
292
+ )
293
+
294
+ return lastDayOfPreviousMonth
286
295
  }
287
296
 
288
297
  // Quarters
@@ -316,8 +325,17 @@ export const getPreviousQuarterStartDate = (newDate: Date | string): Date => {
316
325
  }
317
326
 
318
327
  export const getPreviousQuarterEndDate = (newDate: Date | string): Date => {
319
- const startOfQuarter = getQuarterStartDate(newDate)
320
- return new Date(startOfQuarter.getFullYear(), startOfQuarter.getMonth(), 0, 23, 59, 59)
328
+ const endOfQuarter = getQuarterEndDate(newDate)
329
+ const lastDayOfPreviousQuarter = new Date(
330
+ endOfQuarter.getFullYear(),
331
+ endOfQuarter.getMonth() - 3,
332
+ endOfQuarter.getDate(),
333
+ endOfQuarter.getHours(),
334
+ endOfQuarter.getMinutes(),
335
+ endOfQuarter.getSeconds()
336
+ )
337
+
338
+ return lastDayOfPreviousQuarter
321
339
  }
322
340
 
323
341
  // Years
@@ -43,16 +43,9 @@ module Playbook
43
43
  multiple: multiple,
44
44
  onchange: onchange,
45
45
  include_blank: include_blank,
46
- data: validation_data,
47
46
  }.merge(attributes).merge(input_options)
48
47
  end
49
48
 
50
- def validation_data
51
- fields = input_options[:data] || {}
52
- fields[:message] = validation_message unless validation_message.blank?
53
- fields
54
- end
55
-
56
49
  # Same resolved id as the native +<select>+ (+all_attributes[:id]+) for label +for+.
57
50
  def select_input_id
58
51
  all_attributes[:id].presence
@@ -516,18 +516,18 @@ const resolvedLoadOptions =
516
516
  }
517
517
 
518
518
  // Reset form submitted state when a selection is made (this is all for react rendered rails kit)
519
- if (action === "select-option" || action === "create-option") {
519
+ if (action === "select-option") {
520
520
  setFormSubmitted(false)
521
521
  // Mark that user has made a selection to disable default value focus behavior
522
522
  setHasUserSelected(true)
523
523
  }
524
524
 
525
- // If a value is selected/created and we're preserving input on blur, clear the input
526
- if ((action === "select-option" || action === "create-option") && preserveSearchInput) {
525
+ // If a value is selected and we're preserving input on blur, clear the input
526
+ if (action === "select-option" && preserveSearchInput) {
527
527
  setInputValue("")
528
528
  }
529
529
 
530
- if (action === "select-option" || action === "create-option") {
530
+ if (action === "select-option") {
531
531
  if (selectProps.onMultiValueClick && option)
532
532
  selectProps.onMultiValueClick(option)
533
533
  const multiValueClearEvent = new CustomEvent(
@@ -11,7 +11,6 @@ examples:
11
11
  - typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
12
12
  - typeahead_inline: Inline
13
13
  - typeahead_multi_kit: Multi Kit Options
14
- - typeahead_createable: Createable
15
14
  - typeahead_error_state: Error State
16
15
  - typeahead_margin_bottom: Margin Bottom
17
16
  - typeahead_with_pills_color: With Pills (Custom Color)
@@ -24,10 +24,8 @@
24
24
  "createable": {
25
25
  "type": "boolean",
26
26
  "platforms": [
27
- "react",
28
- "rails"
29
- ],
30
- "default": false
27
+ "react"
28
+ ]
31
29
  },
32
30
  "disabled": {
33
31
  "type": "boolean",
@@ -62,8 +62,6 @@ module Playbook
62
62
  default: false
63
63
  prop :required_indicator, type: Playbook::Props::Boolean,
64
64
  default: false
65
- prop :createable, type: Playbook::Props::Boolean,
66
- default: false
67
65
  def classname
68
66
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
69
67
  generate_classname("pb_typeahead_kit") + default_margin_bottom
@@ -85,7 +83,7 @@ module Playbook
85
83
  end
86
84
 
87
85
  def is_react?
88
- pills || !is_multi || wrapped || input_display == "none" || createable
86
+ pills || !is_multi || wrapped || input_display == "none"
89
87
  end
90
88
 
91
89
  def typeahead_react_options
@@ -117,7 +115,6 @@ module Playbook
117
115
  clearOnContextChange: clear_on_context_change,
118
116
  disabled: disabled,
119
117
  preserveSearchInput: preserve_search_input,
120
- createable: createable,
121
118
  }
122
119
 
123
120
  base_options[:getOptionLabel] = get_option_label if get_option_label.present?
@@ -0,0 +1,58 @@
1
+ export default [
2
+ "minHeight",
3
+ "maxHeight",
4
+ "height",
5
+ "left",
6
+ "bottom",
7
+ "right",
8
+ "top",
9
+ "hover",
10
+ "zIndex",
11
+ "verticalAlign",
12
+ "truncate",
13
+ "textAlign",
14
+ "shadow",
15
+ "position",
16
+ "paddingRight",
17
+ "paddingLeft",
18
+ "paddingTop",
19
+ "paddingBottom",
20
+ "paddingX",
21
+ "paddingY",
22
+ "padding",
23
+ "break",
24
+ "default",
25
+ "overflowX",
26
+ "overflowY",
27
+ "overflow",
28
+ "order",
29
+ "numberSpacing",
30
+ "rowGap",
31
+ "columnGap",
32
+ "gap",
33
+ "maxWidth",
34
+ "minWidth",
35
+ "width",
36
+ "marginRight",
37
+ "marginLeft",
38
+ "marginTop",
39
+ "marginBottom",
40
+ "marginX",
41
+ "marginY",
42
+ "margin",
43
+ "lineHeight",
44
+ "justifySelf",
45
+ "justifyContent",
46
+ "flexWrap",
47
+ "flexShrink",
48
+ "flexGrow",
49
+ "flexDirection",
50
+ "flex",
51
+ "display",
52
+ "dark",
53
+ "cursor",
54
+ "borderRadius",
55
+ "alignSelf",
56
+ "alignItems",
57
+ "alignContent"
58
+ ];
@@ -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-BwwZkfTI.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-Ch18RlJa.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-6Hsm3bJX.js";import Highcharts from"highcharts";import HighchartsReact from"highcharts-react-official";import{t as typography,c as colors}from"./lib-o4u12zAw.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};