@cambly/syntax-core 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +6 -7
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +8 -20
- package/dist/index.js +16 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -372,17 +372,6 @@ function foregroundColor(color) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
// src/Button/Button.tsx
|
|
376
|
-
import { useContext } from "react";
|
|
377
|
-
|
|
378
|
-
// src/ButtonGroup/ButtonGroupContext.tsx
|
|
379
|
-
import React from "react";
|
|
380
|
-
var ButtonGroupContext = React.createContext(
|
|
381
|
-
{}
|
|
382
|
-
);
|
|
383
|
-
ButtonGroupContext.displayName = "ButtonGroupContext";
|
|
384
|
-
var ButtonGroupContext_default = ButtonGroupContext;
|
|
385
|
-
|
|
386
375
|
// css-module:./Button.module.css#css-module
|
|
387
376
|
var Button_module_default = { "button": "_button_13egy_1", "buttonGap": "_buttonGap_13egy_9", "fullWidth": "_fullWidth_13egy_50", "sm": "_sm_13egy_54", "md": "_md_13egy_61", "lg": "_lg_13egy_68", "icon": "_icon_13egy_75", "smIcon": "_smIcon_13egy_79", "mdIcon": "_mdIcon_13egy_86", "lgIcon": "_lgIcon_13egy_93", "textContainer": "_textContainer_13egy_100", "secondaryBorder": "_secondaryBorder_13egy_105", "secondaryDestructiveBorder": "_secondaryDestructiveBorder_13egy_109", "loading": "_loading_13egy_123", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_13egy_1", "loadingCircle": "_loadingCircle_13egy_127", "buttonText": "_buttonText_13egy_135", "buttonTextSmall": "_buttonTextSmall_13egy_142", "buttonTextMedium": "_buttonTextMedium_13egy_146", "buttonTextLarge": "_buttonTextLarge_13egy_150" };
|
|
388
377
|
|
|
@@ -408,20 +397,16 @@ var Button = ({
|
|
|
408
397
|
text,
|
|
409
398
|
loadingText,
|
|
410
399
|
color = "primary",
|
|
411
|
-
size
|
|
400
|
+
size = "md",
|
|
412
401
|
accessibilityLabel,
|
|
413
|
-
disabled
|
|
402
|
+
disabled = false,
|
|
414
403
|
loading = false,
|
|
415
|
-
fullWidth
|
|
404
|
+
fullWidth = false,
|
|
416
405
|
startIcon: StartIcon,
|
|
417
406
|
endIcon: EndIcon,
|
|
418
407
|
onClick,
|
|
419
408
|
tooltip
|
|
420
409
|
}) => {
|
|
421
|
-
const contextProps = useContext(ButtonGroupContext_default);
|
|
422
|
-
const size = (contextProps == null ? void 0 : contextProps.size) || sizeProp;
|
|
423
|
-
const disabled = (contextProps == null ? void 0 : contextProps.disabled) || disabledProp;
|
|
424
|
-
const fullWidth = (contextProps == null ? void 0 : contextProps.fullWidth) || fullWidthProp;
|
|
425
410
|
return /* @__PURE__ */ jsxs(
|
|
426
411
|
"button",
|
|
427
412
|
{
|
|
@@ -472,11 +457,8 @@ var Button = ({
|
|
|
472
457
|
};
|
|
473
458
|
var Button_default = Button;
|
|
474
459
|
|
|
475
|
-
// src/ButtonGroup/ButtonGroup.tsx
|
|
476
|
-
import { useMemo } from "react";
|
|
477
|
-
|
|
478
460
|
// css-module:./ButtonGroup.module.css#css-module
|
|
479
|
-
var ButtonGroup_module_default = { "buttonGroup": "
|
|
461
|
+
var ButtonGroup_module_default = { "buttonGroup": "_buttonGroup_1f9x9_1", "horizontal": "_horizontal_1f9x9_5", "vertical": "_vertical_1f9x9_9", "smallGap": "_smallGap_1f9x9_13", "mediumGap": "_mediumGap_1f9x9_17", "largeGap": "_largeGap_1f9x9_21" };
|
|
480
462
|
|
|
481
463
|
// src/ButtonGroup/ButtonGroup.tsx
|
|
482
464
|
var import_classnames4 = __toESM(require_classnames());
|
|
@@ -487,21 +469,15 @@ var gap = {
|
|
|
487
469
|
["lg"]: ButtonGroup_module_default.largeGap
|
|
488
470
|
};
|
|
489
471
|
var ButtonGroup = ({
|
|
490
|
-
disabled = false,
|
|
491
|
-
fullWidth = false,
|
|
492
472
|
orientation = "horizontal",
|
|
493
473
|
size = "md",
|
|
494
474
|
children
|
|
495
475
|
}) => {
|
|
496
|
-
const context = useMemo(
|
|
497
|
-
() => ({ disabled, fullWidth, size }),
|
|
498
|
-
[disabled, fullWidth, size]
|
|
499
|
-
);
|
|
500
476
|
const classnames2 = (0, import_classnames4.default)(ButtonGroup_module_default.buttonGroup, gap[size], {
|
|
501
477
|
[ButtonGroup_module_default.horizontal]: orientation === "horizontal",
|
|
502
478
|
[ButtonGroup_module_default.vertical]: orientation === "vertical"
|
|
503
479
|
});
|
|
504
|
-
return /* @__PURE__ */ jsx4(
|
|
480
|
+
return /* @__PURE__ */ jsx4("div", { className: classnames2, children });
|
|
505
481
|
};
|
|
506
482
|
var ButtonGroup_default = ButtonGroup;
|
|
507
483
|
|
|
@@ -598,7 +574,6 @@ var Heading_default = Heading;
|
|
|
598
574
|
|
|
599
575
|
// src/IconButton/IconButton.tsx
|
|
600
576
|
var import_classnames6 = __toESM(require_classnames());
|
|
601
|
-
import { useContext as useContext2 } from "react";
|
|
602
577
|
|
|
603
578
|
// css-module:./IconButton.module.css#css-module
|
|
604
579
|
var IconButton_module_default = { "iconButton": "_iconButton_dzhn0_1", "sm": "_sm_dzhn0_46", "md": "_md_dzhn0_51", "lg": "_lg_dzhn0_56", "smIcon": "_smIcon_dzhn0_61", "mdIcon": "_mdIcon_dzhn0_68", "lgIcon": "_lgIcon_dzhn0_75" };
|
|
@@ -613,15 +588,12 @@ var iconSize2 = {
|
|
|
613
588
|
var IconButton = ({
|
|
614
589
|
accessibilityLabel,
|
|
615
590
|
color = "primary",
|
|
616
|
-
disabled
|
|
591
|
+
disabled = false,
|
|
617
592
|
icon: Icon,
|
|
618
|
-
size
|
|
593
|
+
size = "md",
|
|
619
594
|
tooltip,
|
|
620
595
|
onClick
|
|
621
596
|
}) => {
|
|
622
|
-
const contextProps = useContext2(ButtonGroupContext_default);
|
|
623
|
-
const size = (contextProps == null ? void 0 : contextProps.size) || sizeProp;
|
|
624
|
-
const disabled = (contextProps == null ? void 0 : contextProps.disabled) || disabledProp;
|
|
625
597
|
return /* @__PURE__ */ jsx9(
|
|
626
598
|
"button",
|
|
627
599
|
{
|