@blockbite/ui 2.0.9 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/AutocompleteDropdown.d.ts +2 -1
  2. package/dist/Badge.d.ts +2 -1
  3. package/dist/BitePreview.d.ts +2 -1
  4. package/dist/Button.d.ts +2 -1
  5. package/dist/ButtonToggle.d.ts +1 -0
  6. package/dist/Chapter.d.ts +2 -1
  7. package/dist/ChapterDivider.d.ts +2 -1
  8. package/dist/Checkbox.d.ts +2 -1
  9. package/dist/DisappearingMessage.d.ts +2 -1
  10. package/dist/DropdownPicker.d.ts +2 -1
  11. package/dist/EmptyState.d.ts +2 -1
  12. package/dist/FloatingPanel.d.ts +2 -1
  13. package/dist/FocalPointControl.d.ts +1 -0
  14. package/dist/Icon.d.ts +2 -1
  15. package/dist/LinkPicker.d.ts +2 -1
  16. package/dist/MediaPicker.d.ts +2 -1
  17. package/dist/MetricsControl.d.ts +1 -0
  18. package/dist/Modal.d.ts +1 -0
  19. package/dist/NewWindowPortal.d.ts +2 -1
  20. package/dist/Notice.d.ts +2 -1
  21. package/dist/PasswordInput.d.ts +2 -1
  22. package/dist/Popover.d.ts +1 -0
  23. package/dist/ProjectsNavigation.d.ts +14 -0
  24. package/dist/RangeSlider.d.ts +1 -0
  25. package/dist/ResponsiveImage.d.ts +2 -1
  26. package/dist/ResponsiveVideo.d.ts +2 -1
  27. package/dist/ScrollList.d.ts +1 -0
  28. package/dist/SectionList.d.ts +2 -1
  29. package/dist/SelectControlWrapper.d.ts +2 -1
  30. package/dist/SingleBlockTypeAppender.d.ts +2 -1
  31. package/dist/SlideIn.d.ts +2 -1
  32. package/dist/Spinner.d.ts +2 -1
  33. package/dist/Tabs.d.ts +7 -6
  34. package/dist/Tag.d.ts +2 -1
  35. package/dist/TextControl.d.ts +2 -1
  36. package/dist/TextControlLabel.d.ts +2 -1
  37. package/dist/ToggleGroup.d.ts +1 -0
  38. package/dist/ToggleSwitch.d.ts +2 -1
  39. package/dist/Wrap.d.ts +2 -1
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +3577 -49
  42. package/dist/index.js.map +1 -1
  43. package/dist/ui.css +1 -66
  44. package/dist/vite.svg +1 -0
  45. package/package.json +14 -11
  46. package/dist/AutocompleteDropdown.js +0 -24
  47. package/dist/AutocompleteDropdown.js.map +0 -1
  48. package/dist/Badge.js +0 -6
  49. package/dist/Badge.js.map +0 -1
  50. package/dist/BitePreview.js +0 -52
  51. package/dist/BitePreview.js.map +0 -1
  52. package/dist/Button.js +0 -9
  53. package/dist/Button.js.map +0 -1
  54. package/dist/ButtonToggle.js +0 -44
  55. package/dist/ButtonToggle.js.map +0 -1
  56. package/dist/Chapter.js +0 -7
  57. package/dist/Chapter.js.map +0 -1
  58. package/dist/ChapterDivider.js +0 -6
  59. package/dist/ChapterDivider.js.map +0 -1
  60. package/dist/Checkbox.js +0 -12
  61. package/dist/Checkbox.js.map +0 -1
  62. package/dist/DisappearingMessage.js +0 -28
  63. package/dist/DisappearingMessage.js.map +0 -1
  64. package/dist/DropdownPicker.js +0 -36
  65. package/dist/DropdownPicker.js.map +0 -1
  66. package/dist/EmptyState.js +0 -17
  67. package/dist/EmptyState.js.map +0 -1
  68. package/dist/FloatingPanel.js +0 -32
  69. package/dist/FloatingPanel.js.map +0 -1
  70. package/dist/FocalPointControl.js +0 -31
  71. package/dist/FocalPointControl.js.map +0 -1
  72. package/dist/Icon.js +0 -8
  73. package/dist/Icon.js.map +0 -1
  74. package/dist/LinkPicker.js +0 -50
  75. package/dist/LinkPicker.js.map +0 -1
  76. package/dist/MediaPicker.js +0 -96
  77. package/dist/MediaPicker.js.map +0 -1
  78. package/dist/MetricsControl.js +0 -93
  79. package/dist/MetricsControl.js.map +0 -1
  80. package/dist/Modal.js +0 -76
  81. package/dist/Modal.js.map +0 -1
  82. package/dist/NewWindowPortal.js +0 -54
  83. package/dist/NewWindowPortal.js.map +0 -1
  84. package/dist/Notice.js +0 -10
  85. package/dist/Notice.js.map +0 -1
  86. package/dist/PasswordInput.js +0 -23
  87. package/dist/PasswordInput.js.map +0 -1
  88. package/dist/Popover.js +0 -23
  89. package/dist/Popover.js.map +0 -1
  90. package/dist/RangeSlider.js +0 -38
  91. package/dist/RangeSlider.js.map +0 -1
  92. package/dist/ResponsiveImage.js +0 -14
  93. package/dist/ResponsiveImage.js.map +0 -1
  94. package/dist/ResponsiveVideo.js +0 -8
  95. package/dist/ResponsiveVideo.js.map +0 -1
  96. package/dist/ScrollList.js +0 -9
  97. package/dist/ScrollList.js.map +0 -1
  98. package/dist/SectionList.js +0 -61
  99. package/dist/SectionList.js.map +0 -1
  100. package/dist/SelectControlWrapper.js +0 -18
  101. package/dist/SelectControlWrapper.js.map +0 -1
  102. package/dist/SingleBlockTypeAppender.js +0 -18
  103. package/dist/SingleBlockTypeAppender.js.map +0 -1
  104. package/dist/SlideIn.js +0 -17
  105. package/dist/SlideIn.js.map +0 -1
  106. package/dist/Spinner.js +0 -17
  107. package/dist/Spinner.js.map +0 -1
  108. package/dist/Tabs.js +0 -54
  109. package/dist/Tabs.js.map +0 -1
  110. package/dist/Tag.js +0 -6
  111. package/dist/Tag.js.map +0 -1
  112. package/dist/TextControl.js +0 -17
  113. package/dist/TextControl.js.map +0 -1
  114. package/dist/TextControlLabel.js +0 -8
  115. package/dist/TextControlLabel.js.map +0 -1
  116. package/dist/ToggleGroup.js +0 -16
  117. package/dist/ToggleGroup.js.map +0 -1
  118. package/dist/ToggleSwitch.js +0 -17
  119. package/dist/ToggleSwitch.js.map +0 -1
  120. package/dist/Wrap.js +0 -8
  121. package/dist/Wrap.js.map +0 -1
  122. package/dist/types.js +0 -2
  123. package/dist/types.js.map +0 -1
