loon-bulma-react 2023.0.18 → 2023.0.19

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/README.md CHANGED
@@ -2,11 +2,9 @@
2
2
 
3
3
  > ## Aanpassingen
4
4
  >
5
- > - DataTable: als er geen rijen zijn, kan je met de `onNoRowsToRender`-prop vertellen wat er dan WEL gerendered moet worden
6
- > - DataTable: striped-color & hover-color zijn anders
7
- > - DataTable: search-bar smaller en maximaal helft van de beschikbare ruimte
8
- > - DataTable: wrapping van header elementen aangepast
9
- > - Currency Input: gemaakt - probeer maar
5
+ > - `<CB>`-component gemaakt. Een kale checkbox met een label. Geen wrapper, geen direction, geen form.
6
+ > - `<RB>`-component gemaakt. Een Radio-button met een label. Geen wrapper, geen direction, geen form.
7
+ > - `ColorProp` uitgebreid met `"is-${`_string_`}"`-template literal. Als _Bulma_ nog andere kleuren gebruikt dan de standaard-kleuren, kan je die op die manier gebruiken.
10
8
 
11
9
  ## [Bulma](https://bulma.io/) &amp; [React](https://reactjs.org/) componenten voor Loon Salarissoftware.
12
10
 
@@ -63,6 +61,7 @@
63
61
  - FileInput
64
62
  - BasicInput
