@sebgroup/green-react 1.4.0 → 1.5.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/index.js CHANGED
@@ -3092,6 +3092,20 @@ const OptionGroup = ({
3092
3092
  }));
3093
3093
  };
3094
3094
 
3095
+ const InputWrapper = ({
3096
+ children,
3097
+ unitLabel
3098
+ }) => jsx(Fragment, {
3099
+ children: unitLabel ? jsxs("div", Object.assign({
3100
+ className: "group group-border"
3101
+ }, {
3102
+ children: [children, jsx("span", Object.assign({
3103
+ className: "form-text"
3104
+ }, {
3105
+ children: unitLabel
3106
+ }))]
3107
+ })) : children
3108
+ });
3095
3109
  function Slider({
3096
3110
  name = `${randomId()}-slider`,
3097
3111
  defaultValue,
@@ -3102,6 +3116,7 @@ function Slider({
3102
3116
  instruction,
3103
3117
  errorMessage,
3104
3118
  hasTextbox = false,
3119
+ unitLabel,
3105
3120
  disabled = false,
3106
3121
  onChange
3107
3122
  }) {
@@ -3134,10 +3149,10 @@ function Slider({
3134
3149
  })), instruction && jsx("p", {
3135
3150
  children: instruction
3136
3151
  })]
3137
- }), hasTextbox && jsxs("div", Object.assign({
3138
- className: "form-group"
3152
+ }), hasTextbox && jsx(InputWrapper, Object.assign({
3153
+ unitLabel: unitLabel
3139
3154
  }, {
3140
- children: [jsx("input", {
3155
+ children: jsx("input", {
3141
3156
  type: "number",
3142
3157
  value: sliderValue,
3143
3158
  id: `${name}-textbox`,
@@ -3145,9 +3160,7 @@ function Slider({
3145
3160
  className: errorMessage ? 'is-invalid' : '',
3146
3161
  disabled: disabled,
3147
3162
  onChange: handleChange
3148
- }), jsx("span", {
3149
- className: "form-info"
3150
- })]
3163
+ })
3151
3164
  }))]
3152
3165
  })), jsx("input", {
3153
3166
  type: "range",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/chlorophyll": "^1.7.0",
9
+ "@sebgroup/chlorophyll": "^1.8.0",
10
10
  "@sebgroup/extract": "^1.3.1",
11
11
  "classnames": "^2.3.2"
12
12
  },
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AccordionItemInterface } from './accordion-item';
2
3
  export interface AccordionInterface {
3
4
  items: AccordionItemInterface[];
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { DatepickerOptions } from '@sebgroup/extract';
2
3
  export declare const Datepicker: (options?: DatepickerOptions) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DropdownArgs, OnChange } from '@sebgroup/extract';
2
3
  export interface DropdownProps extends DropdownArgs {
3
4
  onChange?: OnChange;
@@ -7,4 +7,4 @@ export declare const TextInput: ({ label, info, testId, onChange, onChangeInput,
7
7
  export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, testId, ...props }: TextInputProps) => JSX.Element;
8
8
  export declare const NumberInput: ({ label, info, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, testId, ...props }: NumberInputProps) => JSX.Element;
9
9
  export declare const Checkbox: ({ label, onChange, validator, testId, ...props }: CheckboxProps) => JSX.Element;
10
- export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "label" | "testId" | "onChange" | "validator" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLInputElement>>;
10
+ export declare const RadioButton: React.ForwardRefExoticComponent<Omit<RadioButtonProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const BankId: ({ fill, focusable, title, ...props }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const Check: ({ focusable, title }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const ChevronDown: ({ focusable, title }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const InfoCircle: ({ focusable, title, ...props }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const SquareExclamation: ({ focusable, title, ...props }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const SquareInfo: ({ focusable, title, ...props }: IconProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { IconProps } from '../../types/props';
2
3
  export declare const Times: ({ focusable, title }: IconProps) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SliderProps } from '../../types';
2
- export declare function Slider({ name, defaultValue, min, max, step, label, instruction, errorMessage, hasTextbox, disabled, onChange, }: SliderProps): JSX.Element;
3
+ export declare function Slider({ name, defaultValue, min, max, step, label, instruction, errorMessage, hasTextbox, unitLabel, disabled, onChange, }: SliderProps): JSX.Element;
3
4
  export default Slider;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { StepperArgs } from './hook';
2
3
  import { IValidator } from "@sebgroup/extract";
3
4
  export interface StepperProps extends StepperArgs {
@@ -23,6 +23,7 @@ export interface SliderProps {
23
23
  instruction?: string;
24
24
  errorMessage?: string;
25
25
  hasTextbox?: boolean;
26
+ unitLabel?: string;
26
27
  disabled?: boolean;
27
28
  onChange?: (value: number) => void;
28
29
  }