tgui-core 1.1.23 → 1.2.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.
@@ -0,0 +1,18 @@
1
+ import './assets/Section.css';const t = "_section_10c68_17", _ = "_title_10c68_28", n = "_titleText_10c68_34", o = "_buttons_10c68_40", c = "_rest_10c68_47", e = "_content_10c68_51", s = "_fitted_10c68_55", l = "_fill_10c68_59", i = "_scrollable_10c68_73", r = "_scrollableHorizontal_10c68_90", a = "_section__flex_10c68_125", b = "_content__noTopPadding_10c68_135", d = "_content__stretchContents_10c68_139", f = {
2
+ section: t,
3
+ title: _,
4
+ titleText: n,
5
+ buttons: o,
6
+ rest: c,
7
+ content: e,
8
+ fitted: s,
9
+ fill: l,
10
+ scrollable: i,
11
+ scrollableHorizontal: r,
12
+ section__flex: a,
13
+ content__noTopPadding: b,
14
+ content__stretchContents: d
15
+ };
16
+ export {
17
+ f as s
18
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file
3
+ * @copyright 2024 Aylong (https://github.com/AyIong)
4
+ * @license MIT
5
+ */._color__black_7gau9_18{background-color:#0003;color:#fff;border:solid rgba(32,32,32,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__black_7gau9_18:hover{background-color:#20202033}._contentColor__black_7gau9_29{background-color:#000;color:#fff;border:solid #101010;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__black_7gau9_37{background-color:#00000054;color:#fff;border:solid rgba(32,32,32,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__white_7gau9_45{background-color:#d9d9d933;color:#000;border:solid rgba(250,250,250,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__white_7gau9_45:hover{background-color:#fafafa33}._contentColor__white_7gau9_56{background-color:#d9d9d9;color:#000;border:solid #f8f8f8;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__white_7gau9_64{background-color:#d9d9d954;color:#000;border:solid rgba(250,250,250,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__red_7gau9_72{background-color:#bd202033;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__red_7gau9_72:hover{background-color:#e3707033}._contentColor__red_7gau9_83{background-color:#bd2020;color:#fff;border:solid #d93f3f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__red_7gau9_91{background-color:#bd202054;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__orange_7gau9_99{background-color:#d95e0c33;color:#fff;border:solid rgba(244,162,107,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__orange_7gau9_99:hover{background-color:#f4a26b33}._contentColor__orange_7gau9_110{background-color:#d95e0c;color:#fff;border:solid #ef7e33;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__orange_7gau9_118{background-color:#d95e0c54;color:#fff;border:solid rgba(244,162,107,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__yellow_7gau9_126{background-color:#d9b80433;color:#000;border:solid rgba(248,225,91,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__yellow_7gau9_126:hover{background-color:#f8e15b33}._contentColor__yellow_7gau9_137{background-color:#d9b804;color:#000;border:solid #f5d523;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__yellow_7gau9_145{background-color:#d9b80454;color:#000;border:solid rgba(248,225,91,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__olive_7gau9_153{background-color:#9aad1433;color:#000;border:solid rgba(209,228,79,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__olive_7gau9_153:hover{background-color:#d1e44f33}._contentColor__olive_7gau9_164{background-color:#9aad14;color:#000;border:solid #bdd327;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__olive_7gau9_172{background-color:#9aad1454;color:#000;border:solid rgba(209,228,79,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__green_7gau9_180{background-color:#1b963833;color:#fff;border:solid rgba(72,214,105,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__green_7gau9_180:hover{background-color:#48d66933}._contentColor__green_7gau9_191{background-color:#1b9638;color:#fff;border:solid #2fb94f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__green_7gau9_199{background-color:#1b963854;color:#fff;border:solid rgba(72,214,105,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__teal_7gau9_207{background-color:#009a9333;color:#fff;border:solid rgba(32,225,216,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__teal_7gau9_207:hover{background-color:#20e1d833}._contentColor__teal_7gau9_218{background-color:#009a93;color:#fff;border:solid #10bdb6;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__teal_7gau9_226{background-color:#009a9354;color:#fff;border:solid rgba(32,225,216,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__blue_7gau9_234{background-color:#1c71b133;color:#fff;border:solid rgba(96,169,224,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__blue_7gau9_234:hover{background-color:#60a9e033}._contentColor__blue_7gau9_245{background-color:#1c71b1;color:#fff;border:solid #308fd6;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__blue_7gau9_253{background-color:#1c71b154;color:#fff;border:solid rgba(96,169,224,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__violet_7gau9_261{background-color:#552dab33;color:#fff;border:solid rgba(149,119,215,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__violet_7gau9_261:hover{background-color:#9577d733}._contentColor__violet_7gau9_272{background-color:#552dab;color:#fff;border:solid #7249ca;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__violet_7gau9_280{background-color:#552dab54;color:#fff;border:solid rgba(149,119,215,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__purple_7gau9_288{background-color:#8b2baa33;color:#fff;border:solid rgba(190,115,215,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__purple_7gau9_288:hover{background-color:#be73d733}._contentColor__purple_7gau9_299{background-color:#8b2baa;color:#fff;border:solid #aa46ca;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__purple_7gau9_307{background-color:#8b2baa54;color:#fff;border:solid rgba(190,115,215,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__pink_7gau9_315{background-color:#cf208233;color:#fff;border:solid rgba(233,129,188,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__pink_7gau9_315:hover{background-color:#e981bc33}._contentColor__pink_7gau9_326{background-color:#cf2082;color:#fff;border:solid #e04ca0;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__pink_7gau9_334{background-color:#cf208254;color:#fff;border:solid rgba(233,129,188,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__brown_7gau9_342{background-color:#8c583633;color:#fff;border:solid rgba(195,144,111,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__brown_7gau9_342:hover{background-color:#c3906f33}._contentColor__brown_7gau9_353{background-color:#8c5836;color:#fff;border:solid #ae724c;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__brown_7gau9_361{background-color:#8c583654;color:#fff;border:solid rgba(195,144,111,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__grey_7gau9_369{background-color:#64646433;color:#fff;border:solid rgba(157,157,157,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__grey_7gau9_369:hover{background-color:#9d9d9d33}._contentColor__grey_7gau9_380{background-color:#646464;color:#fff;border:solid #818181;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__grey_7gau9_388{background-color:#64646454;color:#fff;border:solid rgba(157,157,157,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__light-grey_7gau9_396{background-color:#91919133;color:#fff;border:solid rgba(213,213,213,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__light-grey_7gau9_396:hover{background-color:#d5d5d533}._contentColor__light-grey_7gau9_407{background-color:#919191;color:#fff;border:solid #b3b3b3;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__light-grey_7gau9_415{background-color:#91919154;color:#fff;border:solid rgba(213,213,213,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__good_7gau9_423{background-color:#4d912133;color:#fff;border:solid rgba(130,208,79,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__good_7gau9_423:hover{background-color:#82d04f33}._contentColor__good_7gau9_434{background-color:#4d9121;color:#fff;border:solid #67b335;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__good_7gau9_442{background-color:#4d912154;color:#fff;border:solid rgba(130,208,79,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__average_7gau9_450{background-color:#cd7a0d33;color:#fff;border:solid rgba(241,178,96,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__average_7gau9_450:hover{background-color:#f1b26033}._contentColor__average_7gau9_461{background-color:#cd7a0d;color:#fff;border:solid #eb972b;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__average_7gau9_469{background-color:#cd7a0d54;color:#fff;border:solid rgba(241,178,96,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__bad_7gau9_477{background-color:#bd202033;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__bad_7gau9_477:hover{background-color:#e3707033}._contentColor__bad_7gau9_488{background-color:#bd2020;color:#fff;border:solid #d93f3f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__bad_7gau9_496{background-color:#bd202054;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__label_7gau9_504{background-color:#657a9433;color:#fff;border:solid rgba(175,186,201,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__label_7gau9_504:hover{background-color:#afbac933}._contentColor__label_7gau9_515{background-color:#657a94;color:#fff;border:solid #8a9aae;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__label_7gau9_523{background-color:#657a9454;color:#fff;border:solid rgba(175,186,201,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__default_7gau9_531{background-color:#35353533;color:#fff;border:solid rgba(99,99,99,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__default_7gau9_531:hover{background-color:#63636333}._disabled_7gau9_542{background-color:#631d1d40!important;border-color:#631d1d40!important}._selected_7gau9_547{background-color:#1b963833;color:#fff;border:solid rgba(27,150,56,.25);border-width:1px;transition:background-color .2s,border-color .2s}._selected_7gau9_547:hover{background-color:#48d66933}._contentColor__default_7gau9_558{background-color:#313131;color:#fff;border:solid #404040;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._contentDisabled_7gau9_566{background-color:#631d1d!important;border-top:1px solid #803131!important}._contentSelected_7gau9_571{background-color:#1b9638;color:#fff;border:solid #2fb94f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__default_7gau9_579{background-color:#35353533;color:#fff;border:solid rgba(99,99,99,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._ImageButton_7gau9_587{display:inline-table;position:relative;text-align:center;margin:.25em;-webkit-user-select:none;user-select:none;-ms-user-select:none}._ImageButton_7gau9_587 ._noAction_7gau9_595{pointer-events:none}._ImageButton_7gau9_587 ._container_7gau9_598{display:flex;flex-direction:column;border-radius:.33em}._ImageButton_7gau9_587 ._image_7gau9_603{position:relative;align-self:center;pointer-events:none;overflow:hidden;line-height:0;padding:.25em;border-radius:.33em}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37{display:flex;position:absolute;overflow:hidden;left:1px;bottom:1.8em;max-width:100%;z-index:1}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621{overflow:visible;flex-direction:column;pointer-events:none;top:1px;bottom:inherit!important}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37._buttonsEmpty_7gau9_628{bottom:1px}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37>*{margin:0!important;padding:0 .2em!important;border-radius:0!important}._ImageButton_7gau9_587 ._content_7gau9_29{-ms-user-select:none;-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.25em .5em;margin:-1px;border-radius:0 0 .33em .33em;z-index:2}._fluid_7gau9_649{display:flex;flex-direction:row;position:relative;text-align:center;margin:0 0 .5em;-webkit-user-select:none;user-select:none;-ms-user-select:none}._fluid_7gau9_649:last-child{margin-bottom:0}._fluid_7gau9_649 ._info_7gau9_661{display:flex;flex-direction:column;justify-content:center;flex:1}._fluid_7gau9_649 ._title_7gau9_667{font-weight:700;padding:.5em}._fluid_7gau9_649 ._title_7gau9_667._divider_7gau9_671{margin:0 .5em;border-bottom:.1666666667em solid rgba(255,255,255,.1)}._fluid_7gau9_649 ._contentFluid_7gau9_675{padding:.5em;color:#fff}._fluid_7gau9_649 ._container_7gau9_598{flex-direction:row;flex:1}._fluid_7gau9_649 ._container_7gau9_598._hasButtons_7gau9_683{border-radius:.33em 0 0 .33em;border-width:1px 0 1px 1px}._fluid_7gau9_649 ._image_7gau9_603{padding:0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37{position:relative;left:inherit;bottom:inherit;border-radius:0 .33em .33em 0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsEmpty_7gau9_628{bottom:inherit}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621{overflow:hidden;pointer-events:auto;top:inherit}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621>*{border-top:1px solid rgba(255,255,255,.075)}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621>*:first-child{border-top:0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37>*{display:inline-flex;flex-direction:column;justify-content:center;text-align:center;white-space:pre-wrap;line-height:1.1666666667em;height:100%;border-left:1px solid rgba(255,255,255,.075)}
@@ -1 +1 @@
1
- ._section_1awt0_17{position:relative;margin-bottom:.5em;background-color:#191919;background-color:#00000054;box-sizing:border-box}._section_1awt0_17:last-child{margin-bottom:0}._title_1awt0_28{position:relative;padding:.5em;border-bottom:.1666666667em solid #4972a1}._titleText_1awt0_34{font-size:1.1666666667em;font-weight:700;color:#fff}._buttons_1awt0_40{position:absolute;display:inline-block;right:.5em;margin-top:-.0833333333em}._rest_1awt0_47{position:relative}._content_1awt0_51{padding:.66em .5em}._fitted_1awt0_55>._rest_1awt0_47>._content_1awt0_51{padding:0}._fill_1awt0_59{display:flex;flex-direction:column;height:100%}._fill_1awt0_59>._rest_1awt0_47{flex-grow:1}._fill_1awt0_59>._rest_1awt0_47>._content_1awt0_51{height:100%}._fill_1awt0_59._scrollable_1awt0_73>._rest_1awt0_47>._content_1awt0_51{position:absolute;top:0;left:0;right:0;bottom:0}._scrollable_1awt0_73{overflow-x:hidden;overflow-y:hidden}._scrollable_1awt0_73>._rest_1awt0_47>._content_1awt0_51{overflow-y:scroll;overflow-x:hidden}._scrollableHorizontal_1awt0_90{overflow-x:hidden;overflow-y:hidden}._scrollableHorizontal_1awt0_90>._rest_1awt0_47>._content_1awt0_51{overflow-y:hidden;overflow-x:scroll}._scrollable_1awt0_73._scrollableHorizontal_1awt0_90{overflow-x:hidden;overflow-y:hidden}._scrollable_1awt0_73._scrollableHorizontal_1awt0_90>._rest_1awt0_47>._content_1awt0_51{overflow-y:scroll;overflow-x:scroll}._section_1awt0_17 ._section_1awt0_17{background-color:transparent;margin-left:-.5em;margin-right:-.5em}._section_1awt0_17 ._section_1awt0_17:first-child{margin-top:-.5em}._section_1awt0_17 ._section_1awt0_17 ._titleText_1awt0_34{font-size:1.0833333333em}._section_1awt0_17 ._section_1awt0_17 ._section_1awt0_17 ._titleText_1awt0_34{font-size:1em}
1
+ ._section_10c68_17{position:relative;margin-bottom:.5em;background-color:#191919;background-color:#00000054;box-sizing:border-box}._section_10c68_17:last-child{margin-bottom:0}._title_10c68_28{position:relative;padding:.5em;border-bottom:.1666666667em solid #4972a1}._titleText_10c68_34{font-size:1.1666666667em;font-weight:700;color:#fff}._buttons_10c68_40{position:absolute;display:inline-block;right:.5em;margin-top:-.0833333333em}._rest_10c68_47{position:relative}._content_10c68_51{padding:.66em .5em}._fitted_10c68_55>._rest_10c68_47>._content_10c68_51{padding:0}._fill_10c68_59{display:flex;flex-direction:column;height:100%}._fill_10c68_59>._rest_10c68_47{flex-grow:1}._fill_10c68_59>._rest_10c68_47>._content_10c68_51{height:100%}._fill_10c68_59._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{position:absolute;top:0;left:0;right:0;bottom:0}._scrollable_10c68_73{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:hidden}._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:hidden;overflow-x:scroll}._scrollable_10c68_73._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:scroll}._section_10c68_17 ._section_10c68_17{background-color:transparent;margin-left:-.5em;margin-right:-.5em}._section_10c68_17 ._section_10c68_17:first-child{margin-top:-.5em}._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1.0833333333em}._section_10c68_17 ._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1em}._section__flex_10c68_125{display:flex;flex-flow:column}._section__flex_10c68_125 ._content_10c68_51{overflow:auto;flex-grow:1}._content__noTopPadding_10c68_135{padding-top:0}._content__stretchContents_10c68_139{height:calc(100% - 3rem)}
@@ -10,6 +10,7 @@ export type EventHandlers = Partial<{
10
10
  onKeyDown: KeyboardEventHandler<HTMLDivElement>;
11
11
  onKeyUp: KeyboardEventHandler<HTMLDivElement>;
12
12
  onMouseDown: MouseEventHandler<HTMLDivElement>;
13
+ onMouseLeave: MouseEventHandler<HTMLDivElement>;
13
14
  onMouseMove: MouseEventHandler<HTMLDivElement>;
14
15
  onMouseOver: MouseEventHandler<HTMLDivElement>;
15
16
  onMouseUp: MouseEventHandler<HTMLDivElement>;
@@ -19,6 +20,7 @@ export type BoxProps = Partial<{
19
20
  as: string;
20
21
  children: ReactNode;
21
22
  className: string | BooleanLike;
23
+ id: string;
22
24
  style: CSSProperties;
23
25
  }> & BooleanProps & StringProps & EventHandlers;
24
26
  type DangerDoNotUse = {
@@ -40,6 +40,8 @@ type Props = Partial<{
40
40
  iconPosition: string;
41
41
  /** Icon rotation */
42
42
  iconRotation: number;
43
+ /** Icon size */
44
+ iconSize: number;
43
45
  /** Makes the icon spin */
44
46
  iconSpin: BooleanLike;
45
47
  /** Called when element is clicked */
@@ -1,267 +1,270 @@
1
- import { jsx as l, jsxs as E, Fragment as S } from "react/jsx-runtime";
2
- import { useState as F, createRef as K, useEffect as M, useRef as V } from "react";
3
- import { KEY as I } from "../common/keys.js";
4
- import { classes as R } from "../common/react.js";
5
- import { computeBoxClassName as j, computeBoxProps as q, Box as O } from "./Box.js";
6
- import { Icon as D } from "./Icon.js";
7
- import { Tooltip as P } from "./Tooltip.js";
8
- import '../assets/Button.css';const T = "_button_433yx_17", L = "_fa_433yx_34", Y = "_fas_433yx_35", z = "_far_433yx_36", G = "_dropdown_433yx_43", H = "_ellipsis_433yx_49", J = "_fluid_433yx_54", Q = "_circular_433yx_60", U = "_compact_433yx_64", W = "_color__black_433yx_69", X = "_color__white_433yx_82", Z = "_color__red_433yx_95", $ = "_color__orange_433yx_108", oo = "_color__yellow_433yx_121", to = "_color__olive_433yx_134", _o = "_color__green_433yx_147", no = "_color__teal_433yx_160", eo = "_color__blue_433yx_173", lo = "_color__violet_433yx_186", co = "_color__purple_433yx_199", ro = "_color__pink_433yx_212", io = "_color__brown_433yx_225", so = "_color__grey_433yx_238", ao = "_color__good_433yx_264", uo = "_color__average_433yx_277", fo = "_color__bad_433yx_290", po = "_color__label_433yx_303", yo = "_color__default_433yx_316", xo = "_color__caution_433yx_329", mo = "_color__danger_433yx_342", go = "_color__transparent_433yx_355", bo = "_disabled_433yx_370", ho = "_selected_433yx_374", Co = "_flex_433yx_387", ko = "_flex__fluid_433yx_392", vo = "_verticalAlignContent__top_433yx_396", wo = "_verticalAlignContent__middle_433yx_400", Ao = "_verticalAlignContent__bottom_433yx_404", Bo = "_content_433yx_408", Io = "_textMargin_433yx_413", _ = {
9
- button: T,
10
- fa: L,
11
- fas: Y,
12
- far: z,
13
- dropdown: G,
14
- ellipsis: H,
15
- fluid: J,
16
- circular: Q,
17
- compact: U,
18
- color__black: W,
19
- color__white: X,
20
- color__red: Z,
21
- color__orange: $,
22
- color__yellow: oo,
23
- color__olive: to,
24
- color__green: _o,
25
- color__teal: no,
26
- color__blue: eo,
27
- color__violet: lo,
28
- color__purple: co,
29
- color__pink: ro,
30
- color__brown: io,
31
- color__grey: so,
1
+ import { jsx as l, jsxs as P, Fragment as M } from "react/jsx-runtime";
2
+ import { useState as S, createRef as V, useEffect as z, useRef as j } from "react";
3
+ import { KEY as R, isEscape as E } from "../common/keys.js";
4
+ import { classes as D } from "../common/react.js";
5
+ import { computeBoxClassName as q, computeBoxProps as O, Box as T } from "./Box.js";
6
+ import { Icon as F } from "./Icon.js";
7
+ import { Tooltip as K } from "./Tooltip.js";
8
+ import '../assets/Button.css';const L = "_button_433yx_17", Y = "_fa_433yx_34", G = "_fas_433yx_35", H = "_far_433yx_36", J = "_dropdown_433yx_43", Q = "_ellipsis_433yx_49", U = "_fluid_433yx_54", W = "_circular_433yx_60", X = "_compact_433yx_64", Z = "_color__black_433yx_69", $ = "_color__white_433yx_82", oo = "_color__red_433yx_95", to = "_color__orange_433yx_108", _o = "_color__yellow_433yx_121", no = "_color__olive_433yx_134", eo = "_color__green_433yx_147", lo = "_color__teal_433yx_160", co = "_color__blue_433yx_173", ro = "_color__violet_433yx_186", io = "_color__purple_433yx_199", so = "_color__pink_433yx_212", ao = "_color__brown_433yx_225", uo = "_color__grey_433yx_238", fo = "_color__good_433yx_264", po = "_color__average_433yx_277", yo = "_color__bad_433yx_290", xo = "_color__label_433yx_303", mo = "_color__default_433yx_316", go = "_color__caution_433yx_329", bo = "_color__danger_433yx_342", ho = "_color__transparent_433yx_355", Co = "_disabled_433yx_370", ko = "_selected_433yx_374", vo = "_flex_433yx_387", wo = "_flex__fluid_433yx_392", Ao = "_verticalAlignContent__top_433yx_396", Bo = "_verticalAlignContent__middle_433yx_400", Io = "_verticalAlignContent__bottom_433yx_404", No = "_content_433yx_408", Ro = "_textMargin_433yx_413", _ = {
9
+ button: L,
10
+ fa: Y,
11
+ fas: G,
12
+ far: H,
13
+ dropdown: J,
14
+ ellipsis: Q,
15
+ fluid: U,
16
+ circular: W,
17
+ compact: X,
18
+ color__black: Z,
19
+ color__white: $,
20
+ color__red: oo,
21
+ color__orange: to,
22
+ color__yellow: _o,
23
+ color__olive: no,
24
+ color__green: eo,
25
+ color__teal: lo,
26
+ color__blue: co,
27
+ color__violet: ro,
28
+ color__purple: io,
29
+ color__pink: so,
30
+ color__brown: ao,
31
+ color__grey: uo,
32
32
  "color__light-grey": "_color__light-grey_433yx_251",
33
- color__good: ao,
34
- color__average: uo,
35
- color__bad: fo,
36
- color__label: po,
37
- color__default: yo,
38
- color__caution: xo,
39
- color__danger: mo,
40
- color__transparent: go,
41
- disabled: bo,
42
- selected: ho,
43
- flex: Co,
44
- flex__fluid: ko,
45
- verticalAlignContent__top: vo,
46
- verticalAlignContent__middle: wo,
47
- verticalAlignContent__bottom: Ao,
48
- content: Bo,
49
- textMargin: Io
33
+ color__good: fo,
34
+ color__average: po,
35
+ color__bad: yo,
36
+ color__label: xo,
37
+ color__default: mo,
38
+ color__caution: go,
39
+ color__danger: bo,
40
+ color__transparent: ho,
41
+ disabled: Co,
42
+ selected: ko,
43
+ flex: vo,
44
+ flex__fluid: wo,
45
+ verticalAlignContent__top: Ao,
46
+ verticalAlignContent__middle: Bo,
47
+ verticalAlignContent__bottom: Io,
48
+ content: No,
49
+ textMargin: Ro
50
50
  };
51
- function g(u) {
51
+ function b(a) {
52
52
  const {
53
- captureKeys: s = !0,
54
- children: a,
53
+ captureKeys: i = !0,
54
+ children: s,
55
55
  circular: y,
56
- className: f,
57
- color: i,
58
- compact: b,
56
+ className: p,
57
+ color: r,
58
+ compact: h,
59
59
  content: x,
60
60
  disabled: o,
61
61
  ellipsis: c,
62
62
  fluid: n,
63
63
  icon: e,
64
- iconColor: d,
65
- iconPosition: v,
66
- iconRotation: w,
67
- iconSpin: N,
68
- onClick: h,
64
+ iconColor: u,
65
+ iconPosition: w,
66
+ iconRotation: A,
67
+ iconSize: B,
68
+ iconSpin: I,
69
+ onClick: d,
69
70
  selected: C,
70
- tooltip: m,
71
- tooltipPosition: A,
72
- verticalAlignContent: k,
73
- ...B
74
- } = u, p = x || a;
75
- let t = /* @__PURE__ */ l(
71
+ tooltip: k,
72
+ tooltipPosition: N,
73
+ verticalAlignContent: m,
74
+ ...v
75
+ } = a, t = x || s;
76
+ let g = /* @__PURE__ */ l(
76
77
  "div",
77
78
  {
78
- className: R([
79
+ className: D([
79
80
  _.button,
80
81
  n && _.fluid,
81
82
  o && _.disabled,
82
83
  C && _.selected,
83
84
  y && _.circular,
84
- b && _.compact,
85
- k && _.flex,
86
- k && n && _.flex__fluid,
87
- k && _["verticalAlignContent__" + k],
88
- i && typeof i == "string" ? _["color__" + i] : _.color__default,
89
- f,
90
- j(B)
85
+ h && _.compact,
86
+ m && _.flex,
87
+ m && n && _.flex__fluid,
88
+ m && _["verticalAlignContent__" + m],
89
+ r && typeof r == "string" ? _["color__" + r] : _.color__default,
90
+ p,
91
+ q(v)
91
92
  ]),
92
93
  tabIndex: o ? void 0 : 0,
93
- onClick: (r) => {
94
- !o && h && h(r);
94
+ onClick: (f) => {
95
+ !o && d && d(f);
95
96
  },
96
- onKeyDown: (r) => {
97
- if (s) {
98
- if (r.key === I.Space || r.key === I.Enter) {
99
- r.preventDefault(), !o && h && h(r);
97
+ onKeyDown: (f) => {
98
+ if (i) {
99
+ if (f.key === R.Space || f.key === R.Enter) {
100
+ f.preventDefault(), !o && d && d(f);
100
101
  return;
101
102
  }
102
- r.key === I.Escape && r.preventDefault();
103
+ E(f.key) && f.preventDefault();
103
104
  }
104
105
  },
105
- ...q(B),
106
- children: /* @__PURE__ */ E("div", { className: _.content, children: [
107
- e && v !== "right" && /* @__PURE__ */ l(
108
- D,
106
+ ...O(v),
107
+ children: /* @__PURE__ */ P("div", { className: _.content, children: [
108
+ e && w !== "right" && /* @__PURE__ */ l(
109
+ F,
109
110
  {
110
- mr: p ? 1 : 0,
111
+ mr: t ? 1 : 0,
111
112
  name: e,
112
- color: d,
113
- rotation: w,
114
- spin: N
113
+ color: u,
114
+ rotation: A,
115
+ size: B,
116
+ spin: I
115
117
  }
116
118
  ),
117
119
  c ? /* @__PURE__ */ l(
118
120
  "span",
119
121
  {
120
- className: R([_.ellipsis, e && _.textMargin]),
121
- children: p
122
+ className: D([_.ellipsis, e && _.textMargin]),
123
+ children: t
122
124
  }
123
- ) : p,
124
- e && v === "right" && /* @__PURE__ */ l(
125
- D,
125
+ ) : t,
126
+ e && w === "right" && /* @__PURE__ */ l(
127
+ F,
126
128
  {
127
- ml: p ? 1 : 0,
129
+ ml: t ? 1 : 0,
128
130
  name: e,
129
- color: d,
130
- rotation: w,
131
- spin: N
131
+ color: u,
132
+ rotation: A,
133
+ size: B,
134
+ spin: I
132
135
  }
133
136
  )
134
137
  ] })
135
138
  }
136
139
  );
137
- return m && (t = /* @__PURE__ */ l(P, { content: m, position: A, children: t })), t;
140
+ return k && (g = /* @__PURE__ */ l(K, { content: k, position: N, children: g })), g;
138
141
  }
139
- function No(u) {
140
- const { checked: s, ...a } = u;
142
+ function Do(a) {
143
+ const { checked: i, ...s } = a;
141
144
  return /* @__PURE__ */ l(
142
- g,
145
+ b,
143
146
  {
144
147
  color: "transparent",
145
- icon: s ? "check-square-o" : "square-o",
146
- selected: s,
147
- ...a
148
+ icon: i ? "check-square-o" : "square-o",
149
+ selected: i,
150
+ ...s
148
151
  }
149
152
  );
150
153
  }
151
- g.Checkbox = No;
152
- function Ro(u) {
154
+ b.Checkbox = Do;
155
+ function Fo(a) {
153
156
  const {
154
- children: s,
155
- color: a,
157
+ children: i,
158
+ color: s,
156
159
  confirmColor: y = "bad",
157
- confirmContent: f = "Confirm?",
158
- confirmIcon: i,
159
- ellipsis: b = !0,
160
+ confirmContent: p = "Confirm?",
161
+ confirmIcon: r,
162
+ ellipsis: h = !0,
160
163
  icon: x,
161
164
  onClick: o,
162
165
  ...c
163
- } = u, [n, e] = F(!1);
164
- function d(v) {
166
+ } = a, [n, e] = S(!1);
167
+ function u(w) {
165
168
  if (!n) {
166
169
  e(!0);
167
170
  return;
168
171
  }
169
- o == null || o(v), e(!1);
172
+ o == null || o(w), e(!1);
170
173
  }
171
174
  return /* @__PURE__ */ l(
172
- g,
175
+ b,
173
176
  {
174
- icon: n ? i : x,
175
- color: n ? y : a,
176
- onClick: d,
177
+ icon: n ? r : x,
178
+ color: n ? y : s,
179
+ onClick: u,
177
180
  ...c,
178
- children: n ? f : s
181
+ children: n ? p : i
179
182
  }
180
183
  );
181
184
  }
182
- g.Confirm = Ro;
183
- function Do(u) {
185
+ b.Confirm = Fo;
186
+ function Po(a) {
184
187
  const {
185
- children: s,
186
- color: a = "default",
188
+ children: i,
189
+ color: s = "default",
187
190
  content: y,
188
- currentValue: f,
189
- defaultValue: i,
190
- disabled: b,
191
+ currentValue: p,
192
+ defaultValue: r,
193
+ disabled: h,
191
194
  fluid: x,
192
195
  icon: o,
193
196
  iconRotation: c,
194
197
  iconSpin: n,
195
198
  maxLength: e,
196
- onCommit: d = () => null,
197
- placeholder: v,
198
- tooltip: w,
199
- tooltipPosition: N,
200
- ...h
201
- } = u, [C, m] = F(!1), A = K(), k = y || s;
202
- function B(t) {
203
- const r = A.current;
204
- if (!r) return;
205
- r.value !== "" ? d(t, r.value) : i && d(t, i);
199
+ onCommit: u = () => null,
200
+ placeholder: w,
201
+ tooltip: A,
202
+ tooltipPosition: B,
203
+ ...I
204
+ } = a, [d, C] = S(!1), k = V(), N = y || i;
205
+ function m(t) {
206
+ const g = k.current;
207
+ if (!g) return;
208
+ g.value !== "" ? u(t, g.value) : r && u(t, r);
206
209
  }
207
- M(() => {
208
- const t = A.current;
209
- if (t && C) {
210
- t.value = f || "";
210
+ z(() => {
211
+ const t = k.current;
212
+ if (t && d) {
213
+ t.value = p || "";
211
214
  try {
212
215
  t.focus(), t.select();
213
216
  } catch {
214
217
  }
215
218
  }
216
- }, [C, f]);
217
- let p = /* @__PURE__ */ E(
218
- O,
219
+ }, [d, p]);
220
+ let v = /* @__PURE__ */ P(
221
+ T,
219
222
  {
220
- className: R([
223
+ className: D([
221
224
  _.button,
222
225
  x && _.fluid,
223
- _["color__" + a]
226
+ _["color__" + s]
224
227
  ]),
225
- ...h,
226
- onClick: () => m(!0),
228
+ ...I,
229
+ onClick: () => C(!0),
227
230
  children: [
228
- o && /* @__PURE__ */ l(D, { name: o, rotation: c, spin: n }),
229
- /* @__PURE__ */ l("div", { children: k }),
231
+ o && /* @__PURE__ */ l(F, { name: o, rotation: c, spin: n }),
232
+ /* @__PURE__ */ l("div", { children: N }),
230
233
  /* @__PURE__ */ l(
231
234
  "input",
232
235
  {
233
- disabled: !!b,
234
- ref: A,
236
+ disabled: !!h,
237
+ ref: k,
235
238
  className: "NumberInput__input",
236
239
  style: {
237
- display: C ? "" : "none",
240
+ display: d ? "" : "none",
238
241
  textAlign: "left"
239
242
  },
240
243
  onBlur: (t) => {
241
- C && (m(!1), B(t));
244
+ d && (C(!1), m(t));
242
245
  },
243
246
  onKeyDown: (t) => {
244
- if (t.key === I.Enter) {
245
- m(!1), B(t);
247
+ if (t.key === R.Enter) {
248
+ C(!1), m(t);
246
249
  return;
247
250
  }
248
- t.key === I.Escape && m(!1);
251
+ E(t.key) && C(!1);
249
252
  }
250
253
  }
251
254
  )
252
255
  ]
253
256
  }
254
257
  );
255
- return w && (p = /* @__PURE__ */ l(P, { content: w, position: N, children: p })), p;
258
+ return A && (v = /* @__PURE__ */ l(K, { content: A, position: B, children: v })), v;
256
259
  }
257
- g.Input = Do;
258
- function Eo(u) {
259
- const { accept: s, multiple: a, onSelectFiles: y, ...f } = u, i = V(null);
260
- async function b(o) {
260
+ b.Input = Po;
261
+ function So(a) {
262
+ const { accept: i, multiple: s, onSelectFiles: y, ...p } = a, r = j(null);
263
+ async function h(o) {
261
264
  const c = Array.from(o).map((n) => {
262
265
  const e = new FileReader();
263
- return new Promise((d) => {
264
- e.onload = () => d(e.result), e.readAsText(n);
266
+ return new Promise((u) => {
267
+ e.onload = () => u(e.result), e.readAsText(n);
265
268
  });
266
269
  });
267
270
  return await Promise.all(c);
@@ -269,30 +272,30 @@ function Eo(u) {
269
272
  async function x(o) {
270
273
  const c = o.target.files;
271
274
  if (c != null && c.length) {
272
- const n = await b(c);
273
- y(a ? n : n[0]);
275
+ const n = await h(c);
276
+ y(s ? n : n[0]);
274
277
  }
275
278
  }
276
- return /* @__PURE__ */ E(S, { children: [
277
- /* @__PURE__ */ l(g, { onClick: () => {
279
+ return /* @__PURE__ */ P(M, { children: [
280
+ /* @__PURE__ */ l(b, { onClick: () => {
278
281
  var o;
279
- return (o = i.current) == null ? void 0 : o.click();
280
- }, ...f }),
282
+ return (o = r.current) == null ? void 0 : o.click();
283
+ }, ...p }),
281
284
  /* @__PURE__ */ l(
282
285
  "input",
283
286
  {
284
287
  hidden: !0,
285
288
  type: "file",
286
- ref: i,
287
- accept: s,
288
- multiple: a,
289
+ ref: r,
290
+ accept: i,
291
+ multiple: s,
289
292
  onChange: x
290
293
  }
291
294
  )
292
295
  ] });
293
296
  }
294
- g.File = Eo;
297
+ b.File = So;
295
298
  export {
296
- g as Button,
297
- No as ButtonCheckbox
299
+ b as Button,
300
+ Do as ButtonCheckbox
298
301
  };
@@ -4,6 +4,8 @@ import { BoxProps } from './Box';
4
4
  type Props = Partial<{
5
5
  /** Buttons or other content to render inline with the button */
6
6
  buttons: ReactNode;
7
+ /** Top margin of the child nodes, defaulted to 1 */
8
+ child_mt: number;
7
9
  /** Icon to display with the collapsible */
8
10
  icon: string;
9
11
  /** Whether the collapsible is open */
@@ -1,27 +1,35 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { Box as r } from "./Box.js";
4
- import { Button as p } from "./Button.js";
5
- function v(o) {
6
- const { children: t, color: s, title: a, buttons: n, icon: c, ...m } = o, [l, d] = h(o.open);
7
- return /* @__PURE__ */ i(r, { mb: 1, children: [
8
- /* @__PURE__ */ i("div", { className: "Table", children: [
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { Box as t } from "./Box.js";
4
+ import { Button as b } from "./Button.js";
5
+ function x(o) {
6
+ const {
7
+ children: r,
8
+ child_mt: s = 1,
9
+ color: m,
10
+ title: a,
11
+ buttons: c,
12
+ icon: i,
13
+ ...d
14
+ } = o, [l, h] = p(o.open);
15
+ return /* @__PURE__ */ n(t, { mb: 1, children: [
16
+ /* @__PURE__ */ n("div", { className: "Table", children: [
9
17
  /* @__PURE__ */ e("div", { className: "Table__cell", children: /* @__PURE__ */ e(
10
- p,
18
+ b,
11
19
  {
12
20
  fluid: !0,
13
- color: s,
14
- icon: c || (l ? "chevron-down" : "chevron-right"),
15
- onClick: () => d(!l),
16
- ...m,
21
+ color: m,
22
+ icon: i || (l ? "chevron-down" : "chevron-right"),
23
+ onClick: () => h(!l),
24
+ ...d,
17
25
  children: a
18
26
  }
19
27
  ) }),
20
- n && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: n })
28
+ c && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: c })
21
29
  ] }),
22
- l && /* @__PURE__ */ e(r, { mt: 1, children: t })
30
+ l && /* @__PURE__ */ e(t, { mt: s, children: r })
23
31
  ] });
24
32
  }
25
33
  export {
26
- v as Collapsible
34
+ x as Collapsible
27
35
  };