65
63
  - [CheckBox](#form-checkbox)
64
+ - [CB](#form-cb)
66
65
  - [RadioButtons](#form-radio)
67
66
  - [Ranges](#form-ranges)
68
67
  - Range
@@ -1499,6 +1498,24 @@ Ook is er een `styling`-prop. Met deze kan je wat styling aanpassen
1499
1498
  </div>
1500
1499
  ```
1501
1500
 
1501
+ ### CB <a id="form-cb"></a>
1502
+
1503
+ De `<CB>`-component is ene losstaande checkbox-component. Deze mist alle props die de `<CheckBox>`-component wel heeft. De `<CB>`-component heeft wel een `checked`-prop, die je kan gebruiken om de checkbox te controleren. Er is geen validatie, geen direction-prop etc. De `<CB>` heeft wel een `onValueChanged`-prop, die je kan gebruiken om een functie uit te voeren als de checkbox veranderd.
1504
+
1505
+ - de `className`-prop bepaalt de classnames van de omringende div.
1506
+
1507
+ ```tsx
1508
+ <div>
1509
+ <CB name="name-cb" label="Checkbox" onValueChanged={(checked) => handleChange(checked)} />
1510
+ <CB
1511
+ className="has-background-color-grey"
1512
+ name="name-cb-2"
1513
+ label="Checkbox2"
1514
+ onValueChanged={(checked) => handleChange2(checked)}
1515
+ />
1516
+ </div>
1517
+ ```
1518
+
1502
1519
  #### RadioButtons <a id="form-radio"></a>
1503
1520
 
1504
1521
  Radiobuttons kan je maken met de `<RadioGroup>`-component. De `<RadioGroup>` zelf is een container voor de `<RadioGroup.Item>`-buttons omeen radio-button-group te maken.
@@ -1564,6 +1581,92 @@ const [radio, setRadio] = React.useState('Sieben');
1564
1581
  <>
1565
1582
  ```
1566
1583
 
1584
+ ### RB <a id="forms-rb"></a>
1585
+
1586
+ De `<RB>`-component is ene losstaande checkbox-component. Deze mist alle props die de `<RadioButton>`-component wel heeft. De `<RB>`-component heeft een `checked`-prop en een `value`-prop die je kan gebruiken om de radiobutton te controleren.
1587
+
1588
+ - `checked`: Is dit item checked of niet (is dit het geselecteerde item)
1589
+ - `value`: de waarde om te emitten als deze optie wordt geselecteerd (typed, default =`string`).
1590
+
1591
+ Er is geen validatie, geen direction-prop etc. De `<CB>` heeft wel een `onValueChanged`-prop, die je kan gebruiken om een functie uit te voeren als de radio-button veranderd.
1592
+
1593
+ ##### Voorbeeld met gewone `<RB>`
1594
+
1595
+ ```tsx
1596
+ <div>
1597
+ <RB
1598
+ groupName="name-rb"
1599
+ checked={rbValue === '1'}
1600
+ value="1"
1601
+ onValueChanged={(v) => setRbValue(v)}
1602
+ label="Radio1"
1603
+ id="radio-group-name-1"
1604
+ />
1605
+ <RB
1606
+ groupName="name-rb"
1607
+ checked={rbValue === '2'}
1608
+ value="2"
1609
+ onValueChanged={(v) => setRbValue(v)}
1610
+ label="Radio2"
1611
+ id="radio-group-name-2"
1612
+ />
1613
+ </div>
1614
+ ```
1615
+
1616
+ ##### voorbeeld met een typed `<RB<typeof state>>`
1617
+
1618
+ ```tsx
1619
+ const [state, setState] = React.useState<number>(0);
1620
+
1621
+ return (
1622
+ <div>
1623
+ {[1, 2, 3, 4].map((v) => (
1624
+ <RB<typeof rb2Value>
1625
+ key={v}
1626
+ groupName="name-rb-2"
1627
+ checked={rb2Value === v}
1628
+ value={v}
1629
+ onValueChanged={(v) => setRb2Value(v)}
1630
+ label={`Radio ${v} - numeric Type`}
1631
+ id={`radio-group-name-${v}-2`}
1632
+ />
1633
+ ))}
1634
+ </div>
1635
+ );
1636
+ ```
1637
+
1638
+ ##### voorbeeld met een typed object value `<RB<{waarde: number, tekst: string}>>`
1639
+
1640
+ ```tsx
1641
+ const [state, setState] = React.useState<{ waarde: number; tekst: string }>(0);
1642
+
1643
+ const values = [
1644
+ { waarde: 1, tekst: 'oobsie woobsie dooo 1' },
1645
+ { waarde: 2, tekst: 'oobsie woobsie dooo 2' },
1646
+ { waarde: 3, tekst: 'oobsie woobsie dooo 3' },
1647
+ { waarde: 4, tekst: 'oobsie woobsie dooo 4' },
1648
+ ];
1649
+
1650
+ return (
1651
+ <div>
1652
+ {values.map((v) => (
1653
+ <RB<{ waarde: number; tekst: string }>
1654
+ key={v.waarde}
1655
+ groupName="name-rb-3"
1656
+ checked={rb3Value?.waarde === v.waarde}
1657
+ value={v}
1658
+ onValueChanged={(v) => {
1659
+ console.log(v);
1660
+ setRb3Value(v);
1661
+ }}
1662
+ label={`Radio v-${v.waarde} - object Type`}
1663
+ id={`radio-group-name-${v.waarde}-3`}
1664
+ />
1665
+ ))}
1666
+ </div>
1667
+ );
1668
+ ```
1669
+
1567
1670
  #### Ranges <a id="form-ranges"></a>
1568
1671
 
1569
1672
  Een `<Range>` of `<MultiRange>` is een component om op een andere manier een nummer te selecteren. In plaats van invullen, selecteer je deze op een schaal. Er zijn 2 soorten ranges: **Range** en **MultiRange**. Een Range werkt hetzelfde als een `<input type="number">`, het resultaat is ook een number. Een MultiRange werkt iets anders: het resultaat is een `number[]`, bestaand uit 2 getallen. Deze getallen staan altijd in dezelfde volgorde, dus als je twee begin-waardes opgeeft, komen die er in dezelfde volgorde uit. _Dus niet gesorteerd van klein naar groot_.
@@ -9,12 +9,13 @@ import { BaseButtonProps, ButtonProps } from './ButtonProps';
9
9
  * | Prop | Value | Default | Description |
10
10
  * |----------|-------------------------|----------|-----------------------------------------|
11
11
  * | children | | | De content van de button (icon, text) |
12
- * | color | `p, l, i, w, d, s` | `p` | Kleuren voor de button |
13
- * | styling | `l`, light | | Light style voor de button |
14
- * | | `o`, outlined | | Outlined style voor de button |
15
- * | | `i`, inverted | | Inverted style voor de button |
12
+ * | color | `p`, `l`, `i`, `w`, `d`,| `p` | Kleuren voor de button |
13
+ * | | `s`, `is-${string}` | | |
14
+ * | styling | `l` , light | | Light style voor de button |
15
+ * | | `o` , outlined | | Outlined style voor de button |
16
+ * | | `i` , inverted | | Inverted style voor de button |
16
17
  * | | `lo`, light-outlined | | Light & outlined style voor de button |
17
- * | | `s`, static | | static style voor de button (grey) |
18
+ * | | `s` , static | | static style voor de button (grey) |
18
19
  * | size | `s, m, l, xl` | | sizes voor de button |
19
20
  * | rounded | `true, false` | `false` | Afgeronde hoeken voor de button |
20
21
  * | loading | `true, false` | `false` | heeft button de loading state |
@@ -25,7 +26,7 @@ import { BaseButtonProps, ButtonProps } from './ButtonProps';
25
26
  * | type | `button, reset, submit` | `button` | type 'button' voor de button |
26
27
  */
27
28
  declare const Button: {
28
- (props: BaseButtonProps): JSX.Element;
29
+ ({ color, size, rounded, loading, disabled, type, styling, onClick, children: chldrn, tooltip, id, }: BaseButtonProps): JSX.Element;
29
30
  /**
30
31
  * Een Static Button
31
32
  * Een static button is niet interactief, maar wordt bijvoorbeeld gebruikt als scheiding voor add-ons
@@ -14,7 +14,7 @@ declare type MessageProps = {
14
14
  */
15
15
  declare const Message: {
16
16
  ({ children, title, size, color, }: MessageProps & {
17
- color?: "i" | "p" | "s" | "d" | "w" | "l" | undefined;
17
+ color?: string | undefined;
18
18
  }): JSX.Element;
19
19
  /** Een primary-colored message
20
20
  * @param props props
@@ -3,7 +3,7 @@ import { ColorProp, TagSizeProp, AlignmentProp } from '../../loon-react-bulma-ty
3
3
  export declare type TagProps = {
4
4
  /** Content van de tag */
5
5
  children: React.ReactNode;
6
- /** Kleur van de tag, de standaard kleuren + dark & light */
6
+ /** Kleur van de tag, de standaard kleuren + dark & light en `is-${`string`}`-waardes */
7
7
  color?: ColorProp | 'dark' | 'light';
8
8
  /** Sizes van de tag. (default = 's'). LET OP 3 verschillende sizes ipv 4! */
9
9
  size?: TagSizeProp;
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { CheckradioStylingType, ColorProp } from '../../loon-react-bulma-types';
3
+ import { BaseInputProps } from '../shared';
4
+ declare type CBInputProps = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label'> & {
5
+ /** Speciale styling van de checkbox */
6
+ styling?: CheckradioStylingType;
7
+ /** Is de checkbox checked */
8
+ checked?: boolean;
9
+ /** Kleur van de checkbox (default = 'l', link) */
10
+ color?: ColorProp | ((checked: boolean) => ColorProp);
11
+ /** Verplicht label voor een gewone checkbox */
12
+ label: string | React.ReactNode;
13
+ /** Wat te doen als de waarde is veranderd
14
+ * @param checked: is de checkbox checked ?
15
+ */
16
+ onValueChanged?(checked: boolean): void;
17
+ /** classes voor de omringende `<div>` van de checkbox/label combi */
18
+ className?: string;
19
+ };
20
+ /**
21
+ * Maak een kale checkbox input met een label, dus ZONDER alle form-functies met controls, fields en directions.
22
+ * @param props
23
+ * @returns een checkbox
24
+ * @example <CB checked={true} {...props}/>
25
+ * @description alle props voor de CB component
26
+ * | prop | type | default | description |
27
+ * |-------------------|----------------------|---------|--------------------------------------------|
28
+ * | name | `string ` | | de naam voor de input (REQUIRED) |
29
+ * | label | `string?` | `name` | de label voor de input |
30
+ * | id | `string?` | `name` | de id voor de input |
31
+ * | tooltip | `string?` | `''` | tooltip voor de input |
32
+ * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
33
+ * | disabled | `boolean` | `false` | de input is disabled |
34
+ * | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
35
+ * | checked | `boolean` | `false` | is de checkbox `checked` of niet |
36
+ * | color | `l`,`p`,`s`,`d`,`w`, | `l` | de kleur van de checkbox |
37
+ * | | `i`,`is-${string}` | | |
38
+ * | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
39
+ * | styling | `rounded`,`noborder` | | de styling van de checkbox |
40
+ * | | `colored`, `blocky` | | |
41
+ * | errorMessage | `string ` | | een error message (van buiten setbaar) |
42
+ * | onValueChanged() | `function` | | (value: boolean, valid?: boolean) => void |
43
+ * | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
44
+ */
45
+ declare function JustACheckbox({ checked: defaultChecked, label, name, id, size, color, styling, textAlign, disabled, errorMessage, className: containerClassName, onValueChanged, onKeyDown, }: CBInputProps): JSX.Element;
46
+ export { JustACheckbox as CB };
47
+ export type { CBInputProps };
@@ -130,7 +130,7 @@ declare const Form: {
130
130
  tooltip?: string | undefined;
131
131
  children?: React.ReactNode;
132
132
  size?: "s" | "l" | "m" | "xl" | undefined;
133
- color?: "i" | "p" | "s" | "d" | "w" | "l" | undefined;
133
+ color?: string | undefined;
134
134
  styling?: "rounded" | "noborder" | "colored" | "blocky" | undefined;
135
135
  direction?: "horizontal" | "vertical" | "v" | "h" | undefined;
136
136
  textAlign?: "l" | "c" | "r" | undefined;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { CheckradioStylingType, ColorProp } from '../../loon-react-bulma-types';
3
+ import { BaseInputProps } from '../shared';
4
+ declare type RBInputProps<T = string> = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'id' | 'name'> & {
5
+ /** de group-name voor deze inputs. Radiobuttons werken daar iets anders mee */
6
+ groupName: string;
7
+ /** Speciale styling van de checkbox */
8
+ styling?: CheckradioStylingType;
9
+ /** de te emitten waarde als deze radiobutton checked moet worden */
10
+ value: T;
11
+ /** Is deze radio-button checked */
12
+ checked: boolean;
13
+ /** Kleur van de checkbox (default = 'l', link) */
14
+ color?: ColorProp | ((value: T) => ColorProp);
15
+ /** Verplicht label voor een gewone checkbox */
16
+ label: string | React.ReactNode;
17
+ /** Wat te doen als de waarde is veranderd
18
+ * @param checked: is de checkbox checked ?
19
+ */
20
+ onValueChanged?(value: T): void;
21
+ /** classes voor de omringende `<div>` van de checkbox/label combi */
22
+ className?: string;
23
+ /** ID voor het item. Bij radio-buttons is deze VERPLICHT! */
24
+ id: string;
25
+ };
26
+ /**
27
+ * Maak een kale radiobutton input met een label, dus ZONDER alle form-functies met controls, fields en directions.
28
+ * @param props
29
+ * @returns een radiobutton
30
+ * @example <RB checked={true} groupName="radio-button-group-name" {...props}/>
31
+ * @description alle props voor de CB component
32
+ * | prop | type | default | description |
33
+ * |-------------------|----------------------|---------|--------------------------------------------|
34
+ * | groupName | `string` | | de naam voor de input (REQUIRED) |
35
+ * | label | `string?` | `name` | de label voor de input |
36
+ * | id | `string` | `name` | de id voor de input |
37
+ * | tooltip | `string?` | `''` | tooltip voor de input |
38
+ * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
39
+ * | disabled | `boolean` | `false` | de input is disabled |
40
+ * | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
41
+ * | checked | `boolean` | `false` | is de checkbox `checked` of niet |
42
+ * | color | `l`,`p`,`s`,`d`,`w`, | `l` | de kleur van de checkbox |
43
+ * | | `i`,`is-${string}` | | |
44
+ * | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
45
+ * | styling | `rounded`,`noborder` | | de styling van de checkbox |
46
+ * | | `colored`, `blocky` | | |
47
+ * | errorMessage | `string ` | | een error message (van buiten setbaar) |
48
+ * | setValueFn() | `function` | | (newVal: T) => void. Gebruik om een React-useState-setfunction aan te roepen |
49
+ */
50
+ declare function JustARadioButon<T = string>({ value, checked, label, groupName: name, id, size, color, styling, textAlign, disabled, errorMessage, className: containerClassName, onValueChanged, }: RBInputProps<T>): JSX.Element;
51
+ export { JustARadioButon as RB };
52
+ export type { RBInputProps };
@@ -4,6 +4,8 @@ export { FormBuilder } from './FormBuilder/FormBuilder';
4
4
  export type { FormBuilderProps, FormBuilderFieldProps, FormBuilderButton, } from './FormBuilder/FormBuilderProps';
5
5
  export { CheckBox } from './Checkbox/Checkbox';
6
6
  export type { CheckboxInputProps } from './Checkbox/Checkbox';
7
+ export { CB } from './Checkbox/CB';
8
+ export type { CBInputProps } from './Checkbox/CB';
7
9
  export { Select } from './Selects/Select';
8
10
  export type { SelectOptionGroupType, SelectOptionType } from './Selects/BaseSelectProps';
9
11
  export type { SelectInputProps } from './Selects/Select';
@@ -16,6 +18,8 @@ export type { HiddenInputProps } from './Others/HiddenInput';
16
18
  export { Input } from './Input';
17
19
  export type { InputProps, InputValueType } from './Input';
18
20
  export { RadioGroup, Radio } from './Radio/Radio';
21
+ export { RB } from './Radio/RB';
22
+ export type { RBInputProps } from './Radio/RB';
19
23
  export { EmailInput } from './Text/EmailInput';
20
24
  export type { EmailInputProps } from './Text/EmailInput';
21
25
  export { PasswordInput } from './Text/PasswordInput';
package/dist/index.js CHANGED
@@ -2059,22 +2059,26 @@ TabBar.Item = TabBarItem;
2059
2059
 
2060
2060
  function Tag(_ref) {
2061
2061
  var children = _ref.children,
2062
- color = _ref.color,
2062
+ _ref$color = _ref.color,
2063
+ color = _ref$color === void 0 ? 'l' : _ref$color,
2063
2064
  size = _ref.size,
2064
2065
  light = _ref.light,
2065
2066
  rounded = _ref.rounded,
2066
2067
  tooltip = _ref.tooltip,
2067
2068
  onDismiss = _ref.onDismiss;
2068
- var classes = 'tag';
2069
- classes += light ? ' is-light' : '';
2070
- classes += rounded ? ' is-rounded' : '';
2071
- if (color === 'p') classes += ' is-primary';else if (color === 'i') classes += ' is-info';else if (color === 'd') classes += ' is-danger';else if (color === 'w') classes += ' is-warning';else if (color === 's') classes += ' is-success';else if (color === 'dark') classes += ' is-dark';else if (color === 'light') classes += ' is-light';else classes += ' is-link';
2072
- if (size === 'm') classes += ' is-medium';else if (size === 'l') classes += ' is-large';
2069
+ var className = React__default.useMemo(function () {
2070
+ var classes = 'tag';
2071
+ classes += light ? ' is-light' : '';
2072
+ classes += rounded ? ' is-rounded' : '';
2073
+ if (color === 'p') classes += ' is-primary';else if (color === 'l') classes += ' is-link';else if (color === 'i') classes += ' is-info';else if (color === 'd') classes += ' is-danger';else if (color === 'w') classes += ' is-warning';else if (color === 's') classes += ' is-success';else if (color === 'dark') classes += ' is-dark';else if (color === 'light') classes += ' is-light';else classes += " " + color;
2074
+ if (size === 'm') classes += ' is-medium';else if (size === 'l') classes += ' is-large';
2075
+ return classes;
2076
+ }, [light, rounded, color, size]);
2073
2077
  var handleDismiss = function handleDismiss(e) {
2074
2078
  return onDismiss && onDismiss(e);
2075
2079
  };
2076
2080
  return React__default.createElement("span", {
2077
- className: classes,
2081
+ className: className,
2078
2082
  title: tooltip
2079
2083
  }, children, onDismiss && React__default.createElement("button", {
2080
2084
  className: "delete",
@@ -2370,27 +2374,35 @@ var ButtonGroup = function ButtonGroup(props) {
2370
2374
  }));
2371
2375
  };
2372
2376
 
2373
- var Button = function Button(props) {
2374
- var color = props.color,
2375
- size = props.size,
2376
- rounded = props.rounded,
2377
- loading = props.loading,
2378
- disabled = props.disabled,
2379
- type = props.type,
2380
- styling = props.styling;
2381
- var className = 'button';
2382
- if (styling === 'static' || styling === 's') className += ' is-static';else {
2383
- if (color === 'i') className += ' is-info';else if (color === 'l') className += ' is-link';else if (color === 'd') className += ' is-danger';else if (color === 's') className += ' is-success';else if (color === 'w') className += ' is-warning';else className += ' is-primary';
2384
- if (styling === 'light' || styling === 'l') className += ' is-light';else if (styling === 'outlined' || styling === 'o') className += ' is-outlined';else if (styling === 'inverted' || styling === 'i') className += ' is-inverted';else if (styling === 'light-outlined' || styling === 'lo') className += ' is-light is-outlined';
2385
- }
2386
- if (size === 's') className += ' is-small';else if (size === 'l') className += ' is-medium';else if (size === 'xl') className += ' is-large';
2387
- if (rounded) className += ' is-rounded';
2388
- if (loading) className += ' is-loading';
2377
+ var Button = function Button(_ref) {
2378
+ var _ref$color = _ref.color,
2379
+ color = _ref$color === void 0 ? 'p' : _ref$color,
2380
+ size = _ref.size,
2381
+ rounded = _ref.rounded,
2382
+ loading = _ref.loading,
2383
+ disabled = _ref.disabled,
2384
+ type = _ref.type,
2385
+ styling = _ref.styling,
2386
+ onClick = _ref.onClick,
2387
+ chldrn = _ref.children,
2388
+ tooltip = _ref.tooltip,
2389
+ id = _ref.id;
2390
+ var className = React__default.useMemo(function () {
2391
+ var cn = 'button';
2392
+ if (styling === 'static' || styling === 's') cn += ' is-static';else {
2393
+ if (color === 'p') cn += ' is-primary';else if (color === 'i') cn += ' is-info';else if (color === 'l') cn += ' is-link';else if (color === 'd') cn += ' is-danger';else if (color === 's') cn += ' is-success';else if (color === 'w') cn += ' is-warning';else cn += " " + color;
2394
+ if (styling === 'light' || styling === 'l') cn += ' is-light';else if (styling === 'outlined' || styling === 'o') cn += ' is-outlined';else if (styling === 'inverted' || styling === 'i') cn += ' is-inverted';else if (styling === 'light-outlined' || styling === 'lo') cn += ' is-light is-outlined';
2395
+ }
2396
+ if (size === 's') cn += ' is-small';else if (size === 'l') cn += ' is-medium';else if (size === 'xl') cn += ' is-large';
2397
+ if (rounded) cn += ' is-rounded';
2398
+ if (loading) cn += ' is-loading';
2399
+ return cn;
2400
+ }, [color, styling, size, rounded, loading]);
2389
2401
  var handleClick = function handleClick(e) {
2390
- if (loading || disabled || styling == 'static') return;
2391
- props.onClick && props.onClick(e);
2402
+ if (loading || disabled || styling === 'static') return;
2403
+ onClick && onClick(e);
2392
2404
  };
2393
- var children = React__default.Children.map(props.children, function (child) {
2405
+ var children = React__default.Children.map(chldrn, function (child) {
2394
2406
  if (typeof child === 'string') return React__default.createElement("span", null, child);
2395
2407
  return child;
2396
2408
  });
@@ -2402,8 +2414,8 @@ var Button = function Button(props) {
2402
2414
  onClick: function onClick(e) {
2403
2415
  return handleClick(e);
2404
2416
  },
2405
- title: props.tooltip,
2406
- id: props.id
2417
+ title: tooltip,
2418
+ id: id
2407
2419
  }, children);
2408
2420
  };
2409
2421
  Button.Static = function (props) {
@@ -4515,15 +4527,18 @@ function CheckBox(props) {
4515
4527
  validation: props.validation
4516
4528
  });
4517
4529
  }, [props.value, props.validation]);
4518
- var className = 'is-checkradio';
4519
4530
  var size = props.size,
4520
4531
  color = props.color,
4521
4532
  styling = props.styling,
4522
4533
  textAlign = props.textAlign;
4523
- if (size === 's') className += ' is-small';else if (size === 'l') className += ' is-medium';else if (size === 'xl') className += ' is-large';
4524
- if (color === 'w') className += ' is-warning';else if (color === 'd') className += ' is-danger';else if (color === 'i') className += ' is-info';else if (color === 's') className += ' is-success';else if (color === 'p') className += ' is-primary';else className += ' is-link';
4525
- if (styling === 'rounded') className += ' is-circle';else if (styling === 'noborder') className += ' has-no-border';else if (styling === 'colored') className += ' has-background-color';else if (styling === 'blocky') className += ' is-blocky';
4526
- if (textAlign === 'c') className += ' has-text-centered';else if (textAlign === 'r') className += ' has-text-right';
4534
+ var className = React__default.useMemo(function () {
4535
+ var cn = 'is-checkradio';
4536
+ if (size === 's') cn += ' is-small';else if (size === 'l') cn += ' is-medium';else if (size === 'xl') cn += ' is-large';
4537
+ if (color === 'w') cn += ' is-warning';else if (color === 'l') cn += ' is-link';else if (color === 'd') cn += ' is-danger';else if (color === 'i') cn += ' is-info';else if (color === 's') cn += ' is-success';else if (color === 'p') cn += ' is-primary';else cn += color;
4538
+ if (styling === 'rounded') cn += ' is-circle';else if (styling === 'noborder') cn += ' has-no-border';else if (styling === 'colored') cn += ' has-background-color';else if (styling === 'blocky') cn += ' is-blocky';
4539
+ if (textAlign === 'c') cn += ' has-text-centered';else if (textAlign === 'r') cn += ' has-text-right';
4540
+ return cn;
4541
+ }, [textAlign, size, color, styling]);
4527
4542
  var errorMsg = '';
4528
4543
  if (props.errorMessage) errorMsg = typeof props.errorMessage == 'string' ? props.errorMessage : props.errorMessage(state.value);
4529
4544
  var error = React__default.createElement(InputError, {
@@ -6083,7 +6098,7 @@ function TextInput(props) {
6083
6098
  state = _React$useReducer[0],
6084
6099
  dispatch = _React$useReducer[1];
6085
6100
  var errorMsg = '';
6086
- if (props.errorMessage) errorMsg = typeof props.errorMessage == 'string' ? props.errorMessage : props.errorMessage(state.value);
6101
+ if (props.errorMessage) errorMsg = typeof props.errorMessage === 'string' ? props.errorMessage : props.errorMessage(state.value);
6087
6102
  var className = !state.valid && state.touched || errorMsg ? 'input is-danger' : 'input';
6088
6103
  if (props.size === 's') className += ' is-small';else if (props.size === 'l') className += ' is-medium';else if (props.size === 'xl') className += ' is-large';
6089
6104
  if (props.textAlign === 'c') className += ' has-text-centered';else if (props.textAlign === 'r') className += ' has-text-right';
@@ -6511,11 +6526,14 @@ function InternRadioItem(props) {
6511
6526
  color = props.color,
6512
6527
  styling = props.styling,
6513
6528
  textAlign = props.textAlign;
6514
- var className = 'is-checkradio block';
6515
- if (size === 's') className += ' is-small';else if (size === 'l') className += ' is-medium';else if (size === 'xl') className += ' is-large';
6516
- if (color === 'w') className += ' is-warning';else if (color === 'd') className += ' is-danger';else if (color === 'i') className += ' is-info';else if (color === 's') className += ' is-success';else if (color === 'p') className += ' is-primary';else className += ' is-link';
6517
- if (styling === 'rounded') className += ' is-circle';else if (styling === 'noborder') className += ' has-no-border';else if (styling === 'colored') className += ' has-background-color';else if (styling === 'blocky') className += ' is-blocky';
6518
- if (textAlign === 'c') className += ' has-text-centered';else if (textAlign === 'r') className += ' has-text-right';
6529
+ var className = React__default.useMemo(function () {
6530
+ var cn = 'is-checkradio';
6531
+ if (size === 's') cn += ' is-small';else if (size === 'l') cn += ' is-medium';else if (size === 'xl') cn += ' is-large';
6532
+ if (color === 'w') cn += ' is-warning';else if (color === 'l') cn += ' is-link';else if (color === 'd') cn += ' is-danger';else if (color === 'i') cn += ' is-info';else if (color === 's') cn += ' is-success';else if (color === 'p') cn += ' is-primary';else cn += color;
6533
+ if (styling === 'rounded') cn += ' is-circle';else if (styling === 'noborder') cn += ' has-no-border';else if (styling === 'colored') cn += ' has-background-color';else if (styling === 'blocky') cn += ' is-blocky';
6534
+ if (textAlign === 'c') cn += ' has-text-centered';else if (textAlign === 'r') cn += ' has-text-right';
6535
+ return cn;
6536
+ }, [textAlign, size, color, styling]);
6519
6537
  var containerClassName = (_props$direction3 = props.direction) !== null && _props$direction3 !== void 0 && _props$direction3.startsWith('v') ? 'field my-1' : 'radio field my-1';
6520
6538
  return React__default.createElement("div", {
6521
6539
  className: containerClassName
@@ -6918,6 +6936,108 @@ var fieldMapper = function fieldMapper(f) {
6918
6936
  return field;
6919
6937
  };
6920
6938
 
6939
+ function JustACheckbox(_ref) {
6940
+ var defaultChecked = _ref.checked,
6941
+ label = _ref.label,
6942
+ name = _ref.name,
6943
+ id = _ref.id,
6944
+ size = _ref.size,
6945
+ _ref$color = _ref.color,
6946
+ color = _ref$color === void 0 ? 'l' : _ref$color,
6947
+ styling = _ref.styling,
6948
+ textAlign = _ref.textAlign,
6949
+ disabled = _ref.disabled,
6950
+ errorMessage = _ref.errorMessage,
6951
+ containerClassName = _ref.className,
6952
+ onValueChanged = _ref.onValueChanged,
6953
+ onKeyDown = _ref.onKeyDown;
6954
+ var _useBoolToggle = useBoolToggle(defaultChecked != null ? defaultChecked : false),
6955
+ checked = _useBoolToggle[0],
6956
+ toggleChecked = _useBoolToggle[1];
6957
+ var handleClick = function handleClick() {
6958
+ if (!disabled) {
6959
+ onValueChanged && onValueChanged(!checked);
6960
+ toggleChecked();
6961
+ }
6962
+ };
6963
+ React__default.useEffect(function () {
6964
+ toggleChecked(checked);
6965
+ }, [defaultChecked, errorMessage, name]);
6966
+ var className = React__default.useMemo(function () {
6967
+ var cn = 'is-checkradio';
6968
+ if (size === 's') cn += ' is-small';else if (size === 'l') cn += ' is-medium';else if (size === 'xl') cn += ' is-large';
6969
+ if (color === 'w') cn += ' is-warning';else if (color === 'l') cn += ' is-link';else if (color === 'd') cn += ' is-danger';else if (color === 'i') cn += ' is-info';else if (color === 's') cn += ' is-success';else if (color === 'p') cn += ' is-primary';else cn += typeof color === 'function' ? color(checked) : color;
6970
+ if (styling === 'rounded') cn += ' is-circle';else if (styling === 'noborder') cn += ' has-no-border';else if (styling === 'colored') cn += ' has-background-color';else if (styling === 'blocky') cn += ' is-blocky';
6971
+ if (textAlign === 'c') cn += ' has-text-centered';else if (textAlign === 'r') cn += ' has-text-right';
6972
+ return cn;
6973
+ }, [textAlign, size, color, styling]);
6974
+ var errorMsg = '';
6975
+ if (errorMessage) errorMsg = typeof errorMessage === 'string' ? errorMessage : errorMessage(checked);
6976
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
6977
+ className: containerClassName
6978
+ }, React__default.createElement("input", {
6979
+ className: className,
6980
+ type: "checkbox",
6981
+ name: name,
6982
+ id: id != null ? id : name,
6983
+ checked: checked,
6984
+ disabled: disabled,
6985
+ onChange: function onChange() {
6986
+ return handleClick();
6987
+ },
6988
+ onKeyDown: onKeyDown
6989
+ }), typeof label === 'string' && React__default.createElement("label", {
6990
+ htmlFor: id != null ? id : name
6991
+ }, label != null ? label : name), typeof label !== 'string' && label), errorMessage && React__default.createElement("p", {
6992
+ className: "help is-danger"
6993
+ }, errorMsg));
6994
+ }
6995
+
6996
+ function JustARadioButon(_ref) {
6997
+ var value = _ref.value,
6998
+ checked = _ref.checked,
6999
+ label = _ref.label,
7000
+ name = _ref.groupName,
7001
+ id = _ref.id,
7002
+ size = _ref.size,
7003
+ _ref$color = _ref.color,
7004
+ color = _ref$color === void 0 ? 'l' : _ref$color,
7005
+ styling = _ref.styling,
7006
+ textAlign = _ref.textAlign,
7007
+ disabled = _ref.disabled,
7008
+ errorMessage = _ref.errorMessage,
7009
+ containerClassName = _ref.className,
7010
+ onValueChanged = _ref.onValueChanged;
7011
+ var handleClick = function handleClick() {
7012
+ if (!disabled) onValueChanged && onValueChanged(value);
7013
+ };
7014
+ var className = React__default.useMemo(function () {
7015
+ var cn = 'is-checkradio';
7016
+ if (size === 's') cn += ' is-small';else if (size === 'l') cn += ' is-medium';else if (size === 'xl') cn += ' is-large';
7017
+ if (color === 'w') cn += ' is-warning';else if (color === 'l') cn += ' is-link';else if (color === 'd') cn += ' is-danger';else if (color === 'i') cn += ' is-info';else if (color === 's') cn += ' is-success';else if (color === 'p') cn += ' is-primary';else cn += typeof color === 'function' ? color(value) : color;
7018
+ if (styling === 'rounded') cn += ' is-circle';else if (styling === 'noborder') cn += ' has-no-border';else if (styling === 'colored') cn += ' has-background-color';else if (styling === 'blocky') cn += ' is-blocky';
7019
+ if (textAlign === 'c') cn += ' has-text-centered';else if (textAlign === 'r') cn += ' has-text-right';
7020
+ return cn;
7021
+ }, [textAlign, size, color, styling]);
7022
+ var errorMsg = '';
7023
+ if (errorMessage) errorMsg = typeof errorMessage === 'string' ? errorMessage : errorMessage(value);
7024
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
7025
+ className: containerClassName
7026
+ }, React__default.createElement("input", {
7027
+ className: className,
7028
+ type: "radio",
7029
+ name: name,
7030
+ id: id,
7031
+ checked: checked,
7032
+ disabled: disabled,
7033
+ onChange: handleClick
7034
+ }), typeof label === 'string' && React__default.createElement("label", {
7035
+ htmlFor: id != null ? id : name
7036
+ }, label != null ? label : name), typeof label !== 'string' && label), errorMessage && React__default.createElement("p", {
7037
+ className: "help is-danger"
7038
+ }, errorMsg));
7039
+ }
7040
+
6921
7041
  var _excluded = ["label", "name", "id", "value", "validation", "errorMessage", "size", "textAlign", "disabled", "placeholder", "keyboardType", "tooltip", "direction", "onValueChanged", "onKeyDown", "decimalSeparator", "alwaysShowCents"];
6922
7042
  function reducer$i(state, action) {
6923
7043
  switch (action.type) {
@@ -7339,6 +7459,7 @@ exports.AspectRatio = AspectRatio;
7339
7459
  exports.Box = Box;
7340
7460
  exports.Button = Button;
7341
7461
  exports.ButtonGroup = ButtonGroup;
7462
+ exports.CB = JustACheckbox;
7342
7463
  exports.Calendar = Calendar;
7343
7464
  exports.CheckBox = CheckBox;
7344
7465
  exports.ColorInput = ColorInput;
@@ -7381,6 +7502,7 @@ exports.NotifierProvider = NotifierProvider;
7381
7502
  exports.NumberInput = NumberInput;
7382
7503
  exports.PasswordInput = PasswordInput;
7383
7504
  exports.ProgressBar = ProgressBar;
7505
+ exports.RB = JustARadioButon;
7384
7506
  exports.Radio = Radio;
7385
7507
  exports.RadioGroup = RadioGroup;
7386
7508
  exports.RangeInput = RangeInput;