@bodynarf/react.components 1.4.7 → 1.4.9

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.
@@ -1,4 +1,4 @@
1
- .app-anchor {
1
+ .bbr-anchor {
2
2
  text-decoration: none;
3
3
  color: inherit;
4
4
 
@@ -9,7 +9,7 @@
9
9
  color: #3273dc;
10
10
  }
11
11
 
12
- .app-icon {
12
+ .bbr-icon {
13
13
  transition: none;
14
14
  }
15
15
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AnchorWithIconProps } from "../../types";
3
2
  /** Anchor with icon component */
4
3
  export declare const AnchorWithIcon: ({ href, className, onClick, caption, title, target, icon }: AnchorWithIconProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
@@ -7,8 +7,8 @@ export const AnchorWithIcon = ({ href, className, onClick, caption, title, targe
7
7
  const iconClassName = isNullOrEmpty(caption)
8
8
  ? icon.className
9
9
  : iconPosition === 'left'
10
- ? `${icon.className} app-icon--left`
11
- : `${icon.className} app-icon--right`;
10
+ ? `${icon.className} bbr-icon--left`
11
+ : `${icon.className} bbr-icon--right`;
12
12
  if (iconPosition === 'left') {
13
13
  return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,oBAAY,WAAW,GAAG;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA2B9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,oBAAY,WAAW,GAAG;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isNullOrUndefined, isNullOrEmpty } from '@bodynarf/utils';
2
+ import { isNullOrUndefined, isNullOrEmpty, getClassName } from '@bodynarf/utils';
3
3
  import './anchor.scss';
4
4
  import { SimpleAnchor } from './components/simpleAnchor';
5
5
  import { AnchorWithIcon } from './components/anchorWithIcon';
@@ -8,9 +8,11 @@ export default function Anchor(props) {
8
8
  if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
9
9
  throw new Error("No anchor content provided");
10
10
  }
11
- const className = 'app-anchor'
12
- + (!isNullOrEmpty(props.className) ? ` ${props.className}` : '')
13
- + (props.disableHovering === true ? ' app-anchor--unhoverable' : '');
11
+ const className = getClassName([
12
+ 'bbr-anchor',
13
+ !isNullOrEmpty(props.className) ? ` ${props.className}` : '',
14
+ props.disableHovering === true ? ' bbr-anchor--unhoverable' : ''
15
+ ]);
14
16
  if (isNullOrUndefined(props.icon)) {
15
17
  return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
16
18
  }
@@ -1,4 +1,4 @@
1
- .button {
1
+ .bbr-button {
2
2
  transition: 0.15s ease-in-out;
3
3
  transition-property: background-color, border-color;
4
4
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonWithIconProps } from '../../types';
3
2
  /** Button with icon component */
4
3
  export declare const ButtonWithIcon: ({ className, disabled, onClick, caption, title, icon }: ButtonWithIconProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,2DAA4D,mBAAmB,KAAG,WAsC5G,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,2DAA4D,mBAAmB,KAAG,WAsC5G,CAAC"}
@@ -7,10 +7,10 @@ export const ButtonWithIcon = ({ className, disabled, onClick, caption, title, i
7
7
  const iconClassName = isNullOrEmpty(caption)
8
8
  ? icon.className
9
9
  : iconPosition === 'left'
10
- ? `${icon.className} app-icon--left`
11
- : `${icon.className} app-icon--right`;
10
+ ? `${icon.className} bbr-icon--left`
11
+ : `${icon.className} bbr-icon--right`;
12
12
  className = isNullOrEmpty(caption)
13
- ? `${className} button--icon-only`
13
+ ? `${className} bbr-button--icon-only`
14
14
  : className;
15
15
  if (iconPosition === 'left') {
16
16
  return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,oBAAY,WAAW,GAAG;IACtB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,UAAU,CAAC;IAEjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAA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AAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAkC9D"}
@@ -12,7 +12,9 @@ export default function Button(props) {
12
12
  throw new Error("No button content provided.");
13
13
  }
14
14
  const className = getClassName([
15
- `button is-${props.type}`,
15
+ "button",
16
+ "bbr-button",
17
+ `is-${props.type}`,
16
18
  props.light === true ? 'is-light' : '',
17
19
  !isNullOrUndefined(props.size) ? `is-${props.size}` : '',
18
20
  props.outlined === true ? 'is-outlined' : '',
@@ -1,4 +1,4 @@
1
- .app-icon {
1
+ .bbr-icon {
2
2
  transition: 0.15s ease-in-out color;
3
3
  font-size: 1.3rem;
4
4
 
@@ -11,7 +11,7 @@ const sizeToClassMap = new Map([
11
11
  */
12
12
  export default function Icon({ size = 'medium', name, className }) {
13
13
  const classNames = getClassName([
14
- "app-icon",
14
+ "bbr-icon",
15
15
  "bi",
16
16
  `bi-${name}`,
17
17
  sizeToClassMap.has(size) ? sizeToClassMap.get(size) : "",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search/index.tsx"],"names":[],"mappings":";AAIA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,oBAAY,WAAW,GAAG;IACtB;;;;MAIE;IACF,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpC,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,+DAA+D;IAC/D,I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AAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GACrC,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAwE3B"}
@@ -16,13 +16,15 @@ export default function Search({ searchType, onSearch, caption, name, defaultVal
16
16
  }, [onSearch, searchType]);
17
17
  const onSearchButtonClick = useCallback(() => onSearch(searchValue), [onSearch, searchValue]);
18
18
  const className = getClassName([
19
- 'app-search control',
19
+ "bbr-search",
20
+ "control",
20
21
  `is-${(size || 'normal')}`,
21
22
  isLoading === true ? 'is-loading' : '',
22
23
  searchType === 'byButton' ? 'is-expanded' : '',
23
24
  ]);
24
25
  const inputClassName = getClassName([
25
- 'input is-unselectable',
26
+ "input",
27
+ "is-unselectable",
26
28
  `is-${(size || 'normal')}`,
27
29
  rounded === true ? 'is-rounded' : '',
28
30
  ]);
@@ -1,4 +1,4 @@
1
- .app-search {
1
+ .bbr-search {
2
2
  input[type="search"] {
3
3
  transition: 0.15s ease-out;
4
4
  transition-property: border-color, color, background-color;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bodynarf/react.components",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "author": {
5
5
  "name": "Artem",
6
6
  "email": "bodynar@gmail.com"
package/readme.md CHANGED
@@ -15,6 +15,8 @@ Small library with react components based on Bulma CSS framework&nbsp; <a href="
15
15
  5. *(Optional)* To use **Checkbox** component - install [bulma-checkradio](https://www.npmjs.com/package/bulma-checkradio) and make sure you imported these styles in parent container
16
16
 
17
17
  ## Description
18
+
19
+ Mostly all components have root class with `bbr-` prefix. BBR - Bodynarf Bulma React
18
20
  ### Simple components
19
21
  Simple react components based on html elements.
20
22
 
@@ -23,6 +25,8 @@ Simple react components based on html elements.
23
25
  - **Text**- single line text input;
24
26
  - **Anchor**
25
27
  - **Button**
28
+ - **Number**
29
+ - **Password** - single line password input (requires icon, see *p.4*)
26
30
  - **Icon** - *see p.4 of installation*
27
31
  - **Dropdown** - custom dropdown component, based on html div elements & css. Allows to use icon in elements
28
32
  - **Checkbox** - (*see p.5 of installation*) Checkbox component based on [bulma-checkradio](https://wikiki.github.io/form/checkradio)