halstack-react icon indicating copy to clipboard operation
halstack-react copied to clipboard

Phone Number Field ( ❗ Important Feature )

Open hanoj-budime opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. PhoneNumberField allows users to input phone numbers.

Describe the solution you'd like Import the PhoneNumberField component and provide a label for accessibility/usability as well as a defaultDialCode which will auto-populate the dial code select field.

image

Additional context https://ui.docs.amplify.aws/react/components/phonenumberfield#dial-code-select-properties

Demo

https://ui.docs.amplify.aws/react/components/phonenumberfield#demo

hanoj-budime avatar Feb 10 '23 05:02 hanoj-budime

We understand the value of this component and can be a good proposal. We will investigate it and think if it fits our design system form components.

GomezIvann avatar Jan 31 '24 12:01 GomezIvann

This issue is stale because it has been open for 15 days with no activity. If there are no further updates or modifications within the next 15 days, it will be automatically closed.

github-actions[bot] avatar Feb 25 '24 01:02 github-actions[bot]

Any updates here..

hanoj-budime avatar Mar 13 '24 11:03 hanoj-budime

https://github.com/bl00mber/react-phone-input-2

hanoj-budime avatar Aug 10 '24 06:08 hanoj-budime

Hello @hanoj-budime!

We have no plans to add a Phone Field Input shortly since it can be achievable by combining our DxcTextInput with the DxcSelect. Here is a short example:

image

import {
  DxcContainer,
  DxcFlex,
  DxcGrid,
  DxcInset,
  DxcSelect,
  DxcTextInput,
  DxcTypography,
} from "@dxc-technology/halstack-react";

function App() {
  return (
    <DxcContainer width="50%">
      <DxcInset space="2rem">
        <DxcFlex direction="column">
          <DxcTypography fontSize="0.875rem" fontWeight="600">
            Phone number
          </DxcTypography>
          <DxcTypography fontSize="0.75rem" fontStyle="italic">
            Please, enter your phone number
          </DxcTypography>
        </DxcFlex>
        <DxcGrid gap={"0.5rem"} templateColumns={["1fr", "5fr"]}>
          <DxcSelect
            defaultValue={"1"}
            options={[
              { label: "+1", value: "1" },
              { label: "34", value: "+34" },
            ]}
            size="fillParent"
          />
          <DxcTextInput placeholder="234-567-8910" size="fillParent" />
        </DxcGrid>
      </DxcInset>
    </DxcContainer>
  );
}

export default App;

I hope this helps!

GomezIvann avatar Aug 12 '24 10:08 GomezIvann

@GomezIvann,

image

I know that DxcSelect and DxcTextInput are combined to create the phone number component, but what about width control for DxcSelect? Didn't you notice that DxcSelect is taking up too much width? What will you do about this?

Perview: codesandbox.io

hanoj-budime avatar Aug 12 '24 10:08 hanoj-budime

@GomezIvann,

image

I know that DxcSelect and DxcTextInput are combined to create the phone number component, but what about width control for DxcSelect? Didn't you notice that DxcSelect is taking up too much width? What will you do about this?

Perview: codesandbox.io

I updated the example above. Use size="fillParent" and a DxcGrid to manage the sizes.

GomezIvann avatar Aug 12 '24 10:08 GomezIvann