genesys-react-components 0.2.4-no-jira-peer-deps.194 → 0.3.1-devengage-1574-implementing-code-fences-devengage-1574-implementing-code-fences.219

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.
Files changed (42) hide show
  1. package/README.md +24 -1
  2. package/build/codefence/CodeFence.d.ts +22 -0
  3. package/build/index.d.ts +2 -1
  4. package/build/index.js/index-a1accecb.js +29479 -0
  5. package/build/index.js/index-a1accecb.js.map +1 -0
  6. package/build/index.js/index.js +2232 -0
  7. package/build/index.js/index.js.map +1 -0
  8. package/package.json +6 -3
  9. package/src/alertblock/AlertBlock.scss +1 -1
  10. package/src/codefence/CodeFence.scss +103 -0
  11. package/src/codefence/CodeFence.tsx +68 -0
  12. package/src/copybutton/CopyButton.scss +1 -1
  13. package/src/dxaccordion/DxAccordion.scss +6 -3
  14. package/src/dxbutton/DxButton.scss +26 -23
  15. package/src/dxitemgroup/DxCheckbox.scss +22 -17
  16. package/src/dxitemgroup/dropdown.scss +11 -9
  17. package/src/dxitemgroup/multiselect.scss +12 -9
  18. package/src/dxlabel/DxLabel.scss +5 -3
  19. package/src/dxtabbedcontent/DxTabbedContent.scss +6 -4
  20. package/src/dxtextbox/DxTextbox.scss +15 -12
  21. package/src/dxtoggle/DxToggle.scss +15 -11
  22. package/src/index.ts +2 -0
  23. package/src/loadingplaceholder/LoadingPlaceholder.scss +3 -2
  24. package/src/loadingplaceholder/LoadingPlaceholder.tsx +94 -1
  25. package/src/theme/fonts/roboto-v29-latin-300.woff +0 -0
  26. package/src/theme/fonts/roboto-v29-latin-300.woff2 +0 -0
  27. package/src/theme/fonts/roboto-v29-latin-300italic.woff +0 -0
  28. package/src/theme/fonts/roboto-v29-latin-300italic.woff2 +0 -0
  29. package/src/theme/fonts/roboto-v29-latin-700.woff +0 -0
  30. package/src/theme/fonts/roboto-v29-latin-700.woff2 +0 -0
  31. package/src/theme/fonts/roboto-v29-latin-700italic.woff +0 -0
  32. package/src/theme/fonts/roboto-v29-latin-700italic.woff2 +0 -0
  33. package/src/theme/fonts/roboto-v29-latin-italic.woff +0 -0
  34. package/src/theme/fonts/roboto-v29-latin-italic.woff2 +0 -0
  35. package/src/theme/fonts/roboto-v29-latin-regular.woff +0 -0
  36. package/src/theme/fonts/roboto-v29-latin-regular.woff2 +0 -0
  37. package/src/theme/roboto.scss +65 -0
  38. package/src/theme/scrollbars.scss +49 -0
  39. package/src/theme/typography.scss +184 -0
  40. package/src/theme/variables.scss +413 -0
  41. package/build/index.js +0 -539
  42. package/build/index.js.map +0 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ import { DxTextbox } from 'genesys-react-components';
22
22
  import { GenesysDevIcons } from 'genesys-dev-icons';
23
23
 
24
24
  export default function App() {
25
- const inputRef = useRef<HTMLInputElement>(null);
25
+ const inputRef = useRef < HTMLInputElement > null;
26
26
  return (
27
27
  <div className="app">
28
28
  <DxTextbox
@@ -107,3 +107,26 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
107
107
  The cause of the issue is the first reason. The react-dom dependency is sourced from different locations for the component package and the React app that's using it. The package loads `<thisrepo>/node_modules/react_dom/` but the React app loads `<thisrepo>/app/node_modules/react-dom/` causing them to be different packages even though the loaded versions are identical.
108
108
 
109
109
  The solution is to delete `<thisrepo>/node_modules/` when using `npm link` in a any local React app. It doesn't seem to matter the order of operations as long as the folder is gone before `npm run start` is run to build the React app.
110
+
111
+ ## Concepts and Best Practices
112
+
113
+ ### What SHOULD go in this package?
114
+
115
+ This package yields two conceptual things: React components and style information.
116
+
117
+ Components should be added to this package that provide _functionality_ beyond the base HTML elements and built-in JSX/React constructs. This functionality may be complex and interact with the user, like buttons and text boxes, but can also be simple and provide standardization with no user interaction, like the loading placeholder.
118
+
119
+ Style information can be added to the package in two primary ways.
120
+
121
+ The most straightforward is to apply styles to a component in the package. A component should have a file of the same name, but with the `.scss` file extension to contain its styles.
122
+
123
+ The package also provides general-purpose style information using selectors that apply to base HTML elements. These are broken out into a few individual files that can be consumed individually:
124
+
125
+ - `src/theme/variables.scss` - The variables definition can be used by consuming applications to make any part of its own UI theme-aware. This is typically applied to the page's background, text colors, and custom components in the app.
126
+ - `src/theme/typography.scss` - This file sets base theme style rules controlling the default colors and fonts. These rules apply to standard HTML elements, not components in the package.
127
+ - `src/theme/roboto.scss` - The _Roboto_ font.
128
+ - `src/theme/scrollbars.scss` - Styles for scrollbars
129
+
130
+ ### What SHOULD NOT go in this package?
131
+
132
+ This package is not a shim for base HTML elements. As such, it should not contain components that neither provide custom functionality nor extend/enhance/normalize base HTML elements.
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import './CodeFence.scss';
3
+ declare global {
4
+ interface Window {
5
+ Prism: any;
6
+ }
7
+ }
8
+ interface IProps {
9
+ value: string | JSX.Element;
10
+ noCollapse?: boolean;
11
+ noHeader?: boolean;
12
+ autoCollapse?: boolean;
13
+ title?: string;
14
+ language?: string;
15
+ showLineNumbers?: boolean;
16
+ indentation?: string;
17
+ className?: string;
18
+ jsonEditor?: boolean;
19
+ innerRef?: any;
20
+ }
21
+ export default function CodeFence(props: IProps): JSX.Element;
22
+ export {};
package/build/index.d.ts CHANGED
@@ -14,7 +14,8 @@ import AlertBlock from './alertblock/AlertBlock';
14
14
  import LoadingPlaceholder from './loadingplaceholder/LoadingPlaceholder';
15
15
  import Tooltip from './tooltip/Tooltip';
16
16
  import CopyButton from './copybutton/CopyButton';
17
- export { DxAccordion, DxAccordionGroup, DxButton, DxItemGroup, DxCheckbox, DxLabel, DxTabbedContent, DxTabPanel, DxTextbox, DxToggle, Tooltip, CopyButton, LoadingPlaceholder, AlertBlock, };
17
+ import CodeFence from './codefence/CodeFence';
18
+ export { DxAccordion, DxAccordionGroup, DxButton, DxItemGroup, DxCheckbox, DxLabel, DxTabbedContent, DxTabPanel, DxTextbox, DxToggle, Tooltip, CopyButton, LoadingPlaceholder, AlertBlock, CodeFence, };
18
19
  export interface StringChangedCallback {
19
20
  (value: string): void;
20
21
  }