@steroidsjs/bootstrap 3.0.0-beta.16 → 3.0.0-beta.17

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.d.ts CHANGED
@@ -218,5 +218,11 @@ declare const _default: {
218
218
  'nav.TreeView': {
219
219
  lazy: () => any;
220
220
  };
221
+ 'typography.TextView': {
222
+ lazy: () => any;
223
+ };
224
+ 'typography.TitleView': {
225
+ lazy: () => any;
226
+ };
221
227
  };
222
228
  export default _default;
package/index.js CHANGED
@@ -220,5 +220,11 @@ exports["default"] = {
220
220
  },
221
221
  'nav.TreeView': {
222
222
  lazy: function () { return require('./nav/Tree/TreeView')["default"]; }
223
+ },
224
+ 'typography.TextView': {
225
+ lazy: function () { return require('./typography/Text/TextView')["default"]; }
226
+ },
227
+ 'typography.TitleView': {
228
+ lazy: function () { return require('./typography/Title/TitleView')["default"]; }
223
229
  }
224
230
  };
package/index.scss CHANGED
@@ -67,3 +67,5 @@
67
67
  @import './nav/Nav/NavListView';
68
68
  @import './nav/Nav/NavTabsView';
69
69
  @import './nav/Tree/TreeView';
70
+ @import './typography/Text/TextView';
71
+ @import './typography/Title/TitleView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "3.0.0-beta.16",
3
+ "version": "3.0.0-beta.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
@@ -35,7 +35,7 @@
35
35
  "react-use": "^17.4.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@steroidsjs/core": "^3.0 || >=3.0.0-beta.8",
38
+ "@steroidsjs/core": "^3.0 || >=3.0.0-beta.9",
39
39
  "@steroidsjs/eslint-config": "^2.1.3",
40
40
  "@types/enzyme": "^3.10.8",
41
41
  "@types/googlemaps": "^3.43.3",
@@ -53,6 +53,6 @@
53
53
  "typescript": "^4.9.5"
54
54
  },
55
55
  "peerDependencies": {
56
- "@steroidsjs/core": "^3.0 || >=3.0.0-beta.8"
56
+ "@steroidsjs/core": "^3.0 || >=3.0.0-beta.9"
57
57
  }
58
58
  }
@@ -1,2 +1,3 @@
1
1
  @import "button";
2
2
  @import "card";
