se-design 1.0.90-dev.0 → 1.0.91-r-dev.1
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/AnchoredOverlay/index.d.ts +41 -0
- package/dist/components/NLSearch/ClearAiFiltersBar.d.ts +21 -0
- package/dist/components/NLSearch/NLDynamicChip.d.ts +26 -0
- package/dist/components/NLSearch/NLSearchInput.d.ts +46 -0
- package/dist/components/NLSearch/index.d.ts +6 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/index.js +161 -152
- package/dist/index.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 +1 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- 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 +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.js +1 -1
- 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 +1 -1
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +2 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- 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 +1 -1
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +1 -1
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +3 -3
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- 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 +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +3 -3
- package/dist/index130.js +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +2 -2
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +2 -2
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +2 -2
- 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/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 +2 -2
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +1 -1
- 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/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +2 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +2 -2
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +2 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +1 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +2 -2
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +3 -3
- package/dist/index160.js +2 -2
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +2 -2
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +2 -2
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +2 -2
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +2 -2
- 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/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 +1 -1
- 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 +1 -1
- 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 +3 -3
- package/dist/index180.js +1 -1
- 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 +1 -1
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +1 -1
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +2 -2
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +1 -1
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +1 -1
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +1 -1
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +5 -5
- package/dist/index190.js +2 -2
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +2 -2
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +1 -1
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +1 -1
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +1 -1
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +2 -2
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +1 -1
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +1 -1
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +1 -1
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +1 -1
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +96 -18
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +1 -1
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +1 -1
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +2 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +2 -149
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +2 -9
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -6
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -43
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -21
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +152 -0
- package/dist/index209.js.map +1 -0
- package/dist/index21.js +17 -32
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +12 -0
- package/dist/index210.js.map +1 -0
- package/dist/index211.js +9 -0
- package/dist/index211.js.map +1 -0
- package/dist/index212.js +46 -0
- package/dist/index212.js.map +1 -0
- package/dist/index213.js +24 -0
- package/dist/index213.js.map +1 -0
- package/dist/index22.js +33 -66
- package/dist/index22.js.map +1 -1
- package/dist/{index215.js → index220.js} +1 -1
- package/dist/{index215.js.map → index220.js.map} +1 -1
- package/dist/{index216.js → index221.js} +3 -3
- package/dist/{index216.js.map → index221.js.map} +1 -1
- package/dist/{index223.js → index228.js} +1 -1
- package/dist/{index223.js.map → index228.js.map} +1 -1
- package/dist/index23.js +62 -83
- package/dist/index23.js.map +1 -1
- package/dist/{index225.js → index230.js} +1 -1
- package/dist/{index225.js.map → index230.js.map} +1 -1
- package/dist/{index233.js → index238.js} +1 -1
- package/dist/{index233.js.map → index238.js.map} +1 -1
- package/dist/index24.js +85 -21
- package/dist/index24.js.map +1 -1
- package/dist/{index236.js → index241.js} +1 -1
- package/dist/{index236.js.map → index241.js.map} +1 -1
- package/dist/index25.js +19 -401
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +169 -9
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +3 -4
- package/dist/index251.js.map +1 -1
- package/dist/index253.js +19 -11
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +9 -5
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +9 -5
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +4 -37
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +170 -2
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -8
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +5 -326
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +400 -44
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +5 -49
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +38 -2
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +2 -76
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +7 -92
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +322 -47
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +49 -7
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -5
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +72 -48
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +93 -2
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +52 -2
- package/dist/index269.js.map +1 -1
- package/dist/index27.js +48 -23
- package/dist/index27.js.map +1 -1
- package/dist/index270.js +11 -0
- package/dist/index270.js.map +1 -0
- package/dist/index271.js +8 -0
- package/dist/index271.js.map +1 -0
- package/dist/index272.js +55 -0
- package/dist/index272.js.map +1 -0
- package/dist/index273.js +5 -0
- package/dist/index273.js.map +1 -0
- package/dist/index274.js +5 -0
- package/dist/index274.js.map +1 -0
- package/dist/index28.js +21 -108
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +107 -147
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +3 -3
- package/dist/index30.js +146 -132
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +136 -76
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +73 -94
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +96 -73
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +72 -38
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +40 -72
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +68 -94
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +98 -77
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +75 -311
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +313 -75
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +4 -4
- package/dist/index40.js +72 -79
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +82 -32
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +26 -43
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +49 -109
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +105 -50
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +53 -142
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +137 -188
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +199 -36
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +40 -36
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +36 -149
- package/dist/index49.js.map +1 -1
- package/dist/index51.js +188 -451
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +38 -98
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +33 -40
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +151 -36
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +82 -88
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +452 -154
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +97 -148
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +43 -33
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +34 -82
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +125 -125
- package/dist/index60.js +87 -113
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +156 -71
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +144 -147
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +30 -315
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +83 -44
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +113 -138
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +77 -11
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +151 -54
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +312 -107
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +45 -17
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +10 -9
- package/dist/index70.js +142 -63
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +10 -25
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +51 -104
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +106 -55
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +17 -19
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +63 -168
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +27 -18
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +107 -10
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +62 -5
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +18 -59
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +170 -26
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +18 -11
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +14 -0
- package/dist/index82.js.map +1 -0
- package/dist/index83.js +5 -2
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +62 -2
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +27 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +11 -2
- package/dist/index86.js.map +1 -1
- package/dist/index88.js +2 -2
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +2 -2
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +4 -4
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +2 -2
- 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/index245.js +0 -173
- package/dist/index245.js.map +0 -1
- package/dist/index246.js +0 -7
- package/dist/index246.js.map +0 -1
- package/dist/index248.js +0 -22
- package/dist/index248.js.map +0 -1
- package/dist/index249.js +0 -13
- package/dist/index249.js.map +0 -1
- package/dist/index252.js +0 -173
- package/dist/index252.js.map +0 -1
- package/dist/index50.js +0 -89
- package/dist/index50.js.map +0 -1
- package/dist/index87.js +0 -5
- package/dist/index87.js.map +0 -1
package/dist/index69.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index69.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index69.js","sources":["../src/components/Link/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport './style.scss';\n\n/**\n * Allows native anchor attributes (aria-*, data-*, etc.) to be passed through,\n * but keeps our own href/onClick/aria-label/aria-labelledby/aria-describedby typing.\n */\ntype NativeAnchorProps = Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'href' | 'onClick' | 'target' | 'rel' | 'aria-label' | 'aria-labelledby' | 'aria-describedby'\n>;\n\nexport interface LinkProps extends NativeAnchorProps {\n /**\n * URL to navigate to (required for actual links)\n */\n href: string;\n /**\n * Link text content (string only). Ignored when children are provided.\n */\n label?: string;\n /**\n * Rich content to render inside the link. Takes precedence over label.\n */\n children?: React.ReactNode;\n /**\n * If true, automatically adds target=\"_blank\" and rel=\"noopener noreferrer\"\n * Also appends \" (opens in a new tab)\" to aria-label for screen readers\n */\n external?: boolean;\n /**\n * Accessible name for the link. Use when link text is generic or unclear.\n * Prefer ariaLabelledBy when a visible label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this link.\n * Preferred over ariaLabel when a visible label exists (keeps SR and visual text in sync).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this link.\n * Provides additional context announced after the accessible name.\n */\n ariaDescribedBy?: string;\n /**\n * Click handler (e.g., for analytics tracking)\n */\n onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n /**\n * Custom class name\n */\n className?: string;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n /**\n * Override target (if you need something other than \"_blank\" for external links).\n * Note: If external={true} and target is provided, the provided target will be used.\n */\n target?: string;\n /**\n * Override rel (if you need something other than \"noopener noreferrer\" for external links).\n * Note: If external={true} and rel is provided, the provided rel will be used.\n */\n rel?: string;\n}\n\nconst EXTERNAL_LINK_ARIA_SUFFIX = ' (opens in a new tab)';\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (\n {\n href,\n label,\n children,\n external = false,\n className = '',\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n onClick,\n target,\n rel,\n ...props\n },\n ref\n ) => {\n const resolvedLabel = children ? undefined : label;\n // Handle external link attributes\n // If external={true}, default to target=\"_blank\" and rel=\"noopener noreferrer\"\n // Explicit target/rel props can override these defaults\n const targetAttr = external ? (target ?? '_blank') : target;\n const relAttr = external ? (rel ?? 'noopener noreferrer') : rel;\n\n // Compute accessible name/description props with correct precedence\n // Precedence: ariaLabelledBy > ariaLabel > visible text content\n const accessibleNameProps = getA11yNameAttributes({\n // External link aria-label enhancement for screen readers:\n // When external={true}, always append \"(opens in a new tab)\"\n ariaLabel:\n external ? `${ariaLabel ?? resolvedLabel ?? ''}${EXTERNAL_LINK_ARIA_SUFFIX}` : ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n });\n\n const linkClassName = ['se-design-link', 'focus-outline', 'focus-visible:underline', className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <a\n ref={ref}\n href={href}\n target={targetAttr}\n rel={relAttr}\n className={linkClassName}\n data-automation-id={automationId}\n onClick={onClick}\n {...props}\n {...accessibleNameProps}\n >\n {children ?? label}\n </a>\n );\n }\n);\n\nLink.displayName = 'Link';\n"],"names":["EXTERNAL_LINK_ARIA_SUFFIX","Link","href","label","children","external","className","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","onClick","target","rel","props","ref","resolvedLabel","undefined","targetAttr","relAttr","accessibleNameProps","getA11yNameAttributes","linkClassName","filter","Boolean","join","React","createElement","_extends","displayName"],"mappings":";;;;;;;;;;;;;AAsEA,MAAMA,IAA4B,yBAErBC,sBACX,CACE;AAAA,EACEC,MAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAgBZ,IAAWa,SAAYd,GAIvCe,IAAab,IAAYO,KAAU,WAAYA,GAC/CO,IAAUd,IAAYQ,KAAO,wBAAyBA,GAItDO,IAAsBC,EAAsB;AAAA;AAAA;AAAA,IAGhDb,WACEH,IAAW,GAAGG,KAAaQ,KAAiB,EAAE,GAAGhB,CAAyB,KAAKQ;AAAAA,IACjFC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,EAAAA,CACD,GAEKY,IAAgB,CAAC,kBAAkB,iBAAiB,2BAA2BhB,CAAS,EAC3FiB,OAAOC,OAAO,EACdC,KAAK,GAAG;AAEX,SACEC,gBAAAA,EAAAC,cAAA,KAAAC,EAAA;AAAA,IACEb,KAAAA;AAAAA,IACAb,MAAAA;AAAAA,IACAU,QAAQM;AAAAA,IACRL,KAAKM;AAAAA,IACLb,WAAWgB;AAAAA,IACX,sBAAoBf;AAAAA,IACpBI,SAAAA;AAAAA,EAAAA,GACIG,GACAM,CAAmB,GAEtBhB,KAAYD,CACZ;AAEP,CACF;AAEAF,EAAK4B,cAAc;"}
|
package/dist/index7.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import { isElementVisible as p } from "./
|
|
1
|
+
import s, { useState as h, useCallback as i } from "react";
|
|
2
|
+
import "./index77.js";
|
|
3
|
+
import { isElementVisible as p } from "./index210.js";
|
|
4
4
|
const x = ({
|
|
5
5
|
skipLinks: n,
|
|
6
|
-
className:
|
|
6
|
+
className: c = ""
|
|
7
7
|
}) => {
|
|
8
|
-
const [
|
|
8
|
+
const [r, u] = h(n), l = i(() => {
|
|
9
9
|
const t = n.filter((e) => {
|
|
10
10
|
const o = document.getElementById(e.id);
|
|
11
11
|
return p(o);
|
|
@@ -30,10 +30,10 @@ const x = ({
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}, []);
|
|
33
|
-
return n.length === 0 ? null : /* @__PURE__ */
|
|
34
|
-
className: `se-design-skip-links-bar relative w-full h-0 overflow-hidden p-0 flex items-center justify-center bg-[var(--color-blue-50)] transition-[height] duration-300 ease-out focus-within:h-auto focus-within:py-1 focus-within:px-2 ${
|
|
33
|
+
return n.length === 0 ? null : /* @__PURE__ */ s.createElement("div", {
|
|
34
|
+
className: `se-design-skip-links-bar relative w-full h-0 overflow-hidden p-0 flex items-center justify-center bg-[var(--color-blue-50)] transition-[height] duration-300 ease-out focus-within:h-auto focus-within:py-1 focus-within:px-2 ${c}`,
|
|
35
35
|
onFocus: a
|
|
36
|
-
},
|
|
36
|
+
}, r.map((t) => /* @__PURE__ */ s.createElement("a", {
|
|
37
37
|
key: t.id,
|
|
38
38
|
href: `#${t.id}`,
|
|
39
39
|
className: "absolute -left-[9999px] [clip:rect(0,0,0,0)] no-underline text-[var(--color-blue-500)] text-md py-1 px-2.5 rounded capitalize focus:static focus:left-auto focus:[clip:auto] focus:outline-none focus-visible:!outline-none hover:text-[var(--color-blue-600)] hover:bg-[var(--color-blue-200)]",
|
|
@@ -43,6 +43,7 @@ const x = ({
|
|
|
43
43
|
}, t.label)));
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
x as SkipLinksBar
|
|
46
|
+
x as SkipLinksBar,
|
|
47
|
+
x as default
|
|
47
48
|
};
|
|
48
49
|
//# sourceMappingURL=index7.js.map
|
package/dist/index70.js
CHANGED
|
@@ -1,69 +1,148 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { Button as f } from "./index4.js";
|
|
3
|
+
import { Badge as j } from "./index10.js";
|
|
4
|
+
import { Icon as q } from "./index6.js";
|
|
5
|
+
import { Link as N } from "./index69.js";
|
|
6
|
+
import { CustomModal as G } from "./index13.js";
|
|
7
|
+
import { useStableId as J } from "./index211.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const K = {
|
|
10
|
+
lg: {
|
|
11
|
+
width: "768px",
|
|
12
|
+
height: "500px"
|
|
13
|
+
},
|
|
14
|
+
sm: {
|
|
15
|
+
width: "656px",
|
|
16
|
+
height: "384px"
|
|
17
|
+
}
|
|
18
|
+
}, ea = ({
|
|
19
|
+
isOpen: u,
|
|
20
|
+
onClose: n,
|
|
21
|
+
trigger: c,
|
|
22
|
+
modalWidth: b,
|
|
23
|
+
modalHeight: g,
|
|
24
|
+
variant: x,
|
|
25
|
+
size: t = "lg",
|
|
26
|
+
availabilityLabel: k = "Available on ",
|
|
27
|
+
availabilityBadgeText: r,
|
|
28
|
+
title: C,
|
|
29
|
+
description: v,
|
|
30
|
+
learnMoreLinkText: o,
|
|
31
|
+
learnMoreHref: l,
|
|
32
|
+
onLearnMoreClick: s,
|
|
33
|
+
featureListDesc: m,
|
|
34
|
+
featuresList: I = [],
|
|
35
|
+
featureItemIcon: L,
|
|
36
|
+
mediaContent: S,
|
|
37
|
+
laterButtonText: _,
|
|
38
|
+
purchaseButtonText: A,
|
|
39
|
+
onLaterClick: F,
|
|
40
|
+
onPurchaseClick: P,
|
|
41
|
+
className: $ = "",
|
|
42
|
+
modalContentClassName: D = "",
|
|
43
|
+
automationId: i = "",
|
|
44
|
+
id: z
|
|
45
|
+
}) => {
|
|
46
|
+
const p = J(z, "paywall-title"), B = () => {
|
|
47
|
+
F?.(), n();
|
|
48
|
+
}, d = K[t], O = b ?? d.width, w = g ?? d.height, y = x === "with-points" && t === "lg", h = I.map((e) => typeof e == "string" ? {
|
|
49
|
+
text: e
|
|
50
|
+
} : {
|
|
51
|
+
text: e.text,
|
|
52
|
+
icon: e.icon,
|
|
53
|
+
href: e.href,
|
|
54
|
+
external: e.external,
|
|
55
|
+
onLinkClick: e.onLinkClick
|
|
56
|
+
}), R = y && h.length > 0, W = L ?? /* @__PURE__ */ a.createElement(q, {
|
|
57
|
+
name: "info",
|
|
58
|
+
rotation: "180"
|
|
59
|
+
}), Y = /* @__PURE__ */ a.createElement("section", {
|
|
60
|
+
className: `paywall paywall-ctn paywall-ctn--${t} ${$}`,
|
|
61
|
+
"data-automation-id": i
|
|
62
|
+
}, /* @__PURE__ */ a.createElement("div", {
|
|
63
|
+
className: "paywall-card"
|
|
64
|
+
}, /* @__PURE__ */ a.createElement("div", {
|
|
65
|
+
className: "paywall-card-content"
|
|
66
|
+
}, r && /* @__PURE__ */ a.createElement("span", {
|
|
67
|
+
className: "paywall-card-availability"
|
|
68
|
+
}, /* @__PURE__ */ a.createElement("span", {
|
|
69
|
+
className: "paywall-card-availability-label"
|
|
70
|
+
}, k), /* @__PURE__ */ a.createElement(j, {
|
|
71
|
+
label: r,
|
|
72
|
+
className: "paywall-card-badge",
|
|
73
|
+
bgColor: "var(--color-yellow-100)",
|
|
74
|
+
textColor: "var(--color-yellow-700)"
|
|
75
|
+
})), /* @__PURE__ */ a.createElement("h3", {
|
|
76
|
+
id: p,
|
|
77
|
+
className: "paywall-card-title"
|
|
78
|
+
}, C), /* @__PURE__ */ a.createElement("p", {
|
|
79
|
+
className: "paywall-card-description"
|
|
80
|
+
}, v, o && (l || s) && /* @__PURE__ */ a.createElement(N, {
|
|
81
|
+
href: l ?? "#",
|
|
82
|
+
label: o,
|
|
83
|
+
external: !!l,
|
|
84
|
+
className: "paywall-card-learn-more",
|
|
85
|
+
onClick: (e) => {
|
|
86
|
+
l || e.preventDefault(), s?.(e);
|
|
18
87
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
break;
|
|
36
|
-
case "prev":
|
|
37
|
-
k ? s = (l - e + r.length) % r.length : s = Math.max(0, l - e);
|
|
38
|
-
break;
|
|
39
|
-
case "next":
|
|
40
|
-
k ? s = (l + e) % r.length : s = Math.min(r.length - 1, l + e);
|
|
41
|
-
break;
|
|
88
|
+
})), y && m && /* @__PURE__ */ a.createElement("p", {
|
|
89
|
+
className: "paywall-card-features-intro"
|
|
90
|
+
}, m), R && /* @__PURE__ */ a.createElement("ul", {
|
|
91
|
+
className: "paywall-card-features-list"
|
|
92
|
+
}, h.map((e) => /* @__PURE__ */ a.createElement("li", {
|
|
93
|
+
key: e.text,
|
|
94
|
+
className: "paywall-card-feature-item"
|
|
95
|
+
}, /* @__PURE__ */ a.createElement("span", {
|
|
96
|
+
className: "paywall-card-feature-icon",
|
|
97
|
+
"aria-hidden": !0
|
|
98
|
+
}, e.icon ?? W), /* @__PURE__ */ a.createElement("span", null, e.href || e.onLinkClick ? /* @__PURE__ */ a.createElement(N, {
|
|
99
|
+
href: e.href ?? "#",
|
|
100
|
+
label: e.text,
|
|
101
|
+
external: e.external,
|
|
102
|
+
onClick: (E) => {
|
|
103
|
+
e.href || E.preventDefault(), e.onLinkClick?.(E);
|
|
42
104
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
105
|
+
}) : e.text)))), /* @__PURE__ */ a.createElement("div", {
|
|
106
|
+
className: "paywall-card-actions"
|
|
107
|
+
}, /* @__PURE__ */ a.createElement(f, {
|
|
108
|
+
type: "ghost",
|
|
109
|
+
size: "md",
|
|
110
|
+
label: _,
|
|
111
|
+
onClick: B,
|
|
112
|
+
className: "paywall-card-btn-later"
|
|
113
|
+
}), /* @__PURE__ */ a.createElement(f, {
|
|
114
|
+
type: "primary",
|
|
115
|
+
size: "md",
|
|
116
|
+
label: A,
|
|
117
|
+
onClick: P,
|
|
118
|
+
className: "paywall-card-btn-purchase"
|
|
119
|
+
}))), /* @__PURE__ */ a.createElement("div", {
|
|
120
|
+
className: "paywall-card-media"
|
|
121
|
+
}, S))), Z = /* @__PURE__ */ a.createElement("div", {
|
|
122
|
+
role: "dialog",
|
|
123
|
+
"aria-modal": "true",
|
|
124
|
+
"aria-labelledby": p,
|
|
125
|
+
className: `paywall-modal-content ${D}`,
|
|
126
|
+
style: {
|
|
127
|
+
height: w,
|
|
128
|
+
minHeight: w
|
|
129
|
+
}
|
|
130
|
+
}, Y);
|
|
131
|
+
return /* @__PURE__ */ a.createElement(a.Fragment, null, c && /* @__PURE__ */ a.createElement("span", {
|
|
132
|
+
className: "paywall-trigger"
|
|
133
|
+
}, c), /* @__PURE__ */ a.createElement(G, {
|
|
134
|
+
isOpen: u,
|
|
135
|
+
onClose: n,
|
|
136
|
+
onModalClick: () => {
|
|
48
137
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const e = {};
|
|
56
|
-
return h && (e.role = h), a === "horizontal" ? e["aria-orientation"] = "horizontal" : a === "vertical" && (e["aria-orientation"] = "vertical"), t && Object.assign(e, C(t)), e;
|
|
57
|
-
}, [h, a]);
|
|
58
|
-
return {
|
|
59
|
-
setFocusedId: x,
|
|
60
|
-
focusItem: y,
|
|
61
|
-
handleKeyDown: R,
|
|
62
|
-
getRovingItemProps: A,
|
|
63
|
-
getContainerProps: z
|
|
64
|
-
};
|
|
65
|
-
}
|
|
138
|
+
renderModalContent: () => Z,
|
|
139
|
+
width: O,
|
|
140
|
+
contentClassName: "paywall-modal-content-wrapper",
|
|
141
|
+
automationId: i
|
|
142
|
+
}));
|
|
143
|
+
};
|
|
66
144
|
export {
|
|
67
|
-
|
|
145
|
+
ea as Paywall,
|
|
146
|
+
ea as default
|
|
68
147
|
};
|
|
69
148
|
//# sourceMappingURL=index70.js.map
|
package/dist/index70.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index70.js","sources":["../src/utils/a11y/useRovingFocus.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { getA11yNameAttributes, AccessibleNameInput } from './accessibleName';\nexport type { AccessibleNameInput };\n\nexport type RovingDirection = 'prev' | 'next' | 'first' | 'last';\n\nexport interface UseRovingFocusOptions {\n /**\n * Array of item IDs in order\n */\n itemIds: string[];\n\n /**\n * The tabIndex to apply to the currently focused item in the roving group.\n * Defaults to 0 \n */\n tabIndex?: number;\n\n /**\n * Initial focused item ID. Defaults to first item.\n */\n defaultFocusedId?: string;\n\n /**\n * Orientation for arrow key mapping.\n * - horizontal: ArrowLeft/ArrowRight\n * - vertical: ArrowUp/ArrowDown\n * - grid: all four arrow keys (Left/Right move by 1, Up/Down move by `cols`)\n */\n orientation?: 'horizontal' | 'vertical' | 'grid';\n\n /**\n * Number of columns in the grid. Required when orientation is 'grid'.\n * ArrowUp/ArrowDown navigate by this many items in the flat itemIds array.\n */\n cols?: number;\n\n /**\n * Whether navigation wraps around at ends. Defaults to true.\n */\n loop?: boolean;\n\n /**\n * Callback when focus changes\n */\n onFocusChange?: (id: string) => void;\n\n /**\n * ARIA role for the container element (e.g. 'grid', 'menu', 'tablist', 'toolbar').\n * Returned via getContainerProps().\n */\n role?: React.AriaRole;\n}\n\nexport interface RovingItemProps {\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n}\n\nexport interface RovingContainerProps {\n role?: React.AriaRole;\n 'aria-orientation'?: 'horizontal' | 'vertical';\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\nexport interface UseRovingFocusReturn {\n /**\n * Set focused item ID manually\n */\n setFocusedId: (id: string) => void;\n\n /**\n * Imperatively focus a DOM element by id.\n * If the element exists in refs, focus it immediately.\n * If not yet in DOM, update state so it gets focus once rendered.\n */\n focusItem: (id: string) => void;\n\n /**\n * Keyboard handler for arrow/Home/End navigation.\n * Attach to each item's onKeyDown.\n */\n handleKeyDown: (e: React.KeyboardEvent) => void;\n\n /**\n * Get props for an item in the roving focus group (ref + tabIndex)\n */\n getRovingItemProps: (id: string) => RovingItemProps;\n\n /**\n * Props to spread on the container element.\n * Returns role (if provided), aria-orientation (derived from orientation; omitted for grid),\n * and any accessible name/description attributes passed in.\n */\n getContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n}\n\n/**\n * Hook for managing roving focus pattern (roving tabindex).\n * Reusable for composite widgets: tabs, toolbars, menus, listboxes, radio groups, grids.\n *\n * @example\n * // 1D (toolbar/tabs):\n * const { getRovingItemProps, handleKeyDown } = useRovingFocus({\n * itemIds: ['tab1', 'tab2', 'tab3'],\n * orientation: 'horizontal'\n * });\n *\n * // 2D (grid — flat itemIds, cols for row-jump math):\n * const { getRovingItemProps, handleKeyDown } = useRovingFocus({\n * itemIds: ['r0c0', 'r0c1', 'r0c2', 'r1c0', 'r1c1', 'r1c2'],\n * orientation: 'grid',\n * cols: 3\n * });\n *\n * // In render:\n * <button {...getRovingItemProps('tab1')} onKeyDown={handleKeyDown}>Tab 1</button>\n */\nexport function useRovingFocus({\n itemIds,\n tabIndex = 0,\n defaultFocusedId,\n orientation = 'horizontal',\n cols,\n loop = true,\n onFocusChange,\n role\n}: UseRovingFocusOptions): UseRovingFocusReturn {\n const [focusedId, setFocusedIdState] = React.useState<string>(\n defaultFocusedId || itemIds[0] || ''\n );\n\n const itemRefs = React.useRef<Record<string, HTMLElement | null>>({});\n\n // Sync focusedId if itemIds change and current focusedId is no longer valid\n React.useEffect(() => {\n if (itemIds.length > 0 && !itemIds.includes(focusedId)) {\n const newFocusedId = defaultFocusedId || itemIds[0] || '';\n setFocusedIdState(newFocusedId);\n }\n }, [itemIds, focusedId, defaultFocusedId]);\n\n const setFocusedId = React.useCallback(\n (id: string) => {\n setFocusedIdState((prev) => {\n if (prev === id) return prev;\n onFocusChange?.(id);\n return id;\n });\n },\n [onFocusChange]\n );\n\n const focusItem = React.useCallback(\n (id: string) => {\n const el = itemRefs.current[id];\n if (el) {\n el.focus();\n } else {\n // element not yet in DOM (e.g. month just changed) — update state so it gets focus once rendered\n setFocusedIdState(id);\n onFocusChange?.(id);\n }\n },\n [onFocusChange]\n );\n\n const moveFocus = React.useCallback(\n (direction: RovingDirection, step: number = 1) => {\n if (itemIds.length === 0) return;\n\n const currentIdx = itemIds.indexOf(focusedId);\n const safeIdx = Math.max(0, currentIdx);\n let nextIdx = safeIdx;\n\n switch (direction) {\n case 'first':\n nextIdx = 0;\n break;\n case 'last':\n nextIdx = itemIds.length - 1;\n break;\n case 'prev':\n if (loop) {\n nextIdx = (safeIdx - step + itemIds.length) % itemIds.length;\n } else {\n nextIdx = Math.max(0, safeIdx - step);\n }\n break;\n case 'next':\n if (loop) {\n nextIdx = (safeIdx + step) % itemIds.length;\n } else {\n nextIdx = Math.min(itemIds.length - 1, safeIdx + step);\n }\n break;\n }\n\n const nextId = itemIds[nextIdx];\n if (!nextId) return;\n\n itemRefs.current[nextId]?.focus();\n },\n [itemIds, focusedId, loop]\n );\n\n const getRovingItemProps = React.useCallback(\n (id: string): RovingItemProps => ({\n ref: (el: HTMLElement | null) => {\n itemRefs.current[id] = el;\n },\n tabIndex: focusedId === id ? tabIndex : -1,\n onFocus: () => setFocusedId(id)\n }),\n [focusedId, tabIndex, setFocusedId]\n );\n\n // Keyboard handler for arrow/Home/End navigation\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n let direction: RovingDirection | null = null;\n let step = 1;\n\n if (e.key === 'Home') {\n direction = 'first';\n } else if (e.key === 'End') {\n direction = 'last';\n } else {\n // Horizontal axis (Left/Right) — active for 'horizontal' and 'grid'\n if (orientation !== 'vertical') {\n if (e.key === 'ArrowLeft') direction = 'prev';\n else if (e.key === 'ArrowRight') direction = 'next';\n }\n // Vertical axis (Up/Down) — active for 'vertical' and 'grid'\n if (!direction && orientation !== 'horizontal') {\n if (e.key === 'ArrowUp') direction = 'prev';\n else if (e.key === 'ArrowDown') direction = 'next';\n if (direction && cols) step = cols;\n }\n }\n\n if (direction) {\n e.preventDefault();\n e.stopPropagation();\n moveFocus(direction, step);\n }\n },\n [orientation, cols, moveFocus]\n );\n\n const getContainerProps = React.useCallback((nameInput?: AccessibleNameInput): RovingContainerProps => {\n const props: RovingContainerProps = {};\n if (role) props.role = role;\n if (orientation === 'horizontal') props['aria-orientation'] = 'horizontal';\n else if (orientation === 'vertical') props['aria-orientation'] = 'vertical';\n // grid: aria-orientation omitted — not applicable for role=\"grid\"\n if (nameInput) Object.assign(props, getA11yNameAttributes(nameInput));\n return props;\n }, [role, orientation]);\n\n return {\n setFocusedId,\n focusItem,\n handleKeyDown,\n getRovingItemProps,\n getContainerProps\n };\n}\n"],"names":["React","getA11yNameAttributes","useRovingFocus","itemIds","tabIndex","defaultFocusedId","orientation","cols","loop","onFocusChange","role","focusedId","setFocusedIdState","useState","itemRefs","useRef","useEffect","length","includes","newFocusedId","setFocusedId","useCallback","id","prev","focusItem","el","current","focus","moveFocus","direction","step","currentIdx","indexOf","safeIdx","Math","max","nextIdx","min","nextId","getRovingItemProps","ref","onFocus","handleKeyDown","e","key","preventDefault","stopPropagation","getContainerProps","nameInput","props","Object","assign"],"mappings":"AA0HO,YAAAA,OAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,SAASC,EAAe;AAAA,EAC7BC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAA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0D;AACrG,UAAMC,IAA8B,CAAA;AACpC,WAAIvC,QAAYA,OAAOA,IACnBJ,MAAgB,eAAc2C,EAAM,kBAAkB,IAAI,eACrD3C,MAAgB,eAAY2C,EAAM,kBAAkB,IAAI,aAE7DD,KAAWE,OAAOC,OAAOF,GAAOhD,EAAsB+C,CAAS,CAAC,GAC7DC;AAAAA,EACT,GAAG,CAACvC,GAAMJ,CAAW,CAAC;AAEtB,SAAO;AAAA,IACLc,cAAAA;AAAAA,IACAI,WAAAA;AAAAA,IACAkB,eAAAA;AAAAA,IACAH,oBAAAA;AAAAA,IACAQ,mBAAAA;AAAAA,EAAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index70.js","sources":["../src/components/Paywall/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Button } from 'src/components/Button';\nimport { Badge } from 'src/components/Badge';\nimport { Icon } from 'src/components/Icon';\nimport { Link } from 'src/components/Link';\nimport { CustomModal } from 'src/components/CustomModal';\nimport { useStableId } from 'src/utils/useStableId';\nimport './style.scss';\n\n/** Variant: with bullet points list, or description only */\nexport type PaywallVariant = 'with-points' | 'description-only';\n\n/** Size: small (656×384) or large (768×500) – sets modal dimensions and media panel proportion */\nexport type PaywallSize = 'sm' | 'lg';\n\n/** Feature list item: plain string (uses default/list icon) or object with text, optional per-item icon, and optional link/action */\nexport type PaywallFeatureItem =\n | string\n | {\n text: string;\n icon?: ReactNode;\n /** If provided, the feature text becomes a hyperlink navigating to this URL */\n href?: string;\n /** If true, opens the href in a new tab (only applicable when href is set) */\n external?: boolean;\n /** Click handler — use with href for analytics, or alone for SPA actions */\n onLinkClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n };\n\nconst PAYWALL_SIZE_DIMENSIONS: Record<PaywallSize, { width: string; height: string }> = {\n lg: { width: '768px', height: '500px' },\n sm: { width: '656px', height: '384px' },\n};\n\nexport interface PaywallProps {\n isOpen: boolean;\n onClose: () => void;\n trigger?: ReactNode;\n modalWidth?: string;\n modalHeight?: string;\n variant: PaywallVariant;\n size?: PaywallSize;\n availabilityLabel?: string;\n availabilityBadgeText?: string;\n title: string;\n description: string;\n learnMoreLinkText?: string;\n learnMoreHref?: string;\n onLearnMoreClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n featureListDesc?: string;\n featuresList?: PaywallFeatureItem[];\n featureItemIcon?: ReactNode;\n mediaContent?: ReactNode;\n laterButtonText: string;\n purchaseButtonText: string;\n onLaterClick?: () => void;\n onPurchaseClick?: () => void;\n className?: string;\n modalContentClassName?: string;\n automationId?: string;\n id?: string;\n}\n\n/** Paywall – always shown in a modal. Pass isOpen/onClose and optionally a trigger. */\nexport const Paywall: FC<PaywallProps> = ({\n isOpen,\n onClose,\n trigger,\n modalWidth,\n modalHeight,\n variant,\n size = 'lg',\n availabilityLabel = 'Available on ',\n availabilityBadgeText,\n title,\n description,\n learnMoreLinkText,\n learnMoreHref,\n onLearnMoreClick,\n featureListDesc,\n featuresList = [],\n featureItemIcon,\n mediaContent,\n laterButtonText,\n purchaseButtonText,\n onLaterClick,\n onPurchaseClick,\n className = '',\n modalContentClassName = '',\n automationId = '',\n id: providedId,\n}) => {\n const titleId = useStableId(providedId, 'paywall-title');\n\n const handleLaterClick = () => {\n onLaterClick?.();\n onClose();\n };\n\n const dimensions = PAYWALL_SIZE_DIMENSIONS[size];\n const width = modalWidth ?? dimensions.width;\n const height = modalHeight ?? dimensions.height;\n\n const withPoints = variant === 'with-points' && size === 'lg';\n const normalizedFeatures = featuresList.map((item): { text: string; icon?: ReactNode; href?: string; external?: boolean; onLinkClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void } =>\n typeof item === 'string'\n ? { text: item }\n : { text: item.text, icon: item.icon, href: item.href, external: item.external, onLinkClick: item.onLinkClick }\n );\n const showFeatures = withPoints && normalizedFeatures.length > 0;\n const defaultIcon = featureItemIcon ?? <Icon name=\"info\" rotation='180'/>;\n\n const content = (\n <section\n className={`paywall paywall-ctn paywall-ctn--${size} ${className}`}\n data-automation-id={automationId}\n >\n <div className=\"paywall-card\">\n <div className=\"paywall-card-content\">\n {availabilityBadgeText && (\n <span className=\"paywall-card-availability\">\n <span className=\"paywall-card-availability-label\">{availabilityLabel}</span>\n <Badge\n label={availabilityBadgeText}\n className=\"paywall-card-badge\"\n bgColor=\"var(--color-yellow-100)\"\n textColor=\"var(--color-yellow-700)\"\n />\n </span>\n )}\n <h3 id={titleId} className=\"paywall-card-title\">{title}</h3>\n <p className=\"paywall-card-description\">\n {description}\n {learnMoreLinkText && (learnMoreHref || onLearnMoreClick) && (\n <Link\n href={learnMoreHref ?? '#'}\n label={learnMoreLinkText}\n external={!!learnMoreHref}\n className=\"paywall-card-learn-more\"\n onClick={(e) => { if (!learnMoreHref) { e.preventDefault(); } onLearnMoreClick?.(e); }}\n />\n )}\n </p>\n {withPoints && featureListDesc && (\n <p className=\"paywall-card-features-intro\">{featureListDesc}</p>\n )}\n {showFeatures && (\n <ul className=\"paywall-card-features-list\">\n {normalizedFeatures.map((item) => (\n <li key={item.text} className=\"paywall-card-feature-item\">\n <span className=\"paywall-card-feature-icon\" aria-hidden>\n {item.icon ?? defaultIcon}\n </span>\n <span>\n {item.href || item.onLinkClick ? (\n <Link\n href={item.href ?? '#'}\n label={item.text}\n external={item.external}\n onClick={(e) => { if (!item.href) { e.preventDefault(); } item.onLinkClick?.(e); }}\n />\n ) : (\n item.text\n )}\n </span>\n </li>\n ))}\n </ul>\n )}\n <div className=\"paywall-card-actions\">\n <Button\n type=\"ghost\"\n size=\"md\"\n label={laterButtonText}\n onClick={handleLaterClick}\n className=\"paywall-card-btn-later\"\n />\n <Button\n type=\"primary\"\n size=\"md\"\n label={purchaseButtonText}\n onClick={onPurchaseClick}\n className=\"paywall-card-btn-purchase\"\n />\n </div>\n </div>\n <div className=\"paywall-card-media\">\n {mediaContent}\n </div>\n </div>\n </section>\n );\n\n const modalContent = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n className={`paywall-modal-content ${modalContentClassName}`}\n style={{ height, minHeight: height }}\n >\n {content}\n </div>\n );\n\n return (\n <>\n {trigger && <span className=\"paywall-trigger\">{trigger}</span>}\n <CustomModal\n isOpen={isOpen}\n onClose={onClose}\n onModalClick={() => {}}\n renderModalContent={() => modalContent}\n width={width}\n contentClassName=\"paywall-modal-content-wrapper\"\n automationId={automationId}\n />\n </>\n );\n};\n\nexport default Paywall;\n"],"names":["React__default","Button","Badge","Icon","Link","CustomModal","useStableId","PAYWALL_SIZE_DIMENSIONS","lg","width","height","sm","Paywall","isOpen","onClose","trigger","modalWidth","modalHeight","variant","size","availabilityLabel","availabilityBadgeText","title","description","learnMoreLinkText","learnMoreHref","onLearnMoreClick","featureListDesc","featuresList","featureItemIcon","mediaContent","laterButtonText","purchaseButtonText","onLaterClick","onPurchaseClick","className","modalContentClassName","automationId","id","providedId","titleId","handleLaterClick","dimensions","withPoints","normalizedFeatures","map","item","text","icon","href","external","onLinkClick","showFeatures","length","defaultIcon","React","createElement","name","rotation","content","label","bgColor","textColor","onClick","e","preventDefault","key","type","modalContent","role","style","minHeight","Fragment","onModalClick","renderModalContent","contentClassName"],"mappings":"AA6BA,OAAAA,OAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,SAAA,SAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,OAAA;AAAA,MAAMC,IAAkF;AAAA,EACtFC,IAAI;AAAA,IAAEC,OAAO;AAAA,IAASC,QAAQ;AAAA,EAAA;AAAA,EAC9BC,IAAI;AAAA,IAAEF,OAAO;AAAA,IAASC,QAAQ;AAAA,EAAA;AAChC,GAgCaE,KAA4BA,CAAC;AAAA,EACxCC,QAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,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,MACGzD,KAAWwC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMrB,WAAU;AAAA,EAAA,GAAmBpB,CAAc,GAC7DwC,gBAAAA,EAAAC,cAACnD,GAAW;AAAA,IACVQ,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACA2D,cAAcA,MAAM;AAAA,IAAC;AAAA,IACrBC,oBAAoBA,MAAMN;AAAAA,IAC1B3D,OAAAA;AAAAA,IACAkE,kBAAiB;AAAA,IACjBtC,cAAAA;AAAAA,EAAAA,CACD,CACD;AAEN;"}
|
package/dist/index71.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
additionalSelectors: r = [],
|
|
6
|
-
filterHidden: a = !1
|
|
1
|
+
function i({
|
|
2
|
+
titleId: r,
|
|
3
|
+
descriptionId: t,
|
|
4
|
+
isFocusable: a = !1
|
|
7
5
|
}) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}) : i;
|
|
14
|
-
}
|
|
15
|
-
function b(e) {
|
|
16
|
-
const t = s(e);
|
|
17
|
-
return t.length > 0 ? t[0] : null;
|
|
18
|
-
}
|
|
19
|
-
function c(e) {
|
|
20
|
-
const t = s(e);
|
|
21
|
-
return t.length > 0 ? t[t.length - 1] : null;
|
|
6
|
+
const e = {
|
|
7
|
+
role: "region",
|
|
8
|
+
"aria-labelledby": r
|
|
9
|
+
};
|
|
10
|
+
return t && (e["aria-describedby"] = t), a && (e.tabIndex = -1), e;
|
|
22
11
|
}
|
|
23
12
|
export {
|
|
24
|
-
|
|
25
|
-
u as FOCUSABLE_WITH_ROLES_SELECTOR,
|
|
26
|
-
b as getFirstFocusableElement,
|
|
27
|
-
s as getFocusableElements,
|
|
28
|
-
c as getLastFocusableElement
|
|
13
|
+
i as getRegionAttributes
|
|
29
14
|
};
|
|
30
15
|
//# sourceMappingURL=index71.js.map
|
package/dist/index71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index71.js","sources":["../src/utils/a11y/
|
|
1
|
+
{"version":3,"file":"index71.js","sources":["../src/utils/a11y/regionAttributes.ts"],"sourcesContent":["/**\n * Returns ARIA attributes for a region container element.\n * Used for semantic containers that need role=\"region\" with proper labeling.\n * \n * @param options - Configuration options\n * @param options.titleId - Required. ID of the heading element that labels this region\n * @param options.descriptionId - Optional. ID of the description element\n * @param options.isFocusable - Optional. Whether to make the region focusable (adds tabIndex={-1})\n * @returns Object with region ARIA attributes\n */\nexport function getRegionAttributes({\n titleId,\n descriptionId,\n isFocusable = false\n}: {\n titleId: string;\n descriptionId?: string;\n isFocusable?: boolean;\n}): {\n role: 'region';\n 'aria-labelledby': string;\n 'aria-describedby'?: string;\n tabIndex?: number;\n} {\n const attributes: {\n role: 'region';\n 'aria-labelledby': string;\n 'aria-describedby'?: string;\n tabIndex?: number;\n } = {\n role: 'region',\n 'aria-labelledby': titleId\n };\n\n if (descriptionId) {\n attributes['aria-describedby'] = descriptionId;\n }\n\n if (isFocusable) {\n attributes.tabIndex = -1;\n }\n\n return attributes;\n}\n"],"names":["getRegionAttributes","titleId","descriptionId","isFocusable","attributes","role","tabIndex"],"mappings":"AAUO,SAASA,EAAoB;AAAA,EAClCC,SAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,aAAAA,IAAc;AAKhB,GAKE;AACA,QAAMC,IAKF;AAAA,IACFC,MAAM;AAAA,IACN,mBAAmBJ;AAAAA,EAAAA;AAGrB,SAAIC,MACFE,EAAW,kBAAkB,IAAIF,IAG/BC,MACFC,EAAWE,WAAW,KAGjBF;AACT;"}
|
package/dist/index72.js
CHANGED
|
@@ -1,111 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { isVirtualClick as x } from "./index83.js";
|
|
3
|
+
function I({
|
|
4
|
+
disabled: v = !1,
|
|
5
|
+
loading: l = !1,
|
|
6
|
+
onClick: u,
|
|
7
|
+
onKeyboardActivate: n,
|
|
8
|
+
isNative: o = !0,
|
|
9
|
+
role: y = "button",
|
|
10
|
+
tabIndex: C = 0,
|
|
11
|
+
stopPropagation: c = !1,
|
|
12
|
+
preventDefault: f = !1,
|
|
13
|
+
pressed: P,
|
|
14
|
+
onPointerDown: k,
|
|
15
|
+
onMouseDown: b,
|
|
16
|
+
onTouchStart: p
|
|
17
|
+
} = {}) {
|
|
18
|
+
const e = v || l, a = s.useRef(!1), t = s.useCallback(() => {
|
|
19
|
+
a.current = !0;
|
|
20
|
+
}, []), D = s.useCallback((r) => {
|
|
21
|
+
if (e) return;
|
|
22
|
+
c && r.stopPropagation(), f && r.preventDefault();
|
|
23
|
+
const h = x(r.nativeEvent), w = a.current;
|
|
24
|
+
a.current = !1;
|
|
25
|
+
const m = h ? "virtual" : w ? "pointer" : "keyboard";
|
|
26
|
+
if ((m === "keyboard" || m === "virtual") && n) {
|
|
27
|
+
n(r);
|
|
9
28
|
return;
|
|
10
29
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
container: e
|
|
34
|
-
}) || e : n === "container" ? e : typeof n == "string" ? e.querySelector(n) : n instanceof HTMLElement ? n : null;
|
|
35
|
-
}
|
|
36
|
-
function C({
|
|
37
|
-
enabled: e,
|
|
38
|
-
containerRef: n,
|
|
39
|
-
restoreFocus: s = !0,
|
|
40
|
-
initialFocus: d = "first",
|
|
41
|
-
returnFocusRef: g,
|
|
42
|
-
portalContainerRefs: h
|
|
43
|
-
}) {
|
|
44
|
-
const u = p(null), E = p(null);
|
|
45
|
-
return a(() => {
|
|
46
|
-
if (!e) {
|
|
47
|
-
if (s && u.current) {
|
|
48
|
-
const t = u.current;
|
|
49
|
-
u.current = null, requestAnimationFrame(() => {
|
|
50
|
-
t.isConnected && t.focus();
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const r = n.current;
|
|
56
|
-
if (!r) return;
|
|
57
|
-
const c = g?.current ?? I() ?? f ?? document.activeElement;
|
|
58
|
-
if (f = null, c?.tagName === "IFRAME") {
|
|
59
|
-
u.current = null;
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
return u.current = c, r.contains(document.activeElement) || requestAnimationFrame(() => {
|
|
63
|
-
w(r, d)?.focus();
|
|
64
|
-
}), () => {
|
|
65
|
-
if (s && u.current) {
|
|
66
|
-
const t = u.current;
|
|
67
|
-
u.current = null, requestAnimationFrame(() => {
|
|
68
|
-
t.isConnected && t.focus();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}, [e, n, s, d]), a(() => {
|
|
73
|
-
if (!e) return;
|
|
74
|
-
const r = n.current;
|
|
75
|
-
if (!r) return;
|
|
76
|
-
const c = (t) => {
|
|
77
|
-
if (t.key === "Tab") {
|
|
78
|
-
const o = L({
|
|
79
|
-
container: r
|
|
80
|
-
});
|
|
81
|
-
if (o.length === 0) {
|
|
82
|
-
t.preventDefault(), r.focus();
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const i = o[0], v = o[o.length - 1], y = document.activeElement;
|
|
86
|
-
t.shiftKey && y === i ? (t.preventDefault(), v.focus()) : !t.shiftKey && y === v && (t.preventDefault(), i.focus());
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
return document.addEventListener("keydown", c, !0), () => document.removeEventListener("keydown", c, !0);
|
|
90
|
-
}, [e, n]), a(() => {
|
|
91
|
-
if (!e) return;
|
|
92
|
-
const r = n.current;
|
|
93
|
-
if (!r) return;
|
|
94
|
-
const c = (t) => {
|
|
95
|
-
const o = t.target;
|
|
96
|
-
o?.tagName !== "IFRAME" && (r.contains(o) ? E.current = o : h?.current?.some((i) => i.current?.contains(o)) || (E.current || A({
|
|
97
|
-
container: r
|
|
98
|
-
}) || r).focus());
|
|
99
|
-
};
|
|
100
|
-
return document.addEventListener("focusin", c, !0), () => document.removeEventListener("focusin", c, !0);
|
|
101
|
-
}, [e, n]), {
|
|
102
|
-
triggerRef: u
|
|
30
|
+
u?.(r);
|
|
31
|
+
}, [e, u, n, c, f]), R = s.useCallback((r) => {
|
|
32
|
+
e || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.currentTarget.click());
|
|
33
|
+
}, [e]), d = {
|
|
34
|
+
onPointerDown: k ? (r) => {
|
|
35
|
+
t(), k(r);
|
|
36
|
+
} : t,
|
|
37
|
+
onMouseDown: b ? (r) => {
|
|
38
|
+
t(), b(r);
|
|
39
|
+
} : t,
|
|
40
|
+
onTouchStart: p ? (r) => {
|
|
41
|
+
t(), p(r);
|
|
42
|
+
} : t,
|
|
43
|
+
onClick: D,
|
|
44
|
+
"aria-disabled": e ? "true" : void 0,
|
|
45
|
+
"aria-busy": l ? "true" : void 0,
|
|
46
|
+
"aria-pressed": P
|
|
47
|
+
};
|
|
48
|
+
o || (d.onKeyDown = R);
|
|
49
|
+
const i = {
|
|
50
|
+
pressProps: d,
|
|
51
|
+
isDisabled: e
|
|
103
52
|
};
|
|
53
|
+
return o || (i.role = y, i.tabIndex = e ? -1 : C), i;
|
|
104
54
|
}
|
|
105
55
|
export {
|
|
106
|
-
I as
|
|
107
|
-
T as consumeLastInteractedElement,
|
|
108
|
-
_ as setFocusAnchor,
|
|
109
|
-
C as useFocusTrap
|
|
56
|
+
I as useAccessiblePress
|
|
110
57
|
};
|
|
111
58
|
//# sourceMappingURL=index72.js.map
|