se-design 1.0.75 → 1.0.76-dev1
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/dist/assets/style.css +1 -1
- package/dist/components/AccessibleDiv/index.d.ts +24 -0
- package/dist/components/Checkbox/index.d.ts +12 -0
- package/dist/components/CustomAccordion/index.d.ts +1 -0
- package/dist/components/CustomModal/index.d.ts +15 -12
- package/dist/components/DatePicker/useDatePickerA11y.d.ts +50 -0
- package/dist/components/Dropdown/index.d.ts +13 -0
- package/dist/components/Icon/index.d.ts +8 -2
- package/dist/components/InputWithIcon/index.d.ts +9 -1
- package/dist/components/LabelChip/index.d.ts +1 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/PhoneInput/index.d.ts +13 -5
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/SidebarOverlay/index.d.ts +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +144 -133
- package/dist/index.js.map +1 -1
- package/dist/index10.js +23 -59
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +1 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +2 -2
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +2 -2
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +2 -2
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +2 -2
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +2 -2
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +70 -63
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +2 -2
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +2 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +1 -1
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +1 -1
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +71 -34
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +2 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -2
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +2 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +2 -2
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +2 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +1 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +50 -14
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +2 -2
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +1 -1
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +1 -1
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +1 -1
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +15 -9
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +2 -2
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +2 -2
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -2
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -2
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +10 -218
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +2 -2
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +2 -2
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +2 -2
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +1 -1
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +1 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -1
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +220 -60
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +1 -1
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +1 -1
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +60 -99
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +1 -1
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +2 -2
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +2 -2
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +1 -1
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +95 -282
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +2 -2
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +1 -1
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +1 -1
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +1 -1
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +2 -2
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +1 -1
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +1 -1
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +2 -2
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +1 -1
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +2 -2
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +317 -16
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +2 -149
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +2 -9
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +2 -6
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +2 -5
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +2 -40
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +2 -59
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +2 -23
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +152 -0
- package/dist/index197.js.map +1 -0
- package/dist/index198.js +12 -0
- package/dist/index198.js.map +1 -0
- package/dist/index199.js +5 -23
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +15 -31
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +8 -0
- package/dist/index200.js.map +1 -0
- package/dist/index201.js +36 -80
- package/dist/index201.js.map +1 -1
- package/dist/index206.js +26 -0
- package/dist/index206.js.map +1 -0
- package/dist/index207.js +71 -0
- package/dist/index207.js.map +1 -0
- package/dist/index21.js +33 -61
- package/dist/index21.js.map +1 -1
- package/dist/{index210.js → index215.js} +1 -1
- package/dist/{index210.js.map → index215.js.map} +1 -1
- package/dist/index22.js +57 -76
- package/dist/index22.js.map +1 -1
- package/dist/{index218.js → index223.js} +1 -1
- package/dist/{index218.js.map → index223.js.map} +1 -1
- package/dist/{index221.js → index226.js} +2 -2
- package/dist/{index221.js.map → index226.js.map} +1 -1
- package/dist/index23.js +83 -21
- package/dist/index23.js.map +1 -1
- package/dist/index235.js +171 -8
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +3 -9
- package/dist/index236.js.map +1 -1
- package/dist/index238.js +18 -169
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +10 -11
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +20 -222
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +8 -4
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +4 -5
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +168 -36
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +11 -2
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -7
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +5 -326
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +36 -48
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -2
- package/dist/index248.js +7 -75
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +308 -74
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +289 -43
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +45 -47
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -8
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +75 -4
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +89 -48
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +52 -2
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -2
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +8 -0
- package/dist/index256.js.map +1 -0
- package/dist/index257.js +55 -0
- package/dist/index257.js.map +1 -0
- package/dist/index258.js +5 -0
- package/dist/index258.js.map +1 -0
- package/dist/index259.js +5 -0
- package/dist/index259.js.map +1 -0
- package/dist/index26.js +48 -23
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +21 -81
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +101 -138
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +139 -128
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +57 -98
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +133 -69
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +67 -96
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +96 -71
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +70 -38
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +40 -71
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +67 -82
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +99 -54
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +53 -280
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +281 -70
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +69 -80
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +102 -42
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +82 -32
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +26 -44
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +45 -67
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +65 -49
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +53 -139
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +132 -179
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +194 -35
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +34 -29
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +31 -145
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +131 -70
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +40 -315
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +80 -371
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +451 -91
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +98 -38
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +35 -35
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +35 -90
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +89 -159
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +157 -143
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +149 -33
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +33 -86
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +80 -113
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +323 -43
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +114 -62
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +62 -147
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +146 -312
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +317 -44
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +44 -143
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +145 -12
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +10 -44
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +42 -15
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +76 -48
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +18 -58
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +44 -51
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +66 -5
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +25 -7
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +105 -0
- package/dist/index72.js.map +1 -0
- package/dist/index73.js +62 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +21 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +5 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +54 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +24 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +9 -2
- package/dist/index78.js.map +1 -1
- package/dist/index8.js +48 -85
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +2 -2
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +2 -2
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +1 -1
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +2 -2
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +1 -1
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -1
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +91 -27
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +1 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -1
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +1 -1
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +1 -1
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index230.js +0 -7
- package/dist/index230.js.map +0 -1
- package/dist/index232.js +0 -25
- package/dist/index232.js.map +0 -1
- package/dist/index233.js +0 -57
- package/dist/index233.js.map +0 -1
- package/dist/index234.js +0 -22
- package/dist/index234.js.map +0 -1
- package/dist/index237.js +0 -8
- package/dist/index237.js.map +0 -1
- package/dist/index79.js +0 -5
- package/dist/index79.js.map +0 -1
package/dist/index22.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index22.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index22.js","sources":["../src/components/TableLayout/index.tsx"],"sourcesContent":["import React, { FC, ReactNode, useRef } from 'react';\nimport { TableContentLoader } from 'components/TableContentLoader';\n\nexport interface TableLayoutProps {\n className?: string;\n automationId?: string;\n loading: boolean;\n headerData: any[];\n tableData: any[];\n headerColSpan?: number[];\n renderTableContentLoader?: (noOfColumns: number) => ReactNode;\n getTableHeaders: (props: { headerData: any[]; sortData: any; onSortUiUpdate: any; loading: boolean }) => ReactNode;\n getTableBody: (props: { tableData: any[]; onRowClick: any; loading: boolean }) => ReactNode;\n getTableFooter: (props: { tableData: any[]; loading: boolean }) => ReactNode;\n onSortUiUpdate: (newSortData: any) => void;\n onRowClick: (rowData: any) => void;\n tableId: string;\n /**\n * ID of element that describes the table (e.g., sort instructions for screen readers)\n */\n ariaDescribedBy?: string;\n /**\n * Accessible name for the table element\n */\n ariaLabel?: string;\n}\n\nexport const TableLayout: FC<TableLayoutProps> = ({\n className = '',\n automationId = '',\n loading,\n headerColSpan = [],\n headerData,\n tableData,\n renderTableContentLoader,\n getTableHeaders,\n getTableBody,\n getTableFooter,\n onSortUiUpdate,\n onRowClick,\n tableId,\n ariaDescribedBy,\n ariaLabel,\n ...props\n}) => {\n const tableRef = useRef<HTMLTableElement>(null);\n\n return (\n <div className={'se-design-table-layout-wrapper flex flex-col flex-1 min-h-0' + (className.length > 0 ? ` ${className}` : '') + (loading? ' table-data-loading' : '')} {...props}>\n <div className=\"se-design-table-scroll-area flex-1 min-h-0 overflow-y-auto\">\n <table\n className={'se-design-table w-full bg-[var(--color-white)] border-collapse table-fixed'}\n ref={tableRef}\n data-automation-id={automationId}\n id={tableId}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n >\n <thead>\n <tr>{getTableHeaders({ headerData, sortData: {}, onSortUiUpdate, loading })}</tr>\n </thead>\n <tbody>\n {loading ? (\n <TableContentLoader noOfColumns={headerData?.length} colSpan={headerColSpan} />\n ) : (\n getTableBody({ tableData, onRowClick, loading })\n )}\n </tbody>\n </table>\n </div>\n <div className=\"se-design-table-footer w-full bg-[var(--color-white)] flex-shrink-0\">\n {getTableFooter({ tableData, loading })}\n </div>\n </div>\n );\n};\n"],"names":["TableLayout","className","automationId","loading","headerColSpan","headerData","tableData","renderTableContentLoader","getTableHeaders","getTableBody","getTableFooter","onSortUiUpdate","onRowClick","tableId","ariaDescribedBy","ariaLabel","props","tableRef","useRef","React","createElement","_extends","length","ref","id","sortData","TableContentLoader","noOfColumns","colSpan"],"mappings":";;;;;;;;;;;AA2BO,MAAMA,IAAoCA,CAAC;AAAA,EAChDC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,SAAAA;AAAAA,EACAC,eAAAA,IAAgB,CAAA;AAAA,EAChBC,YAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,0BAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAWC,EAAyB,IAAI;AAE9C,SACEC,gBAAAA,EAAAC,cAAA,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import d, { forwardRef as b } from "react";
|
|
2
|
-
import { Button as p } from "./
|
|
2
|
+
import { Button as p } from "./index4.js";
|
|
3
3
|
function n() {
|
|
4
4
|
return n = Object.assign ? Object.assign.bind() : function(a) {
|
|
5
5
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -43,4 +43,4 @@ g.displayName = "TabButton";
|
|
|
43
43
|
export {
|
|
44
44
|
g as TabButton
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=index226.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index226.js","sources":["../src/components/NavigationBar/TabButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button } from '../Button';\n\nexport interface TabButtonProps {\n id: string;\n label: string;\n isSelected: boolean;\n isDisabled?: boolean;\n panelId?: string;\n tabIndex: number;\n className?: string;\n automationId?: string;\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;\n onFocus: () => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Internal TabButton component for NavigationBar.\n * Uses Button (unstyled) internally for consistent activation handling.\n * Supports forwardRef for focus management (roving tabindex).\n */\nexport const TabButton = forwardRef<HTMLButtonElement, TabButtonProps>(\n (\n {\n id,\n label,\n isSelected,\n isDisabled = false,\n panelId,\n tabIndex,\n className = '',\n automationId,\n onClick,\n onFocus,\n onKeyDown\n },\n ref\n ) => {\n return (\n <Button\n ref={ref}\n type=\"unstyled\"\n label={label}\n disabled={isDisabled}\n onClick={onClick}\n className={className}\n automationId={automationId}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n {...(panelId ? { 'aria-controls': panelId } : {})}\n tabIndex={tabIndex}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n />\n );\n }\n);\n\nTabButton.displayName = 'TabButton';\n"],"names":["TabButton","id","label","isSelected","isDisabled","panelId","tabIndex","className","automationId","onClick","onFocus","onKeyDown","ref","React","createElement","Button","_extends","type","disabled","role","displayName"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,sBACX,CACE;AAAA,EACEC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AACF,GACAC,MAGEC,gBAAAA,EAAAC,cAACC,GAAMC,EAAA;AAAA,EACLJ,KAAAA;AAAAA,EACAK,MAAK;AAAA,EACLf,OAAAA;AAAAA,EACAgB,UAAUd;AAAAA,EACVK,SAAAA;AAAAA,EACAF,WAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAW,MAAK;AAAA,EACLlB,IAAAA;AAAAA,EACA,iBAAeE;AAAAA,GACVE,IAAU;AAAA,EAAE,iBAAiBA;AAAAA,IAAY,IAAE;AAAA,EAChDC,UAAAA;AAAAA,EACAI,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,CAAqB,CACtB,CAGP;AAEAX,EAAUoB,cAAc;"}
|
package/dist/index23.js
CHANGED
|
@@ -1,26 +1,88 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className: "se-design-color-coded-label flex items-center gap-2",
|
|
13
|
-
onClick: r
|
|
14
|
-
}, l && /* @__PURE__ */ e.createElement("span", {
|
|
15
|
-
className: "w-[15px] h-[15px] rounded-[3px] inline-block",
|
|
16
|
-
style: {
|
|
17
|
-
backgroundColor: l
|
|
1
|
+
import s, { useState as _, useEffect as j } from "react";
|
|
2
|
+
import { useStableId as B } from "./index199.js";
|
|
3
|
+
import { getA11yNameAttributes as K } from "./index78.js";
|
|
4
|
+
import "./index72.js";
|
|
5
|
+
import { mergeIds as L } from "./index200.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
function h() {
|
|
8
|
+
return h = Object.assign ? Object.assign.bind() : function(u) {
|
|
9
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10
|
+
var r = arguments[i];
|
|
11
|
+
for (var e in r) ({}).hasOwnProperty.call(r, e) && (u[e] = r[e]);
|
|
18
12
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return u;
|
|
14
|
+
}, h.apply(null, arguments);
|
|
15
|
+
}
|
|
16
|
+
const J = ({
|
|
17
|
+
className: u = "",
|
|
18
|
+
automationId: i = "",
|
|
19
|
+
defaultChecked: r = !1,
|
|
20
|
+
checked: e,
|
|
21
|
+
disabled: n = !1,
|
|
22
|
+
onChange: x,
|
|
23
|
+
checkMarkType: c = "",
|
|
24
|
+
label: l = "",
|
|
25
|
+
disabledLabel: g = "",
|
|
26
|
+
containerAutomationId: E = "",
|
|
27
|
+
ariaLabel: y,
|
|
28
|
+
ariaLabelledBy: C,
|
|
29
|
+
ariaDescribedBy: N,
|
|
30
|
+
tabIndex: k,
|
|
31
|
+
ariaHidden: I = !1
|
|
32
|
+
}) => {
|
|
33
|
+
const o = e !== void 0, [t, m] = _(o ? e : r);
|
|
34
|
+
j(() => {
|
|
35
|
+
m(o ? e : r);
|
|
36
|
+
}, [e, r]);
|
|
37
|
+
const w = (a) => {
|
|
38
|
+
n || (o || m((b) => !b), x?.(o ? !e : !t, a));
|
|
39
|
+
}, A = (a) => {
|
|
40
|
+
if (!n && (a.key === "Enter" || a.key === " ")) {
|
|
41
|
+
a.preventDefault(), a.stopPropagation();
|
|
42
|
+
const b = o ? !e : !t;
|
|
43
|
+
o || m(b);
|
|
44
|
+
const d = a.currentTarget.closest("label")?.querySelector("input");
|
|
45
|
+
d && x?.(b, {
|
|
46
|
+
target: d,
|
|
47
|
+
currentTarget: d
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, $ = () => n ? t && c === "tick" ? "disabled-tick" : t && c === "minus-checkbox" ? "disabled-minus-checkbox" : t && !c ? "disabled-tick" : "disabled-default" : c === "minus-checkbox" && t ? "minus-checkbox" : t ? "checked" : "unchecked", D = () => n ? "checkbox-label-disabled" : "checkbox-label", p = () => n && g ? g : l, f = B(void 0, "checkbox-input"), v = l ? `${f}-label` : void 0, O = K({
|
|
51
|
+
ariaLabelledBy: L(v, C),
|
|
52
|
+
ariaLabel: y,
|
|
53
|
+
ariaDescribedBy: N
|
|
54
|
+
}), S = () => c === "minus-checkbox" && t ? "mixed" : t ? "true" : "false";
|
|
55
|
+
return /* @__PURE__ */ s.createElement("div", {
|
|
56
|
+
className: "se-design-checkbox-ctn",
|
|
57
|
+
"aria-hidden": I ? "true" : void 0
|
|
58
|
+
}, /* @__PURE__ */ s.createElement("label", h({
|
|
59
|
+
role: "checkbox",
|
|
60
|
+
htmlFor: f,
|
|
61
|
+
className: `se-design-checkbox ${u} ${$()}`,
|
|
62
|
+
"data-automation-id": E || "checkbox-container",
|
|
63
|
+
tabIndex: k !== void 0 ? k : n ? -1 : 0,
|
|
64
|
+
"aria-checked": S(),
|
|
65
|
+
"aria-disabled": n ? "true" : "false"
|
|
66
|
+
}, O, {
|
|
67
|
+
onKeyDown: A
|
|
68
|
+
}), /* @__PURE__ */ s.createElement("input", {
|
|
69
|
+
id: f,
|
|
70
|
+
type: "checkbox",
|
|
71
|
+
checked: t,
|
|
72
|
+
onChange: w,
|
|
73
|
+
disabled: n,
|
|
74
|
+
tabIndex: -1,
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}), /* @__PURE__ */ s.createElement("span", {
|
|
77
|
+
className: "checkbox-item",
|
|
78
|
+
"data-automation-id": i
|
|
79
|
+
}), p()?.length > 0 && /* @__PURE__ */ s.createElement("span", {
|
|
80
|
+
id: v,
|
|
81
|
+
className: D(),
|
|
82
|
+
"data-automation-id": i || (l ? `checkbox-label-${l}` : "checkbox-label")
|
|
83
|
+
}, p())));
|
|
22
84
|
};
|
|
23
85
|
export {
|
|
24
|
-
|
|
86
|
+
J as Checkbox
|
|
25
87
|
};
|
|
26
88
|
//# sourceMappingURL=index23.js.map
|
package/dist/index23.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index23.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index23.js","sources":["../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect } from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport { mergeIds } from '../../utils/mergeIds';\nimport './style.scss';\n\nexport interface CheckboxProps {\n className?: string;\n automationId?: string;\n defaultChecked?: boolean;\n /**\n * Controlled checked value. When provided, the checkbox is controlled by the parent\n * and its visual state always reflects this prop. Use `onChange` to update the parent state.\n */\n checked?: boolean;\n onChange?: (checked: boolean, e: React.ChangeEvent<HTMLInputElement>) => void;\n disabled?: boolean;\n checkMarkType?: 'tick' | 'minus-checkbox' | '';\n label?: string;\n disabledLabel?: string;\n containerAutomationId?: string;\n /**\n * Explicit accessible name for the checkbox.\n * Used as fallback when ariaLabelledBy is not provided and no internal label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this checkbox (for screen reader association).\n * Typically used when checkbox is part of a larger labelled context.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this checkbox (provides additional context).\n * Often used for help text or instructions.\n */\n ariaDescribedBy?: string;\n /**\n * Override the default tabIndex. Pass -1 when the checkbox is used as a\n * visual-only indicator inside a composite widget (e.g. listbox option).\n */\n tabIndex?: number;\n /**\n * When true, sets aria-hidden=\"true\" on the checkbox container so the\n * checkbox role and state are hidden from assistive technology. Use when\n * the checkbox is purely visual (e.g. inside a role=\"option\" that already\n * conveys selection state via aria-selected).\n */\n ariaHidden?: boolean;\n}\n\nexport const Checkbox: FC<CheckboxProps> = ({\n className = '',\n automationId = '',\n defaultChecked = false,\n checked,\n disabled = false,\n onChange,\n checkMarkType = '',\n label = '',\n disabledLabel = '',\n containerAutomationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n tabIndex: tabIndexProp,\n ariaHidden = false\n}) => {\n const isControlled = checked !== undefined;\n const [isChecked, setIsChecked] = useState(isControlled ? checked : defaultChecked);\n\n useEffect(() => {\n if (isControlled) {\n setIsChecked(checked!);\n } else {\n setIsChecked(defaultChecked);\n }\n }, [checked, defaultChecked]);\n\n const handleClick = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n if (!isControlled) {\n setIsChecked((prev) => !prev);\n }\n onChange?.(isControlled ? !checked : !isChecked, e);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLLabelElement | HTMLSpanElement>) => {\n if (disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const newChecked = isControlled ? !checked : !isChecked;\n if (!isControlled) {\n setIsChecked(newChecked);\n }\n\n // Create a proper synthetic event for the onChange callback\n const inputElement = e.currentTarget.closest('label')?.querySelector('input');\n if (inputElement) {\n const syntheticEvent = {\n target: inputElement,\n currentTarget: inputElement\n } as React.ChangeEvent<HTMLInputElement>;\n onChange?.(newChecked, syntheticEvent);\n }\n }\n };\n\n const getCheckBoxClassName = () => {\n // Handle disabled states with proper checked status\n if (disabled) {\n if (isChecked && checkMarkType === 'tick') return 'disabled-tick';\n if (isChecked && checkMarkType === 'minus-checkbox') return 'disabled-minus-checkbox';\n if (isChecked && !checkMarkType) return 'disabled-tick'; // Default to tick for checked disabled\n return 'disabled-default'; // Unchecked disabled\n }\n\n // Handle enabled states\n if (checkMarkType === 'minus-checkbox' && isChecked) return 'minus-checkbox';\n return isChecked ? 'checked' : 'unchecked';\n };\n\n const getLabelClassName = () => {\n return disabled ? 'checkbox-label-disabled' : 'checkbox-label';\n };\n\n const getLabelText = () => {\n if (disabled && disabledLabel) {\n return disabledLabel;\n }\n return label;\n };\n\n // Generate stable IDs (persists across renders)\n const inputId = useStableId(undefined, 'checkbox-input');\n const labelId = label ? `${inputId}-label` : undefined;\n\n const a11yNameAttributes = getA11yNameAttributes({\n ariaLabelledBy: mergeIds(labelId, ariaLabelledBy),\n ariaLabel,\n ariaDescribedBy\n });\n\n // Determine aria-checked value: \"mixed\" for indeterminate, \"true\" for checked, \"false\" for unchecked\n const getAriaChecked = () => {\n if (checkMarkType === 'minus-checkbox' && isChecked) {\n return 'mixed'; // Indeterminate/half-checked state\n }\n return isChecked ? 'true' : 'false';\n };\n\n return (\n <div className=\"se-design-checkbox-ctn\" aria-hidden={ariaHidden ? 'true' : undefined}>\n <label\n role=\"checkbox\"\n htmlFor={inputId}\n className={`se-design-checkbox ${className} ${getCheckBoxClassName()}`}\n data-automation-id={containerAutomationId || 'checkbox-container'}\n tabIndex={tabIndexProp !== undefined ? tabIndexProp : disabled ? -1 : 0}\n aria-checked={getAriaChecked()}\n aria-disabled={disabled ? 'true' : 'false'}\n {...a11yNameAttributes}\n onKeyDown={handleKeyDown}\n >\n <input\n id={inputId}\n type=\"checkbox\"\n checked={isChecked}\n onChange={handleClick}\n disabled={disabled}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <span className=\"checkbox-item\" data-automation-id={automationId}></span>\n {getLabelText()?.length > 0 && (\n <span\n id={labelId}\n className={getLabelClassName()}\n data-automation-id={automationId || (label ? `checkbox-label-${label}` : 'checkbox-label')}\n >\n {getLabelText()}\n </span>\n )}\n </label>\n </div>\n );\n};\n"],"names":["Checkbox","className","automationId","defaultChecked","checked","disabled","onChange","checkMarkType","label","disabledLabel","containerAutomationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","tabIndex","tabIndexProp","ariaHidden","isControlled","undefined","isChecked","setIsChecked","useState","useEffect","handleClick","e","prev","handleKeyDown","key","preventDefault","stopPropagation","newChecked","inputElement","currentTarget","closest","querySelector","target","getCheckBoxClassName","getLabelClassName","getLabelText","inputId","useStableId","labelId","a11yNameAttributes","getA11yNameAttributes","mergeIds","getAriaChecked","React","createElement","_extends","role","htmlFor","onKeyDown","id","type","length"],"mappings":";;;;;;;;;;;;;;;AAkDO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,gBAAAA,IAAiB;AAAA,EACjBC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,OAAAA,IAAQ;AAAA,EACRC,eAAAA,IAAgB;AAAA,EAChBC,uBAAAA,IAAwB;AAAA,EACxBC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,UAAUC;AAAAA,EACVC,YAAAA,IAAa;AACf,MAAM;AACJ,QAAMC,IAAeb,MAAYc,QAC3B,CAACC,GAAWC,CAAY,IAAIC,EAASJ,IAAeb,IAAUD,CAAc;AAElFmB,EAAAA,EAAU,MAAM;AACd,IACEF,EADEH,IACWb,IAEAD,CAFQ;AAAA,EAIzB,GAAG,CAACC,GAASD,CAAc,CAAC;AAE5B,QAAMoB,IAAcA,CAACC,MAA2C;AAC9D,IAAInB,MACCY,KACHG,EAAcK,CAAAA,MAAS,CAACA,CAAI,GAE9BnB,IAAWW,IAAe,CAACb,IAAU,CAACe,GAAWK,CAAC;AAAA,EACpD,GAEME,IAAgBA,CAACF,MAA+D;AACpF,QAAInB,CAAAA,MACAmB,EAAEG,QAAQ,WAAWH,EAAEG,QAAQ,MAAK;AACtCH,MAAAA,EAAEI,eAAAA,GACFJ,EAAEK,gBAAAA;AACF,YAAMC,IAAab,IAAe,CAACb,IAAU,CAACe;AAC9C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BoB,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IACEK,IAAIb;AAAAA,IACJc,MAAK;AAAA,IACLjD,SAASe;AAAAA,IACTb,UAAUiB;AAAAA,IACVlB,UAAAA;AAAAA,IACAS,UAAU;AAAA,IACV,eAAY;AAAA,EAAA,CACb,GACDgC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAM9C,WAAU;AAAA,IAAgB,sBAAoBC;AAAAA,EAAAA,CAAoB,GACvEoC,EAAAA,GAAgBgB,SAAS,KACxBR,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IACEK,IAAIX;AAAAA,IACJxC,WAAWoC,EAAAA;AAAAA,IACX,sBAAoBnC,MAAiBM,IAAQ,kBAAkBA,CAAK,KAAK;AAAA,EAAA,GAExE8B,EAAAA,CACG,CAEH,CACJ;AAET;"}
|
package/dist/index235.js
CHANGED
|
@@ -1,13 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useState as W, useMemo as F, useEffect as N, useCallback as $ } from "react";
|
|
2
|
+
import { useRovingFocus as C } from "./index70.js";
|
|
3
|
+
const z = (e, o, a, g, m) => {
|
|
4
|
+
const u = e.toLocaleDateString("en-US", {
|
|
5
|
+
weekday: "long",
|
|
6
|
+
month: "long",
|
|
7
|
+
day: "numeric",
|
|
8
|
+
year: "numeric"
|
|
9
|
+
});
|
|
10
|
+
return m ? u : g ? `${u}, start and end of range` : o ? `${u}, start of range` : a ? `${u}, end of range` : u;
|
|
11
|
+
}, y = (e) => {
|
|
12
|
+
const o = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), g = String(e.getDate()).padStart(2, "0");
|
|
13
|
+
return `date-${o}-${a}-${g}`;
|
|
14
|
+
}, k = (e, o) => new Date(e, o + 1, 0).getDate(), L = (e) => {
|
|
15
|
+
const o = e.getFullYear(), a = e.getMonth();
|
|
16
|
+
return Array.from({
|
|
17
|
+
length: k(o, a)
|
|
18
|
+
}, (g, m) => y(new Date(o, a, m + 1)));
|
|
19
|
+
}, x = (e, o, a) => {
|
|
20
|
+
const g = e.getFullYear(), m = e.getMonth(), u = (r) => r.getFullYear() === g && r.getMonth() === m;
|
|
21
|
+
if (a.startDate && u(a.startDate)) {
|
|
22
|
+
const r = new Date(a.startDate);
|
|
23
|
+
r.setHours(0, 0, 0, 0);
|
|
24
|
+
const l = y(r);
|
|
25
|
+
if (o.includes(l)) return l;
|
|
7
26
|
}
|
|
8
|
-
|
|
27
|
+
if (a.endDate && u(a.endDate)) {
|
|
28
|
+
const r = new Date(a.endDate);
|
|
29
|
+
r.setHours(0, 0, 0, 0);
|
|
30
|
+
const l = y(r);
|
|
31
|
+
if (o.includes(l)) return l;
|
|
32
|
+
}
|
|
33
|
+
const P = /* @__PURE__ */ new Date();
|
|
34
|
+
if (u(P)) {
|
|
35
|
+
const r = y(P);
|
|
36
|
+
if (o.includes(r)) return r;
|
|
37
|
+
}
|
|
38
|
+
return o[0] || "";
|
|
39
|
+
};
|
|
40
|
+
function B({
|
|
41
|
+
leftMonth: e,
|
|
42
|
+
rightMonth: o,
|
|
43
|
+
showSingleMonth: a,
|
|
44
|
+
selectedRange: g,
|
|
45
|
+
onMonthChange: m
|
|
46
|
+
}) {
|
|
47
|
+
const [u, P] = W(null), r = F(() => L(e), [e]), l = F(() => L(o), [o]), E = F(() => x(e, r, g), [e, r, g]), H = F(() => x(o, l, g), [o, l, g]), {
|
|
48
|
+
getRovingItemProps: Y,
|
|
49
|
+
focusItem: I,
|
|
50
|
+
getContainerProps: U
|
|
51
|
+
} = C({
|
|
52
|
+
itemIds: r,
|
|
53
|
+
defaultFocusedId: E,
|
|
54
|
+
orientation: "grid",
|
|
55
|
+
cols: 7,
|
|
56
|
+
loop: !1,
|
|
57
|
+
role: "grid"
|
|
58
|
+
}), {
|
|
59
|
+
getRovingItemProps: M,
|
|
60
|
+
focusItem: h,
|
|
61
|
+
getContainerProps: G
|
|
62
|
+
} = C({
|
|
63
|
+
itemIds: l,
|
|
64
|
+
defaultFocusedId: H,
|
|
65
|
+
orientation: "grid",
|
|
66
|
+
cols: 7,
|
|
67
|
+
loop: !1,
|
|
68
|
+
role: "grid"
|
|
69
|
+
});
|
|
70
|
+
N(() => {
|
|
71
|
+
if (!u) return;
|
|
72
|
+
const f = y(u);
|
|
73
|
+
r.includes(f) ? (I(f), P(null)) : l.includes(f) && (h(f), P(null));
|
|
74
|
+
}, [u, r, l, I, h]);
|
|
75
|
+
const b = $((f, K) => {
|
|
76
|
+
const v = a || K === "left";
|
|
77
|
+
m(new Date(f.getFullYear(), f.getMonth(), 1), v), P(new Date(f));
|
|
78
|
+
}, [a, m]);
|
|
79
|
+
return {
|
|
80
|
+
getGridCellProps: $(({
|
|
81
|
+
isLeftCalendar: f,
|
|
82
|
+
isDateDisabled: K,
|
|
83
|
+
handleDateClick: v
|
|
84
|
+
}) => {
|
|
85
|
+
const A = f ? "left" : "right", S = f ? I : h, O = f ? Y : M, R = (t, d) => {
|
|
86
|
+
const s = d.getFullYear(), n = d.getMonth(), p = d.getDate(), w = (c) => {
|
|
87
|
+
if (c.getFullYear() !== s || c.getMonth() !== n) {
|
|
88
|
+
b(c, A);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
S(y(c));
|
|
92
|
+
};
|
|
93
|
+
switch (t.key) {
|
|
94
|
+
case "ArrowLeft":
|
|
95
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(s, n, p - 1));
|
|
96
|
+
break;
|
|
97
|
+
case "ArrowRight":
|
|
98
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(s, n, p + 1));
|
|
99
|
+
break;
|
|
100
|
+
case "ArrowUp":
|
|
101
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(s, n, p - 7));
|
|
102
|
+
break;
|
|
103
|
+
case "ArrowDown":
|
|
104
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(s, n, p + 7));
|
|
105
|
+
break;
|
|
106
|
+
case "Home": {
|
|
107
|
+
t.preventDefault(), t.stopPropagation();
|
|
108
|
+
const c = d.getDay(), i = new Date(s, n, p - c), D = i.getMonth() !== n ? new Date(s, n, 1) : i;
|
|
109
|
+
S(y(D));
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
case "End": {
|
|
113
|
+
t.preventDefault(), t.stopPropagation();
|
|
114
|
+
const c = d.getDay(), i = new Date(s, n, p + (6 - c)), D = k(s, n), T = i.getMonth() !== n ? new Date(s, n, D) : i;
|
|
115
|
+
S(y(T));
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case "PageUp": {
|
|
119
|
+
t.preventDefault(), t.stopPropagation();
|
|
120
|
+
const c = t.shiftKey ? s - 1 : s, i = t.shiftKey ? n : n - 1, D = Math.min(p, k(c, i));
|
|
121
|
+
b(new Date(c, i, D), A);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case "PageDown": {
|
|
125
|
+
t.preventDefault(), t.stopPropagation();
|
|
126
|
+
const c = t.shiftKey ? s + 1 : s, i = t.shiftKey ? n : n + 1, D = Math.min(p, k(c, i));
|
|
127
|
+
b(new Date(c, i, D), A);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "Enter":
|
|
131
|
+
case " ":
|
|
132
|
+
t.preventDefault(), K(d) || v(d);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return ({
|
|
137
|
+
cellId: t,
|
|
138
|
+
cellDate: d,
|
|
139
|
+
disabled: s,
|
|
140
|
+
ariaLabel: n,
|
|
141
|
+
ariaSelected: p,
|
|
142
|
+
ariaCurrent: w,
|
|
143
|
+
ariaDisabled: c
|
|
144
|
+
}) => {
|
|
145
|
+
const i = O(t);
|
|
146
|
+
return {
|
|
147
|
+
id: t,
|
|
148
|
+
role: "gridcell",
|
|
149
|
+
ref: i.ref,
|
|
150
|
+
tabIndex: i.tabIndex,
|
|
151
|
+
onFocus: i.onFocus,
|
|
152
|
+
"aria-label": n,
|
|
153
|
+
"aria-selected": p,
|
|
154
|
+
"aria-current": w,
|
|
155
|
+
"aria-disabled": c,
|
|
156
|
+
onKeyDown: (D) => R(D, d),
|
|
157
|
+
onClick: () => {
|
|
158
|
+
s || v(d);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
}, [b, I, h, Y, M]),
|
|
163
|
+
getLeftRovingItemProps: Y,
|
|
164
|
+
getRightRovingItemProps: M,
|
|
165
|
+
getLeftContainerProps: U,
|
|
166
|
+
getRightContainerProps: G,
|
|
167
|
+
focusLeftItem: I,
|
|
168
|
+
focusRightItem: h
|
|
169
|
+
};
|
|
9
170
|
}
|
|
10
171
|
export {
|
|
11
|
-
|
|
172
|
+
y as formatDateId,
|
|
173
|
+
z as getCellAriaLabel,
|
|
174
|
+
B as useDatePickerA11y
|
|
12
175
|
};
|
|
13
176
|
//# sourceMappingURL=index235.js.map
|
package/dist/index235.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index235.js","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.indexOf(n) >= 0) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,GAAGC,GAAG;AAC3C,MAAYD,KAAR,KAAW,QAAO;AACtB,MAAIE,IAAI,CAAA;AACR,WAASC,KAAKH,EAAG,KAAI,CAAA,EAAG,eAAe,KAAKA,GAAGG,CAAC,GAAG;AACjD,QAAIF,EAAE,QAAQE,CAAC,KAAK,EAAG;AACvB,IAAAD,EAAEC,CAAC,IAAIH,EAAEG,CAAC;AAAA,EACX;AACD,SAAOD;AACT;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index235.js","sources":["../src/components/DatePicker/useDatePickerA11y.ts"],"sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react';\n\nimport { useRovingFocus, RovingItemProps, RovingContainerProps, AccessibleNameInput } from '../../utils/a11y/useRovingFocus';\nimport type { DateRange } from './index';\n\nexport const getCellAriaLabel = (\n date: Date,\n isStart: boolean,\n isEnd: boolean,\n isSameStartEnd: boolean,\n singleDateSelection: boolean\n): string => {\n const base = date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n });\n if (singleDateSelection) return base;\n if (isSameStartEnd) return `${base}, start and end of range`;\n if (isStart) return `${base}, start of range`;\n if (isEnd) return `${base}, end of range`;\n return base;\n};\n\nexport const formatDateId = (d: Date) => {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const dd = String(d.getDate()).padStart(2, '0');\n return `date-${y}-${m}-${dd}`;\n};\n\nconst getDaysInMonth = (year: number, month: number) => new Date(year, month + 1, 0).getDate();\n\nconst getPanelItemIds = (panelDate: Date): string[] => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n return Array.from({ length: getDaysInMonth(year, month) }, (_, i) =>\n formatDateId(new Date(year, month, i + 1))\n );\n};\n\nconst getPanelDefaultFocusId = (panelDate: Date, itemIds: string[], selectedRange: DateRange): string => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n const isInPanel = (d: Date) => d.getFullYear() === year && d.getMonth() === month;\n\n // Prefer startDate if it falls in this panel\n if (selectedRange.startDate && isInPanel(selectedRange.startDate)) {\n const d = new Date(selectedRange.startDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n // Fall back to endDate if it falls in this panel (e.g. right panel when start is in left panel)\n if (selectedRange.endDate && isInPanel(selectedRange.endDate)) {\n const d = new Date(selectedRange.endDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n const today = new Date();\n if (isInPanel(today)) {\n const id = formatDateId(today);\n if (itemIds.includes(id)) return id;\n }\n return itemIds[0] || '';\n};\n\ninterface UseDatePickerA11yOptions {\n leftMonth: Date;\n rightMonth: Date;\n showSingleMonth: boolean;\n selectedRange: DateRange;\n onMonthChange: (date: Date, isLeft: boolean) => void;\n}\n\ninterface CellKeyDownOptions {\n isLeftCalendar: boolean;\n isDateDisabled: (date: Date) => boolean;\n handleDateClick: (date: Date) => void;\n}\n\ninterface GridCellItemInput {\n cellId: string;\n cellDate: Date;\n disabled: boolean;\n ariaLabel: string;\n ariaSelected: boolean;\n ariaCurrent: 'date' | undefined;\n ariaDisabled: true | undefined;\n}\n\nexport interface GridCellElementProps {\n id: string;\n role: 'gridcell';\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n 'aria-label': string;\n 'aria-selected': boolean;\n 'aria-current': 'date' | undefined;\n 'aria-disabled': true | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onClick: () => void;\n}\n\ninterface UseDatePickerA11yReturn {\n getGridCellProps: (options: CellKeyDownOptions) => (item: GridCellItemInput) => GridCellElementProps;\n getLeftRovingItemProps: (id: string) => RovingItemProps;\n getRightRovingItemProps: (id: string) => RovingItemProps;\n getLeftContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n getRightContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n focusLeftItem: (id: string) => void;\n focusRightItem: (id: string) => void;\n}\n\nexport function useDatePickerA11y({\n leftMonth,\n rightMonth,\n showSingleMonth,\n selectedRange,\n onMonthChange\n}: UseDatePickerA11yOptions): UseDatePickerA11yReturn {\n const [keyboardFocusDate, setKeyboardFocusDate] = useState<Date | null>(null);\n\n const leftItemIds = useMemo(() => getPanelItemIds(leftMonth), [leftMonth]);\n const rightItemIds = useMemo(() => getPanelItemIds(rightMonth), [rightMonth]);\n\n const leftDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(leftMonth, leftItemIds, selectedRange),\n [leftMonth, leftItemIds, selectedRange]\n );\n const rightDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(rightMonth, rightItemIds, selectedRange),\n [rightMonth, rightItemIds, selectedRange]\n );\n\n const { getRovingItemProps: getLeftRovingItemProps, focusItem: focusLeftItem, getContainerProps: getLeftContainerProps } = useRovingFocus({\n itemIds: leftItemIds,\n defaultFocusedId: leftDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n const { getRovingItemProps: getRightRovingItemProps, focusItem: focusRightItem, getContainerProps: getRightContainerProps } = useRovingFocus({\n itemIds: rightItemIds,\n defaultFocusedId: rightDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n // After keyboard navigation shifts a panel to a new month, focus the target cell via roving focus refs\n useEffect(() => {\n if (!keyboardFocusDate) return;\n const id = formatDateId(keyboardFocusDate);\n if (leftItemIds.includes(id)) {\n focusLeftItem(id);\n setKeyboardFocusDate(null);\n } else if (rightItemIds.includes(id)) {\n focusRightItem(id);\n setKeyboardFocusDate(null);\n }\n }, [keyboardFocusDate, leftItemIds, rightItemIds, focusLeftItem, focusRightItem]);\n\n // Navigate the keyboard focus to a date that may be in a different month.\n // Each panel advances completely independently — never touches the other panel.\n const handleKeyboardNavigate = useCallback(\n (targetDate: Date, sourcePanel: 'left' | 'right') => {\n const isLeft = showSingleMonth || sourcePanel === 'left';\n onMonthChange(new Date(targetDate.getFullYear(), targetDate.getMonth(), 1), isLeft);\n setKeyboardFocusDate(new Date(targetDate));\n },\n [showSingleMonth, onMonthChange]\n );\n\n const getGridCellProps = useCallback(\n ({ isLeftCalendar, isDateDisabled, handleDateClick }: CellKeyDownOptions) => {\n const panel: 'left' | 'right' = isLeftCalendar ? 'left' : 'right';\n const focusPanelItem = isLeftCalendar ? focusLeftItem : focusRightItem;\n const getRovingItemProps = isLeftCalendar ? getLeftRovingItemProps : getRightRovingItemProps;\n\n const handleKeyDown = (e: React.KeyboardEvent, cellDate: Date) => {\n const cellYear = cellDate.getFullYear();\n const cellMonth = cellDate.getMonth();\n const cellDay = cellDate.getDate();\n\n const navigateTo = (targetDate: Date) => {\n if (targetDate.getFullYear() !== cellYear || targetDate.getMonth() !== cellMonth) {\n handleKeyboardNavigate(targetDate, panel);\n return;\n }\n focusPanelItem(formatDateId(targetDate));\n };\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 1));\n break;\n case 'ArrowRight':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 1));\n break;\n case 'ArrowUp':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 7));\n break;\n case 'ArrowDown':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 7));\n break;\n case 'Home': {\n // First day of the current week row (Sunday), clamped to month start\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const homeDate = new Date(cellYear, cellMonth, cellDay - dayOfWeek);\n const clamped = homeDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, 1) : homeDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'End': {\n // Last day of the current week row (Saturday), clamped to month end\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const endDate = new Date(cellYear, cellMonth, cellDay + (6 - dayOfWeek));\n const daysInThisMonth = getDaysInMonth(cellYear, cellMonth);\n const clamped =\n endDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, daysInThisMonth) : endDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'PageUp': {\n // Shift+PageUp = previous year, PageUp = previous month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear - 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth - 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'PageDown': {\n // Shift+PageDown = next year, PageDown = next month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear + 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth + 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'Enter':\n case ' ':\n e.preventDefault();\n if (!isDateDisabled(cellDate)) {\n handleDateClick(cellDate);\n }\n break;\n }\n };\n\n return ({ cellId, cellDate, disabled, ariaLabel, ariaSelected, ariaCurrent, ariaDisabled }: GridCellItemInput): GridCellElementProps => {\n const rovingProps = getRovingItemProps(cellId);\n return {\n id: cellId,\n role: 'gridcell',\n ref: rovingProps.ref,\n tabIndex: rovingProps.tabIndex,\n onFocus: rovingProps.onFocus,\n 'aria-label': ariaLabel,\n 'aria-selected': ariaSelected,\n 'aria-current': ariaCurrent,\n 'aria-disabled': ariaDisabled,\n onKeyDown: (e: React.KeyboardEvent) => handleKeyDown(e, cellDate),\n onClick: () => { if (!disabled) handleDateClick(cellDate); }\n };\n };\n },\n [handleKeyboardNavigate, focusLeftItem, focusRightItem, getLeftRovingItemProps, getRightRovingItemProps]\n );\n\n return {\n getGridCellProps,\n getLeftRovingItemProps,\n getRightRovingItemProps,\n getLeftContainerProps,\n getRightContainerProps,\n focusLeftItem,\n focusRightItem\n };\n}\n"],"names":["useState","useMemo","useEffect","useCallback","useRovingFocus","getCellAriaLabel","date","isStart","isEnd","isSameStartEnd","singleDateSelection","base","toLocaleDateString","weekday","month","day","year","formatDateId","d","y","getFullYear","m","String","getMonth","padStart","dd","getDate","getDaysInMonth","Date","getPanelItemIds","panelDate","Array","from","length","_","i","getPanelDefaultFocusId","itemIds","selectedRange","isInPanel","startDate","setHours","id","includes","endDate","today","useDatePickerA11y","leftMonth","rightMonth","showSingleMonth","onMonthChange","keyboardFocusDate","setKeyboardFocusDate","leftItemIds","rightItemIds","leftDefaultFocusId","rightDefaultFocusId","getRovingItemProps","getLeftRovingItemProps","focusItem","focusLeftItem","getContainerProps","getLeftContainerProps","defaultFocusedId","orientation","cols","loop","role","getRightRovingItemProps","focusRightItem","getRightContainerProps","handleKeyboardNavigate","targetDate","sourcePanel","isLeft","getGridCellProps","isLeftCalendar","isDateDisabled","handleDateClick","panel","focusPanelItem","handleKeyDown","e","cellDate","cellYear","cellMonth","cellDay","navigateTo","key","preventDefault","stopPropagation","dayOfWeek","getDay","homeDate","clamped","daysInThisMonth","tYear","shiftKey","tMonth","tDay","Math","min","cellId","disabled","ariaLabel","ariaSelected","ariaCurrent","ariaDisabled","rovingProps","ref","tabIndex","onFocus","onKeyDown","onClick"],"mappings":"AAKO,SAAA,YAAAA,GAAA,WAAAC,GAAA,aAAAC,GAAA,eAAAC,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,MAAMC,IAAmBA,CAC9BC,GACAC,GACAC,GACAC,GACAC,MACW;AACX,QAAMC,IAAOL,EAAKM,mBAAmB,SAAS;AAAA,IAC5CC,SAAS;AAAA,IACTC,OAAO;AAAA,IACPC,KAAK;AAAA,IACLC,MAAM;AAAA,EAAA,CACP;AACD,SAAIN,IAA4BC,IAC5BF,IAAuB,GAAGE,CAAI,6BAC9BJ,IAAgB,GAAGI,CAAI,qBACvBH,IAAc,GAAGG,CAAI,mBAClBA;AACT,GAEaM,IAAeA,CAACC,MAAY;AACvC,QAAMC,IAAID,EAAEE,YAAAA,GACNC,IAAIC,OAAOJ,EAAEK,SAAAA,IAAa,CAAC,EAAEC,SAAS,GAAG,GAAG,GAC5CC,IAAKH,OAAOJ,EAAEQ,QAAAA,CAAS,EAAEF,SAAS,GAAG,GAAG;AAC9C,SAAO,QAAQL,CAAC,IAAIE,CAAC,IAAII,CAAE;AAC7B,GAEME,IAAiBA,CAACX,GAAcF,M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eS,GAAgBX,GAAwBU,CAAuB,CACzG;AAAA,IAIEV,wBAAAA;AAAAA,IACAU,yBAAAA;AAAAA,IACAN,uBAAAA;AAAAA,IACAQ,wBAAAA;AAAAA,IACAV,eAAAA;AAAAA,IACAS,gBAAAA;AAAAA,EAAAA;AAEJ;"}
|
package/dist/index236.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
function e
|
|
2
|
-
return
|
|
3
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
4
|
-
var a = arguments[n];
|
|
5
|
-
for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
}, e.apply(null, arguments);
|
|
1
|
+
function n(e) {
|
|
2
|
+
return new Promise((t) => setTimeout(t, e));
|
|
9
3
|
}
|
|
10
4
|
export {
|
|
11
|
-
|
|
5
|
+
n as delay
|
|
12
6
|
};
|
|
13
7
|
//# sourceMappingURL=index236.js.map
|
package/dist/index236.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index236.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index236.js","sources":["../src/utils/delay.ts"],"sourcesContent":["/**\n * Delays execution by the specified number of milliseconds\n * @param ms - The number of milliseconds to delay\n * @returns A Promise that resolves after the specified delay\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n} "],"names":["delay","ms","Promise","resolve","setTimeout"],"mappings":"AAKO,SAASA,EAAMC,GAA2B;AAC7C,SAAO,IAAIC,QAAQC,CAAAA,MAAWC,WAAWD,GAASF,CAAE,CAAC;AACzD;"}
|