package/dist/ui.css CHANGED
@@ -1,66 +1 @@
1
- /*
2
- only used to target children of the UI components
3
- in favour of [&>.chidren] selector within components
4
- */
5
-
6
- /* TextControl.tsx */
7
- .blockbite-ui__text-control-label {
8
- input {
9
- @apply mb-1 appearance-none rounded-none !border-0 border-b-2 border-l-2 border-wordpress bg-transparent p-1 text-[13px] font-bold focus:border-b-2;
10
- }
11
- }
12
-
13
- /* DropdownPicker.tsx */
14
- .blockbite-ui__dropdown-picker {
15
- .components-button {
16
- @apply !h-[32px];
17
- }
18
- }
19
-
20
- /* Modal.tsx */
21
- .blockbite-ui__modal .components-modal__content {
22
- padding: 1rem;
23
- padding-bottom: 4rem;
24
- }
25
-
26
- /* ButtonToggle.tsx */
27
- .blockbite-ui__button-group--tabs {
28
- .blockbite-ui__button--default {
29
- @apply h-[40px] rounded-none !border-x-0 !border-t-0 border-b-2;
30
- &.is-pressed {
31
- @apply !border-x-0 !border-b-2;
32
- }
33
- }
34
- }
35
-
36
- /* Popover.tsx */
37
- .blockbite-ui__popover {
38
- .components-popover__content {
39
- @apply w-full;
40
- }
41
- }
42
-
43
- /* Button.tsx */
44
- .blockbite-ui__button--default {
45
- @apply !rounded-sm !border-[0.1px] border-solid !border-grey !p-2 !text-[12px] !font-light !text-black !shadow-none hover:bg-easy;
46
- &.is-pressed {
47
- @apply border !border-wordpress !bg-transparent !text-wordpress;
48
- }
49
- .blockbite--icon {
50
- @apply scale-[1.2];
51
- }
52
- }
53
- .blockbite-ui__button {
54
- &.is-icon {
55
- @apply h-[30px] w-[30px];
56
- }
57
- }
58
- /* Large Round Button for nav landings */
59
- .blockbite-ui__button--rounded {
60
- @apply flex !h-14 !w-14 items-center justify-center !rounded-full border !border-black bg-easy !text-black hover:bg-slate-300;
61
- }
62
-
63
- /* Checkbox.tsx */
64
- .blockbite-ui__checkbox span {
65
- @apply !font-sans !text-[12px] !font-normal !text-black;
66
- }
1
+ .bb_ .\!visible{visibility:visible!important}.bb_ .visible{visibility:visible}.bb_ .fixed{position:fixed}.bb_ .absolute{position:absolute}.bb_ .relative{position:relative}.bb_ .bottom-0{bottom:0}.bb_ .left-0{left:0}.bb_ .right-0{right:0}.bb_ .right-1{right:.25rem}.bb_ .top-0{top:0}.bb_ .top-1{top:.25rem}.bb_ .top-2{top:.5rem}.bb_ .z-\[9999\]{z-index:9999}.bb_ .col-span-2{grid-column:span 2 / span 2}.bb_ .\!m-0{margin:0!important}.bb_ .m-0{margin:0}.bb_ .mx-1{margin-left:.25rem;margin-right:.25rem}.bb_ .mx-auto{margin-left:auto;margin-right:auto}.bb_ .my-2{margin-top:.5rem;margin-bottom:.5rem}.bb_ .\!mb-0{margin-bottom:0!important}.bb_ .\!mr-2{margin-right:.5rem!important}.bb_ .mb-4{margin-bottom:1rem}.bb_ .mr-3{margin-right:.75rem}.bb_ .mt-1{margin-top:.25rem}.bb_ .mt-2{margin-top:.5rem}.bb_ .mt-4{margin-top:1rem}.bb_ .block{display:block}.bb_ .flex{display:flex}.bb_ .inline-flex{display:inline-flex}.bb_ .grid{display:grid}.bb_ .aspect-1\/1{aspect-ratio:1 / 1}.bb_ .aspect-16\/10{aspect-ratio:16 / 10}.bb_ .aspect-16\/9{aspect-ratio:16 / 9}.bb_ .aspect-2\/1{aspect-ratio:2 / 1}.bb_ .aspect-21\/9{aspect-ratio:21 / 9}.bb_ .aspect-3\/4{aspect-ratio:3 / 4}.bb_ .aspect-4\/3{aspect-ratio:4 / 3}.bb_ .aspect-5\/4{aspect-ratio:5 / 4}.bb_ .h-12{height:3rem}.bb_ .h-3{height:.75rem}.bb_ .h-4{height:1rem}.bb_ .h-5{height:1.25rem}.bb_ .h-\[1px\]{height:1px}.bb_ .h-\[200px\]{height:200px}.bb_ .h-\[300px\]{height:300px}.bb_ .h-\[32px\]{height:32px}.bb_ .h-\[400px\]{height:400px}.bb_ .h-\[4rem\]{height:4rem}.bb_ .h-\[550px\]{height:550px}.bb_ .h-\[calc\(100\%-80px\)\]{height:calc(100% - 80px)}.bb_ .h-full{height:100%}.bb_ .w-12{width:3rem}.bb_ .w-3{width:.75rem}.bb_ .w-4{width:1rem}.bb_ .w-5{width:1.25rem}.bb_ .w-52{width:13rem}.bb_ .w-\[200px\]{width:200px}.bb_ .w-\[300px\]{width:300px}.bb_ .w-\[400px\]{width:400px}.bb_ .w-\[75px\]{width:75px}.bb_ .w-full{width:100%}.bb_ .min-w-\[240px\]{min-width:240px}.bb_ .max-w-sm{max-width:24rem}.bb_ .shrink-0{flex-shrink:0}.bb_ .grow{flex-grow:1}.bb_ .-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-10{--tw-scale-x: .1;--tw-scale-y: .1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-20{--tw-scale-x: .2;--tw-scale-y: .2;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-30{--tw-scale-x: .3;--tw-scale-y: .3;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-40{--tw-scale-x: .4;--tw-scale-y: .4;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-60{--tw-scale-x: .6;--tw-scale-y: .6;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-70{--tw-scale-x: .7;--tw-scale-y: .7;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-80{--tw-scale-x: .8;--tw-scale-y: .8;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.bb_ .cursor-move{cursor:move}.bb_ .cursor-pointer{cursor:pointer}.bb_ .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.bb_ .flex-row{flex-direction:row}.bb_ .flex-col{flex-direction:column}.bb_ .flex-wrap{flex-wrap:wrap}.bb_ .items-center{align-items:center}.bb_ .items-baseline{align-items:baseline}.bb_ .justify-end{justify-content:flex-end}.bb_ .justify-center{justify-content:center}.bb_ .gap-1{gap:.25rem}.bb_ .gap-2{gap:.5rem}.bb_ :is(.space-x-2>:not([hidden])~:not([hidden])){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.bb_ :is(.space-y-1\.5>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.bb_ :is(.divide-y>:not([hidden])~:not([hidden])){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.bb_ .overflow-auto{overflow:auto}.bb_ .overflow-y-auto{overflow-y:auto}.bb_ .overflow-y-scroll{overflow-y:scroll}.bb_ .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bb_ .\!rounded-none{border-radius:0!important}.bb_ .rounded{border-radius:.25rem}.bb_ .rounded-2xl{border-radius:1rem}.bb_ .rounded-full{border-radius:9999px}.bb_ .border{border-width:1px}.bb_ .border-b{border-bottom-width:1px}.bb_ .border-l-4{border-left-width:4px}.bb_ .border-r{border-right-width:1px}.bb_ .border-t{border-top-width:1px}.bb_ .border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bb_ .border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bb_ .border-transparent{border-color:transparent}.bb_ .border-opacity-70{--tw-border-opacity: .7}.bb_ .\!bg-transparent{background-color:transparent!important}.bb_ .bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bb_ .bg-easy{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bb_ .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bb_ .bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bb_ .bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bb_ .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bb_ .bg-opacity-50{--tw-bg-opacity: .5}.bb_ .\!p-0{padding:0!important}.bb_ .p-0{padding:0}.bb_ .p-2{padding:.5rem}.bb_ .p-4{padding:1rem}.bb_ .px-2\.5{padding-left:.625rem;padding-right:.625rem}.bb_ .px-3{padding-left:.75rem;padding-right:.75rem}.bb_ .px-4{padding-left:1rem;padding-right:1rem}.bb_ .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.bb_ .py-2{padding-top:.5rem;padding-bottom:.5rem}.bb_ .\!pt-2{padding-top:.5rem!important}.bb_ .pb-2{padding-bottom:.5rem}.bb_ .pb-4{padding-bottom:1rem}.bb_ .text-left{text-align:left}.bb_ .text-center{text-align:center}.bb_ .\!font-sans{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,sans-serif!important}.bb_ .\!text-\[11px\]{font-size:11px!important}.bb_ .text-2xl{font-size:1.5rem;line-height:2rem}.bb_ .text-\[12px\]{font-size:12px}.bb_ .text-sm{font-size:.875rem;line-height:1.25rem}.bb_ .text-sm\/6{font-size:.875rem;line-height:1.5rem}.bb_ .text-xs{font-size:.75rem;line-height:1rem}.bb_ .font-bold{font-weight:700}.bb_ .font-medium{font-weight:500}.bb_ .font-semibold{font-weight:600}.bb_ .\!text-current{color:currentColor!important}.bb_ .\!text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity, 1))!important}.bb_ .\!text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity, 1))!important}.bb_ .text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.bb_ .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.bb_ .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.bb_ .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.bb_ .-outline-offset-2{outline-offset:-2px}.bb_ .outline-black{outline-color:#2b2b2a}.bb_ .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.bb_ .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.bb_ .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.blockbite-ui__text-control-label input{margin-bottom:.25rem}.blockbite-ui__text-control-label input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.blockbite-ui__text-control-label input{border-radius:0}.blockbite-ui__text-control-label input{border-width:0px!important}.blockbite-ui__text-control-label input{border-bottom-width:2px}.blockbite-ui__text-control-label input{border-left-width:2px}.blockbite-ui__text-control-label input{border-color:var(--wp-admin-theme-color)}.blockbite-ui__text-control-label input{background-color:transparent}.blockbite-ui__text-control-label input{padding:.25rem}.blockbite-ui__text-control-label input{font-size:13px}.blockbite-ui__text-control-label input{font-weight:700}.blockbite-ui__text-control-label input:focus{border-bottom-width:2px}.blockbite-ui__dropdown-picker .components-button{height:32px!important}.blockbite-ui__modal .components-modal__content{padding:1rem 1rem 4rem}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{height:40px}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-radius:0}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-left-width:0px!important;border-right-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-top-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default{border-bottom-width:2px}.blockbite-ui__button-group--tabs .blockbite-ui__button--default.is-pressed{border-left-width:0px!important;border-right-width:0px!important}.blockbite-ui__button-group--tabs .blockbite-ui__button--default.is-pressed{border-bottom-width:2px!important}.blockbite-ui__popover .components-popover__content{width:100%}.blockbite-ui__button--default{border-radius:.125rem!important;border-width:.1px!important;border-style:solid;--tw-border-opacity: 1 !important;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))!important;padding:.5rem!important;font-size:12px!important;font-weight:300!important;--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important;--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.blockbite-ui__button--default:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.blockbite-ui__button--default.is-pressed{border-width:1px}.blockbite-ui__button--default.is-pressed{border-color:var(--wp-admin-theme-color)!important}.blockbite-ui__button--default.is-pressed{background-color:transparent!important}.blockbite-ui__button--default.is-pressed{color:var(--wp-admin-theme-color)!important}.blockbite-ui__button--default .blockbite--icon{--tw-scale-x: 1.2;--tw-scale-y: 1.2;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.blockbite-ui__button.is-icon{height:30px}.blockbite-ui__button.is-icon{width:30px}.blockbite-ui__button--rounded{display:flex;height:3.5rem!important;width:3.5rem!important;align-items:center;justify-content:center;border-radius:9999px!important;border-width:1px;--tw-border-opacity: 1 !important;border-color:rgb(43 43 42 / var(--tw-border-opacity, 1))!important;--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important}.blockbite-ui__button--rounded:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.blockbite-ui__checkbox span{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,sans-serif!important;font-size:12px!important;font-weight:400!important;--tw-text-opacity: 1 !important;color:rgb(43 43 42 / var(--tw-text-opacity, 1))!important}.bb_ .hover\:bg-easy:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bb_ .hover\:text-wordpress:hover{color:var(--wp-admin-theme-color)}.bb_ .focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.bb_ .focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@media (min-width: 640px){.bb_ .sm\:text-left{text-align:left}}
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json CHANGED
@@ -1,21 +1,16 @@
1
1
  {
2
2
  "name": "@blockbite/ui",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Shared React UI components for Blockbite apps",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
+ "style": "./dist/ui.css",
7
8
  "exports": {
8
9
  ".": {
9
10
  "import": "./dist/index.js",
10
11
  "require": "./dist/index.js",
11
12
  "types": "./dist/index.d.ts",
12
13
  "default": "./dist/index.js"
13
- },
14
- "./components/*": {
15
- "import": "./dist/index.js",
16
- "require": "./dist/index.js",
17
- "types": "./dist/index.d.ts",
18
- "default": "./dist/index.js"
19
14
  }
20
15
  },
21
16
  "files": [
@@ -38,7 +33,8 @@
38
33
  "@wordpress/primitives": "^4.22.0",
39
34
  "classnames": "^2.5.1",
40
35
  "lodash": "^4.17.21",
41
- "@blockbite/icons": "4.4.13"
36
+ "@blockbite/icons": "4.4.15",
37
+ "@blockbite/shared-utils": "2.0.0"
42
38
  },
43
39
  "peerDependencies": {
44
40
  "@wordpress/components": "^29.7.0",
@@ -52,12 +48,19 @@
52
48
  "@types/react-dom": "^18.2.19",
53
49
  "@types/wordpress__block-editor": "^11.5.16",
54
50
  "@types/wordpress__blocks": "^12.5.17",
55
- "typescript": "^5.0.0"
51
+ "@vitejs/plugin-react": "^4.4.1",
52
+ "autoprefixer": "^10.4.19",
53
+ "postcss": "^8.4.38",
54
+ "postcss-nested": "^7.0.2",
55
+ "tailwindcss": "^3.4.17",
56
+ "typescript": "^5.8.3",
57
+ "vite": "^6.3.4",
58
+ "vite-plugin-dts": "^4.5.3"
56
59
  },
57
60
  "scripts": {
58
- "copy-css": "cp ./src/ui.css ./dist/ui.css",
61
+ "dev": "vite",
59
62
  "generate-index": "node ./generate-index.cjs",
60
- "build": "npm run generate-index && tsc --project tsconfig.build.json && npm run copy-css",
63
+ "build": "npm run generate-index && vite build",
61
64
  "type-check": "tsc --noEmit"
62
65
  }
63
66
  }
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Pencil1 as Pencil1Icon } from '@blockbite/icons';
3
- import { Button, Dropdown, TextControl } from '@wordpress/components';
4
- import { useEffect, useState } from '@wordpress/element';
5
- import classNames from 'classnames';
6
- import { ButtonToggle } from './ButtonToggle.js';
7
- import { Wrap } from './Wrap.js';
8
- export function AutocompleteDropdown({ defaultValue, options, swatch, onPressedChange, }) {
9
- const [activeKeyword, setActiveKeyword] = useState('');
10
- const [filteredOptions, setFilteredOptions] = useState([]);
11
- useEffect(() => {
12
- setFilteredOptions(options.filter((option) => option.label.toLowerCase().includes(activeKeyword.toLowerCase())));
13
- }, [activeKeyword, options]);
14
- useEffect(() => {
15
- setActiveKeyword('');
16
- setFilteredOptions(options);
17
- }, [defaultValue, options]);
18
- return (_jsx(Dropdown, { className: "option-panel-dropdown", contentClassName: "option-panel-dropdown-content", popoverProps: { placement: 'bottom-start' }, renderToggle: ({ isOpen, onToggle }) => (_jsx(Wrap, { important: true, children: _jsx(Button, { variant: "secondary", size: "small", onClick: onToggle, "aria-expanded": isOpen, children: _jsxs("div", { className: "flex items-center gap-1 !bg-transparent !p-0 !text-[11px] !text-current", children: [swatch && (_jsx("div", { className: classNames(`h-3 w-3 rounded-full bg-${defaultValue}`) })), _jsx("span", { children: defaultValue || 'Select option…' }), _jsx(Pencil1Icon, {})] }) }) })), renderContent: () => (_jsx(Wrap, { important: true, children: _jsxs("div", { className: "w-52", children: [_jsx(TextControl, { label: "Search options", value: activeKeyword, onChange: (value) => setActiveKeyword(value), autoComplete: "off" }), _jsxs("div", { className: "grid grid-cols-2 gap-1 !bg-transparent !p-0 !pt-2", children: [filteredOptions.length === 0 && (_jsx("div", { className: "!text-gray-medium col-span-2 pb-2 text-center !text-[11px]", children: "No options found." })), filteredOptions.map((option, index) => (_jsxs(ButtonToggle, { className: classNames({
19
- 'bg-primary': option.value,
20
- }), size: "small", value: option.value.toString(), defaultPressed: defaultValue, onPressedChange: (value) => {
21
- onPressedChange(value ? option.value : '');
22
- }, children: [swatch && (_jsx("div", { className: classNames(`mr-3 h-3 w-3 rounded-full bg-${option.value}`) })), option.label] }, `ButtonToggle__${option.value}___${index}`)))] })] }) })) }));
23
- }
24
- //# sourceMappingURL=AutocompleteDropdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutocompleteDropdown.js","sourceRoot":"","sources":["../src/AutocompleteDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,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AAK,EAAE,CAmBlC,CAChB,CAAC,IACE,IACF,GACD,CACR,GACD,CACH,CAAC;AACJ,CAAC"}
package/dist/Badge.js DELETED
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- export const Badge = ({ children, className, onClick }) => {
4
- return (_jsx("div", { onClick: onClick, className: classNames(className, 'inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800'), children: children }));
5
- };
6
- //# sourceMappingURL=Badge.js.map
package/dist/Badge.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAQpC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAc,EAAE,EAAE;IACpE,OAAO,CACL,cACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,CACnB,SAAS,EACT,mGAAmG,CACpG,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createPortal, useEffect, useRef, useState } from '@wordpress/element';
3
- export const BitePreview = ({ htmlContent, cssContent, frontendAssets }) => {
4
- const iframeRef = useRef(null);
5
- const [iframeBody, setIframeBody] = useState(null);
6
- useEffect(() => {
7
- const iframe = iframeRef.current;
8
- if (iframe) {
9
- iframe.onload = () => {
10
- const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
11
- if (iframeDocument) {
12
- setIframeBody(iframeDocument.body); // Set the iframe body for portal
13
- // Inject CSS content directly
14
- const styleTag = iframeDocument.createElement('style');
15
- styleTag.innerHTML = cssContent;
16
- iframeDocument.head.appendChild(styleTag);
17
- // Adopt or Create Frontend Assets
18
- frontendAssets.forEach(({ type, id, url }) => {
19
- const existingElement = document.getElementById(id);
20
- if (existingElement) {
21
- // If the asset exists in the parent, move it to the iframe
22
- const adoptedElement = document.adoptNode(existingElement.cloneNode(true));
23
- iframeDocument.head.appendChild(adoptedElement);
24
- }
25
- else {
26
- // Create a new script or style if not found
27
- const newElement = iframeDocument.createElement(type === 'script' ? 'script' : 'link');
28
- newElement.id = id;
29
- if (type === 'script') {
30
- newElement.src = url;
31
- newElement.async = true;
32
- }
33
- else {
34
- newElement.rel = 'stylesheet';
35
- newElement.href = url;
36
- }
37
- iframeDocument.head.appendChild(newElement);
38
- }
39
- });
40
- }
41
- };
42
- }
43
- return () => {
44
- if (iframe) {
45
- iframe.onload = null; // Clean up event listener
46
- }
47
- };
48
- }, [htmlContent, cssContent, frontendAssets]);
49
- return (_jsxs("div", { className: "render-preview-container", style: { width: '100%', minHeight: '100%' }, children: [_jsx("iframe", { ref: iframeRef, title: "Preview", className: "editor-styles-wrapper", width: "100%", height: "100%" }), iframeBody &&
50
- createPortal(_jsx("div", { className: "b_", children: _jsx("div", { className: "b_utils", dangerouslySetInnerHTML: { __html: htmlContent } }) }), iframeBody)] }));
51
- };
52
- //# sourceMappingURL=BitePreview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BitePreview.js","sourceRoot":"","sources":["../src/BitePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;IACzE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QAEjC,IAAI,MAAM,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gCAC9B,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;4BACxB,CAAC;4BAED,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;wBAC9C,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,0BAA0B;YAClD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;IAE9C,OAAO,CACL,eACE,SAAS,EAAC,0BAA0B,EACpC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAE3C,iBACE,GAAG,EAAE,SAAS,EACd,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,uBAAuB,EACjC,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,GACb,EACD,UAAU;gBACT,YAAY,CACV,cAAK,SAAS,EAAC,IAAI,YACjB,cACE,SAAS,EAAC,SAAS,EACnB,uBAAuB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAChD,GACE,EACN,UAAU,CACX,IACC,CACP,CAAC;AACJ,CAAC,CAAC"}
package/dist/Button.js DELETED
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button as WordpressButton } from '@wordpress/components';
3
- import classNames from 'classnames';
4
- import { Icon } from './Icon.js';
5
- export const Button = ({ children, size = 'default', label, className, onClick, variant = 'primary', display = 'auto', icon, disabled = false, }) => {
6
- const isIconDisplay = display === 'icon' || display === 'icon-lg';
7
- return (_jsxs(WordpressButton, { size: size, variant: variant, label: label, showTooltip: true, disabled: disabled, className: classNames(className, 'blockbite-ui__button', 'flex items-center justify-center gap-1', { 'is-primary': variant === 'primary' }, { 'is-secondary': variant === 'secondary' }, { 'is-link': variant === 'link' }, { 'is-tertiary': variant === 'tertiary' }, { 'is-icon': display === 'icon' }), onClick: onClick, children: [icon && (_jsx(Icon, { icon: icon, className: classNames({ 'h-4 w-4': display === 'icon-lg' }) })), !isIconDisplay ? children : null, label && !children && !isIconDisplay ? _jsx("span", { children: label }) : null] }));
8
- };
9
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAejC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,MAAM,EAChB,IAAI,EACJ,QAAQ,GAAG,KAAK,GACJ,EAAE,EAAE;IAChB,MAAM,aAAa,GAAG,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,SAAS,CAAC;IAElE,OAAO,CACL,MAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,CACnB,SAAS,EACT,sBAAsB,EACtB,wCAAwC,EACxC,EAAE,YAAY,EAAE,OAAO,KAAK,SAAS,EAAE,EACvC,EAAE,cAAc,EAAE,OAAO,KAAK,WAAW,EAAE,EAC3C,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,EAAE,EACjC,EAAE,aAAa,EAAE,OAAO,KAAK,UAAU,EAAE,EACzC,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,EAAE,CAClC,EACD,OAAO,EAAE,OAAO,aAEf,IAAI,IAAI,CACP,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC,GAC3D,CACH,EACA,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAChC,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,yBAAO,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,IACnD,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button as WordpressButton } from '@wordpress/components';
3
- import { memo, useCallback, useEffect, useState } from '@wordpress/element';
4
- import classNames from 'classnames';
5
- import { Icon } from './Icon.js';
6
- import { Wrap } from './Wrap.js';
7
- export const ButtonToggle = memo(({ children, className, value, variant = 'secondary', defaultPressed, onPressedChange, icon, size = 'compact', display = 'auto', label, }) => {
8
- const [isPressed, setIsPressed] = useState(false);
9
- useEffect(() => {
10
- setIsPressed(defaultPressed === value ? true : false);
11
- // eslint-disable-next-line react-hooks/exhaustive-deps
12
- }, [defaultPressed]);
13
- const handleClick = useCallback(() => {
14
- setIsPressed((prev) => !prev);
15
- onPressedChange(value);
16
- // eslint-disable-next-line react-hooks/exhaustive-deps
17
- }, [isPressed, onPressedChange]);
18
- return (_jsxs(WordpressButton, { "aria-label": label, className: classNames(className, 'blockbite-ui__button--default'), value: value, size: size, label: label, variant: variant, showTooltip: true, isPressed: isPressed, onClick: handleClick, children: [icon && _jsx(Icon, { icon: icon }), display !== 'icon' ? children : null, label && !children && display !== 'icon' ? _jsx("span", { children: label }) : null] }));
19
- });
20
- export const ButtonToggleGroup = memo(({ className, defaultPressed = '', toggle = true, display = 'auto', options, size = 'compact', tabs = false, variant = 'secondary', stretch = false, onPressedChange, }) => {
21
- const [isPressed, setIsPressed] = useState(defaultPressed);
22
- useEffect(() => {
23
- setIsPressed(defaultPressed);
24
- }, [defaultPressed]);
25
- const handleButtonClick = useCallback((value) => {
26
- const newValue = toggle && isPressed === value ? '' : value;
27
- setIsPressed(newValue);
28
- onPressedChange === null || onPressedChange === void 0 ? void 0 : onPressedChange(newValue);
29
- }, [isPressed, onPressedChange, toggle]);
30
- const renderContent = (option) => {
31
- if (display === 'icon' && (option === null || option === void 0 ? void 0 : option.icon)) {
32
- return _jsx(Icon, { icon: option.icon });
33
- }
34
- else if (display === 'label') {
35
- return _jsx("span", { children: option.label });
36
- }
37
- return (_jsxs("span", { className: "flex items-center justify-center gap-1", children: [option.icon && _jsx(Icon, { icon: option.icon }), _jsx("span", { children: option.label })] }));
38
- };
39
- return (_jsx(Wrap, { className: classNames('blockbite-ui__button-group flex flex-wrap gap-1', className, tabs ? 'blockbite-ui__button-group--tabs' : ''), children: options.map((option, index) => (_jsxs(WordpressButton, { className: classNames('blockbite-ui__button--default', {
40
- grow: stretch,
41
- 'justify-center': stretch,
42
- }), "aria-label": option.label, showTooltip: true, value: option.value, size: size, label: (option === null || option === void 0 ? void 0 : option.tooltip) || option.label, variant: variant, isPressed: isPressed === option.value, onClick: () => handleButtonClick(option.value), children: [renderContent(option), option.children && option.children] }, `ButtonToggleGroup__${option.value}__${option.label}__${index}`))) }));
43
- });
44
- //# sourceMappingURL=ButtonToggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonToggle.js","sourceRoot":"","sources":["../src/ButtonToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAA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AO,CACL,gBAAM,SAAS,EAAC,wCAAwC,aACrD,MAAM,CAAC,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EAC3C,yBAAO,MAAM,CAAC,KAAK,GAAQ,IACtB,CACR,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,UAAU,CACnB,iDAAiD,EACjD,SAAS,EACT,IAAI,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,EAAE,CAC/C,YAEA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,MAAC,eAAe,IAEd,SAAS,EAAE,UAAU,CAAC,+BAA+B,EAAE;gBACrD,IAAI,EAAE,OAAO;gBACb,gBAAgB,EAAE,OAAO;aAC1B,CAAC,gBAEU,MAAM,CAAC,KAAK,EACxB,WAAW,EAAE,IAAI,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,KAAI,MAAM,CAAC,KAAK,EACtC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC,KAAK,EACrC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,aAE7C,aAAa,CAAC,MAAM,CAAC,EACrB,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAhB9B,sBAAsB,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK,EAAE,CAiBpD,CACnB,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
package/dist/Chapter.js DELETED
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { Wrap } from './Wrap.js';
4
- export const Chapter = ({ children, title }) => {
5
- return (_jsxs(Wrap, { className: classNames('text-gray-medium my-2 flex items-center gap-1 text-[12px] font-medium', classNames), children: [title && _jsx(Wrap, { className: "font-medium", children: title }), children] }));
6
- };
7
- //# sourceMappingURL=Chapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chapter.js","sourceRoot":"","sources":["../src/Chapter.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAgB,EAAE,EAAE;IAC3D,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE,UAAU,CACnB,uEAAuE,EACvE,UAAU,CACX,aAEA,KAAK,IAAI,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,YAAE,KAAK,GAAQ,EACrD,QAAQ,IACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- export const ChapterDivider = ({ id = '', title, className, help, }) => {
4
- return (_jsxs("div", Object.assign({}, (id ? { id } : null), { className: classNames('mb-4', className), children: [_jsxs("div", { className: "flex w-full flex-wrap items-center gap-2", children: [_jsx("small", { className: "shrink-1 text-[12px]", children: title }), _jsx("span", { className: "h-[1px] w-full bg-easy" })] }), help && _jsx("small", { className: "w-full shrink-0 text-[12px]", children: help })] })));
5
- };
6
- //# sourceMappingURL=ChapterDivider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChapterDivider.js","sourceRoot":"","sources":["../src/ChapterDivider.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AASpC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,EAAE,GAAG,EAAE,EACP,KAAK,EACL,SAAS,EACT,IAAI,GACgB,EAAE,EAAE;IACxB,OAAO,CACL,+BAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,aACrE,eAAK,SAAS,EAAC,0CAA0C,aACvD,gBAAO,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAS,EACvD,eAAM,SAAS,EAAC,wBAAwB,GAAQ,IAC5C,EACL,IAAI,IAAI,gBAAO,SAAS,EAAC,6BAA6B,YAAE,IAAI,GAAS,KAClE,CACP,CAAC;AACJ,CAAC,CAAC"}
package/dist/Checkbox.js DELETED
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CheckboxControl } from '@wordpress/components';
3
- import { useEffect, useState } from '@wordpress/element';
4
- import { Wrap } from './Wrap.js';
5
- export const Checkbox = ({ label, help, defaultChecked }) => {
6
- const [isChecked, setChecked] = useState(defaultChecked);
7
- useEffect(() => {
8
- setChecked(defaultChecked);
9
- }, [defaultChecked]);
10
- return (_jsx(Wrap, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2", children: _jsx(CheckboxControl, { label: label, help: help, checked: isChecked, onChange: setChecked }) }));
11
- };
12
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAiB,EAAE,EAAE;IACzE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAC,qDAAqD,YACnE,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,UAAU,GACpB,GACG,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,28 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from '@wordpress/element';
3
- export const DisappearingMessage = ({ duration, children, trigger, }) => {
4
- const [alert, setAlert] = useState(false);
5
- const isMountingRef = useRef(false);
6
- useEffect(() => {
7
- isMountingRef.current = true;
8
- }, []);
9
- useEffect(() => {
10
- let timeoutId = null;
11
- // Only run on subsequent renders
12
- if (trigger && !isMountingRef.current) {
13
- setAlert(true);
14
- timeoutId = setTimeout(() => {
15
- setAlert(false);
16
- }, duration);
17
- }
18
- else {
19
- isMountingRef.current = false;
20
- }
21
- // Cleanup timeout on unmount or when `trigger` changes
22
- return () => {
23
- clearTimeout(timeoutId);
24
- };
25
- }, [trigger, duration]);
26
- return alert && _jsx(_Fragment, { children: children });
27
- };
28
- //# sourceMappingURL=DisappearingMessage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DisappearingMessage.js","sourceRoot":"","sources":["../src/DisappearingMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAQjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,OAAO,GACkB,EAAE,EAAE;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,iCAAiC;QACjC,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC1B,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,EAAE,QAAQ,CAAC,CAAC;QACf,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAChC,CAAC;QAED,uDAAuD;QACvD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExB,OAAO,KAAK,IAAI,4BAAG,QAAQ,GAAI,CAAC;AAClC,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ChevronDown as ChevronDownIcon } from '@blockbite/icons';
3
- import { DropdownMenu } from '@wordpress/components';
4
- import { useEffect, useState } from '@wordpress/element';
5
- import classNames from 'classnames';
6
- import { Icon } from './Icon.js';
7
- export const DropdownPicker = ({ label, className, defaultValue, defaultIcon = ChevronDownIcon, onPressedChange, options, }) => {
8
- var _a;
9
- const [currentOption, setCurrentOption] = useState(null);
10
- useEffect(() => {
11
- setCurrentOption(defaultValue);
12
- }, [defaultValue]);
13
- const allOptions = [
14
- ...options.map((option) => ({
15
- icon: option.icon,
16
- label: option.label,
17
- title: option.label,
18
- value: option.value,
19
- onClick: () => {
20
- setCurrentOption(option.value);
21
- onPressedChange(option.value);
22
- },
23
- })),
24
- {
25
- icon: _jsx(Icon, { icon: defaultIcon }),
26
- title: 'Reset',
27
- value: 'reset',
28
- onClick: () => {
29
- setCurrentOption('reset');
30
- onPressedChange('reset');
31
- },
32
- },
33
- ];
34
- return (_jsx(DropdownMenu, { controls: allOptions, className: classNames('blockbite-ui__dropdown-picker border-primary border', className), icon: ((_a = options.find((option) => option.value === currentOption)) === null || _a === void 0 ? void 0 : _a.icon) || (_jsx(Icon, { icon: defaultIcon })), label: label || 'Select' }));
35
- };
36
- //# sourceMappingURL=DropdownPicker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownPicker.js","sourceRoot":"","sources":["../src/DropdownPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBjC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,GAAG,eAAe,EAC7B,eAAe,EACf,OAAO,GACa,EAAE,EAAE;;IACxB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,UAAU,GAAG;QACjB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,GAAG,EAAE;gBACZ,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC/B,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;SACF,CAAC,CAAC;QACH;YACE,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI;YACjC,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,GAAG,EAAE;gBACZ,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC1B,eAAe,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,UAAU,CACnB,qDAAqD,EACrD,SAAS,CACV,EACD,IAAI,EACF,CAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC,0CAAE,IAAI,KAAI,CAChE,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI,CAC5B,EAEH,KAAK,EAAE,KAAK,IAAI,QAAQ,GACxB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- export function EmptyState(_a) {
14
- var { icon, title, description, children = null } = _a, rest = __rest(_a, ["icon", "title", "description", "children"]);
15
- return (_jsx("div", Object.assign({}, rest, { children: _jsx("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans", children: _jsxs("div", { className: "max-w-sm", children: [icon && _jsx("div", { className: "mx-auto !text-gray-400", children: icon }), _jsx("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium", children: title }), _jsx("p", { className: "mt-1 !font-sans text-sm !text-gray-500", children: description }), children && _jsx("div", { className: "mt-4", children: children })] }) }) })));
16
- }
17
- //# sourceMappingURL=EmptyState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAQA,MAAM,UAAU,UAAU,CAAC,EAMnB;QANmB,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,IAAI,OAET,EADH,IAAI,cALkB,4CAM1B,CADQ;IAEP,OAAO,CACL,8BAAS,IAAI,cACX,cAAK,SAAS,EAAC,gFAAgF,YAC7F,eAAK,SAAS,EAAC,UAAU,aACtB,IAAI,IAAI,cAAK,SAAS,EAAC,wBAAwB,YAAE,IAAI,GAAO,EAC7D,aAAI,SAAS,EAAC,sDAAsD,YACjE,KAAK,GACH,EACL,YAAG,SAAS,EAAC,wCAAwC,YAClD,WAAW,GACV,EACH,QAAQ,IAAI,cAAK,SAAS,EAAC,MAAM,YAAE,QAAQ,GAAO,IAC/C,GACF,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from '@wordpress/element';
3
- export function FloatingPanel({ children, }) {
4
- const panelRef = useRef(null);
5
- const [position, setPosition] = useState({ x: 100, y: 100 });
6
- const [dragging, setDragging] = useState(false);
7
- const [offset, setOffset] = useState({ x: 0, y: 0 });
8
- useEffect(() => {
9
- const handleMouseMove = (e) => {
10
- if (dragging) {
11
- setPosition({
12
- x: e.clientX - offset.x,
13
- y: e.clientY - offset.y,
14
- });
15
- }
16
- };
17
- const handleMouseUp = () => setDragging(false);
18
- window.addEventListener('mousemove', handleMouseMove);
19
- window.addEventListener('mouseup', handleMouseUp);
20
- return () => {
21
- window.removeEventListener('mousemove', handleMouseMove);
22
- window.removeEventListener('mouseup', handleMouseUp);
23
- };
24
- }, [dragging, offset]);
25
- const startDragging = (e) => {
26
- const rect = panelRef.current.getBoundingClientRect();
27
- setOffset({ x: e.clientX - rect.left, y: e.clientY - rect.top });
28
- setDragging(true);
29
- };
30
- return (_jsx("div", { className: "bb_", children: _jsxs("div", { ref: panelRef, className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]", style: { left: position.x, top: position.y }, children: [children, _jsx("div", { className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded", onMouseDown: startDragging })] }) }));
31
- }
32
- //# sourceMappingURL=FloatingPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../src/FloatingPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAMjE,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,GAGT;IACC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7D,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE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E,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,aAE3C,QAAQ,EACT,cACE,SAAS,EAAC,gEAAgE,EAC1E,WAAW,EAAE,aAAa,GACrB,IACH,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FocalPointPicker } from '@wordpress/components';
3
- import { useEffect, useState } from '@wordpress/element';
4
- import { Wrap } from './Wrap.js';
5
- export const FocalPointControl = ({ defaultValue, onValueChange, url, }) => {
6
- const [focalPoint, setFocalPoint] = useState({
7
- x: 0.5,
8
- y: 0.5,
9
- });
10
- useEffect(() => {
11
- onValueChange(`[${(focalPoint.x * 100).toFixed(2)}%_${(focalPoint.y * 100).toFixed(2)}%]`);
12
- // eslint-disable-next-line react-hooks/exhaustive-deps
13
- }, [focalPoint]);
14
- useEffect(() => {
15
- // default value is in the format of [x%_y%] parse to get the x and y values
16
- if (defaultValue.includes('%')) {
17
- const [x, y] = defaultValue
18
- .replace('[', '')
19
- .replace('%]', '')
20
- .split('_')
21
- .map((value) => parseFloat(value) / 100);
22
- setFocalPoint({
23
- x,
24
- y,
25
- });
26
- }
27
- }, [defaultValue]);
28
- return (_jsx(Wrap, { className: "relative flex flex-col", children: _jsx(FocalPointPicker, { url: url, value: focalPoint, onDrag: (value) => setFocalPoint(value), onChange: (value) => setFocalPoint(value) }) }));
29
- };
30
- export default FocalPointControl;
31
- //# sourceMappingURL=FocalPointControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FocalPointControl.js","sourceRoot":"","sources":["../src/FocalPointControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,MAAM,CAAC,MAAM,iBAAiB,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C,GACzC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
package/dist/Icon.js DELETED
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Wrap } from './Wrap.js';
3
- export const Icon = ({ icon: IconComponent, className = '' }) => {
4
- if (!IconComponent)
5
- return null;
6
- return (_jsxs(Wrap, { className: `blockbite--icon`, children: [_jsx(IconComponent, { className: className }), ' '] }));
7
- };
8
- //# sourceMappingURL=Icon.js.map
package/dist/Icon.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,EAAE,EAAa,EAAE,EAAE;IACzE,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,iBAAiB,aAChC,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,GAAI,EAAC,GAAG,IAEtC,CACR,CAAC;AACJ,CAAC,CAAC"}