@ktnpm_devops/react-component 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/dist/charts/CounterTimeseriesChart/CounterTimeseriesChart.d.ts +1 -1
- package/dist/charts/CounterTimeseriesChart/CounterTimeseriesChart.d.ts.map +1 -1
- package/dist/charts/CounterTimeseriesChart/CounterTimeseriesChart.types.d.ts +3 -0
- package/dist/charts/CounterTimeseriesChart/CounterTimeseriesChart.types.d.ts.map +1 -1
- package/dist/charts/CountersAnalysisCard/CountersAnalysisCard.d.ts +1 -1
- package/dist/charts/CountersAnalysisCard/CountersAnalysisCard.d.ts.map +1 -1
- package/dist/charts/CountersAnalysisCard/CountersAnalysisCard.types.d.ts +3 -0
- package/dist/charts/CountersAnalysisCard/CountersAnalysisCard.types.d.ts.map +1 -1
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.d.ts.map +1 -1
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.types.d.ts +8 -11
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.types.d.ts.map +1 -1
- package/dist/charts/GroupedBarChartCard/defaultLabels.d.ts +1 -1
- package/dist/charts/GroupedBarChartCard/defaultLabels.d.ts.map +1 -1
- package/dist/charts/StackedBarChartCard/StackedBarChartCard.d.ts +1 -1
- package/dist/charts/StackedBarChartCard/StackedBarChartCard.d.ts.map +1 -1
- package/dist/charts/StackedBarChartCard/StackedBarChartCard.types.d.ts +3 -0
- package/dist/charts/StackedBarChartCard/StackedBarChartCard.types.d.ts.map +1 -1
- package/dist/charts/TemporalTrendChartCard/TemporalTrendChartCard.d.ts +1 -1
- package/dist/charts/TemporalTrendChartCard/TemporalTrendChartCard.d.ts.map +1 -1
- package/dist/charts/TemporalTrendChartCard/TemporalTrendChartCard.types.d.ts +3 -0
- package/dist/charts/TemporalTrendChartCard/TemporalTrendChartCard.types.d.ts.map +1 -1
- package/dist/composites/CustomRangePicker/CustomRangePicker.d.ts +3 -12
- package/dist/composites/CustomRangePicker/CustomRangePicker.d.ts.map +1 -1
- package/dist/composites/CustomRangePicker/CustomRangePicker.types.d.ts +18 -0
- package/dist/composites/CustomRangePicker/CustomRangePicker.types.d.ts.map +1 -0
- package/dist/composites/CustomRangePicker/index.d.ts +1 -1
- package/dist/composites/CustomRangePicker/index.d.ts.map +1 -1
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.d.ts +1 -1
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.d.ts.map +1 -1
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts +8 -4
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts.map +1 -1
- package/dist/composites/MultiSelectDropdown/MultiSelectDropdown.d.ts +3 -32
- package/dist/composites/MultiSelectDropdown/MultiSelectDropdown.d.ts.map +1 -1
- package/dist/composites/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +36 -0
- package/dist/composites/MultiSelectDropdown/MultiSelectDropdown.types.d.ts.map +1 -0
- package/dist/composites/MultiSelectDropdown/index.d.ts +1 -1
- package/dist/composites/MultiSelectDropdown/index.d.ts.map +1 -1
- package/dist/composites/SingleSelectDropdown/SingleSelectDropdown.d.ts +3 -22
- package/dist/composites/SingleSelectDropdown/SingleSelectDropdown.d.ts.map +1 -1
- package/dist/composites/SingleSelectDropdown/SingleSelectDropdown.types.d.ts +26 -0
- package/dist/composites/SingleSelectDropdown/SingleSelectDropdown.types.d.ts.map +1 -0
- package/dist/composites/SingleSelectDropdown/index.d.ts +1 -1
- package/dist/composites/SingleSelectDropdown/index.d.ts.map +1 -1
- package/dist/data/LiveExplorerTable/LiveExplorerTable.d.ts +1 -1
- package/dist/data/LiveExplorerTable/LiveExplorerTable.d.ts.map +1 -1
- package/dist/data/LiveExplorerTable/LiveExplorerTable.types.d.ts +3 -0
- package/dist/data/LiveExplorerTable/LiveExplorerTable.types.d.ts.map +1 -1
- package/dist/index.cjs +41 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +2 -2
- package/dist/index10.js +2 -2
- package/dist/index100.cjs +11 -2
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +11 -2
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +19 -13
- package/dist/index101.cjs.map +1 -1
- package/dist/index101.js +19 -13
- package/dist/index101.js.map +1 -1
- package/dist/index102.cjs +12 -30
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +12 -30
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +64 -28
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +64 -28
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +10 -134
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +9 -133
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +16 -40
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +17 -41
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +17 -21
- package/dist/index107.cjs.map +1 -1
- package/dist/index107.js +16 -20
- package/dist/index107.js.map +1 -1
- package/dist/index108.cjs +2 -53
- package/dist/index108.cjs.map +1 -1
- package/dist/index108.js +3 -54
- package/dist/index108.js.map +1 -1
- package/dist/index109.cjs +25 -116
- package/dist/index109.cjs.map +1 -1
- package/dist/index109.js +24 -115
- package/dist/index109.js.map +1 -1
- package/dist/index11.cjs +2 -2
- package/dist/index11.js +2 -2
- package/dist/index110.cjs +73 -42
- package/dist/index110.cjs.map +1 -1
- package/dist/index110.js +72 -41
- package/dist/index110.js.map +1 -1
- package/dist/index111.cjs +30 -15
- package/dist/index111.cjs.map +1 -1
- package/dist/index111.js +30 -15
- package/dist/index111.js.map +1 -1
- package/dist/index112.cjs +2 -50
- package/dist/index112.cjs.map +1 -1
- package/dist/index112.js +3 -51
- package/dist/index112.js.map +1 -1
- package/dist/index113.cjs +39 -35
- package/dist/index113.cjs.map +1 -1
- package/dist/index113.js +38 -34
- package/dist/index113.js.map +1 -1
- package/dist/index114.cjs +84 -43
- package/dist/index114.cjs.map +1 -1
- package/dist/index114.js +83 -42
- package/dist/index114.js.map +1 -1
- package/dist/index115.cjs +51 -24
- package/dist/index115.cjs.map +1 -1
- package/dist/index115.js +50 -23
- package/dist/index115.js.map +1 -1
- package/dist/index116.cjs +21 -39
- package/dist/index116.cjs.map +1 -1
- package/dist/index116.js +20 -38
- package/dist/index116.js.map +1 -1
- package/dist/index117.cjs +22 -9
- package/dist/index117.cjs.map +1 -1
- package/dist/index117.js +21 -8
- package/dist/index117.js.map +1 -1
- package/dist/index118.cjs +6 -10
- package/dist/index118.cjs.map +1 -1
- package/dist/index118.js +5 -9
- package/dist/index118.js.map +1 -1
- package/dist/index119.cjs +25 -20
- package/dist/index119.cjs.map +1 -1
- package/dist/index119.js +24 -19
- package/dist/index119.js.map +1 -1
- package/dist/index12.cjs +2 -2
- package/dist/index12.js +2 -2
- package/dist/index120.cjs +19 -14
- package/dist/index120.cjs.map +1 -1
- package/dist/index120.js +18 -13
- package/dist/index120.js.map +1 -1
- package/dist/index121.cjs +6 -10
- package/dist/index121.cjs.map +1 -1
- package/dist/index121.js +5 -9
- package/dist/index121.js.map +1 -1
- package/dist/index122.cjs +4 -64
- package/dist/index122.cjs.map +1 -1
- package/dist/index122.js +5 -65
- package/dist/index122.js.map +1 -1
- package/dist/index123.cjs +30 -66
- package/dist/index123.cjs.map +1 -1
- package/dist/index123.js +30 -66
- package/dist/index123.js.map +1 -1
- package/dist/index124.cjs +16 -16
- package/dist/index124.js +17 -17
- package/dist/index125.cjs +15 -22
- package/dist/index125.cjs.map +1 -1
- package/dist/index125.js +14 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.cjs +57 -69
- package/dist/index126.cjs.map +1 -1
- package/dist/index126.js +56 -68
- package/dist/index126.js.map +1 -1
- package/dist/index127.cjs +21 -7
- package/dist/index127.cjs.map +1 -1
- package/dist/index127.js +20 -6
- package/dist/index127.js.map +1 -1
- package/dist/index128.cjs +19 -34
- package/dist/index128.cjs.map +1 -1
- package/dist/index128.js +19 -34
- package/dist/index128.js.map +1 -1
- package/dist/index129.cjs +13 -13
- package/dist/index129.js +13 -13
- package/dist/index13.cjs +2 -2
- package/dist/index13.js +2 -2
- package/dist/index130.cjs +34 -16
- package/dist/index130.cjs.map +1 -1
- package/dist/index130.js +34 -16
- package/dist/index130.js.map +1 -1
- package/dist/index131.cjs +40 -49
- package/dist/index131.cjs.map +1 -1
- package/dist/index131.js +39 -48
- package/dist/index131.js.map +1 -1
- package/dist/index132.cjs +54 -75
- package/dist/index132.cjs.map +1 -1
- package/dist/index132.js +53 -74
- package/dist/index132.js.map +1 -1
- package/dist/index133.cjs +21 -34
- package/dist/index133.cjs.map +1 -1
- package/dist/index133.js +20 -33
- package/dist/index133.js.map +1 -1
- package/dist/index134.cjs +37 -0
- package/dist/index134.cjs.map +1 -0
- package/dist/index134.js +37 -0
- package/dist/index134.js.map +1 -0
- package/dist/index135.cjs +1166 -0
- package/dist/index135.cjs.map +1 -0
- package/dist/index135.js +1167 -0
- package/dist/index135.js.map +1 -0
- package/dist/index136.cjs +1578 -0
- package/dist/index136.cjs.map +1 -0
- package/dist/index136.js +1579 -0
- package/dist/index136.js.map +1 -0
- package/dist/index137.cjs +51 -0
- package/dist/index137.cjs.map +1 -0
- package/dist/index137.js +51 -0
- package/dist/index137.js.map +1 -0
- package/dist/index138.cjs +78 -0
- package/dist/index138.cjs.map +1 -0
- package/dist/index138.js +78 -0
- package/dist/index138.js.map +1 -0
- package/dist/index14.cjs +2 -2
- package/dist/index14.js +2 -2
- package/dist/index15.cjs +2 -2
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +3 -3
- package/dist/index16.js +3 -3
- package/dist/index17.cjs +2 -2
- package/dist/index17.js +2 -2
- package/dist/index18.cjs +2 -2
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +2 -2
- package/dist/index19.js +2 -2
- package/dist/index20.cjs +2 -2
- package/dist/index20.js +2 -2
- package/dist/index21.cjs +2 -2
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +15 -88
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +17 -90
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +85 -153
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +87 -155
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +158 -127
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +158 -127
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +138 -129
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +139 -130
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +144 -17
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +144 -17
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +92 -191
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +92 -191
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +17 -22
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +17 -22
- package/dist/index28.js.map +1 -1
- package/dist/index29.cjs +145 -102
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +144 -101
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +21 -154
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +22 -155
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +135 -75
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +136 -76
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +147 -94
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +149 -96
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +86 -7
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +88 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +99 -129
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +101 -131
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +6 -54
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +8 -56
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +138 -17
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +140 -19
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +55 -37
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +55 -37
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +16 -299
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +18 -301
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +43 -34
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +44 -35
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +305 -107
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +307 -109
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +30 -64
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +31 -65
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +113 -74
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +115 -76
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +63 -54
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +64 -55
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +69 -144
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +70 -145
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +57 -96
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +59 -98
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +147 -66
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +149 -68
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +97 -7
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +99 -9
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +72 -17
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +73 -18
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +7 -76
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +9 -78
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +17 -183
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +17 -183
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +72 -59
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +74 -61
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +184 -97
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +185 -98
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +49 -32
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +49 -32
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +114 -6
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +115 -7
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +44 -144
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +45 -145
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +6 -8
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +6 -8
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +143 -15
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +145 -17
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +7 -65
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +9 -67
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +19 -16
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +18 -15
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +67 -27
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +66 -26
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +16 -18
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +15 -17
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +23 -2
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +24 -3
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +20 -5
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +21 -6
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +19 -145
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +17 -143
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +24 -36
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +24 -36
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +4 -28
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +3 -27
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +10 -18
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +9 -17
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +13 -19
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +13 -19
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +15 -12
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +15 -12
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +145 -25
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +143 -23
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +37 -16
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +37 -16
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +134 -7
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +133 -6
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +12 -19
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +11 -18
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +40 -19
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +41 -20
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +111 -69
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +111 -69
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +37 -28
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +37 -28
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +29 -2
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +30 -3
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +49 -43
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +50 -44
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +35 -84
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +34 -83
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +43 -24
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +42 -23
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +24 -57
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +23 -56
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +36 -1160
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +36 -1161
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +9 -1576
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +8 -1576
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +10 -15
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +9 -14
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +18 -46
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +18 -46
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +13 -17
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +13 -17
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +10 -36
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +9 -35
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +64 -10
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +64 -10
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +22 -21
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +21 -20
- package/dist/index89.js.map +1 -1
- package/dist/index90.cjs +70 -10
- package/dist/index90.cjs.map +1 -1
- package/dist/index90.js +68 -8
- package/dist/index90.js.map +1 -1
- package/dist/index91.cjs +6 -6
- package/dist/index91.cjs.map +1 -1
- package/dist/index91.js +5 -5
- package/dist/index91.js.map +1 -1
- package/dist/index92.cjs +32 -32
- package/dist/index92.js +32 -32
- package/dist/index93.cjs +48 -22
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +47 -21
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +15 -37
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +15 -37
- package/dist/index94.js.map +1 -1
- package/dist/index95.cjs +36 -92
- package/dist/index95.cjs.map +1 -1
- package/dist/index95.js +35 -91
- package/dist/index95.js.map +1 -1
- package/dist/index96.cjs +39 -39
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +38 -38
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +92 -39
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +91 -38
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +34 -19
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +35 -20
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +2 -38
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +3 -39
- package/dist/index99.js.map +1 -1
- package/dist/labels/ComponentLabels.types.d.ts +164 -0
- package/dist/labels/ComponentLabels.types.d.ts.map +1 -0
- package/dist/labels/ComponentLabelsContext.d.ts +5 -0
- package/dist/labels/ComponentLabelsContext.d.ts.map +1 -0
- package/dist/labels/ComponentLabelsProvider.d.ts +11 -0
- package/dist/labels/ComponentLabelsProvider.d.ts.map +1 -0
- package/dist/labels/assignDefined.d.ts +3 -0
- package/dist/labels/assignDefined.d.ts.map +1 -0
- package/dist/labels/defaults.d.ts +5 -0
- package/dist/labels/defaults.d.ts.map +1 -0
- package/dist/labels/defaults.test.d.ts +2 -0
- package/dist/labels/defaults.test.d.ts.map +1 -0
- package/dist/labels/index.d.ts +4 -0
- package/dist/labels/index.d.ts.map +1 -0
- package/dist/labels/useComponentLabels.d.ts +9 -0
- package/dist/labels/useComponentLabels.d.ts.map +1 -0
- package/dist/primitives/Modal/Modal.d.ts +2 -14
- package/dist/primitives/Modal/Modal.d.ts.map +1 -1
- package/dist/primitives/Modal/Modal.types.d.ts +18 -0
- package/dist/primitives/Modal/Modal.types.d.ts.map +1 -0
- package/dist/primitives/Modal/index.d.ts +1 -1
- package/dist/primitives/Modal/index.d.ts.map +1 -1
- package/dist/primitives/Pagination/Pagination.d.ts.map +1 -1
- package/dist/primitives/Pagination/Pagination.types.d.ts +4 -0
- package/dist/primitives/Pagination/Pagination.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const constants = require("./index70.cjs");
|
|
4
|
+
const DEFAULT_PLACEMENT = { align: "start", side: "bottom" };
|
|
5
|
+
function resolveHorizontal(anchor, width, boundary, margin) {
|
|
6
|
+
const left = boundary.left + margin;
|
|
7
|
+
const right = boundary.right - margin;
|
|
8
|
+
if (anchor.left + width <= right) return { align: "start" };
|
|
9
|
+
if (anchor.right - width >= left) return { align: "end" };
|
|
10
|
+
return { align: "start", shift: Math.max(right - width, left) - anchor.left };
|
|
11
|
+
}
|
|
12
|
+
const shrink = (rect, margin) => ({
|
|
13
|
+
top: rect.top + margin,
|
|
14
|
+
bottom: rect.bottom - margin
|
|
15
|
+
});
|
|
16
|
+
function resolveVertical(anchor, panel, box, currentSide, margin) {
|
|
17
|
+
const inside = shrink(box.vertical, margin);
|
|
18
|
+
const escape = box.escape && shrink(box.escape, margin);
|
|
19
|
+
const room = (side2, rect) => side2 === "bottom" ? rect.bottom - (anchor.bottom + panel.gap) : anchor.top - panel.gap - rect.top;
|
|
20
|
+
const candidates = [
|
|
21
|
+
{ side: "bottom", outside: false },
|
|
22
|
+
{ side: "top", outside: false }
|
|
23
|
+
];
|
|
24
|
+
if (escape) candidates.push({ side: "bottom", outside: true }, { side: "top", outside: true });
|
|
25
|
+
const fits = (c) => panel.height <= room(c.side, c.outside && escape ? escape : inside);
|
|
26
|
+
const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));
|
|
27
|
+
const first = kept || candidates.find(fits);
|
|
28
|
+
if (first) return first;
|
|
29
|
+
const limit = escape ?? inside;
|
|
30
|
+
const side = room("bottom", limit) >= room("top", limit) ? "bottom" : "top";
|
|
31
|
+
return {
|
|
32
|
+
side,
|
|
33
|
+
outside: room(side, inside) < room(side, limit),
|
|
34
|
+
maxHeight: Math.max(room(side, limit), 0)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function fixedStyle(anchor, panel, viewportBottom, horizontal, vertical) {
|
|
38
|
+
const below = vertical.side === "bottom";
|
|
39
|
+
return {
|
|
40
|
+
position: "fixed",
|
|
41
|
+
top: below ? anchor.bottom + panel.gap : "auto",
|
|
42
|
+
bottom: below ? "auto" : viewportBottom - anchor.top + panel.gap,
|
|
43
|
+
left: horizontal.align === "start" ? anchor.left + (horizontal.shift ?? 0) : anchor.right - panel.width,
|
|
44
|
+
right: "auto",
|
|
45
|
+
width: panel.width,
|
|
46
|
+
boxSizing: "border-box"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function resolvePanelPlacement({
|
|
50
|
+
anchor,
|
|
51
|
+
panel,
|
|
52
|
+
box,
|
|
53
|
+
currentSide,
|
|
54
|
+
margin = constants.PANEL_EDGE_MARGIN
|
|
55
|
+
}) {
|
|
56
|
+
if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;
|
|
57
|
+
const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);
|
|
58
|
+
const vertical = resolveVertical(anchor, panel, box, currentSide, margin);
|
|
59
|
+
const { align } = horizontal;
|
|
60
|
+
const { side, maxHeight } = vertical;
|
|
61
|
+
const style = vertical.outside ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical) : {};
|
|
62
|
+
if (!vertical.outside && horizontal.shift !== void 0) {
|
|
63
|
+
style.transform = `translateX(${horizontal.shift}px)`;
|
|
64
|
+
}
|
|
65
|
+
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
66
|
+
return Object.keys(style).length ? { align, side, style } : { align, side };
|
|
67
|
+
}
|
|
68
|
+
const sameStyle = (a = {}, b = {}) => {
|
|
69
|
+
const keys = Object.keys(a);
|
|
70
|
+
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
71
|
+
};
|
|
72
|
+
const samePlacement = (a, b) => a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);
|
|
73
|
+
exports.DEFAULT_PLACEMENT = DEFAULT_PLACEMENT;
|
|
74
|
+
exports.resolveHorizontal = resolveHorizontal;
|
|
75
|
+
exports.resolvePanelPlacement = resolvePanelPlacement;
|
|
76
|
+
exports.resolveVertical = resolveVertical;
|
|
77
|
+
exports.samePlacement = samePlacement;
|
|
78
|
+
//# sourceMappingURL=index138.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index138.cjs","sources":["../src/utils/panelPlacement.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { PANEL_EDGE_MARGIN } from '../constants';\nimport type {\n AnchorRect,\n ClippingBox,\n HorizontalRect,\n PanelAlign,\n PanelPlacement,\n PanelSide,\n PanelSize,\n PlacementInput,\n VerticalRect,\n} from './panelPlacement.types';\n\nexport const DEFAULT_PLACEMENT: PanelPlacement = { align: 'start', side: 'bottom' };\n\ninterface HorizontalPlacement {\n align: PanelAlign;\n /** Px to move the start-aligned panel by, when it fits on neither side. */\n shift?: number;\n}\n\ninterface VerticalPlacement {\n side: PanelSide;\n /** True when the panel is placed against the viewport, outside the clipping box. */\n outside: boolean;\n maxHeight?: number;\n}\n\n/**\n * Left-aligned if it fits rightwards, else right-aligned if it fits leftwards, else\n * shifted just enough to fit, keeping its left edge visible first.\n */\nexport function resolveHorizontal(\n anchor: HorizontalRect,\n width: number,\n boundary: HorizontalRect,\n margin: number,\n): HorizontalPlacement {\n const left = boundary.left + margin;\n const right = boundary.right - margin;\n\n if (anchor.left + width <= right) return { align: 'start' };\n if (anchor.right - width >= left) return { align: 'end' };\n return { align: 'start', shift: Math.max(right - width, left) - anchor.left };\n}\n\nconst shrink = (rect: VerticalRect, margin: number): VerticalRect => ({\n top: rect.top + margin,\n bottom: rect.bottom - margin,\n});\n\n/**\n * Below, else above, inside the clipping box; else below, else above, in the escape\n * box; else on the side with more room, with the height limited to it. While open, the\n * current side is kept as long as the panel still fits on it.\n */\nexport function resolveVertical(\n anchor: VerticalRect,\n panel: PanelSize,\n box: ClippingBox,\n currentSide: PanelSide | null,\n margin: number,\n): VerticalPlacement {\n const inside = shrink(box.vertical, margin);\n const escape = box.escape && shrink(box.escape, margin);\n const room = (side: PanelSide, rect: VerticalRect) =>\n side === 'bottom'\n ? rect.bottom - (anchor.bottom + panel.gap)\n : anchor.top - panel.gap - rect.top;\n\n const candidates: VerticalPlacement[] = [\n { side: 'bottom', outside: false },\n { side: 'top', outside: false },\n ];\n if (escape) candidates.push({ side: 'bottom', outside: true }, { side: 'top', outside: true });\n const fits = (c: VerticalPlacement) =>\n panel.height <= room(c.side, c.outside && escape ? escape : inside);\n\n const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));\n const first = kept || candidates.find(fits);\n if (first) return first;\n\n const limit = escape ?? inside;\n const side: PanelSide = room('bottom', limit) >= room('top', limit) ? 'bottom' : 'top';\n return {\n side,\n outside: room(side, inside) < room(side, limit),\n maxHeight: Math.max(room(side, limit), 0),\n };\n}\n\nfunction fixedStyle(\n anchor: AnchorRect,\n panel: PanelSize,\n viewportBottom: number,\n horizontal: HorizontalPlacement,\n vertical: VerticalPlacement,\n): CSSProperties {\n const below = vertical.side === 'bottom';\n return {\n position: 'fixed',\n top: below ? anchor.bottom + panel.gap : 'auto',\n bottom: below ? 'auto' : viewportBottom - anchor.top + panel.gap,\n left:\n horizontal.align === 'start'\n ? anchor.left + (horizontal.shift ?? 0)\n : anchor.right - panel.width,\n right: 'auto',\n width: panel.width,\n boxSizing: 'border-box',\n };\n}\n\n/**\n * Places a dropdown panel against its trigger so the boxes that clip it never cut it\n * off. Pure: takes the measured trigger, the panel measured in its default layout and\n * the clipping box. A panel that was never laid out keeps the default placement.\n */\nexport function resolvePanelPlacement({\n anchor,\n panel,\n box,\n currentSide,\n margin = PANEL_EDGE_MARGIN,\n}: PlacementInput): PanelPlacement {\n if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;\n\n const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);\n const vertical = resolveVertical(anchor, panel, box, currentSide, margin);\n const { align } = horizontal;\n const { side, maxHeight } = vertical;\n\n const style: CSSProperties = vertical.outside\n ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical)\n : {};\n if (!vertical.outside && horizontal.shift !== undefined) {\n style.transform = `translateX(${horizontal.shift}px)`;\n }\n if (maxHeight !== undefined) style.maxHeight = maxHeight;\n\n return Object.keys(style).length ? { align, side, style } : { align, side };\n}\n\nconst sameStyle = (a: CSSProperties = {}, b: CSSProperties = {}) => {\n const keys = Object.keys(a) as (keyof CSSProperties)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n};\n\nexport const samePlacement = (a: PanelPlacement, b: PanelPlacement) =>\n a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);\n"],"names":["side","PANEL_EDGE_MARGIN"],"mappings":"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"}
|
package/dist/index138.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { PANEL_EDGE_MARGIN } from "./index70.js";
|
|
2
|
+
const DEFAULT_PLACEMENT = { align: "start", side: "bottom" };
|
|
3
|
+
function resolveHorizontal(anchor, width, boundary, margin) {
|
|
4
|
+
const left = boundary.left + margin;
|
|
5
|
+
const right = boundary.right - margin;
|
|
6
|
+
if (anchor.left + width <= right) return { align: "start" };
|
|
7
|
+
if (anchor.right - width >= left) return { align: "end" };
|
|
8
|
+
return { align: "start", shift: Math.max(right - width, left) - anchor.left };
|
|
9
|
+
}
|
|
10
|
+
const shrink = (rect, margin) => ({
|
|
11
|
+
top: rect.top + margin,
|
|
12
|
+
bottom: rect.bottom - margin
|
|
13
|
+
});
|
|
14
|
+
function resolveVertical(anchor, panel, box, currentSide, margin) {
|
|
15
|
+
const inside = shrink(box.vertical, margin);
|
|
16
|
+
const escape = box.escape && shrink(box.escape, margin);
|
|
17
|
+
const room = (side2, rect) => side2 === "bottom" ? rect.bottom - (anchor.bottom + panel.gap) : anchor.top - panel.gap - rect.top;
|
|
18
|
+
const candidates = [
|
|
19
|
+
{ side: "bottom", outside: false },
|
|
20
|
+
{ side: "top", outside: false }
|
|
21
|
+
];
|
|
22
|
+
if (escape) candidates.push({ side: "bottom", outside: true }, { side: "top", outside: true });
|
|
23
|
+
const fits = (c) => panel.height <= room(c.side, c.outside && escape ? escape : inside);
|
|
24
|
+
const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));
|
|
25
|
+
const first = kept || candidates.find(fits);
|
|
26
|
+
if (first) return first;
|
|
27
|
+
const limit = escape ?? inside;
|
|
28
|
+
const side = room("bottom", limit) >= room("top", limit) ? "bottom" : "top";
|
|
29
|
+
return {
|
|
30
|
+
side,
|
|
31
|
+
outside: room(side, inside) < room(side, limit),
|
|
32
|
+
maxHeight: Math.max(room(side, limit), 0)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function fixedStyle(anchor, panel, viewportBottom, horizontal, vertical) {
|
|
36
|
+
const below = vertical.side === "bottom";
|
|
37
|
+
return {
|
|
38
|
+
position: "fixed",
|
|
39
|
+
top: below ? anchor.bottom + panel.gap : "auto",
|
|
40
|
+
bottom: below ? "auto" : viewportBottom - anchor.top + panel.gap,
|
|
41
|
+
left: horizontal.align === "start" ? anchor.left + (horizontal.shift ?? 0) : anchor.right - panel.width,
|
|
42
|
+
right: "auto",
|
|
43
|
+
width: panel.width,
|
|
44
|
+
boxSizing: "border-box"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function resolvePanelPlacement({
|
|
48
|
+
anchor,
|
|
49
|
+
panel,
|
|
50
|
+
box,
|
|
51
|
+
currentSide,
|
|
52
|
+
margin = PANEL_EDGE_MARGIN
|
|
53
|
+
}) {
|
|
54
|
+
if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;
|
|
55
|
+
const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);
|
|
56
|
+
const vertical = resolveVertical(anchor, panel, box, currentSide, margin);
|
|
57
|
+
const { align } = horizontal;
|
|
58
|
+
const { side, maxHeight } = vertical;
|
|
59
|
+
const style = vertical.outside ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical) : {};
|
|
60
|
+
if (!vertical.outside && horizontal.shift !== void 0) {
|
|
61
|
+
style.transform = `translateX(${horizontal.shift}px)`;
|
|
62
|
+
}
|
|
63
|
+
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
64
|
+
return Object.keys(style).length ? { align, side, style } : { align, side };
|
|
65
|
+
}
|
|
66
|
+
const sameStyle = (a = {}, b = {}) => {
|
|
67
|
+
const keys = Object.keys(a);
|
|
68
|
+
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
69
|
+
};
|
|
70
|
+
const samePlacement = (a, b) => a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);
|
|
71
|
+
export {
|
|
72
|
+
DEFAULT_PLACEMENT,
|
|
73
|
+
resolveHorizontal,
|
|
74
|
+
resolvePanelPlacement,
|
|
75
|
+
resolveVertical,
|
|
76
|
+
samePlacement
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=index138.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index138.js","sources":["../src/utils/panelPlacement.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { PANEL_EDGE_MARGIN } from '../constants';\nimport type {\n AnchorRect,\n ClippingBox,\n HorizontalRect,\n PanelAlign,\n PanelPlacement,\n PanelSide,\n PanelSize,\n PlacementInput,\n VerticalRect,\n} from './panelPlacement.types';\n\nexport const DEFAULT_PLACEMENT: PanelPlacement = { align: 'start', side: 'bottom' };\n\ninterface HorizontalPlacement {\n align: PanelAlign;\n /** Px to move the start-aligned panel by, when it fits on neither side. */\n shift?: number;\n}\n\ninterface VerticalPlacement {\n side: PanelSide;\n /** True when the panel is placed against the viewport, outside the clipping box. */\n outside: boolean;\n maxHeight?: number;\n}\n\n/**\n * Left-aligned if it fits rightwards, else right-aligned if it fits leftwards, else\n * shifted just enough to fit, keeping its left edge visible first.\n */\nexport function resolveHorizontal(\n anchor: HorizontalRect,\n width: number,\n boundary: HorizontalRect,\n margin: number,\n): HorizontalPlacement {\n const left = boundary.left + margin;\n const right = boundary.right - margin;\n\n if (anchor.left + width <= right) return { align: 'start' };\n if (anchor.right - width >= left) return { align: 'end' };\n return { align: 'start', shift: Math.max(right - width, left) - anchor.left };\n}\n\nconst shrink = (rect: VerticalRect, margin: number): VerticalRect => ({\n top: rect.top + margin,\n bottom: rect.bottom - margin,\n});\n\n/**\n * Below, else above, inside the clipping box; else below, else above, in the escape\n * box; else on the side with more room, with the height limited to it. While open, the\n * current side is kept as long as the panel still fits on it.\n */\nexport function resolveVertical(\n anchor: VerticalRect,\n panel: PanelSize,\n box: ClippingBox,\n currentSide: PanelSide | null,\n margin: number,\n): VerticalPlacement {\n const inside = shrink(box.vertical, margin);\n const escape = box.escape && shrink(box.escape, margin);\n const room = (side: PanelSide, rect: VerticalRect) =>\n side === 'bottom'\n ? rect.bottom - (anchor.bottom + panel.gap)\n : anchor.top - panel.gap - rect.top;\n\n const candidates: VerticalPlacement[] = [\n { side: 'bottom', outside: false },\n { side: 'top', outside: false },\n ];\n if (escape) candidates.push({ side: 'bottom', outside: true }, { side: 'top', outside: true });\n const fits = (c: VerticalPlacement) =>\n panel.height <= room(c.side, c.outside && escape ? escape : inside);\n\n const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));\n const first = kept || candidates.find(fits);\n if (first) return first;\n\n const limit = escape ?? inside;\n const side: PanelSide = room('bottom', limit) >= room('top', limit) ? 'bottom' : 'top';\n return {\n side,\n outside: room(side, inside) < room(side, limit),\n maxHeight: Math.max(room(side, limit), 0),\n };\n}\n\nfunction fixedStyle(\n anchor: AnchorRect,\n panel: PanelSize,\n viewportBottom: number,\n horizontal: HorizontalPlacement,\n vertical: VerticalPlacement,\n): CSSProperties {\n const below = vertical.side === 'bottom';\n return {\n position: 'fixed',\n top: below ? anchor.bottom + panel.gap : 'auto',\n bottom: below ? 'auto' : viewportBottom - anchor.top + panel.gap,\n left:\n horizontal.align === 'start'\n ? anchor.left + (horizontal.shift ?? 0)\n : anchor.right - panel.width,\n right: 'auto',\n width: panel.width,\n boxSizing: 'border-box',\n };\n}\n\n/**\n * Places a dropdown panel against its trigger so the boxes that clip it never cut it\n * off. Pure: takes the measured trigger, the panel measured in its default layout and\n * the clipping box. A panel that was never laid out keeps the default placement.\n */\nexport function resolvePanelPlacement({\n anchor,\n panel,\n box,\n currentSide,\n margin = PANEL_EDGE_MARGIN,\n}: PlacementInput): PanelPlacement {\n if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;\n\n const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);\n const vertical = resolveVertical(anchor, panel, box, currentSide, margin);\n const { align } = horizontal;\n const { side, maxHeight } = vertical;\n\n const style: CSSProperties = vertical.outside\n ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical)\n : {};\n if (!vertical.outside && horizontal.shift !== undefined) {\n style.transform = `translateX(${horizontal.shift}px)`;\n }\n if (maxHeight !== undefined) style.maxHeight = maxHeight;\n\n return Object.keys(style).length ? { align, side, style } : { align, side };\n}\n\nconst sameStyle = (a: CSSProperties = {}, b: CSSProperties = {}) => {\n const keys = Object.keys(a) as (keyof CSSProperties)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n};\n\nexport const samePlacement = (a: PanelPlacement, b: PanelPlacement) =>\n a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);\n"],"names":["side"],"mappings":"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"}
|
package/dist/index14.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const Button_module = require("./
|
|
5
|
+
const clsx = require("./index61.cjs");
|
|
6
|
+
const Button_module = require("./index62.cjs");
|
|
7
7
|
const Button = react.forwardRef(
|
|
8
8
|
({ className, variant = "primary", size = "md", type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
"button",
|
package/dist/index14.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index61.js";
|
|
4
|
+
import styles from "./index62.js";
|
|
5
5
|
const Button = forwardRef(
|
|
6
6
|
({ className, variant = "primary", size = "md", type = "button", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
7
|
"button",
|
package/dist/index15.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const clsx = require("./
|
|
5
|
-
const Card_module = require("./
|
|
4
|
+
const clsx = require("./index61.cjs");
|
|
5
|
+
const Card_module = require("./index100.cjs");
|
|
6
6
|
const Card = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(Card_module.default.root, className), ...props });
|
|
7
7
|
const CardHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(Card_module.default.header, className), ...props });
|
|
8
8
|
const CardContent = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(Card_module.default.content, className), ...props });
|
package/dist/index15.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "./
|
|
3
|
-
import styles from "./
|
|
2
|
+
import { clsx } from "./index61.js";
|
|
3
|
+
import styles from "./index100.js";
|
|
4
4
|
const Card = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: clsx(styles.root, className), ...props });
|
|
5
5
|
const CardHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: clsx(styles.header, className), ...props });
|
|
6
6
|
const CardContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: clsx(styles.content, className), ...props });
|
package/dist/index16.cjs
CHANGED
|
@@ -4,9 +4,9 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const reactDom = require("react-dom");
|
|
6
6
|
const useEscapeKey = require("./index5.cjs");
|
|
7
|
-
const constants = require("./
|
|
8
|
-
const clsx = require("./
|
|
9
|
-
const ChartExpandModal_module = require("./
|
|
7
|
+
const constants = require("./index70.cjs");
|
|
8
|
+
const clsx = require("./index61.cjs");
|
|
9
|
+
const ChartExpandModal_module = require("./index123.cjs");
|
|
10
10
|
const getInitialSize = (override) => {
|
|
11
11
|
if (typeof window === "undefined") {
|
|
12
12
|
return {
|
package/dist/index16.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useEffect, useCallback } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { useEscapeKey } from "./index5.js";
|
|
5
|
-
import { SVG_STROKE_WIDTH, SVG_VIEWBOX, ICON_SIZE, CHART_MODAL, VIEWPORT_MARGIN } from "./
|
|
6
|
-
import { clsx } from "./
|
|
7
|
-
import styles from "./
|
|
5
|
+
import { SVG_STROKE_WIDTH, SVG_VIEWBOX, ICON_SIZE, CHART_MODAL, VIEWPORT_MARGIN } from "./index70.js";
|
|
6
|
+
import { clsx } from "./index61.js";
|
|
7
|
+
import styles from "./index123.js";
|
|
8
8
|
const getInitialSize = (override) => {
|
|
9
9
|
if (typeof window === "undefined") {
|
|
10
10
|
return {
|
package/dist/index17.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const clsx = require("./
|
|
5
|
-
const ChatLayout_module = require("./
|
|
4
|
+
const clsx = require("./index61.cjs");
|
|
5
|
+
const ChatLayout_module = require("./index133.cjs");
|
|
6
6
|
const ChatLayout = ({
|
|
7
7
|
sidebar,
|
|
8
8
|
conversationList,
|
package/dist/index17.js
CHANGED
package/dist/index18.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const Checkbox_module = require("./
|
|
5
|
+
const clsx = require("./index61.cjs");
|
|
6
|
+
const Checkbox_module = require("./index117.cjs");
|
|
7
7
|
const Checkbox = react.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
checked,
|
package/dist/index18.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useEffect, useCallback } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index61.js";
|
|
4
|
+
import styles from "./index117.js";
|
|
5
5
|
const Checkbox = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
checked,
|
package/dist/index19.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const Chip_module = require("./
|
|
5
|
+
const clsx = require("./index61.cjs");
|
|
6
|
+
const Chip_module = require("./index64.cjs");
|
|
7
7
|
const Chip = react.forwardRef(
|
|
8
8
|
({ className, value, selected = false, size = "md", type = "button", onToggle, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
"button",
|
package/dist/index19.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index61.js";
|
|
4
|
+
import styles from "./index64.js";
|
|
5
5
|
const Chip = forwardRef(
|
|
6
6
|
({ className, value, selected = false, size = "md", type = "button", onToggle, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
7
|
"button",
|
package/dist/index20.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const ChipGroup_module = require("./
|
|
5
|
+
const clsx = require("./index61.cjs");
|
|
6
|
+
const ChipGroup_module = require("./index112.cjs");
|
|
7
7
|
const Chip = require("./index19.cjs");
|
|
8
8
|
const ChipGroup = react.forwardRef(
|
|
9
9
|
({ options, selected, onToggle, size = "md", className, ...props }, ref) => {
|
package/dist/index20.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index61.js";
|
|
4
|
+
import styles from "./index112.js";
|
|
5
5
|
import { Chip } from "./index19.js";
|
|
6
6
|
const ChipGroup = forwardRef(
|
|
7
7
|
({ options, selected, onToggle, size = "md", className, ...props }, ref) => {
|
package/dist/index21.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const Col_module = require("./
|
|
5
|
+
const clsx = require("./index61.cjs");
|
|
6
|
+
const Col_module = require("./index106.cjs");
|
|
7
7
|
const GRID_COLUMNS = 12;
|
|
8
8
|
function toFlexValue(value) {
|
|
9
9
|
if (value === true) return 1;
|
package/dist/index21.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index61.js";
|
|
4
|
+
import styles from "./index106.js";
|
|
5
5
|
const GRID_COLUMNS = 12;
|
|
6
6
|
function toFlexValue(value) {
|
|
7
7
|
if (value === true) return 1;
|
package/dist/index22.cjs
CHANGED
|
@@ -2,93 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
useEscapeKey.useEscapeKey(onClose);
|
|
14
|
-
const adjustPosition = react.useCallback(() => {
|
|
15
|
-
if (!menuRef.current) return;
|
|
16
|
-
const rect = menuRef.current.getBoundingClientRect();
|
|
17
|
-
const vw = window.innerWidth;
|
|
18
|
-
const vh = window.innerHeight;
|
|
19
|
-
let ax = x;
|
|
20
|
-
let ay = y;
|
|
21
|
-
if (x + rect.width > vw - constants.CONTEXT_MENU_MARGIN) ax = vw - rect.width - constants.CONTEXT_MENU_MARGIN;
|
|
22
|
-
if (y + rect.height > vh - constants.CONTEXT_MENU_MARGIN) ay = vh - rect.height - constants.CONTEXT_MENU_MARGIN;
|
|
23
|
-
menuRef.current.style.left = `${ax}px`;
|
|
24
|
-
menuRef.current.style.top = `${ay}px`;
|
|
25
|
-
}, [x, y]);
|
|
26
|
-
react.useEffect(() => {
|
|
27
|
-
adjustPosition();
|
|
28
|
-
}, [adjustPosition]);
|
|
29
|
-
react.useEffect(() => {
|
|
30
|
-
const handleClick = (e) => {
|
|
31
|
-
if (menuRef.current && !menuRef.current.contains(e.target)) onClose();
|
|
32
|
-
};
|
|
33
|
-
const handleScroll = () => onClose();
|
|
34
|
-
document.addEventListener("mousedown", handleClick);
|
|
35
|
-
window.addEventListener("scroll", handleScroll, true);
|
|
36
|
-
return () => {
|
|
37
|
-
document.removeEventListener("mousedown", handleClick);
|
|
38
|
-
window.removeEventListener("scroll", handleScroll, true);
|
|
39
|
-
};
|
|
40
|
-
}, [onClose]);
|
|
41
|
-
const handleItemClick = (item) => {
|
|
42
|
-
if (item.disabled) return;
|
|
43
|
-
item.onClick();
|
|
44
|
-
onClose();
|
|
45
|
-
};
|
|
46
|
-
const handleKeyDown = (e) => {
|
|
47
|
-
if (e.key === "ArrowDown") {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
setFocusedIndex((prev) => Math.min(prev + 1, items.length - 1));
|
|
50
|
-
} else if (e.key === "ArrowUp") {
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
setFocusedIndex((prev) => Math.max(prev - 1, 0));
|
|
53
|
-
} else if (e.key === "Enter" && focusedIndex >= 0 && focusedIndex < items.length) {
|
|
54
|
-
e.preventDefault();
|
|
55
|
-
handleItemClick(items[focusedIndex]);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
if (typeof document === "undefined") return null;
|
|
59
|
-
return reactDom.createPortal(
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
-
"div",
|
|
62
|
-
{
|
|
63
|
-
ref: menuRef,
|
|
64
|
-
className: ContextMenu_module.default.root,
|
|
65
|
-
style: { left: x, top: y },
|
|
66
|
-
role: "menu",
|
|
67
|
-
"aria-label": "Context menu",
|
|
68
|
-
onKeyDown: handleKeyDown,
|
|
69
|
-
children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
70
|
-
"button",
|
|
71
|
-
{
|
|
72
|
-
type: "button",
|
|
73
|
-
className: clsx.clsx(ContextMenu_module.default.item, {
|
|
74
|
-
[ContextMenu_module.default.disabled]: item.disabled,
|
|
75
|
-
[ContextMenu_module.default.focused]: i === focusedIndex
|
|
76
|
-
}),
|
|
77
|
-
onClick: () => handleItemClick(item),
|
|
78
|
-
role: "menuitem",
|
|
79
|
-
"aria-disabled": item.disabled || void 0,
|
|
80
|
-
tabIndex: i === focusedIndex ? 0 : -1,
|
|
81
|
-
children: [
|
|
82
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ContextMenu_module.default.icon, children: item.icon }),
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
item.label
|
|
87
|
-
))
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
document.body
|
|
91
|
-
);
|
|
5
|
+
const ComponentLabelsContext = require("./index66.cjs");
|
|
6
|
+
const assignDefined = require("./index67.cjs");
|
|
7
|
+
const mergeOverrides = (outer, inner) => {
|
|
8
|
+
const merged = { ...outer };
|
|
9
|
+
Object.keys(inner).forEach((group) => {
|
|
10
|
+
merged[group] = assignDefined.assignDefined({ ...outer[group] }, inner[group]);
|
|
11
|
+
});
|
|
12
|
+
return merged;
|
|
92
13
|
};
|
|
93
|
-
|
|
14
|
+
const ComponentLabelsProvider = ({ labels, children }) => {
|
|
15
|
+
const parent = react.useContext(ComponentLabelsContext.ComponentLabelsContext);
|
|
16
|
+
const value = react.useMemo(() => mergeOverrides(parent, labels), [parent, labels]);
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComponentLabelsContext.ComponentLabelsContext.Provider, { value, children });
|
|
18
|
+
};
|
|
19
|
+
ComponentLabelsProvider.displayName = "ComponentLabelsProvider";
|
|
20
|
+
exports.ComponentLabelsProvider = ComponentLabelsProvider;
|
|
94
21
|
//# sourceMappingURL=index22.cjs.map
|
package/dist/index22.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index22.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index22.cjs","sources":["../src/labels/ComponentLabelsProvider.tsx"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport type {\n ComponentLabels,\n ComponentLabelsOverrides,\n ComponentLabelsProviderProps,\n} from './ComponentLabels.types';\nimport { ComponentLabelsContext } from './ComponentLabelsContext';\nimport { assignDefined } from './assignDefined';\n\nconst mergeOverrides = (\n outer: ComponentLabelsOverrides,\n inner: ComponentLabelsOverrides,\n): ComponentLabelsOverrides => {\n const merged: Record<string, object> = { ...outer };\n (Object.keys(inner) as (keyof ComponentLabels)[]).forEach((group) => {\n merged[group] = assignDefined({ ...outer[group] }, inner[group]);\n });\n return merged as ComponentLabelsOverrides;\n};\n\n/**\n * Replaces the library's fixed texts for every covered component below it. Partial: groups\n * and keys not given keep their English default. Nested providers merge inner over outer.\n */\nexport const ComponentLabelsProvider = ({ labels, children }: ComponentLabelsProviderProps) => {\n const parent = useContext(ComponentLabelsContext);\n const value = useMemo(() => mergeOverrides(parent, labels), [parent, labels]);\n return (\n <ComponentLabelsContext.Provider value={value}>{children}</ComponentLabelsContext.Provider>\n );\n};\n\nComponentLabelsProvider.displayName = 'ComponentLabelsProvider';\n"],"names":["assignDefined","useContext","ComponentLabelsContext","useMemo","jsx"],"mappings":";;;;;;AASA,MAAM,iBAAiB,CACrB,OACA,UAC6B;AAC7B,QAAM,SAAiC,EAAE,GAAG,MAAA;AAC3C,SAAO,KAAK,KAAK,EAAgC,QAAQ,CAAC,UAAU;AACnE,WAAO,KAAK,IAAIA,cAAAA,cAAc,EAAE,GAAG,MAAM,KAAK,EAAA,GAAK,MAAM,KAAK,CAAC;AAAA,EACjE,CAAC;AACD,SAAO;AACT;AAMO,MAAM,0BAA0B,CAAC,EAAE,QAAQ,eAA6C;AAC7F,QAAM,SAASC,MAAAA,WAAWC,6CAAsB;AAChD,QAAM,QAAQC,cAAQ,MAAM,eAAe,QAAQ,MAAM,GAAG,CAAC,QAAQ,MAAM,CAAC;AAC5E,SACEC,2BAAAA,IAACF,uBAAAA,uBAAuB,UAAvB,EAAgC,OAAe,SAAA,CAAS;AAE7D;AAEA,wBAAwB,cAAc;;"}
|
package/dist/index22.js
CHANGED
|
@@ -1,94 +1,21 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
useEscapeKey(onClose);
|
|
12
|
-
const adjustPosition = useCallback(() => {
|
|
13
|
-
if (!menuRef.current) return;
|
|
14
|
-
const rect = menuRef.current.getBoundingClientRect();
|
|
15
|
-
const vw = window.innerWidth;
|
|
16
|
-
const vh = window.innerHeight;
|
|
17
|
-
let ax = x;
|
|
18
|
-
let ay = y;
|
|
19
|
-
if (x + rect.width > vw - CONTEXT_MENU_MARGIN) ax = vw - rect.width - CONTEXT_MENU_MARGIN;
|
|
20
|
-
if (y + rect.height > vh - CONTEXT_MENU_MARGIN) ay = vh - rect.height - CONTEXT_MENU_MARGIN;
|
|
21
|
-
menuRef.current.style.left = `${ax}px`;
|
|
22
|
-
menuRef.current.style.top = `${ay}px`;
|
|
23
|
-
}, [x, y]);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
adjustPosition();
|
|
26
|
-
}, [adjustPosition]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const handleClick = (e) => {
|
|
29
|
-
if (menuRef.current && !menuRef.current.contains(e.target)) onClose();
|
|
30
|
-
};
|
|
31
|
-
const handleScroll = () => onClose();
|
|
32
|
-
document.addEventListener("mousedown", handleClick);
|
|
33
|
-
window.addEventListener("scroll", handleScroll, true);
|
|
34
|
-
return () => {
|
|
35
|
-
document.removeEventListener("mousedown", handleClick);
|
|
36
|
-
window.removeEventListener("scroll", handleScroll, true);
|
|
37
|
-
};
|
|
38
|
-
}, [onClose]);
|
|
39
|
-
const handleItemClick = (item) => {
|
|
40
|
-
if (item.disabled) return;
|
|
41
|
-
item.onClick();
|
|
42
|
-
onClose();
|
|
43
|
-
};
|
|
44
|
-
const handleKeyDown = (e) => {
|
|
45
|
-
if (e.key === "ArrowDown") {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
setFocusedIndex((prev) => Math.min(prev + 1, items.length - 1));
|
|
48
|
-
} else if (e.key === "ArrowUp") {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
setFocusedIndex((prev) => Math.max(prev - 1, 0));
|
|
51
|
-
} else if (e.key === "Enter" && focusedIndex >= 0 && focusedIndex < items.length) {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
handleItemClick(items[focusedIndex]);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
if (typeof document === "undefined") return null;
|
|
57
|
-
return createPortal(
|
|
58
|
-
/* @__PURE__ */ jsx(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
ref: menuRef,
|
|
62
|
-
className: styles.root,
|
|
63
|
-
style: { left: x, top: y },
|
|
64
|
-
role: "menu",
|
|
65
|
-
"aria-label": "Context menu",
|
|
66
|
-
onKeyDown: handleKeyDown,
|
|
67
|
-
children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
68
|
-
"button",
|
|
69
|
-
{
|
|
70
|
-
type: "button",
|
|
71
|
-
className: clsx(styles.item, {
|
|
72
|
-
[styles.disabled]: item.disabled,
|
|
73
|
-
[styles.focused]: i === focusedIndex
|
|
74
|
-
}),
|
|
75
|
-
onClick: () => handleItemClick(item),
|
|
76
|
-
role: "menuitem",
|
|
77
|
-
"aria-disabled": item.disabled || void 0,
|
|
78
|
-
tabIndex: i === focusedIndex ? 0 : -1,
|
|
79
|
-
children: [
|
|
80
|
-
item.icon && /* @__PURE__ */ jsx("span", { className: styles.icon, children: item.icon }),
|
|
81
|
-
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
item.label
|
|
85
|
-
))
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
document.body
|
|
89
|
-
);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { ComponentLabelsContext } from "./index66.js";
|
|
4
|
+
import { assignDefined } from "./index67.js";
|
|
5
|
+
const mergeOverrides = (outer, inner) => {
|
|
6
|
+
const merged = { ...outer };
|
|
7
|
+
Object.keys(inner).forEach((group) => {
|
|
8
|
+
merged[group] = assignDefined({ ...outer[group] }, inner[group]);
|
|
9
|
+
});
|
|
10
|
+
return merged;
|
|
90
11
|
};
|
|
12
|
+
const ComponentLabelsProvider = ({ labels, children }) => {
|
|
13
|
+
const parent = useContext(ComponentLabelsContext);
|
|
14
|
+
const value = useMemo(() => mergeOverrides(parent, labels), [parent, labels]);
|
|
15
|
+
return /* @__PURE__ */ jsx(ComponentLabelsContext.Provider, { value, children });
|
|
16
|
+
};
|
|
17
|
+
ComponentLabelsProvider.displayName = "ComponentLabelsProvider";
|
|
91
18
|
export {
|
|
92
|
-
|
|
19
|
+
ComponentLabelsProvider
|
|
93
20
|
};
|
|
94
21
|
//# sourceMappingURL=index22.js.map
|