3
+ @import "typography";
@@ -0,0 +1,26 @@
1
+ @mixin typography-type($typeMap) {
2
+ font-family: map-get($typeMap, font-family);
3
+ font-size: map-get($typeMap, font-size);
4
+ font-weight: map-get($typeMap, font-weight);
5
+ line-height: map-get($typeMap, line-height);
6
+ color: map-get($typeMap, color);
7
+ text-transform: map-get($typeMap, text-transform);
8
+ text-decoration: map-get($typeMap, text-decoration);
9
+ text-align: map-get($typeMap, text-align);
10
+
11
+ @media (max-width: $tablet-width) {
12
+ font-size: map-get($typeMap, tablet-font-size);
13
+ font-weight: map-get($typeMap, tablet-font-weight);
14
+ line-height: map-get($typeMap, tablet-line-height);
15
+ text-transform: map-get($typeMap, tablet-text-transform);
16
+ text-align: map-get($typeMap, tablet-text-align);
17
+ }
18
+
19
+ @media (max-width: $mobile-width) {
20
+ font-size: map-get($typeMap, mobile-font-size);
21
+ font-weight: map-get($typeMap, mobile-font-weight);
22
+ line-height: map-get($typeMap, mobile-line-height);
23
+ text-transform: map-get($typeMap, mobile-text-transform);
24
+ text-align: map-get($typeMap, mobile-text-align);
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ $mobile-width: 540px !default;
2
+ $tablet-width: 960px !default;
@@ -21,3 +21,87 @@ $line-height-2xl: 45px;
21
21
  $font-weight-sm: 400;
22
22
  $font-weight-md: 500;
23
23
  $font-weight-lg: 700;
24
+
25
+ $title-types: () !default;
26
+ $title-types: map-merge(
27
+ (
28
+ "h1": (
29
+ "font-size": $font-size-2xl,
30
+ "font-weight": $font-weight-lg,
31
+ "line-height": $line-height-2xl,
32
+ "color": $text-color,
33
+ ),
34
+ "h2": (
35
+ "font-size": $font-size-xl,
36
+ "font-weight": $font-weight-lg,
37
+ "line-height": $line-height-xl,
38
+ "color": $text-color,
39
+ ),
40
+ "h3": (
41
+ "font-size": $font-size-lg,
42
+ "font-weight": $font-weight-lg,
43
+ "line-height": $line-height-lg,
44
+ "color": $text-color,
45
+ ),
46
+ "h4": (
47
+ "font-size": $font-size-base,
48
+ "font-weight": $font-weight-lg,
49
+ "line-height": $line-height-base,
50
+ "color": $text-color,
51
+ ),
52
+ "h5": (
53
+ "font-size": $font-size-sm,
54
+ "font-weight": $font-weight-md,
55
+ "line-height": $line-height-sm,
56
+ "color": $text-color,
57
+ ),
58
+ "h6": (
59
+ "font-size": $font-size-xs,
60
+ "font-weight": $font-weight-md,
61
+ "line-height": $line-height-xs,
62
+ "color": $text-color,
63
+ ),
64
+ "subtitle": (
65
+ "font-size": $font-size-2xl,
66
+ "font-weight": $font-weight-md,
67
+ "line-height": $line-height-2xl,
68
+ "color": $text-color,
69
+ ),
70
+ ),
71
+ $title-types
72
+ );
73
+
74
+ $text-types: () !default;
75
+ $text-types: map-merge(
76
+ (
77
+ "body": (
78
+ "font-size": $font-size-base,
79
+ "font-weight": $font-weight-sm,
80
+ "line-height": $line-height-base,
81
+ "color": $text-color,
82
+ ),
83
+ "span": (
84
+ "font-size": $font-size-base,
85
+ "font-weight": $font-weight-sm,
86
+ "line-height": $line-height-base,
87
+ "color": $text-color,
88
+ ),
89
+ "boldSpan": (
90
+ "font-size": $font-size-base,
91
+ "font-weight": $font-weight-lg,
92
+ "line-height": $line-height-base,
93
+ "color": $text-color,
94
+ ),
95
+ ),
96
+ $text-types
97
+ );
98
+
99
+ $typography-colors: (
100
+ "text-color": $text-color,
101
+ "primary": $primary,
102
+ "secondary": $secondary,
103
+ "success": $success,
104
+ "danger": $danger,
105
+ "warning": $warning,
106
+ "info": $info,
107
+ );
@@ -1,4 +1,5 @@
1
1
  @import 'common/colors';
2
+ @import 'common/media';
2
3
  @import 'common/typography';
3
4
  @import 'common/radiuses';
4
5
  @import 'common/old-variables';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ITextViewProps } from '@steroidsjs/core/ui/typography/Text/Text';
3
+ export default function TextView(props: ITextViewProps): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ exports.__esModule = true;
26
+ var React = __importStar(require("react"));
27
+ var hooks_1 = require("@steroidsjs/core/hooks");
28
+ var TYPE_MAPPING = {
29
+ body: 'p',
30
+ span: 'span',
31
+ boldSpan: 'span'
32
+ };
33
+ function TextView(props) {
34
+ var bem = (0, hooks_1.useBem)('TextView');
35
+ var tag = props.tag || TYPE_MAPPING[props.type || ''] || 'p';
36
+ return (React.createElement(tag, {
37
+ className: bem(bem.block({
38
+ type: props.type,
39
+ color: props.color
40
+ }), props.className),
41
+ style: props.style
42
+ }, React.createElement(React.Fragment, null,
43
+ props.content,
44
+ props.children)));
45
+ }
46
+ exports["default"] = TextView;
@@ -0,0 +1,15 @@
1
+ .TextView {
2
+ font-family: $font-family-nunito;
3
+
4
+ @each $typeName, $typeMap in $text-types {
5
+ &_type_#{$typeName} {
6
+ @include typography-type($typeMap);
7
+ }
8
+ }
9
+
10
+ @each $colorName, $color in $typography-colors {
11
+ &_color_#{$colorName} {
12
+ color: $color;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ITitleViewProps } from '@steroidsjs/core/ui/typography/Title/Title';
3
+ export default function TitleView(props: ITitleViewProps): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ exports.__esModule = true;
26
+ var React = __importStar(require("react"));
27
+ var hooks_1 = require("@steroidsjs/core/hooks");
28
+ var TYPE_MAPPING = {
29
+ h1: 'h1',
30
+ h2: 'h2',
31
+ h3: 'h3',
32
+ h4: 'h4',
33
+ h5: 'h5',
34
+ h6: 'h6',
35
+ subtitle: 'h6'
36
+ };
37
+ function TitleView(props) {
38
+ var bem = (0, hooks_1.useBem)('TitleView');
39
+ var tag = props.tag || TYPE_MAPPING[props.type || ''] || 'h2';
40
+ return (React.createElement(tag, {
41
+ className: bem(bem.block({
42
+ type: props.type,
43
+ color: props.color
44
+ }), props.className),
45
+ style: props.style
46
+ }, React.createElement(React.Fragment, null,
47
+ props.content,
48
+ props.children)));
49
+ }
50
+ exports["default"] = TitleView;
@@ -0,0 +1,15 @@
1
+ .TitleView {
2
+ font-family: $font-family-nunito;
3
+
4
+ @each $typeName, $typeMap in $title-types {
5
+ &_type_#{$typeName} {
6
+ @include typography-type($typeMap);
7
+ }
8
+ }
9
+
10
+ @each $colorName, $color in $typography-colors {
11
+ &_color_#{$colorName} {
12
+ color: $color;
13
+ }
14
+ }
15
+ }